Methods
(static) probe(optionsopt, callbackopt)
Discover NVT devices in the subnetwork
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
<optional> |
Properties
|
||||||||||||||||||||||||||||||
callback |
Discovery~ProbeCallback |
<optional> |
timeout callback |
- Source:
Fires:
Examples
var onvif = require('onvif');
onvif.Discovery.on('device', function(cam){
// function would be called as soon as NVT responses
cam.username = <USERNAME>;
cam.password = <PASSWORD>;
cam.connect(console.log);
})
onvif.Discovery.probe();
var onvif = require('onvif');
onvif.Discovery.probe(function(err, cams) {
// function would be called only after timeout (5 sec by default)
if (err) { throw err; }
cams.forEach(function(cam) {
cam.username = <USERNAME>;
cam.password = <PASSWORD>;
cam.connect(console.log);
});
});
Type Definitions
ProbeCallback()
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
error |
Error |
<nullable> |
|
found |
Array.<(Cam|object)> | devices |
- Source:
Events
device
Indicates discovered device.
Type:
- Cam | object
- Source:
error
Indicates error response from device.
Type:
- string
- Source: