$ npm install node-yoctopuce
$ node-gyp configure$ node-gyp build
Clone the node-yoctopuce repo, then install:
$ git clone git://github.com/schlafsack/node-yoctopuce.git --depth 1$ cd node-yoctopuce$ npm install
then run the examples:
$ node examples/httpRequest MyDevice
The API is split into two sections. Firstly a high level, node-like, asynchronous API and secondly the synchronous bindings to the native YAPI library.
Verifies if a given logical name is valid or not for the yocotpuce API.
var valid = yapi;
Returns an array of descriptors for the devices visible to the API.
var descriptors = yapi;
Returns version information for the YAPI library.
var apiVersion = yapi;
Returns the device descriptor for a device identified by a serial number, logical name or URL.
var identifier = 'THRMCPL1-0A420';var descriptor = yapi;
Returns the device information for a device identified by a device descriptor.
var descriptor = 239;var info = yapi;
Returns the device's serial number and path to use when making an intial http request.
var descriptor = 239;var path = yapi;
Returns a function descriptor for a function identified by a class and a full hardware id or logical name.
A function hardware id takes the form 'device.function'.
var functionClass = 'Temperature';var functionName = 'THRMCPL1-0A420.temperature1';var descriptor = yapi;
Returns the function information for a function identified by a function descriptor.
var descriptor = 5374191;var info = yapi;
Returns a list of descriptors for functions in the given class.
var functionClass = 'Temperature';var descriptors = yapi;
Returns a list of descriptors for the functions of the device identified by the descriptor.
var descriptor = 239;var descriptors = yapi;
Makes an http request to the device identified by a serial number, logical name or URL.
var identifier = 'THRMCPL1-0A420';var response = yapi;
Registers a network URL to be scanned for devices.
var url = '';yapi;
Unregisters a network URL.
var url = '';yapi;
log event is emitted when the YAPI library needs to log debug messages.
deviceLog event is emitted when the YAPI library detects a device event.
deviceArrival event is emitted when the YAPI library detects a device has arrived.
deviceRemoval event is emitted when the YAPI library detects a device has been removed.
deviceChange event is emitted when the YAPI library detects that the logical name of a device has changed.
functionUpdate event is emitted when the YAPI library detects that the value of a function has changed.
Copyright (c) 2013, Tom Greasley firstname.lastname@example.org
Copyright Tom Greasley and contributors. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.