Class: Discovery

Discovery()

new Discovery()

Discovery singleton
Source:

Methods

(static) probe(optionsopt, callbackopt)

Discover NVT devices in the subnetwork
Parameters:
Name Type Attributes Description
options object <optional>
Properties
Name Type Attributes Default Description
timeout number <optional>
5000 timeout in milliseconds for discovery responses
resolve boolean <optional>
true set to `false` if you want omit creating of Cam objects
messageId string <optional>
GUID WS-Discovery message id
device string <optional>
defaultroute Interface to bind on for discovery ex. `eth0`
listeningPort number <optional>
null client will listen to discovery data device sent
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:
Source:

error

Indicates error response from device.
Type:
  • string
Source: