UNPKG

onvif

Version:

Client to ONVIF NVT devices Profile S: cameras

883 lines (244 loc) 11.3 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JSDoc: Class: Discovery</title> <script src="scripts/prettify/prettify.js"> </script> <script src="scripts/prettify/lang-css.js"> </script> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css"> <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css"> </head> <body> <div id="main"> <h1 class="page-title">Class: Discovery</h1> <section> <header> <h2>Discovery</h2> </header> <article> <div class="container-overview"> <h4 class="name" id="Discovery"><span class="type-signature"></span>new Discovery<span class="signature">()</span><span class="type-signature"></span></h4> <div class="description"> Discovery singleton </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="discovery.js.html">discovery.js</a>, <a href="discovery.js.html#line22">line 22</a> </li></ul></dd> </dl> </div> <h3 class="subsection-title">Methods</h3> <h4 class="name" id=".probe"><span class="type-signature">(static) </span>probe<span class="signature">(options<span class="signature-attributes">opt</span>, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4> <div class="description"> Discover NVT devices in the subnetwork </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Attributes</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>options</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last"> <h6>Properties</h6> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Attributes</th> <th>Default</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>timeout</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> 5000 </td> <td class="description last">timeout in milliseconds for discovery responses</td> </tr> <tr> <td class="name"><code>resolve</code></td> <td class="type"> <span class="param-type">boolean</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> true </td> <td class="description last">set to `false` if you want omit creating of Cam objects</td> </tr> <tr> <td class="name"><code>messageId</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> GUID </td> <td class="description last">WS-Discovery message id</td> </tr> </tbody> </table> </td> </tr> <tr> <td class="name"><code>callback</code></td> <td class="type"> <span class="param-type"><a href="Discovery_.html#~ProbeCallback">Discovery~ProbeCallback</a></span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last">timeout callback</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="discovery.js.html">discovery.js</a>, <a href="discovery.js.html#line60">line 60</a> </li></ul></dd> </dl> <h5>Fires:</h5> <ul> <li><a href="Discovery_.html#event:device">Discovery#event:device</a></li> <li><a href="Discovery_.html#event:error">Discovery#event:error</a></li> </ul> <h5>Examples</h5> <pre class="prettyprint"><code>var onvif = require('onvif'); onvif.Discovery.on('device', function(cam){ // function would be called as soon as NVT responses cam.username = &lt;USERNAME>; cam.password = &lt;PASSWORD>; cam.connect(console.log); }) onvif.Discovery.probe();</code></pre> <pre class="prettyprint"><code>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 = &lt;USERNAME>; cam.password = &lt;PASSWORD>; cam.connect(console.log); }); });</code></pre> <h3 class="subsection-title">Type Definitions</h3> <h4 class="name" id="~ProbeCallback"><span class="type-signature"></span>ProbeCallback<span class="signature">()</span><span class="type-signature"></span></h4> <h5 class="subsection-title">Properties:</h5> <table class="props"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Attributes</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>error</code></td> <td class="type"> <span class="param-type">Error</span> </td> <td class="attributes"> &lt;nullable><br> </td> <td class="description last"></td> </tr> <tr> <td class="name"><code>found</code></td> <td class="type"> <span class="param-type">Array.&lt;(<a href="Cam_.html">Cam</a>|object)></span> </td> <td class="attributes"> </td> <td class="description last">devices</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="discovery.js.html">discovery.js</a>, <a href="discovery.js.html#line24">line 24</a> </li></ul></dd> </dl> <h3 class="subsection-title">Events</h3> <h4 class="name" id="event:device">device</h4> <div class="description"> Indicates discovered device. </div> <h5>Type:</h5> <ul> <li> <span class="param-type"><a href="Cam_.html">Cam</a></span> | <span class="param-type">object</span> </li> </ul> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="discovery.js.html">discovery.js</a>, <a href="discovery.js.html#line126">line 126</a> </li></ul></dd> </dl> <h4 class="name" id="event:error">error</h4> <div class="description"> Indicates error response from device. </div> <h5>Type:</h5> <ul> <li> <span class="param-type">string</span> </li> </ul> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="discovery.js.html">discovery.js</a>, <a href="discovery.js.html#line101">line 101</a> </li></ul></dd> </dl> </article> </section> </div> <nav> <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Cam_.html">Cam</a></li><li><a href="Discovery_.html">Discovery</a></li></ul><h3>Events</h3><ul><li><a href="Cam_.html#event:event">event</a></li><li><a href="Cam_.html#event:rawResponse">rawResponse</a></li><li><a href="Discovery_.html#event:device">device</a></li><li><a href="Discovery_.html#event:error">error</a></li></ul><h3>Namespaces</h3><ul><li><a href="cam.html">cam</a></li><li><a href="discovery.html">discovery</a></li><li><a href="utils.html">utils</a></li></ul><h3>Global</h3><ul><li><a href="global.html#guid">guid</a></li><li><a href="global.html#linerase">linerase</a></li><li><a href="global.html#parseSOAPString">parseSOAPString</a></li></ul> </nav> <br class="clear"> <footer> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.0</a> on Mon Jun 20 2016 15:42:18 GMT+0300 (MSK) </footer> <script> prettyPrint(); </script> <script src="scripts/linenumber.js"> </script> </body> </html>