',cmt:'

Yoctopuce application programming interface allows you to control the module voltage output. You affect absolute output values or make transitions

'}}; doc['VSource']['FindVSource']={syn:'Retrieves a voltage source for a given identifier.',lib:'YVSource.FindVSource()',pro:'function FindVSource(func)',cmt:'

Retrieves a voltage source for a given identifier. The identifier can be specified using several formats:

- FunctionLogicalName
- ModuleSerialNumber.FunctionIdentifier
- ModuleSerialNumber.FunctionLogicalName
- ModuleLogicalName.FunctionIdentifier
- ModuleLogicalName.FunctionLogicalName

This function does not require that the voltage source is online at the time it is invoked. The returned object is nevertheless valid. Use the method `YVSource.isOnline()` to test if the voltage source is indeed online at a given time. In case of ambiguity when looking for a voltage source by logical name, no error is notified: the first instance found is returned. The search is performed first by hardware name, then by logical name.',par:{func:'a string that uniquely characterizes the voltage source'},ret:'a `YVSource` object allowing you to drive the voltage source.'}; doc['VSource']['FirstVSource']={syn:'Starts the enumeration of voltage sources currently accessible.',lib:'YVSource.FirstVSource()',pro:'function FirstVSource()',cmt:'

Starts the enumeration of voltage sources currently accessible. Use the method `YVSource.nextVSource()` to iterate on next voltage sources.

',ret:'a pointer to a `YVSource` object, corresponding to the first voltage source currently online, or a `null` pointer if there are none.'}; doc['VSource']['describe']={syn:'Returns a short text that describes the function in the form `TYPE(NAME)=SERIAL.FUNCTIONID`.',lib:'vsource.describe()',pro:'function describe()',cmt:'

Returns a short text that describes the function in the form `TYPE(NAME)=SERIAL.FUNCTIONID`. More precisely, `TYPE` is the type of the function, `NAME` it the name used for the first access to the function, `SERIAL` is the serial number of the module if the module is connected or `\x22unresolved\x22`, and `FUNCTIONID` is the hardware identifier of the function if the module is connected. For example, this method returns `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1` if the module is already connected or `Relay(BadCustomeName.relay1)=unresolved` if the module has not yet been connected. This method does not trigger any USB or TCP transaction and can therefore be used in a debugger.

',ret:'a string that describes the function (ex: `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1`)'}; doc['VSource']['get_advertisedValue']={syn:'Returns the current value of the voltage source (no more than 6 characters).',lib:'vsource.get_advertisedValue()',pro:'function get_advertisedValue()',cmt:'

Returns the current value of the voltage source (no more than 6 characters).

',ret:'a string corresponding to the current value of the voltage source (no more than 6 characters)',ext:'On failure, throws an exception or returns `Y_ADVERTISEDVALUE_INVALID`.'}; doc['VSource']['get_errorMessage']={syn:'Returns the error message of the latest error with this function.',lib:'vsource.get_errorMessage()',pro:'function get_errorMessage()',cmt:'

Returns the error message of the latest error with this function. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a string corresponding to the latest error message that occured while using this function object'}; doc['VSource']['get_errorType']={syn:'Returns the numerical error code of the latest error with this function.',lib:'vsource.get_errorType()',pro:'function get_errorType()',cmt:'

Returns the numerical error code of the latest error with this function. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a number corresponding to the code of the latest error that occured while using this function object'}; doc['VSource']['get_extPowerFailure']={syn:'Returns true if external power supply voltage is too low.',lib:'vsource.get_extPowerFailure()',pro:'function get_extPowerFailure()',cmt:'

Returns true if external power supply voltage is too low.

',ret:'either `Y_EXTPOWERFAILURE_FALSE` or `Y_EXTPOWERFAILURE_TRUE`, according to true if external power supply voltage is too low',ext:'On failure, throws an exception or returns `Y_EXTPOWERFAILURE_INVALID`.'}; doc['VSource']['get_failure']={syn:'Returns true if the module is in failure mode.',lib:'vsource.get_failure()',pro:'function get_failure()',cmt:'

Returns true if the module is in failure mode. More information can be obtained by testing get_overheat, get_overcurrent etc... When a error condition is met, the output voltage is set to z\xE9ro and cannot be changed until the reset() function is called.

',ret:'either `Y_FAILURE_FALSE` or `Y_FAILURE_TRUE`, according to true if the module is in failure mode',ext:'On failure, throws an exception or returns `Y_FAILURE_INVALID`.'}; doc['VSource']['get_friendlyName']={syn:'Returns a global identifier of the function in the format `MODULE_NAME.FUNCTION_NAME`.',lib:'vsource.get_friendlyName()',pro:'function get_friendlyName()',cmt:'

Returns a global identifier of the function in the format `MODULE_NAME.FUNCTION_NAME`. The returned string uses the logical names of the module and of the function if they are defined, otherwise the serial number of the module and the hardware identifier of the function (for exemple: `MyCustomName.relay1`)

',ret:'a string that uniquely identifies the function using logical names (ex: `MyCustomName.relay1`) On failure, throws an exception or returns `Y_FRIENDLYNAME_INVALID`.'}; doc['VSource']['get_functionDescriptor']={syn:'Returns a unique identifier of type `YFUN_DESCR` corresponding to the function.',lib:'vsource.get_vsourceDescriptor()',pro:'function get_functionDescriptor()',cmt:'

Returns a unique identifier of type `YFUN_DESCR` corresponding to the function. This identifier can be used to test if two instances of `YFunction` reference the same physical function on the same physical device.

',ret:'an identifier of type `YFUN_DESCR`. If the function has never been contacted, the returned value is `Y_FUNCTIONDESCRIPTOR_INVALID`.'}; doc['VSource']['get_functionId']={syn:'Returns the hardware identifier of the function, without reference to the module.',lib:'vsource.get_vsourceId()',pro:'function get_functionId()',cmt:'

Returns the hardware identifier of the function, without reference to the module. For example `relay1`

',ret:'a string that identifies the function (ex: `relay1`) On failure, throws an exception or returns `Y_FUNCTIONID_INVALID`.'}; doc['VSource']['get_hardwareId']={syn:'Returns the unique hardware identifier of the function in the form `SERIAL.FUNCTIONID`.',lib:'vsource.get_hardwareId()',pro:'function get_hardwareId()',cmt:'

Returns the unique hardware identifier of the function in the form `SERIAL.FUNCTIONID`. The unique hardware identifier is composed of the device serial number and of the hardware identifier of the function. (for example `RELAYLO1-123456.relay1`)

',ret:'a string that uniquely identifies the function (ex: `RELAYLO1-123456.relay1`) On failure, throws an exception or returns `Y_HARDWAREID_INVALID`.'}; doc['VSource']['get_logicalName']={syn:'Returns the logical name of the voltage source.',lib:'vsource.get_logicalName()',pro:'function get_logicalName()',cmt:'

Returns the logical name of the voltage source.

',ret:'a string corresponding to the logical name of the voltage source',ext:'On failure, throws an exception or returns `Y_LOGICALNAME_INVALID`.'}; doc['VSource']['get_module']={syn:'Gets the `YModule` object for the device on which the function is located.',lib:'vsource.get_module()',pro:'function get_module()',cmt:'

Gets the `YModule` object for the device on which the function is located. If the function cannot be located on any module, the returned instance of `YModule` is not shown as on-line.

',ret:'an instance of `YModule`'}; doc['VSource']['get_module_async']={syn:'Gets the `YModule` object for the device on which the function is located (asynchronous version).',lib:'vsource.get_module_async()',pro:'function get_module_async(callback, context)',cmt:'

Gets the `YModule` object for the device on which the function is located (asynchronous version). If the function cannot be located on any module, the returned `YModule` object does not show as on-line. This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking Firefox javascript VM that does not implement context switching during blocking I/O calls. See the documentation section on asynchronous Javascript calls for more details.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the requested `YModule` object',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['VSource']['get_overCurrent']={syn:'Returns true if the appliance connected to the device is too greedy .',lib:'vsource.get_overCurrent()',pro:'function get_overCurrent()',cmt:'

Returns true if the appliance connected to the device is too greedy .

',ret:'either `Y_OVERCURRENT_FALSE` or `Y_OVERCURRENT_TRUE`, according to true if the appliance connected to the device is too greedy',ext:'On failure, throws an exception or returns `Y_OVERCURRENT_INVALID`.'}; doc['VSource']['get_overHeat']={syn:'Returns TRUE if the module is overheating.',lib:'vsource.get_overHeat()',pro:'function get_overHeat()',cmt:'

Returns TRUE if the module is overheating.

',ret:'either `Y_OVERHEAT_FALSE` or `Y_OVERHEAT_TRUE`, according to TRUE if the module is overheating',ext:'On failure, throws an exception or returns `Y_OVERHEAT_INVALID`.'}; doc['VSource']['get_overLoad']={syn:'Returns true if the device is not able to maintaint the requested voltage output .',lib:'vsource.get_overLoad()',pro:'function get_overLoad()',cmt:'

Returns true if the device is not able to maintaint the requested voltage output .

',ret:'either `Y_OVERLOAD_FALSE` or `Y_OVERLOAD_TRUE`, according to true if the device is not able to maintaint the requested voltage output',ext:'On failure, throws an exception or returns `Y_OVERLOAD_INVALID`.'}; doc['VSource']['get_regulationFailure']={syn:'Returns true if the voltage output is too high regarding the requested voltage .',lib:'vsource.get_regulationFailure()',pro:'function get_regulationFailure()',cmt:'

Returns true if the voltage output is too high regarding the requested voltage .

',ret:'either `Y_REGULATIONFAILURE_FALSE` or `Y_REGULATIONFAILURE_TRUE`, according to true if the voltage output is too high regarding the requested voltage',ext:'On failure, throws an exception or returns `Y_REGULATIONFAILURE_INVALID`.'}; doc['VSource']['get_unit']={syn:'Returns the measuring unit for the voltage.',lib:'vsource.get_unit()',pro:'function get_unit()',cmt:'

Returns the measuring unit for the voltage.

',ret:'a string corresponding to the measuring unit for the voltage',ext:'On failure, throws an exception or returns `Y_UNIT_INVALID`.'}; doc['VSource']['get_userData']={syn:'Returns the value of the userData attribute, as previously stored using method `set_userData`.',lib:'vsource.get_userData()',pro:'function get_userData()',cmt:'

Returns the value of the userData attribute, as previously stored using method `set_userData`. This attribute is never touched directly by the API, and is at disposal of the caller to store a context.

',ret:'the object stored previously by the caller.'}; doc['VSource']['get_voltage']={syn:'Returns the voltage output command (mV) ',lib:'vsource.get_voltage()',pro:'function get_voltage()',cmt:'

Returns the voltage output command (mV)

',ret:'an integer corresponding to the voltage output command (mV)',ext:'On failure, throws an exception or returns `Y_VOLTAGE_INVALID`.'}; doc['VSource']['isOnline']={syn:'Checks if the function is currently reachable, without raising any error.',lib:'vsource.isOnline()',pro:'function isOnline()',cmt:'

Checks if the function is currently reachable, without raising any error. If there is a cached value for the function in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the requested function.

',ret:'`true` if the function can be reached, and `false` otherwise'}; doc['VSource']['isOnline_async']={syn:'Checks if the function is currently reachable, without raising any error (asynchronous version).',lib:'vsource.isOnline_async()',pro:'function isOnline_async(callback, context)',cmt:'

Checks if the function is currently reachable, without raising any error (asynchronous version). If there is a cached value for the function in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the requested function.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking Firefox Javascript VM that does not implement context switching during blocking I/O calls.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the boolean result',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['VSource']['load']={syn:'Preloads the function cache with a specified validity duration.',lib:'vsource.load()',pro:'function load(msValidity)',cmt:'

Preloads the function cache with a specified validity duration. By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network trafic for instance.

',par:{msValidity:'an integer corresponding to the validity attributed to the loaded function parameters, in milliseconds'},ret:'`YAPI_SUCCESS` when the call succeeds. On failure, throws an exception or returns a negative error code.'}; doc['VSource']['load_async']={syn:'Preloads the function cache with a specified validity duration (asynchronous version).',lib:'vsource.load_async()',pro:'function load_async(msValidity, callback, context)',cmt:'

Preloads the function cache with a specified validity duration (asynchronous version). By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network trafic for instance. This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking Firefox javascript VM that does not implement context switching during blocking I/O calls. See the documentation section on asynchronous Javascript calls for more details.

',par:{msValidity:'an integer corresponding to the validity of the loaded function parameters, in milliseconds',callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the error code (or `YAPI_SUCCESS`)',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['VSource']['nextVSource']={syn:'Continues the enumeration of voltage sources started using `yFirstVSource()`.',lib:'vsource.nextVSource()',pro:'function nextVSource()',cmt:'

Continues the enumeration of voltage sources started using `yFirstVSource()`.

',ret:'a pointer to a `YVSource` object, corresponding to a voltage source currently online, or a `null` pointer if there are no more voltage sources to enumerate.'}; doc['VSource']['pulse']={syn:'Sets device output to a specific volatage, for a specified duration, then brings it automatically to 0V.',lib:'vsource.pulse()',pro:'function pulse(voltage, ms_duration)',cmt:'

Sets device output to a specific volatage, for a specified duration, then brings it automatically to 0V.

',par:{voltage:'pulse voltage, in millivolts',ms_duration:'pulse duration, in millisecondes'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['VSource']['registerValueCallback']={syn:'Registers the callback function that is invoked on every change of advertised value.',lib:'vsource.registerValueCallback()',pro:'function registerValueCallback(callback)',cmt:'

Registers the callback function that is invoked on every change of advertised value. The callback is invoked only during the execution of `ySleep` or `yHandleEvents`. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a null pointer as argument.

',par:{callback:'the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and the character string describing the new advertised value.'}}; doc['VSource']['set_logicalName']={syn:'Changes the logical name of the voltage source.',lib:'vsource.set_logicalName()',pro:'function set_logicalName(newval)',cmt:'

Changes the logical name of the voltage source. You can use `yCheckLogicalName()` prior to this call to make sure that your parameter is valid. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',par:{newval:'a string corresponding to the logical name of the voltage source'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['VSource']['set_userData']={syn:'Stores a user context provided as argument in the userData attribute of the function.',lib:'vsource.set_userData()',pro:'function set_userData(data)',cmt:'

Stores a user context provided as argument in the userData attribute of the function. This attribute is never touched by the API, and is at disposal of the caller to store a context.

',par:{data:'any kind of object to be stored'}}; doc['VSource']['set_voltage']={syn:'Tunes the device output voltage (milliVolts).',lib:'vsource.set_voltage()',pro:'function set_voltage(newval)',cmt:'

Tunes the device output voltage (milliVolts).

',par:{newval:'an integer'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['VSource']['voltageMove']={syn:'Performs a smooth move at constant speed toward a given value.',lib:'vsource.voltageMove()',pro:'function voltageMove(target, ms_duration)',cmt:'

Performs a smooth move at constant speed toward a given value.

',par:{target:'new output value at end of transition, in milliVolts.',ms_duration:'transition duration, in milliseconds'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['VSource']['wait_async']={syn:'Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function.',lib:'vsource.wait_async()',pro:'function wait_async(callback, context)',cmt:'

Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function. The callback function can therefore freely issue synchronous or asynchronous commands, without risking to block the Javascript VM.

',par:{callback:'callback function that is invoked when all pending commands on the module are completed. The callback function receives three arguments: the caller-specific context object, the receiving function object and the boolean result',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing :'}; //--- (end of generated code: VSource) //--- (generated code: Network) doc['Network']={'':{syn:'Network function interface',inc:'<script type='text/javascript' src='yocto_network.js'></script>',cmt:'

YNetwork objects provide access to TCP/IP parameters of Yoctopuce modules that include a built-in network interface.

'}}; doc['Network']['FindNetwork']={syn:'Retrieves a network interface for a given identifier.',lib:'YNetwork.FindNetwork()',pro:'function FindNetwork(func)',cmt:'

Retrieves a network interface for a given identifier. The identifier can be specified using several formats:

- FunctionLogicalName
- ModuleSerialNumber.FunctionIdentifier
- ModuleSerialNumber.FunctionLogicalName
- ModuleLogicalName.FunctionIdentifier
- ModuleLogicalName.FunctionLogicalName

This function does not require that the network interface is online at the time it is invoked. The returned object is nevertheless valid. Use the method `YNetwork.isOnline()` to test if the network interface is indeed online at a given time. In case of ambiguity when looking for a network interface by logical name, no error is notified: the first instance found is returned. The search is performed first by hardware name, then by logical name.

If a call to this object\x27s is_online() method returns FALSE although you are certain that the matching device is plugged, make sure that you did call registerHub() at application initialization time.

',par:{func:'a string that uniquely characterizes the network interface'},ret:'a `YNetwork` object allowing you to drive the network interface.'}; doc['Network']['FirstNetwork']={syn:'Starts the enumeration of network interfaces currently accessible.',lib:'YNetwork.FirstNetwork()',pro:'function FirstNetwork()',cmt:'

Starts the enumeration of network interfaces currently accessible. Use the method `YNetwork.nextNetwork()` to iterate on next network interfaces.

',ret:'a pointer to a `YNetwork` object, corresponding to the first network interface currently online, or a `null` pointer if there are none.'}; doc['Network']['callbackLogin']={syn:'Connects to the notification callback and saves the credentials required to log into it.',lib:'network.callbackLogin()',pro:'function callbackLogin(username, password)',cmt:'

Connects to the notification callback and saves the credentials required to log into it. The password is not stored into the module, only a hashed copy of the credentials are saved. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',par:{username:'username required to log to the callback',password:'password required to log to the callback'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Network']['clearCache']={syn:'Invalidates the cache.',lib:'network.clearCache()',pro:'function clearCache()',cmt:'

Invalidates the cache. Invalidates the cache of the network interface attributes. Forces the next call to get_xxx() or loadxxx() to use values that come from the device.

'}; doc['Network']['describe']={syn:'Returns a short text that describes unambiguously the instance of the network interface in the form `TYPE(NAME)=SERIAL.FUNCTIONID`.',lib:'network.describe()',pro:'function describe()',cmt:'

Returns a short text that describes unambiguously the instance of the network interface in the form `TYPE(NAME)=SERIAL.FUNCTIONID`. More precisely, `TYPE` is the type of the function, `NAME` it the name used for the first access to the function, `SERIAL` is the serial number of the module if the module is connected or `\x22unresolved\x22`, and `FUNCTIONID` is the hardware identifier of the function if the module is connected. For example, this method returns `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1` if the module is already connected or `Relay(BadCustomeName.relay1)=unresolved` if the module has not yet been connected. This method does not trigger any USB or TCP transaction and can therefore be used in a debugger.

',ret:'a string that describes the network interface (ex: `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1`)'}; doc['Network']['get_adminPassword']={syn:'Returns a hash string if a password has been set for user \x22admin\x22, or an empty string otherwise.',lib:'network.get_adminPassword()',pro:'function get_adminPassword()',cmt:'

Returns a hash string if a password has been set for user \x22admin\x22, or an empty string otherwise.

',ret:'a string corresponding to a hash string if a password has been set for user \x22admin\x22, or an empty string otherwise',ext:'On failure, throws an exception or returns `Y_ADMINPASSWORD_INVALID`.'}; doc['Network']['get_advertisedValue']={syn:'Returns the current value of the network interface (no more than 6 characters).',lib:'network.get_advertisedValue()',pro:'function get_advertisedValue()',cmt:'

Returns the current value of the network interface (no more than 6 characters).

',ret:'a string corresponding to the current value of the network interface (no more than 6 characters).',ext:'On failure, throws an exception or returns `Y_ADVERTISEDVALUE_INVALID`.'}; doc['Network']['get_callbackCredentials']={syn:'Returns a hashed version of the notification callback credentials if set, or an empty string otherwise.',lib:'network.get_callbackCredentials()',pro:'function get_callbackCredentials()',cmt:'

Returns a hashed version of the notification callback credentials if set, or an empty string otherwise.

',ret:'a string corresponding to a hashed version of the notification callback credentials if set, or an empty string otherwise',ext:'On failure, throws an exception or returns `Y_CALLBACKCREDENTIALS_INVALID`.'}; doc['Network']['get_callbackEncoding']={syn:'Returns the encoding standard to use for representing notification values.',lib:'network.get_callbackEncoding()',pro:'function get_callbackEncoding()',cmt:'

Returns the encoding standard to use for representing notification values.

',ret:'a value among `Y_CALLBACKENCODING_FORM`, `Y_CALLBACKENCODING_JSON`, `Y_CALLBACKENCODING_JSON_ARRAY`, `Y_CALLBACKENCODING_CSV`, `Y_CALLBACKENCODING_YOCTO_API`, `Y_CALLBACKENCODING_JSON_NUM`, `Y_CALLBACKENCODING_EMONCMS`, `Y_CALLBACKENCODING_AZURE`, `Y_CALLBACKENCODING_INFLUXDB`, `Y_CALLBACKENCODING_MQTT` and `Y_CALLBACKENCODING_YOCTO_API_JZON` corresponding to the encoding standard to use for representing notification values',ext:'On failure, throws an exception or returns `Y_CALLBACKENCODING_INVALID`.'}; doc['Network']['get_callbackInitialDelay']={syn:'Returns the initial waiting time before first callback notifications, in seconds.',lib:'network.get_callbackInitialDelay()',pro:'function get_callbackInitialDelay()',cmt:'

Returns the initial waiting time before first callback notifications, in seconds.

',ret:'an integer corresponding to the initial waiting time before first callback notifications, in seconds',ext:'On failure, throws an exception or returns `Y_CALLBACKINITIALDELAY_INVALID`.'}; doc['Network']['get_callbackMaxDelay']={syn:'Returns the waiting time between two HTTP callbacks when there is nothing new.',lib:'network.get_callbackMaxDelay()',pro:'function get_callbackMaxDelay()',cmt:'

Returns the waiting time between two HTTP callbacks when there is nothing new.

',ret:'an integer corresponding to the waiting time between two HTTP callbacks when there is nothing new',ext:'On failure, throws an exception or returns `Y_CALLBACKMAXDELAY_INVALID`.'}; doc['Network']['get_callbackMethod']={syn:'Returns the HTTP method used to notify callbacks for significant state changes.',lib:'network.get_callbackMethod()',pro:'function get_callbackMethod()',cmt:'

Returns the HTTP method used to notify callbacks for significant state changes.

',ret:'a value among `Y_CALLBACKMETHOD_POST`, `Y_CALLBACKMETHOD_GET` and `Y_CALLBACKMETHOD_PUT` corresponding to the HTTP method used to notify callbacks for significant state changes',ext:'On failure, throws an exception or returns `Y_CALLBACKMETHOD_INVALID`.'}; doc['Network']['get_callbackMinDelay']={syn:'Returns the minimum waiting time between two HTTP callbacks, in seconds.',lib:'network.get_callbackMinDelay()',pro:'function get_callbackMinDelay()',cmt:'

Returns the minimum waiting time between two HTTP callbacks, in seconds.

',ret:'an integer corresponding to the minimum waiting time between two HTTP callbacks, in seconds',ext:'On failure, throws an exception or returns `Y_CALLBACKMINDELAY_INVALID`.'}; doc['Network']['get_callbackSchedule']={syn:'Returns the HTTP callback schedule strategy, as a text string.',lib:'network.get_callbackSchedule()',pro:'function get_callbackSchedule()',cmt:'

Returns the HTTP callback schedule strategy, as a text string.

',ret:'a string corresponding to the HTTP callback schedule strategy, as a text string',ext:'On failure, throws an exception or returns `Y_CALLBACKSCHEDULE_INVALID`.'}; doc['Network']['get_callbackUrl']={syn:'Returns the callback URL to notify of significant state changes.',lib:'network.get_callbackUrl()',pro:'function get_callbackUrl()',cmt:'

Returns the callback URL to notify of significant state changes.

',ret:'a string corresponding to the callback URL to notify of significant state changes',ext:'On failure, throws an exception or returns `Y_CALLBACKURL_INVALID`.'}; doc['Network']['get_defaultPage']={syn:'Returns the HTML page to serve for the URL \x22/\x22\x22 of the hub.',lib:'network.get_defaultPage()',pro:'function get_defaultPage()',cmt:'

Returns the HTML page to serve for the URL \x22/\x22\x22 of the hub.

',ret:'a string corresponding to the HTML page to serve for the URL \x22/\x22\x22 of the hub',ext:'On failure, throws an exception or returns `Y_DEFAULTPAGE_INVALID`.'}; doc['Network']['get_discoverable']={syn:'Returns the activation state of the multicast announce protocols to allow easy discovery of the module in the network neighborhood (uPnP/Bonjour protocol).',lib:'network.get_discoverable()',pro:'function get_discoverable()',cmt:'

Returns the activation state of the multicast announce protocols to allow easy discovery of the module in the network neighborhood (uPnP/Bonjour protocol).

',ret:'either `Y_DISCOVERABLE_FALSE` or `Y_DISCOVERABLE_TRUE`, according to the activation state of the multicast announce protocols to allow easy discovery of the module in the network neighborhood (uPnP/Bonjour protocol)',ext:'On failure, throws an exception or returns `Y_DISCOVERABLE_INVALID`.'}; doc['Network']['get_errorMessage']={syn:'Returns the error message of the latest error with the network interface.',lib:'network.get_errorMessage()',pro:'function get_errorMessage()',cmt:'

Returns the error message of the latest error with the network interface. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a string corresponding to the latest error message that occured while using the network interface object'}; doc['Network']['get_errorType']={syn:'Returns the numerical error code of the latest error with the network interface.',lib:'network.get_errorType()',pro:'function get_errorType()',cmt:'

Returns the numerical error code of the latest error with the network interface. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a number corresponding to the code of the latest error that occurred while using the network interface object'}; doc['Network']['get_friendlyName']={syn:'Returns a global identifier of the network interface in the format `MODULE_NAME.FUNCTION_NAME`.',lib:'network.get_friendlyName()',pro:'function get_friendlyName()',cmt:'

Returns a global identifier of the network interface in the format `MODULE_NAME.FUNCTION_NAME`. The returned string uses the logical names of the module and of the network interface if they are defined, otherwise the serial number of the module and the hardware identifier of the network interface (for example: `MyCustomName.relay1`)

',ret:'a string that uniquely identifies the network interface using logical names (ex: `MyCustomName.relay1`)',ext:'On failure, throws an exception or returns `Y_FRIENDLYNAME_INVALID`.'}; doc['Network']['get_functionDescriptor']={syn:'Returns a unique identifier of type `YFUN_DESCR` corresponding to the function.',lib:'network.get_functionDescriptor()',pro:'function get_functionDescriptor()',cmt:'

Returns a unique identifier of type `YFUN_DESCR` corresponding to the function. This identifier can be used to test if two instances of `YFunction` reference the same physical function on the same physical device.

',ret:'an identifier of type `YFUN_DESCR`.',ext:'If the function has never been contacted, the returned value is `Y_FUNCTIONDESCRIPTOR_INVALID`.'}; doc['Network']['get_functionId']={syn:'Returns the hardware identifier of the network interface, without reference to the module.',lib:'network.get_functionId()',pro:'function get_functionId()',cmt:'

Returns the hardware identifier of the network interface, without reference to the module. For example `relay1`

',ret:'a string that identifies the network interface (ex: `relay1`)',ext:'On failure, throws an exception or returns `Y_FUNCTIONID_INVALID`.'}; doc['Network']['get_hardwareId']={syn:'Returns the unique hardware identifier of the network interface in the form `SERIAL.FUNCTIONID`.',lib:'network.get_hardwareId()',pro:'function get_hardwareId()',cmt:'

Returns the unique hardware identifier of the network interface in the form `SERIAL.FUNCTIONID`. The unique hardware identifier is composed of the device serial number and of the hardware identifier of the network interface (for example `RELAYLO1-123456.relay1`).

',ret:'a string that uniquely identifies the network interface (ex: `RELAYLO1-123456.relay1`)',ext:'On failure, throws an exception or returns `Y_HARDWAREID_INVALID`.'}; doc['Network']['get_httpPort']={syn:'Returns the HTML page to serve for the URL \x22/\x22\x22 of the hub.',lib:'network.get_httpPort()',pro:'function get_httpPort()',cmt:'

Returns the HTML page to serve for the URL \x22/\x22\x22 of the hub.

',ret:'an integer corresponding to the HTML page to serve for the URL \x22/\x22\x22 of the hub',ext:'On failure, throws an exception or returns `Y_HTTPPORT_INVALID`.'}; doc['Network']['get_ipAddress']={syn:'Returns the IP address currently in use by the device.',lib:'network.get_ipAddress()',pro:'function get_ipAddress()',cmt:'

Returns the IP address currently in use by the device. The address may have been configured statically, or provided by a DHCP server.

',ret:'a string corresponding to the IP address currently in use by the device',ext:'On failure, throws an exception or returns `Y_IPADDRESS_INVALID`.'}; doc['Network']['get_ipConfig']={syn:'Returns the IP configuration of the network interface.',lib:'network.get_ipConfig()',pro:'function get_ipConfig()',cmt:'

Returns the IP configuration of the network interface.

If the network interface is setup to use a static IP address, the string starts with \x22STATIC:\x22 and is followed by three parameters, separated by \x22/\x22. The first is the device IP address, followed by the subnet mask length, and finally the router IP address (default gateway). For instance: \x22STATIC:192.168.1.14/16/192.168.1.1\x22

If the network interface is configured to receive its IP from a DHCP server, the string start with \x22DHCP:\x22 and is followed by three parameters separated by \x22/\x22. The first is the fallback IP address, then the fallback subnet mask length and finally the fallback router IP address. These three parameters are used when no DHCP reply is received.

',ret:'a string corresponding to the IP configuration of the network interface',ext:'On failure, throws an exception or returns `Y_IPCONFIG_INVALID`.'}; doc['Network']['get_logicalName']={syn:'Returns the logical name of the network interface.',lib:'network.get_logicalName()',pro:'function get_logicalName()',cmt:'

Returns the logical name of the network interface.

',ret:'a string corresponding to the logical name of the network interface.',ext:'On failure, throws an exception or returns `Y_LOGICALNAME_INVALID`.'}; doc['Network']['get_macAddress']={syn:'Returns the MAC address of the network interface.',lib:'network.get_macAddress()',pro:'function get_macAddress()',cmt:'

Returns the MAC address of the network interface. The MAC address is also available on a sticker on the module, in both numeric and barcode forms.

',ret:'a string corresponding to the MAC address of the network interface',ext:'On failure, throws an exception or returns `Y_MACADDRESS_INVALID`.'}; doc['Network']['get_module']={syn:'Gets the `YModule` object for the device on which the function is located.',lib:'network.get_module()',pro:'function get_module()',cmt:'

Gets the `YModule` object for the device on which the function is located. If the function cannot be located on any module, the returned instance of `YModule` is not shown as on-line.

',ret:'an instance of `YModule`'}; doc['Network']['get_module_async']={syn:'Gets the `YModule` object for the device on which the function is located (asynchronous version).',lib:'network.get_module_async()',pro:'function get_module_async(callback, context)',cmt:'

Gets the `YModule` object for the device on which the function is located (asynchronous version). If the function cannot be located on any module, the returned `YModule` object does not show as on-line.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking Firefox javascript VM that does not implement context switching during blocking I/O calls. See the documentation section on asynchronous Javascript calls for more details.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the requested `YModule` object',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['Network']['get_ntpServer']={syn:'Returns the IP address of the NTP server to be used by the device.',lib:'network.get_ntpServer()',pro:'function get_ntpServer()',cmt:'

Returns the IP address of the NTP server to be used by the device.

',ret:'a string corresponding to the IP address of the NTP server to be used by the device',ext:'On failure, throws an exception or returns `Y_NTPSERVER_INVALID`.'}; doc['Network']['get_poeCurrent']={syn:'Returns the current consumed by the module from Power-over-Ethernet (PoE), in milli-amps.',lib:'network.get_poeCurrent()',pro:'function get_poeCurrent()',cmt:'

Returns the current consumed by the module from Power-over-Ethernet (PoE), in milli-amps. The current consumption is measured after converting PoE source to 5 Volt, and should never exceed 1800 mA.

',ret:'an integer corresponding to the current consumed by the module from Power-over-Ethernet (PoE), in milli-amps',ext:'On failure, throws an exception or returns `Y_POECURRENT_INVALID`.'}; doc['Network']['get_primaryDNS']={syn:'Returns the IP address of the primary name server to be used by the module.',lib:'network.get_primaryDNS()',pro:'function get_primaryDNS()',cmt:'

Returns the IP address of the primary name server to be used by the module.

',ret:'a string corresponding to the IP address of the primary name server to be used by the module',ext:'On failure, throws an exception or returns `Y_PRIMARYDNS_INVALID`.'}; doc['Network']['get_readiness']={syn:'Returns the current established working mode of the network interface.',lib:'network.get_readiness()',pro:'function get_readiness()',cmt:'

Returns the current established working mode of the network interface. Level zero (DOWN_0) means that no hardware link has been detected. Either there is no signal on the network cable, or the selected wireless access point cannot be detected. Level 1 (LIVE_1) is reached when the network is detected, but is not yet connected. For a wireless network, this shows that the requested SSID is present. Level 2 (LINK_2) is reached when the hardware connection is established. For a wired network connection, level 2 means that the cable is attached at both ends. For a connection to a wireless access point, it shows that the security parameters are properly configured. For an ad-hoc wireless connection, it means that there is at least one other device connected on the ad-hoc network. Level 3 (DHCP_3) is reached when an IP address has been obtained using DHCP. Level 4 (DNS_4) is reached when the DNS server is reachable on the network. Level 5 (WWW_5) is reached when global connectivity is demonstrated by properly loading the current time from an NTP server.

',ret:'a value among `Y_READINESS_DOWN`, `Y_READINESS_EXISTS`, `Y_READINESS_LINKED`, `Y_READINESS_LAN_OK` and `Y_READINESS_WWW_OK` corresponding to the current established working mode of the network interface',ext:'On failure, throws an exception or returns `Y_READINESS_INVALID`.'}; doc['Network']['get_router']={syn:'Returns the IP address of the router on the device subnet (default gateway).',lib:'network.get_router()',pro:'function get_router()',cmt:'

Returns the IP address of the router on the device subnet (default gateway).

',ret:'a string corresponding to the IP address of the router on the device subnet (default gateway)',ext:'On failure, throws an exception or returns `Y_ROUTER_INVALID`.'}; doc['Network']['get_secondaryDNS']={syn:'Returns the IP address of the secondary name server to be used by the module.',lib:'network.get_secondaryDNS()',pro:'function get_secondaryDNS()',cmt:'

Returns the IP address of the secondary name server to be used by the module.

',ret:'a string corresponding to the IP address of the secondary name server to be used by the module',ext:'On failure, throws an exception or returns `Y_SECONDARYDNS_INVALID`.'}; doc['Network']['get_subnetMask']={syn:'Returns the subnet mask currently used by the device.',lib:'network.get_subnetMask()',pro:'function get_subnetMask()',cmt:'

Returns the subnet mask currently used by the device.

',ret:'a string corresponding to the subnet mask currently used by the device',ext:'On failure, throws an exception or returns `Y_SUBNETMASK_INVALID`.'}; doc['Network']['get_userData']={syn:'Returns the value of the userData attribute, as previously stored using method `set_userData`.',lib:'network.get_userData()',pro:'function get_userData()',cmt:'

Returns the value of the userData attribute, as previously stored using method `set_userData`. This attribute is never touched directly by the API, and is at disposal of the caller to store a context.

',ret:'the object stored previously by the caller.'}; doc['Network']['get_userPassword']={syn:'Returns a hash string if a password has been set for \x22user\x22 user, or an empty string otherwise.',lib:'network.get_userPassword()',pro:'function get_userPassword()',cmt:'

Returns a hash string if a password has been set for \x22user\x22 user, or an empty string otherwise.

',ret:'a string corresponding to a hash string if a password has been set for \x22user\x22 user, or an empty string otherwise',ext:'On failure, throws an exception or returns `Y_USERPASSWORD_INVALID`.'}; doc['Network']['get_wwwWatchdogDelay']={syn:'Returns the allowed downtime of the WWW link (in seconds) before triggering an automated reboot to try to recover Internet connectivity.',lib:'network.get_wwwWatchdogDelay()',pro:'function get_wwwWatchdogDelay()',cmt:'

Returns the allowed downtime of the WWW link (in seconds) before triggering an automated reboot to try to recover Internet connectivity. A zero value disables automated reboot in case of Internet connectivity loss.

',ret:'an integer corresponding to the allowed downtime of the WWW link (in seconds) before triggering an automated reboot to try to recover Internet connectivity',ext:'On failure, throws an exception or returns `Y_WWWWATCHDOGDELAY_INVALID`.'}; doc['Network']['isOnline']={syn:'Checks if the network interface is currently reachable, without raising any error.',lib:'network.isOnline()',pro:'function isOnline()',cmt:'

Checks if the network interface is currently reachable, without raising any error. If there is a cached value for the network interface in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the network interface.

',ret:'`true` if the network interface can be reached, and `false` otherwise'}; doc['Network']['isOnline_async']={syn:'Checks if the network interface is currently reachable, without raising any error (asynchronous version).',lib:'network.isOnline_async()',pro:'function isOnline_async(callback, context)',cmt:'

Checks if the network interface is currently reachable, without raising any error (asynchronous version). If there is a cached value for the network interface in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the requested function.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the boolean result',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['Network']['load']={syn:'Preloads the network interface cache with a specified validity duration.',lib:'network.load()',pro:'function load(msValidity)',cmt:'

Preloads the network interface cache with a specified validity duration. By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network traffic for instance.

',par:{msValidity:'an integer corresponding to the validity attributed to the loaded function parameters, in milliseconds'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Network']['loadAttribute']={syn:'Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.',lib:'network.loadAttribute()',pro:'function loadAttribute(attrName)',cmt:'

Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.

',par:{attrName:'the name of the requested attribute'},ret:'a string with the value of the the attribute',ext:'On failure, throws an exception or returns an empty string.'}; doc['Network']['load_async']={syn:'Preloads the network interface cache with a specified validity duration (asynchronous version).',lib:'network.load_async()',pro:'function load_async(msValidity, callback, context)',cmt:'

Preloads the network interface cache with a specified validity duration (asynchronous version). By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network trafic for instance.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{msValidity:'an integer corresponding to the validity of the loaded function parameters, in milliseconds',callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the error code (or `YAPI_SUCCESS`)',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['Network']['muteValueCallbacks']={syn:'Disables the propagation of every new advertised value to the parent hub.',lib:'network.muteValueCallbacks()',pro:'function muteValueCallbacks()',cmt:'

Disables the propagation of every new advertised value to the parent hub. You can use this function to save bandwidth and CPU on computers with limited resources, or to prevent unwanted invocations of the HTTP callback. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Network']['nextNetwork']={syn:'Continues the enumeration of network interfaces started using `yFirstNetwork()`.',lib:'network.nextNetwork()',pro:'function nextNetwork()',cmt:'

Continues the enumeration of network interfaces started using `yFirstNetwork()`.

',ret:'a pointer to a `YNetwork` object, corresponding to a network interface currently online, or a `null` pointer if there are no more network interfaces to enumerate.'}; doc['Network']['ping']={syn:'Pings host to test the network connectivity.',lib:'network.ping()',pro:'function ping(host)',cmt:'

Pings host to test the network connectivity. Sends four ICMP ECHO_REQUEST requests from the module to the target host. This method returns a string with the result of the 4 ICMP ECHO_REQUEST requests.

',par:{host:'the hostname or the IP address of the target'},ret:'a string with the result of the ping.'}; doc['Network']['registerValueCallback']={syn:'Registers the callback function that is invoked on every change of advertised value.',lib:'network.registerValueCallback()',pro:'function registerValueCallback(callback)',cmt:'

Registers the callback function that is invoked on every change of advertised value. The callback is invoked only during the execution of `ySleep` or `yHandleEvents`. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a null pointer as argument.

',par:{callback:'the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and the character string describing the new advertised value.'}}; doc['Network']['set_adminPassword']={syn:'Changes the password for the \x22admin\x22 user.',lib:'network.set_adminPassword()',pro:'function set_adminPassword(newval)',cmt:'

Changes the password for the \x22admin\x22 user. This password becomes instantly required to perform any change of the module state. If the specified value is an empty string, a password is not required anymore. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',par:{newval:'a string corresponding to the password for the \x22admin\x22 user'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Network']['set_callbackCredentials']={syn:'Changes the credentials required to connect to the callback address.',lib:'network.set_callbackCredentials()',pro:'function set_callbackCredentials(newval)',cmt:'

Changes the credentials required to connect to the callback address. The credentials must be provided as returned by function `get_callbackCredentials`, in the form `username:hash`. The method used to compute the hash varies according to the the authentication scheme implemented by the callback, For Basic authentication, the hash is the MD5 of the string `username:password`. For Digest authentication, the hash is the MD5 of the string `username:realm:password`. For a simpler way to configure callback credentials, use function `callbackLogin` instead. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',par:{newval:'a string corresponding to the credentials required to connect to the callback address'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Network']['set_callbackEncoding']={syn:'Changes the encoding standard to use for representing notification values.',lib:'network.set_callbackEncoding()',pro:'function set_callbackEncoding(newval)',cmt:'

Changes the encoding standard to use for representing notification values.

',par:{newval:'a value among `Y_CALLBACKENCODING_FORM`, `Y_CALLBACKENCODING_JSON`, `Y_CALLBACKENCODING_JSON_ARRAY`, `Y_CALLBACKENCODING_CSV`, `Y_CALLBACKENCODING_YOCTO_API`, `Y_CALLBACKENCODING_JSON_NUM`, `Y_CALLBACKENCODING_EMONCMS`, `Y_CALLBACKENCODING_AZURE`, `Y_CALLBACKENCODING_INFLUXDB`, `Y_CALLBACKENCODING_MQTT` and `Y_CALLBACKENCODING_YOCTO_API_JZON` corresponding to the encoding standard to use for representing notification values'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Network']['set_callbackInitialDelay']={syn:'Changes the initial waiting time before first callback notifications, in seconds.',lib:'network.set_callbackInitialDelay()',pro:'function set_callbackInitialDelay(newval)',cmt:'

Changes the initial waiting time before first callback notifications, in seconds.

',par:{newval:'an integer corresponding to the initial waiting time before first callback notifications, in seconds'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Network']['set_callbackMaxDelay']={syn:'Changes the waiting time between two HTTP callbacks when there is nothing new.',lib:'network.set_callbackMaxDelay()',pro:'function set_callbackMaxDelay(newval)',cmt:'

Changes the waiting time between two HTTP callbacks when there is nothing new.

',par:{newval:'an integer corresponding to the waiting time between two HTTP callbacks when there is nothing new'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Network']['set_callbackMethod']={syn:'Changes the HTTP method used to notify callbacks for significant state changes.',lib:'network.set_callbackMethod()',pro:'function set_callbackMethod(newval)',cmt:'

Changes the HTTP method used to notify callbacks for significant state changes.

',par:{newval:'a value among `Y_CALLBACKMETHOD_POST`, `Y_CALLBACKMETHOD_GET` and `Y_CALLBACKMETHOD_PUT` corresponding to the HTTP method used to notify callbacks for significant state changes'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Network']['set_callbackMinDelay']={syn:'Changes the minimum waiting time between two HTTP callbacks, in seconds.',lib:'network.set_callbackMinDelay()',pro:'function set_callbackMinDelay(newval)',cmt:'

Changes the minimum waiting time between two HTTP callbacks, in seconds.

',par:{newval:'an integer corresponding to the minimum waiting time between two HTTP callbacks, in seconds'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Network']['set_callbackSchedule']={syn:'Changes the HTTP callback schedule strategy, as a text string.',lib:'network.set_callbackSchedule()',pro:'function set_callbackSchedule(newval)',cmt:'

Changes the HTTP callback schedule strategy, as a text string.

',par:{newval:'a string corresponding to the HTTP callback schedule strategy, as a text string'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Network']['set_callbackUrl']={syn:'Changes the callback URL to notify significant state changes.',lib:'network.set_callbackUrl()',pro:'function set_callbackUrl(newval)',cmt:'

Changes the callback URL to notify significant state changes. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',par:{newval:'a string corresponding to the callback URL to notify significant state changes'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Network']['set_defaultPage']={syn:'Changes the default HTML page returned by the hub.',lib:'network.set_defaultPage()',pro:'function set_defaultPage(newval)',cmt:'

Changes the default HTML page returned by the hub. If not value are set the hub return \x22index.html\x22 which is the web interface of the hub. It is possible de change this page for file that has been uploaded on the hub.

',par:{newval:'a string corresponding to the default HTML page returned by the hub'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Network']['set_discoverable']={syn:'Changes the activation state of the multicast announce protocols to allow easy discovery of the module in the network neighborhood (uPnP/Bonjour protocol).',lib:'network.set_discoverable()',pro:'function set_discoverable(newval)',cmt:'

Changes the activation state of the multicast announce protocols to allow easy discovery of the module in the network neighborhood (uPnP/Bonjour protocol).

',par:{newval:'either `Y_DISCOVERABLE_FALSE` or `Y_DISCOVERABLE_TRUE`, according to the activation state of the multicast announce protocols to allow easy discovery of the module in the network neighborhood (uPnP/Bonjour protocol)'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Network']['set_httpPort']={syn:'Changes the default HTML page returned by the hub.',lib:'network.set_httpPort()',pro:'function set_httpPort(newval)',cmt:'

Changes the default HTML page returned by the hub. If not value are set the hub return \x22index.html\x22 which is the web interface of the hub. It is possible de change this page for file that has been uploaded on the hub.

',par:{newval:'an integer corresponding to the default HTML page returned by the hub'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Network']['set_logicalName']={syn:'Changes the logical name of the network interface.',lib:'network.set_logicalName()',pro:'function set_logicalName(newval)',cmt:'

Changes the logical name of the network interface. You can use `yCheckLogicalName()` prior to this call to make sure that your parameter is valid. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',par:{newval:'a string corresponding to the logical name of the network interface.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Network']['set_ntpServer']={syn:'Changes the IP address of the NTP server to be used by the module.',lib:'network.set_ntpServer()',pro:'function set_ntpServer(newval)',cmt:'

Changes the IP address of the NTP server to be used by the module. Remember to call the `saveToFlash()` method and then to reboot the module to apply this setting.

',par:{newval:'a string corresponding to the IP address of the NTP server to be used by the module'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Network']['set_periodicCallbackSchedule']={syn:'Setup periodic HTTP callbacks (simplifed function).',lib:'network.set_periodicCallbackSchedule()',pro:'function set_periodicCallbackSchedule(interval, offset)',cmt:'

Setup periodic HTTP callbacks (simplifed function).

',par:{interval:'a string representing the callback periodicity, expressed in seconds, minutes or hours, eg. \x2260s\x22, \x225m\x22, \x221h\x22, \x2248h\x22.',offset:'an integer representing the time offset relative to the period when the callback should occur. For instance, if the periodicity is 24h, an offset of 7 will make the callback occur each day at 7AM.'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Network']['set_primaryDNS']={syn:'Changes the IP address of the primary name server to be used by the module.',lib:'network.set_primaryDNS()',pro:'function set_primaryDNS(newval)',cmt:'

Changes the IP address of the primary name server to be used by the module. When using DHCP, if a value is specified, it overrides the value received from the DHCP server. Remember to call the `saveToFlash()` method and then to reboot the module to apply this setting.

',par:{newval:'a string corresponding to the IP address of the primary name server to be used by the module'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Network']['set_secondaryDNS']={syn:'Changes the IP address of the secondary name server to be used by the module.',lib:'network.set_secondaryDNS()',pro:'function set_secondaryDNS(newval)',cmt:'

Changes the IP address of the secondary name server to be used by the module. When using DHCP, if a value is specified, it overrides the value received from the DHCP server. Remember to call the `saveToFlash()` method and then to reboot the module to apply this setting.

',par:{newval:'a string corresponding to the IP address of the secondary name server to be used by the module'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Network']['set_userData']={syn:'Stores a user context provided as argument in the userData attribute of the function.',lib:'network.set_userData()',pro:'function set_userData(data)',cmt:'

Stores a user context provided as argument in the userData attribute of the function. This attribute is never touched by the API, and is at disposal of the caller to store a context.

',par:{data:'any kind of object to be stored'}}; doc['Network']['set_userPassword']={syn:'Changes the password for the \x22user\x22 user.',lib:'network.set_userPassword()',pro:'function set_userPassword(newval)',cmt:'

Changes the password for the \x22user\x22 user. This password becomes instantly required to perform any use of the module. If the specified value is an empty string, a password is not required anymore. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',par:{newval:'a string corresponding to the password for the \x22user\x22 user'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Network']['set_wwwWatchdogDelay']={syn:'Changes the allowed downtime of the WWW link (in seconds) before triggering an automated reboot to try to recover Internet connectivity.',lib:'network.set_wwwWatchdogDelay()',pro:'function set_wwwWatchdogDelay(newval)',cmt:'

Changes the allowed downtime of the WWW link (in seconds) before triggering an automated reboot to try to recover Internet connectivity. A zero value disables automated reboot in case of Internet connectivity loss. The smallest valid non-zero timeout is 90 seconds.

',par:{newval:'an integer corresponding to the allowed downtime of the WWW link (in seconds) before triggering an automated reboot to try to recover Internet connectivity'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Network']['triggerCallback']={syn:'Trigger an HTTP callback quickly.',lib:'network.triggerCallback()',pro:'function triggerCallback()',cmt:'

Trigger an HTTP callback quickly. This function can even be called within an HTTP callback, in which case the next callback will be triggered 5 seconds after the end of the current callback, regardless if the minimum time between callbacks configured in the device.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Network']['unmuteValueCallbacks']={syn:'Re-enables the propagation of every new advertised value to the parent hub.',lib:'network.unmuteValueCallbacks()',pro:'function unmuteValueCallbacks()',cmt:'

Re-enables the propagation of every new advertised value to the parent hub. This function reverts the effect of a previous call to `muteValueCallbacks()`. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Network']['useDHCP']={syn:'Changes the configuration of the network interface to enable the use of an IP address received from a DHCP server.',lib:'network.useDHCP()',pro:'function useDHCP(fallbackIpAddr, fallbackSubnetMaskLen, fallbackRouter)',cmt:'

Changes the configuration of the network interface to enable the use of an IP address received from a DHCP server. Until an address is received from a DHCP server, the module uses the IP parameters specified to this function. Remember to call the `saveToFlash()` method and then to reboot the module to apply this setting.

',par:{fallbackIpAddr:'fallback IP address, to be used when no DHCP reply is received',fallbackSubnetMaskLen:'fallback subnet mask length when no DHCP reply is received, as an integer (eg. 24 means 255.255.255.0)',fallbackRouter:'fallback router IP address, to be used when no DHCP reply is received'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Network']['useDHCPauto']={syn:'Changes the configuration of the network interface to enable the use of an IP address received from a DHCP server.',lib:'network.useDHCPauto()',pro:'function useDHCPauto()',cmt:'

Changes the configuration of the network interface to enable the use of an IP address received from a DHCP server. Until an address is received from a DHCP server, the module uses an IP of the network 169.254.0.0/16 (APIPA). Remember to call the `saveToFlash()` method and then to reboot the module to apply this setting.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Network']['useStaticIP']={syn:'Changes the configuration of the network interface to use a static IP address.',lib:'network.useStaticIP()',pro:'function useStaticIP(ipAddress, subnetMaskLen, router)',cmt:'

Changes the configuration of the network interface to use a static IP address. Remember to call the `saveToFlash()` method and then to reboot the module to apply this setting.

',par:{ipAddress:'device IP address',subnetMaskLen:'subnet mask length, as an integer (eg. 24 means 255.255.255.0)',router:'router IP address (default gateway)'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Network']['wait_async']={syn:'Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function.',lib:'network.wait_async()',pro:'function wait_async(callback, context)',cmt:'

Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function. The callback function can therefore freely issue synchronous or asynchronous commands, without risking to block the Javascript VM.

',par:{callback:'callback function that is invoked when all pending commands on the module are completed. The callback function receives two arguments: the caller-specific context object and the receiving function object.',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing.'}; //--- (end of generated code: Network) //--- (generated code: Wireless) doc['Wireless']={'':{syn:'Wireless function interface',inc:'<script type='text/javascript' src='yocto_wireless.js'></script>',cmt:'

YWireless functions provides control over wireless network parameters and status for devices that are wireless-enabled.

'}}; doc['Wireless']['FindWireless']={syn:'Retrieves a wireless lan interface for a given identifier.',lib:'YWireless.FindWireless()',pro:'function FindWireless(func)',cmt:'

Retrieves a wireless lan interface for a given identifier. The identifier can be specified using several formats:

- FunctionLogicalName
- ModuleSerialNumber.FunctionIdentifier
- ModuleSerialNumber.FunctionLogicalName
- ModuleLogicalName.FunctionIdentifier
- ModuleLogicalName.FunctionLogicalName

This function does not require that the wireless lan interface is online at the time it is invoked. The returned object is nevertheless valid. Use the method `YWireless.isOnline()` to test if the wireless lan interface is indeed online at a given time. In case of ambiguity when looking for a wireless lan interface by logical name, no error is notified: the first instance found is returned. The search is performed first by hardware name, then by logical name.

If a call to this object\x27s is_online() method returns FALSE although you are certain that the matching device is plugged, make sure that you did call registerHub() at application initialization time.

',par:{func:'a string that uniquely characterizes the wireless lan interface'},ret:'a `YWireless` object allowing you to drive the wireless lan interface.'}; doc['Wireless']['FirstWireless']={syn:'Starts the enumeration of wireless lan interfaces currently accessible.',lib:'YWireless.FirstWireless()',pro:'function FirstWireless()',cmt:'

Starts the enumeration of wireless lan interfaces currently accessible. Use the method `YWireless.nextWireless()` to iterate on next wireless lan interfaces.

',ret:'a pointer to a `YWireless` object, corresponding to the first wireless lan interface currently online, or a `null` pointer if there are none.'}; doc['Wireless']['adhocNetwork']={syn:'Changes the configuration of the wireless lan interface to create an ad-hoc wireless network, without using an access point.',lib:'wireless.adhocNetwork()',pro:'function adhocNetwork(ssid, securityKey)',cmt:'

Changes the configuration of the wireless lan interface to create an ad-hoc wireless network, without using an access point. On the YoctoHub-Wireless-g, it is best to use softAPNetworkInstead(), which emulates an access point (Soft AP) which is more efficient and more widely supported than ad-hoc networks.

When a security key is specified for an ad-hoc network, the network is protected by a WEP40 key (5 characters or 10 hexadecimal digits) or WEP128 key (13 characters or 26 hexadecimal digits). It is recommended to use a well-randomized WEP128 key using 26 hexadecimal digits to maximize security. Remember to call the `saveToFlash()` method and then to reboot the module to apply this setting.

',par:{ssid:'the name of the network to connect to',securityKey:'the network key, as a character string'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Wireless']['clearCache']={syn:'Invalidates the cache.',lib:'wireless.clearCache()',pro:'function clearCache()',cmt:'

Invalidates the cache. Invalidates the cache of the wireless lan interface attributes. Forces the next call to get_xxx() or loadxxx() to use values that come from the device.

'}; doc['Wireless']['describe']={syn:'Returns a short text that describes unambiguously the instance of the wireless lan interface in the form `TYPE(NAME)=SERIAL.FUNCTIONID`.',lib:'wireless.describe()',pro:'function describe()',cmt:'

Returns a short text that describes unambiguously the instance of the wireless lan interface in the form `TYPE(NAME)=SERIAL.FUNCTIONID`. More precisely, `TYPE` is the type of the function, `NAME` it the name used for the first access to the function, `SERIAL` is the serial number of the module if the module is connected or `\x22unresolved\x22`, and `FUNCTIONID` is the hardware identifier of the function if the module is connected. For example, this method returns `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1` if the module is already connected or `Relay(BadCustomeName.relay1)=unresolved` if the module has not yet been connected. This method does not trigger any USB or TCP transaction and can therefore be used in a debugger.

',ret:'a string that describes the wireless lan interface (ex: `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1`)'}; doc['Wireless']['get_advertisedValue']={syn:'Returns the current value of the wireless lan interface (no more than 6 characters).',lib:'wireless.get_advertisedValue()',pro:'function get_advertisedValue()',cmt:'

Returns the current value of the wireless lan interface (no more than 6 characters).

',ret:'a string corresponding to the current value of the wireless lan interface (no more than 6 characters).',ext:'On failure, throws an exception or returns `Y_ADVERTISEDVALUE_INVALID`.'}; doc['Wireless']['get_channel']={syn:'Returns the 802.11 channel currently used, or 0 when the selected network has not been found.',lib:'wireless.get_channel()',pro:'function get_channel()',cmt:'

Returns the 802.11 channel currently used, or 0 when the selected network has not been found.

',ret:'an integer corresponding to the 802.11 channel currently used, or 0 when the selected network has not been found',ext:'On failure, throws an exception or returns `Y_CHANNEL_INVALID`.'}; doc['Wireless']['get_detectedWlans']={syn:'Returns a list of YWlanRecord objects that describe detected Wireless networks.',lib:'wireless.get_detectedWlans()',pro:'function get_detectedWlans()',cmt:'

Returns a list of YWlanRecord objects that describe detected Wireless networks. This list is not updated when the module is already connected to an acces point (infrastructure mode). To force an update of this list, `startWlanScan()` must be called. Note that an languages without garbage collections, the returned list must be freed by the caller.

',ret:'a list of `YWlanRecord` objects, containing the SSID, channel, link quality and the type of security of the wireless network.',ext:'On failure, throws an exception or returns an empty list.'}; doc['Wireless']['get_errorMessage']={syn:'Returns the error message of the latest error with the wireless lan interface.',lib:'wireless.get_errorMessage()',pro:'function get_errorMessage()',cmt:'

Returns the error message of the latest error with the wireless lan interface. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a string corresponding to the latest error message that occured while using the wireless lan interface object'}; doc['Wireless']['get_errorType']={syn:'Returns the numerical error code of the latest error with the wireless lan interface.',lib:'wireless.get_errorType()',pro:'function get_errorType()',cmt:'

Returns the numerical error code of the latest error with the wireless lan interface. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a number corresponding to the code of the latest error that occurred while using the wireless lan interface object'}; doc['Wireless']['get_friendlyName']={syn:'Returns a global identifier of the wireless lan interface in the format `MODULE_NAME.FUNCTION_NAME`.',lib:'wireless.get_friendlyName()',pro:'function get_friendlyName()',cmt:'

Returns a global identifier of the wireless lan interface in the format `MODULE_NAME.FUNCTION_NAME`. The returned string uses the logical names of the module and of the wireless lan interface if they are defined, otherwise the serial number of the module and the hardware identifier of the wireless lan interface (for example: `MyCustomName.relay1`)

',ret:'a string that uniquely identifies the wireless lan interface using logical names (ex: `MyCustomName.relay1`)',ext:'On failure, throws an exception or returns `Y_FRIENDLYNAME_INVALID`.'}; doc['Wireless']['get_functionDescriptor']={syn:'Returns a unique identifier of type `YFUN_DESCR` corresponding to the function.',lib:'wireless.get_functionDescriptor()',pro:'function get_functionDescriptor()',cmt:'

Returns a unique identifier of type `YFUN_DESCR` corresponding to the function. This identifier can be used to test if two instances of `YFunction` reference the same physical function on the same physical device.

',ret:'an identifier of type `YFUN_DESCR`.',ext:'If the function has never been contacted, the returned value is `Y_FUNCTIONDESCRIPTOR_INVALID`.'}; doc['Wireless']['get_functionId']={syn:'Returns the hardware identifier of the wireless lan interface, without reference to the module.',lib:'wireless.get_functionId()',pro:'function get_functionId()',cmt:'

Returns the hardware identifier of the wireless lan interface, without reference to the module. For example `relay1`

',ret:'a string that identifies the wireless lan interface (ex: `relay1`)',ext:'On failure, throws an exception or returns `Y_FUNCTIONID_INVALID`.'}; doc['Wireless']['get_hardwareId']={syn:'Returns the unique hardware identifier of the wireless lan interface in the form `SERIAL.FUNCTIONID`.',lib:'wireless.get_hardwareId()',pro:'function get_hardwareId()',cmt:'

Returns the unique hardware identifier of the wireless lan interface in the form `SERIAL.FUNCTIONID`. The unique hardware identifier is composed of the device serial number and of the hardware identifier of the wireless lan interface (for example `RELAYLO1-123456.relay1`).

',ret:'a string that uniquely identifies the wireless lan interface (ex: `RELAYLO1-123456.relay1`)',ext:'On failure, throws an exception or returns `Y_HARDWAREID_INVALID`.'}; doc['Wireless']['get_linkQuality']={syn:'Returns the link quality, expressed in percent.',lib:'wireless.get_linkQuality()',pro:'function get_linkQuality()',cmt:'

Returns the link quality, expressed in percent.

',ret:'an integer corresponding to the link quality, expressed in percent',ext:'On failure, throws an exception or returns `Y_LINKQUALITY_INVALID`.'}; doc['Wireless']['get_logicalName']={syn:'Returns the logical name of the wireless lan interface.',lib:'wireless.get_logicalName()',pro:'function get_logicalName()',cmt:'

Returns the logical name of the wireless lan interface.

',ret:'a string corresponding to the logical name of the wireless lan interface.',ext:'On failure, throws an exception or returns `Y_LOGICALNAME_INVALID`.'}; doc['Wireless']['get_message']={syn:'Returns the latest status message from the wireless interface.',lib:'wireless.get_message()',pro:'function get_message()',cmt:'

Returns the latest status message from the wireless interface.

',ret:'a string corresponding to the latest status message from the wireless interface',ext:'On failure, throws an exception or returns `Y_MESSAGE_INVALID`.'}; doc['Wireless']['get_module']={syn:'Gets the `YModule` object for the device on which the function is located.',lib:'wireless.get_module()',pro:'function get_module()',cmt:'

Gets the `YModule` object for the device on which the function is located. If the function cannot be located on any module, the returned instance of `YModule` is not shown as on-line.

',ret:'an instance of `YModule`'}; doc['Wireless']['get_module_async']={syn:'Gets the `YModule` object for the device on which the function is located (asynchronous version).',lib:'wireless.get_module_async()',pro:'function get_module_async(callback, context)',cmt:'

Gets the `YModule` object for the device on which the function is located (asynchronous version). If the function cannot be located on any module, the returned `YModule` object does not show as on-line.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking Firefox javascript VM that does not implement context switching during blocking I/O calls. See the documentation section on asynchronous Javascript calls for more details.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the requested `YModule` object',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['Wireless']['get_security']={syn:'Returns the security algorithm used by the selected wireless network.',lib:'wireless.get_security()',pro:'function get_security()',cmt:'

Returns the security algorithm used by the selected wireless network.

',ret:'a value among `Y_SECURITY_UNKNOWN`, `Y_SECURITY_OPEN`, `Y_SECURITY_WEP`, `Y_SECURITY_WPA` and `Y_SECURITY_WPA2` corresponding to the security algorithm used by the selected wireless network',ext:'On failure, throws an exception or returns `Y_SECURITY_INVALID`.'}; doc['Wireless']['get_ssid']={syn:'Returns the wireless network name (SSID).',lib:'wireless.get_ssid()',pro:'function get_ssid()',cmt:'

Returns the wireless network name (SSID).

',ret:'a string corresponding to the wireless network name (SSID)',ext:'On failure, throws an exception or returns `Y_SSID_INVALID`.'}; doc['Wireless']['get_userData']={syn:'Returns the value of the userData attribute, as previously stored using method `set_userData`.',lib:'wireless.get_userData()',pro:'function get_userData()',cmt:'

Returns the value of the userData attribute, as previously stored using method `set_userData`. This attribute is never touched directly by the API, and is at disposal of the caller to store a context.

',ret:'the object stored previously by the caller.'}; doc['Wireless']['get_wlanState']={syn:'Returns the current state of the wireless interface.',lib:'wireless.get_wlanState()',pro:'function get_wlanState()',cmt:'

Returns the current state of the wireless interface. The state `Y_WLANSTATE_DOWN` means that the network interface is not connected to a network. The state `Y_WLANSTATE_SCANNING` means that the network interface is scanning available frequencies. During this stage, the device is not reachable, and the network settings are not yet applied. The state `Y_WLANSTATE_CONNECTED` means that the network settings have been successfully applied ant that the device is reachable from the wireless network. If the device is configured to use ad-hoc or Soft AP mode, it means that the wireless network is up and that other devices can join the network. The state `Y_WLANSTATE_REJECTED` means that the network interface has not been able to join the requested network. The description of the error can be obtain with the `get_message()` method.

',ret:'a value among `Y_WLANSTATE_DOWN`, `Y_WLANSTATE_SCANNING`, `Y_WLANSTATE_CONNECTED` and `Y_WLANSTATE_REJECTED` corresponding to the current state of the wireless interface',ext:'On failure, throws an exception or returns `Y_WLANSTATE_INVALID`.'}; doc['Wireless']['isOnline']={syn:'Checks if the wireless lan interface is currently reachable, without raising any error.',lib:'wireless.isOnline()',pro:'function isOnline()',cmt:'

Checks if the wireless lan interface is currently reachable, without raising any error. If there is a cached value for the wireless lan interface in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the wireless lan interface.

',ret:'`true` if the wireless lan interface can be reached, and `false` otherwise'}; doc['Wireless']['isOnline_async']={syn:'Checks if the wireless lan interface is currently reachable, without raising any error (asynchronous version).',lib:'wireless.isOnline_async()',pro:'function isOnline_async(callback, context)',cmt:'

Checks if the wireless lan interface is currently reachable, without raising any error (asynchronous version). If there is a cached value for the wireless lan interface in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the requested function.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the boolean result',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['Wireless']['joinNetwork']={syn:'Changes the configuration of the wireless lan interface to connect to an existing access point (infrastructure mode).',lib:'wireless.joinNetwork()',pro:'function joinNetwork(ssid, securityKey)',cmt:'

Changes the configuration of the wireless lan interface to connect to an existing access point (infrastructure mode). Remember to call the `saveToFlash()` method and then to reboot the module to apply this setting.

',par:{ssid:'the name of the network to connect to',securityKey:'the network key, as a character string'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Wireless']['load']={syn:'Preloads the wireless lan interface cache with a specified validity duration.',lib:'wireless.load()',pro:'function load(msValidity)',cmt:'

Preloads the wireless lan interface cache with a specified validity duration. By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network traffic for instance.

',par:{msValidity:'an integer corresponding to the validity attributed to the loaded function parameters, in milliseconds'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Wireless']['loadAttribute']={syn:'Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.',lib:'wireless.loadAttribute()',pro:'function loadAttribute(attrName)',cmt:'

Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.

',par:{attrName:'the name of the requested attribute'},ret:'a string with the value of the the attribute',ext:'On failure, throws an exception or returns an empty string.'}; doc['Wireless']['load_async']={syn:'Preloads the wireless lan interface cache with a specified validity duration (asynchronous version).',lib:'wireless.load_async()',pro:'function load_async(msValidity, callback, context)',cmt:'

Preloads the wireless lan interface cache with a specified validity duration (asynchronous version). By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network trafic for instance.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{msValidity:'an integer corresponding to the validity of the loaded function parameters, in milliseconds',callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the error code (or `YAPI_SUCCESS`)',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['Wireless']['muteValueCallbacks']={syn:'Disables the propagation of every new advertised value to the parent hub.',lib:'wireless.muteValueCallbacks()',pro:'function muteValueCallbacks()',cmt:'

Disables the propagation of every new advertised value to the parent hub. You can use this function to save bandwidth and CPU on computers with limited resources, or to prevent unwanted invocations of the HTTP callback. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Wireless']['nextWireless']={syn:'Continues the enumeration of wireless lan interfaces started using `yFirstWireless()`.',lib:'wireless.nextWireless()',pro:'function nextWireless()',cmt:'

Continues the enumeration of wireless lan interfaces started using `yFirstWireless()`.

',ret:'a pointer to a `YWireless` object, corresponding to a wireless lan interface currently online, or a `null` pointer if there are no more wireless lan interfaces to enumerate.'}; doc['Wireless']['registerValueCallback']={syn:'Registers the callback function that is invoked on every change of advertised value.',lib:'wireless.registerValueCallback()',pro:'function registerValueCallback(callback)',cmt:'

Registers the callback function that is invoked on every change of advertised value. The callback is invoked only during the execution of `ySleep` or `yHandleEvents`. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a null pointer as argument.

',par:{callback:'the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and the character string describing the new advertised value.'}}; doc['Wireless']['set_logicalName']={syn:'Changes the logical name of the wireless lan interface.',lib:'wireless.set_logicalName()',pro:'function set_logicalName(newval)',cmt:'

Changes the logical name of the wireless lan interface. You can use `yCheckLogicalName()` prior to this call to make sure that your parameter is valid. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',par:{newval:'a string corresponding to the logical name of the wireless lan interface.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Wireless']['set_userData']={syn:'Stores a user context provided as argument in the userData attribute of the function.',lib:'wireless.set_userData()',pro:'function set_userData(data)',cmt:'

Stores a user context provided as argument in the userData attribute of the function. This attribute is never touched by the API, and is at disposal of the caller to store a context.

',par:{data:'any kind of object to be stored'}}; doc['Wireless']['softAPNetwork']={syn:'Changes the configuration of the wireless lan interface to create a new wireless network by emulating a WiFi access point (Soft AP).',lib:'wireless.softAPNetwork()',pro:'function softAPNetwork(ssid, securityKey)',cmt:'

Changes the configuration of the wireless lan interface to create a new wireless network by emulating a WiFi access point (Soft AP). This function can only be used with the YoctoHub-Wireless-g.

When a security key is specified for a SoftAP network, the network is protected by a WEP40 key (5 characters or 10 hexadecimal digits) or WEP128 key (13 characters or 26 hexadecimal digits). It is recommended to use a well-randomized WEP128 key using 26 hexadecimal digits to maximize security. Remember to call the `saveToFlash()` method and then to reboot the module to apply this setting.

',par:{ssid:'the name of the network to connect to',securityKey:'the network key, as a character string'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Wireless']['startWlanScan']={syn:'Triggers a scan of the wireless frequency and builds the list of available networks.',lib:'wireless.startWlanScan()',pro:'function startWlanScan()',cmt:'

Triggers a scan of the wireless frequency and builds the list of available networks. The scan forces a disconnection from the current network. At then end of the process, the the network interface attempts to reconnect to the previous network. During the scan, the `wlanState` switches to `Y_WLANSTATE_DOWN`, then to `Y_WLANSTATE_SCANNING`. When the scan is completed, `get_wlanState()` returns either `Y_WLANSTATE_DOWN` or `Y_WLANSTATE_SCANNING`. At this point, the list of detected network can be retrieved with the `get_detectedWlans()` method.

On failure, throws an exception or returns a negative error code.

'}; doc['Wireless']['unmuteValueCallbacks']={syn:'Re-enables the propagation of every new advertised value to the parent hub.',lib:'wireless.unmuteValueCallbacks()',pro:'function unmuteValueCallbacks()',cmt:'

Re-enables the propagation of every new advertised value to the parent hub. This function reverts the effect of a previous call to `muteValueCallbacks()`. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Wireless']['wait_async']={syn:'Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function.',lib:'wireless.wait_async()',pro:'function wait_async(callback, context)',cmt:'

Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function. The callback function can therefore freely issue synchronous or asynchronous commands, without risking to block the Javascript VM.

',par:{callback:'callback function that is invoked when all pending commands on the module are completed. The callback function receives two arguments: the caller-specific context object and the receiving function object.',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing.'}; //--- (end of generated code: Wireless) //--- (generated code: Voc) doc['Voc']={'':{syn:'Voc function interface',inc:'<script type='text/javascript' src='yocto_voc.js'></script>',cmt:'

The Yoctopuce class YVoc allows you to read and configure Yoctopuce Volatile Organic Compound sensors. It inherits from YSensor class the core functions to read measurements, to register callback functions, to access the autonomous datalogger.

'}}; doc['Voc']['FindVoc']={syn:'Retrieves a Volatile Organic Compound sensor for a given identifier.',lib:'YVoc.FindVoc()',pro:'function FindVoc(func)',cmt:'

Retrieves a Volatile Organic Compound sensor for a given identifier. The identifier can be specified using several formats:

- FunctionLogicalName
- ModuleSerialNumber.FunctionIdentifier
- ModuleSerialNumber.FunctionLogicalName
- ModuleLogicalName.FunctionIdentifier
- ModuleLogicalName.FunctionLogicalName

This function does not require that the Volatile Organic Compound sensor is online at the time it is invoked. The returned object is nevertheless valid. Use the method `YVoc.isOnline()` to test if the Volatile Organic Compound sensor is indeed online at a given time. In case of ambiguity when looking for a Volatile Organic Compound sensor by logical name, no error is notified: the first instance found is returned. The search is performed first by hardware name, then by logical name.

If a call to this object\x27s is_online() method returns FALSE although you are certain that the matching device is plugged, make sure that you did call registerHub() at application initialization time.

',par:{func:'a string that uniquely characterizes the Volatile Organic Compound sensor'},ret:'a `YVoc` object allowing you to drive the Volatile Organic Compound sensor.'}; doc['Voc']['FirstVoc']={syn:'Starts the enumeration of Volatile Organic Compound sensors currently accessible.',lib:'YVoc.FirstVoc()',pro:'function FirstVoc()',cmt:'

Starts the enumeration of Volatile Organic Compound sensors currently accessible. Use the method `YVoc.nextVoc()` to iterate on next Volatile Organic Compound sensors.

',ret:'a pointer to a `YVoc` object, corresponding to the first Volatile Organic Compound sensor currently online, or a `null` pointer if there are none.'}; doc['Voc']['calibrateFromPoints']={syn:'Configures error correction data points, in particular to compensate for a possible perturbation of the measure caused by an enclosure.',lib:'voc.calibrateFromPoints()',pro:'function calibrateFromPoints(rawValues, refValues)',cmt:'

Configures error correction data points, in particular to compensate for a possible perturbation of the measure caused by an enclosure. It is possible to configure up to five correction points. Correction points must be provided in ascending order, and be in the range of the sensor. The device will automatically perform a linear interpolation of the error correction between specified points. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

For more information on advanced capabilities to refine the calibration of sensors, please contact support@yoctopuce.com.

',par:{rawValues:'array of floating point numbers, corresponding to the raw values returned by the sensor for the correction points.',refValues:'array of floating point numbers, corresponding to the corrected values for the correction points.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Voc']['clearCache']={syn:'Invalidates the cache.',lib:'voc.clearCache()',pro:'function clearCache()',cmt:'

Invalidates the cache. Invalidates the cache of the Volatile Organic Compound sensor attributes. Forces the next call to get_xxx() or loadxxx() to use values that come from the device.

'}; doc['Voc']['describe']={syn:'Returns a short text that describes unambiguously the instance of the Volatile Organic Compound sensor in the form `TYPE(NAME)=SERIAL.FUNCTIONID`.',lib:'voc.describe()',pro:'function describe()',cmt:'

Returns a short text that describes unambiguously the instance of the Volatile Organic Compound sensor in the form `TYPE(NAME)=SERIAL.FUNCTIONID`. More precisely, `TYPE` is the type of the function, `NAME` it the name used for the first access to the function, `SERIAL` is the serial number of the module if the module is connected or `\x22unresolved\x22`, and `FUNCTIONID` is the hardware identifier of the function if the module is connected. For example, this method returns `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1` if the module is already connected or `Relay(BadCustomeName.relay1)=unresolved` if the module has not yet been connected. This method does not trigger any USB or TCP transaction and can therefore be used in a debugger.

',ret:'a string that describes the Volatile Organic Compound sensor (ex: `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1`)'}; doc['Voc']['get_advMode']={syn:'Returns the measuring mode used for the advertised value pushed to the parent hub.',lib:'voc.get_advMode()',pro:'function get_advMode()',cmt:'

Returns the measuring mode used for the advertised value pushed to the parent hub.

',ret:'a value among `Y_ADVMODE_IMMEDIATE`, `Y_ADVMODE_PERIOD_AVG`, `Y_ADVMODE_PERIOD_MIN` and `Y_ADVMODE_PERIOD_MAX` corresponding to the measuring mode used for the advertised value pushed to the parent hub',ext:'On failure, throws an exception or returns `Y_ADVMODE_INVALID`.'}; doc['Voc']['get_advertisedValue']={syn:'Returns the current value of the Volatile Organic Compound sensor (no more than 6 characters).',lib:'voc.get_advertisedValue()',pro:'function get_advertisedValue()',cmt:'

Returns the current value of the Volatile Organic Compound sensor (no more than 6 characters).

',ret:'a string corresponding to the current value of the Volatile Organic Compound sensor (no more than 6 characters).',ext:'On failure, throws an exception or returns `Y_ADVERTISEDVALUE_INVALID`.'}; doc['Voc']['get_currentRawValue']={syn:'Returns the uncalibrated, unrounded raw value returned by the sensor, in ppm (vol), as a floating point number.',lib:'voc.get_currentRawValue()',pro:'function get_currentRawValue()',cmt:'

Returns the uncalibrated, unrounded raw value returned by the sensor, in ppm (vol), as a floating point number.

',ret:'a floating point number corresponding to the uncalibrated, unrounded raw value returned by the sensor, in ppm (vol), as a floating point number',ext:'On failure, throws an exception or returns `Y_CURRENTRAWVALUE_INVALID`.'}; doc['Voc']['get_currentValue']={syn:'Returns the current value of the estimated VOC concentration, in ppm (vol), as a floating point number.',lib:'voc.get_currentValue()',pro:'function get_currentValue()',cmt:'

Returns the current value of the estimated VOC concentration, in ppm (vol), as a floating point number.

',ret:'a floating point number corresponding to the current value of the estimated VOC concentration, in ppm (vol), as a floating point number',ext:'On failure, throws an exception or returns `Y_CURRENTVALUE_INVALID`.'}; doc['Voc']['get_dataLogger']={syn:'Returns the YDatalogger object of the device hosting the sensor.',lib:'voc.get_dataLogger()',pro:'function get_dataLogger()',cmt:'

Returns the YDatalogger object of the device hosting the sensor. This method returns an object of class YDatalogger that can control global parameters of the data logger. The returned object should not be freed.

',ret:'an YDataLogger object or null on error.'}; doc['Voc']['get_errorMessage']={syn:'Returns the error message of the latest error with the Volatile Organic Compound sensor.',lib:'voc.get_errorMessage()',pro:'function get_errorMessage()',cmt:'

Returns the error message of the latest error with the Volatile Organic Compound sensor. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a string corresponding to the latest error message that occured while using the Volatile Organic Compound sensor object'}; doc['Voc']['get_errorType']={syn:'Returns the numerical error code of the latest error with the Volatile Organic Compound sensor.',lib:'voc.get_errorType()',pro:'function get_errorType()',cmt:'

Returns the numerical error code of the latest error with the Volatile Organic Compound sensor. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a number corresponding to the code of the latest error that occurred while using the Volatile Organic Compound sensor object'}; doc['Voc']['get_friendlyName']={syn:'Returns a global identifier of the Volatile Organic Compound sensor in the format `MODULE_NAME.FUNCTION_NAME`.',lib:'voc.get_friendlyName()',pro:'function get_friendlyName()',cmt:'

Returns a global identifier of the Volatile Organic Compound sensor in the format `MODULE_NAME.FUNCTION_NAME`. The returned string uses the logical names of the module and of the Volatile Organic Compound sensor if they are defined, otherwise the serial number of the module and the hardware identifier of the Volatile Organic Compound sensor (for example: `MyCustomName.relay1`)

',ret:'a string that uniquely identifies the Volatile Organic Compound sensor using logical names (ex: `MyCustomName.relay1`)',ext:'On failure, throws an exception or returns `Y_FRIENDLYNAME_INVALID`.'}; doc['Voc']['get_functionDescriptor']={syn:'Returns a unique identifier of type `YFUN_DESCR` corresponding to the function.',lib:'voc.get_functionDescriptor()',pro:'function get_functionDescriptor()',cmt:'

Returns a unique identifier of type `YFUN_DESCR` corresponding to the function. This identifier can be used to test if two instances of `YFunction` reference the same physical function on the same physical device.

',ret:'an identifier of type `YFUN_DESCR`.',ext:'If the function has never been contacted, the returned value is `Y_FUNCTIONDESCRIPTOR_INVALID`.'}; doc['Voc']['get_functionId']={syn:'Returns the hardware identifier of the Volatile Organic Compound sensor, without reference to the module.',lib:'voc.get_functionId()',pro:'function get_functionId()',cmt:'

Returns the hardware identifier of the Volatile Organic Compound sensor, without reference to the module. For example `relay1`

',ret:'a string that identifies the Volatile Organic Compound sensor (ex: `relay1`)',ext:'On failure, throws an exception or returns `Y_FUNCTIONID_INVALID`.'}; doc['Voc']['get_hardwareId']={syn:'Returns the unique hardware identifier of the Volatile Organic Compound sensor in the form `SERIAL.FUNCTIONID`.',lib:'voc.get_hardwareId()',pro:'function get_hardwareId()',cmt:'

Returns the unique hardware identifier of the Volatile Organic Compound sensor in the form `SERIAL.FUNCTIONID`. The unique hardware identifier is composed of the device serial number and of the hardware identifier of the Volatile Organic Compound sensor (for example `RELAYLO1-123456.relay1`).

',ret:'a string that uniquely identifies the Volatile Organic Compound sensor (ex: `RELAYLO1-123456.relay1`)',ext:'On failure, throws an exception or returns `Y_HARDWAREID_INVALID`.'}; doc['Voc']['get_highestValue']={syn:'Returns the maximal value observed for the estimated VOC concentration since the device was started.',lib:'voc.get_highestValue()',pro:'function get_highestValue()',cmt:'

Returns the maximal value observed for the estimated VOC concentration since the device was started. Can be reset to an arbitrary value thanks to set_highestValue().

',ret:'a floating point number corresponding to the maximal value observed for the estimated VOC concentration since the device was started',ext:'On failure, throws an exception or returns `Y_HIGHESTVALUE_INVALID`.'}; doc['Voc']['get_logFrequency']={syn:'Returns the datalogger recording frequency for this function, or \x22OFF\x22 when measures are not stored in the data logger flash memory.',lib:'voc.get_logFrequency()',pro:'function get_logFrequency()',cmt:'

Returns the datalogger recording frequency for this function, or \x22OFF\x22 when measures are not stored in the data logger flash memory.

',ret:'a string corresponding to the datalogger recording frequency for this function, or \x22OFF\x22 when measures are not stored in the data logger flash memory',ext:'On failure, throws an exception or returns `Y_LOGFREQUENCY_INVALID`.'}; doc['Voc']['get_logicalName']={syn:'Returns the logical name of the Volatile Organic Compound sensor.',lib:'voc.get_logicalName()',pro:'function get_logicalName()',cmt:'

Returns the logical name of the Volatile Organic Compound sensor.

',ret:'a string corresponding to the logical name of the Volatile Organic Compound sensor.',ext:'On failure, throws an exception or returns `Y_LOGICALNAME_INVALID`.'}; doc['Voc']['get_lowestValue']={syn:'Returns the minimal value observed for the estimated VOC concentration since the device was started.',lib:'voc.get_lowestValue()',pro:'function get_lowestValue()',cmt:'

Returns the minimal value observed for the estimated VOC concentration since the device was started. Can be reset to an arbitrary value thanks to set_lowestValue().

',ret:'a floating point number corresponding to the minimal value observed for the estimated VOC concentration since the device was started',ext:'On failure, throws an exception or returns `Y_LOWESTVALUE_INVALID`.'}; doc['Voc']['get_module']={syn:'Gets the `YModule` object for the device on which the function is located.',lib:'voc.get_module()',pro:'function get_module()',cmt:'

Gets the `YModule` object for the device on which the function is located. If the function cannot be located on any module, the returned instance of `YModule` is not shown as on-line.

',ret:'an instance of `YModule`'}; doc['Voc']['get_module_async']={syn:'Gets the `YModule` object for the device on which the function is located (asynchronous version).',lib:'voc.get_module_async()',pro:'function get_module_async(callback, context)',cmt:'

Gets the `YModule` object for the device on which the function is located (asynchronous version). If the function cannot be located on any module, the returned `YModule` object does not show as on-line.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking Firefox javascript VM that does not implement context switching during blocking I/O calls. See the documentation section on asynchronous Javascript calls for more details.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the requested `YModule` object',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['Voc']['get_recordedData']={syn:'Retrieves a DataSet object holding historical data for this sensor, for a specified time interval.',lib:'voc.get_recordedData()',pro:'function get_recordedData(startTime, endTime)',cmt:'

Retrieves a DataSet object holding historical data for this sensor, for a specified time interval. The measures will be retrieved from the data logger, which must have been turned on at the desired time. See the documentation of the DataSet class for information on how to get an overview of the recorded data, and how to load progressively a large set of measures from the data logger.

This function only works if the device uses a recent firmware, as DataSet objects are not supported by firmwares older than version 13000.

',par:{startTime:'the start of the desired measure time interval, as a Unix timestamp, i.e. the number of seconds since January 1, 1970 UTC. The special value 0 can be used to include any meaasure, without initial limit.',endTime:'the end of the desired measure time interval, as a Unix timestamp, i.e. the number of seconds since January 1, 1970 UTC. The special value 0 can be used to include any meaasure, without ending limit.'},ret:'an instance of YDataSet, providing access to historical data. Past measures can be loaded progressively using methods from the YDataSet object.'}; doc['Voc']['get_reportFrequency']={syn:'Returns the timed value notification frequency, or \x22OFF\x22 if timed value notifications are disabled for this function.',lib:'voc.get_reportFrequency()',pro:'function get_reportFrequency()',cmt:'

Returns the timed value notification frequency, or \x22OFF\x22 if timed value notifications are disabled for this function.

',ret:'a string corresponding to the timed value notification frequency, or \x22OFF\x22 if timed value notifications are disabled for this function',ext:'On failure, throws an exception or returns `Y_REPORTFREQUENCY_INVALID`.'}; doc['Voc']['get_resolution']={syn:'Returns the resolution of the measured values.',lib:'voc.get_resolution()',pro:'function get_resolution()',cmt:'

Returns the resolution of the measured values. The resolution corresponds to the numerical precision of the measures, which is not always the same as the actual precision of the sensor.

',ret:'a floating point number corresponding to the resolution of the measured values',ext:'On failure, throws an exception or returns `Y_RESOLUTION_INVALID`.'}; doc['Voc']['get_sensorState']={syn:'Returns the sensor health state code, which is zero when there is an up-to-date measure available or a positive code if the sensor is not able to provide a measure right now.',lib:'voc.get_sensorState()',pro:'function get_sensorState()',cmt:'

Returns the sensor health state code, which is zero when there is an up-to-date measure available or a positive code if the sensor is not able to provide a measure right now.

',ret:'an integer corresponding to the sensor health state code, which is zero when there is an up-to-date measure available or a positive code if the sensor is not able to provide a measure right now',ext:'On failure, throws an exception or returns `Y_SENSORSTATE_INVALID`.'}; doc['Voc']['get_unit']={syn:'Returns the measuring unit for the estimated VOC concentration.',lib:'voc.get_unit()',pro:'function get_unit()',cmt:'

Returns the measuring unit for the estimated VOC concentration.

',ret:'a string corresponding to the measuring unit for the estimated VOC concentration',ext:'On failure, throws an exception or returns `Y_UNIT_INVALID`.'}; doc['Voc']['get_userData']={syn:'Returns the value of the userData attribute, as previously stored using method `set_userData`.',lib:'voc.get_userData()',pro:'function get_userData()',cmt:'

Returns the value of the userData attribute, as previously stored using method `set_userData`. This attribute is never touched directly by the API, and is at disposal of the caller to store a context.

',ret:'the object stored previously by the caller.'}; doc['Voc']['isOnline']={syn:'Checks if the Volatile Organic Compound sensor is currently reachable, without raising any error.',lib:'voc.isOnline()',pro:'function isOnline()',cmt:'

Checks if the Volatile Organic Compound sensor is currently reachable, without raising any error. If there is a cached value for the Volatile Organic Compound sensor in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the Volatile Organic Compound sensor.

',ret:'`true` if the Volatile Organic Compound sensor can be reached, and `false` otherwise'}; doc['Voc']['isOnline_async']={syn:'Checks if the Volatile Organic Compound sensor is currently reachable, without raising any error (asynchronous version).',lib:'voc.isOnline_async()',pro:'function isOnline_async(callback, context)',cmt:'

Checks if the Volatile Organic Compound sensor is currently reachable, without raising any error (asynchronous version). If there is a cached value for the Volatile Organic Compound sensor in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the requested function.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the boolean result',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['Voc']['load']={syn:'Preloads the Volatile Organic Compound sensor cache with a specified validity duration.',lib:'voc.load()',pro:'function load(msValidity)',cmt:'

Preloads the Volatile Organic Compound sensor cache with a specified validity duration. By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network traffic for instance.

',par:{msValidity:'an integer corresponding to the validity attributed to the loaded function parameters, in milliseconds'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Voc']['loadAttribute']={syn:'Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.',lib:'voc.loadAttribute()',pro:'function loadAttribute(attrName)',cmt:'

Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.

',par:{attrName:'the name of the requested attribute'},ret:'a string with the value of the the attribute',ext:'On failure, throws an exception or returns an empty string.'}; doc['Voc']['loadCalibrationPoints']={syn:'Retrieves error correction data points previously entered using the method `calibrateFromPoints`.',lib:'voc.loadCalibrationPoints()',pro:'function loadCalibrationPoints(rawValues, refValues)',cmt:'

Retrieves error correction data points previously entered using the method `calibrateFromPoints`.

',par:{rawValues:'array of floating point numbers, that will be filled by the function with the raw sensor values for the correction points.',refValues:'array of floating point numbers, that will be filled by the function with the desired values for the correction points.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Voc']['load_async']={syn:'Preloads the Volatile Organic Compound sensor cache with a specified validity duration (asynchronous version).',lib:'voc.load_async()',pro:'function load_async(msValidity, callback, context)',cmt:'

Preloads the Volatile Organic Compound sensor cache with a specified validity duration (asynchronous version). By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network trafic for instance.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{msValidity:'an integer corresponding to the validity of the loaded function parameters, in milliseconds',callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the error code (or `YAPI_SUCCESS`)',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['Voc']['muteValueCallbacks']={syn:'Disables the propagation of every new advertised value to the parent hub.',lib:'voc.muteValueCallbacks()',pro:'function muteValueCallbacks()',cmt:'

Disables the propagation of every new advertised value to the parent hub. You can use this function to save bandwidth and CPU on computers with limited resources, or to prevent unwanted invocations of the HTTP callback. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Voc']['nextVoc']={syn:'Continues the enumeration of Volatile Organic Compound sensors started using `yFirstVoc()`.',lib:'voc.nextVoc()',pro:'function nextVoc()',cmt:'

Continues the enumeration of Volatile Organic Compound sensors started using `yFirstVoc()`.

',ret:'a pointer to a `YVoc` object, corresponding to a Volatile Organic Compound sensor currently online, or a `null` pointer if there are no more Volatile Organic Compound sensors to enumerate.'}; doc['Voc']['registerTimedReportCallback']={syn:'Registers the callback function that is invoked on every periodic timed notification.',lib:'voc.registerTimedReportCallback()',pro:'function registerTimedReportCallback(callback)',cmt:'

Registers the callback function that is invoked on every periodic timed notification. The callback is invoked only during the execution of `ySleep` or `yHandleEvents`. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a null pointer as argument.

',par:{callback:'the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and an YMeasure object describing the new advertised value.'}}; doc['Voc']['registerValueCallback']={syn:'Registers the callback function that is invoked on every change of advertised value.',lib:'voc.registerValueCallback()',pro:'function registerValueCallback(callback)',cmt:'

Registers the callback function that is invoked on every change of advertised value. The callback is invoked only during the execution of `ySleep` or `yHandleEvents`. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a null pointer as argument.

',par:{callback:'the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and the character string describing the new advertised value.'}}; doc['Voc']['set_advMode']={syn:'Changes the measuring mode used for the advertised value pushed to the parent hub.',lib:'voc.set_advMode()',pro:'function set_advMode(newval)',cmt:'

Changes the measuring mode used for the advertised value pushed to the parent hub.

',par:{newval:'a value among `Y_ADVMODE_IMMEDIATE`, `Y_ADVMODE_PERIOD_AVG`, `Y_ADVMODE_PERIOD_MIN` and `Y_ADVMODE_PERIOD_MAX` corresponding to the measuring mode used for the advertised value pushed to the parent hub'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Voc']['set_highestValue']={syn:'Changes the recorded maximal value observed.',lib:'voc.set_highestValue()',pro:'function set_highestValue(newval)',cmt:'

Changes the recorded maximal value observed. Can be used to reset the value returned by get_lowestValue().

',par:{newval:'a floating point number corresponding to the recorded maximal value observed'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Voc']['set_logFrequency']={syn:'Changes the datalogger recording frequency for this function.',lib:'voc.set_logFrequency()',pro:'function set_logFrequency(newval)',cmt:'

Changes the datalogger recording frequency for this function. The frequency can be specified as samples per second, as sample per minute (for instance \x2215/m\x22) or in samples per hour (eg. \x224/h\x22). To disable recording for this function, use the value \x22OFF\x22.

',par:{newval:'a string corresponding to the datalogger recording frequency for this function'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Voc']['set_logicalName']={syn:'Changes the logical name of the Volatile Organic Compound sensor.',lib:'voc.set_logicalName()',pro:'function set_logicalName(newval)',cmt:'

Changes the logical name of the Volatile Organic Compound sensor. You can use `yCheckLogicalName()` prior to this call to make sure that your parameter is valid. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',par:{newval:'a string corresponding to the logical name of the Volatile Organic Compound sensor.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Voc']['set_lowestValue']={syn:'Changes the recorded minimal value observed.',lib:'voc.set_lowestValue()',pro:'function set_lowestValue(newval)',cmt:'

Changes the recorded minimal value observed. Can be used to reset the value returned by get_lowestValue().

',par:{newval:'a floating point number corresponding to the recorded minimal value observed'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Voc']['set_reportFrequency']={syn:'Changes the timed value notification frequency for this function.',lib:'voc.set_reportFrequency()',pro:'function set_reportFrequency(newval)',cmt:'

Changes the timed value notification frequency for this function. The frequency can be specified as samples per second, as sample per minute (for instance \x2215/m\x22) or in samples per hour (eg. \x224/h\x22). To disable timed value notifications for this function, use the value \x22OFF\x22.

',par:{newval:'a string corresponding to the timed value notification frequency for this function'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Voc']['set_resolution']={syn:'Changes the resolution of the measured physical values.',lib:'voc.set_resolution()',pro:'function set_resolution(newval)',cmt:'

Changes the resolution of the measured physical values. The resolution corresponds to the numerical precision when displaying value. It does not change the precision of the measure itself.

',par:{newval:'a floating point number corresponding to the resolution of the measured physical values'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Voc']['set_userData']={syn:'Stores a user context provided as argument in the userData attribute of the function.',lib:'voc.set_userData()',pro:'function set_userData(data)',cmt:'

Stores a user context provided as argument in the userData attribute of the function. This attribute is never touched by the API, and is at disposal of the caller to store a context.

',par:{data:'any kind of object to be stored'}}; doc['Voc']['startDataLogger']={syn:'Starts the data logger on the device.',lib:'voc.startDataLogger()',pro:'function startDataLogger()',cmt:'

Starts the data logger on the device. Note that the data logger will only save the measures on this sensor if the logFrequency is not set to \x22OFF\x22.

',ret:'`YAPI_SUCCESS` if the call succeeds.'}; doc['Voc']['stopDataLogger']={syn:'Stops the datalogger on the device.',lib:'voc.stopDataLogger()',pro:'function stopDataLogger()',cmt:'

Stops the datalogger on the device.

',ret:'`YAPI_SUCCESS` if the call succeeds.'}; doc['Voc']['unmuteValueCallbacks']={syn:'Re-enables the propagation of every new advertised value to the parent hub.',lib:'voc.unmuteValueCallbacks()',pro:'function unmuteValueCallbacks()',cmt:'

Re-enables the propagation of every new advertised value to the parent hub. This function reverts the effect of a previous call to `muteValueCallbacks()`. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Voc']['wait_async']={syn:'Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function.',lib:'voc.wait_async()',pro:'function wait_async(callback, context)',cmt:'

Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function. The callback function can therefore freely issue synchronous or asynchronous commands, without risking to block the Javascript VM.

',par:{callback:'callback function that is invoked when all pending commands on the module are completed. The callback function receives two arguments: the caller-specific context object and the receiving function object.',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing.'}; //--- (end of generated code: Voc) //--- (generated code: Watchdog) doc['Watchdog']={'':{syn:'Watchdog function interface',inc:'<script type='text/javascript' src='yocto_watchdog.js'></script>',cmt:'

The watchog function works like a relay and can cause a brief power cut to an appliance after a preset delay to force this appliance to reset. The Watchdog must be called from time to time to reset the timer and prevent the appliance reset. The watchdog can be driven direcly with pulse and delayedpulse methods to switch off an appliance for a given duration.

'}}; doc['Watchdog']['FindWatchdog']={syn:'Retrieves a watchdog for a given identifier.',lib:'YWatchdog.FindWatchdog()',pro:'function FindWatchdog(func)',cmt:'

Retrieves a watchdog for a given identifier. The identifier can be specified using several formats:

- FunctionLogicalName
- ModuleSerialNumber.FunctionIdentifier
- ModuleSerialNumber.FunctionLogicalName
- ModuleLogicalName.FunctionIdentifier
- ModuleLogicalName.FunctionLogicalName

This function does not require that the watchdog is online at the time it is invoked. The returned object is nevertheless valid. Use the method `YWatchdog.isOnline()` to test if the watchdog is indeed online at a given time. In case of ambiguity when looking for a watchdog by logical name, no error is notified: the first instance found is returned. The search is performed first by hardware name, then by logical name.

If a call to this object\x27s is_online() method returns FALSE although you are certain that the matching device is plugged, make sure that you did call registerHub() at application initialization time.

',par:{func:'a string that uniquely characterizes the watchdog'},ret:'a `YWatchdog` object allowing you to drive the watchdog.'}; doc['Watchdog']['FirstWatchdog']={syn:'Starts the enumeration of watchdog currently accessible.',lib:'YWatchdog.FirstWatchdog()',pro:'function FirstWatchdog()',cmt:'

Starts the enumeration of watchdog currently accessible. Use the method `YWatchdog.nextWatchdog()` to iterate on next watchdog.

',ret:'a pointer to a `YWatchdog` object, corresponding to the first watchdog currently online, or a `null` pointer if there are none.'}; doc['Watchdog']['clearCache']={syn:'Invalidates the cache.',lib:'watchdog.clearCache()',pro:'function clearCache()',cmt:'

Invalidates the cache. Invalidates the cache of the watchdog attributes. Forces the next call to get_xxx() or loadxxx() to use values that come from the device.

'}; doc['Watchdog']['delayedPulse']={syn:'Schedules a pulse.',lib:'watchdog.delayedPulse()',pro:'function delayedPulse(ms_delay, ms_duration)',cmt:'

Schedules a pulse.

',par:{ms_delay:'waiting time before the pulse, in millisecondes',ms_duration:'pulse duration, in millisecondes'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Watchdog']['describe']={syn:'Returns a short text that describes unambiguously the instance of the watchdog in the form `TYPE(NAME)=SERIAL.FUNCTIONID`.',lib:'watchdog.describe()',pro:'function describe()',cmt:'

Returns a short text that describes unambiguously the instance of the watchdog in the form `TYPE(NAME)=SERIAL.FUNCTIONID`. More precisely, `TYPE` is the type of the function, `NAME` it the name used for the first access to the function, `SERIAL` is the serial number of the module if the module is connected or `\x22unresolved\x22`, and `FUNCTIONID` is the hardware identifier of the function if the module is connected. For example, this method returns `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1` if the module is already connected or `Relay(BadCustomeName.relay1)=unresolved` if the module has not yet been connected. This method does not trigger any USB or TCP transaction and can therefore be used in a debugger.

',ret:'a string that describes the watchdog (ex: `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1`)'}; doc['Watchdog']['get_advertisedValue']={syn:'Returns the current value of the watchdog (no more than 6 characters).',lib:'watchdog.get_advertisedValue()',pro:'function get_advertisedValue()',cmt:'

Returns the current value of the watchdog (no more than 6 characters).

',ret:'a string corresponding to the current value of the watchdog (no more than 6 characters).',ext:'On failure, throws an exception or returns `Y_ADVERTISEDVALUE_INVALID`.'}; doc['Watchdog']['get_autoStart']={syn:'Returns the watchdog runing state at module power on.',lib:'watchdog.get_autoStart()',pro:'function get_autoStart()',cmt:'

Returns the watchdog runing state at module power on.

',ret:'either `Y_AUTOSTART_OFF` or `Y_AUTOSTART_ON`, according to the watchdog runing state at module power on',ext:'On failure, throws an exception or returns `Y_AUTOSTART_INVALID`.'}; doc['Watchdog']['get_countdown']={syn:'Returns the number of milliseconds remaining before a pulse (delayedPulse() call) When there is no scheduled pulse, returns zero.',lib:'watchdog.get_countdown()',pro:'function get_countdown()',cmt:'

Returns the number of milliseconds remaining before a pulse (delayedPulse() call) When there is no scheduled pulse, returns zero.

',ret:'an integer corresponding to the number of milliseconds remaining before a pulse (delayedPulse() call) When there is no scheduled pulse, returns zero',ext:'On failure, throws an exception or returns `Y_COUNTDOWN_INVALID`.'}; doc['Watchdog']['get_errorMessage']={syn:'Returns the error message of the latest error with the watchdog.',lib:'watchdog.get_errorMessage()',pro:'function get_errorMessage()',cmt:'

Returns the error message of the latest error with the watchdog. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a string corresponding to the latest error message that occured while using the watchdog object'}; doc['Watchdog']['get_errorType']={syn:'Returns the numerical error code of the latest error with the watchdog.',lib:'watchdog.get_errorType()',pro:'function get_errorType()',cmt:'

Returns the numerical error code of the latest error with the watchdog. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a number corresponding to the code of the latest error that occurred while using the watchdog object'}; doc['Watchdog']['get_friendlyName']={syn:'Returns a global identifier of the watchdog in the format `MODULE_NAME.FUNCTION_NAME`.',lib:'watchdog.get_friendlyName()',pro:'function get_friendlyName()',cmt:'

Returns a global identifier of the watchdog in the format `MODULE_NAME.FUNCTION_NAME`. The returned string uses the logical names of the module and of the watchdog if they are defined, otherwise the serial number of the module and the hardware identifier of the watchdog (for example: `MyCustomName.relay1`)

',ret:'a string that uniquely identifies the watchdog using logical names (ex: `MyCustomName.relay1`)',ext:'On failure, throws an exception or returns `Y_FRIENDLYNAME_INVALID`.'}; doc['Watchdog']['get_functionDescriptor']={syn:'Returns a unique identifier of type `YFUN_DESCR` corresponding to the function.',lib:'watchdog.get_functionDescriptor()',pro:'function get_functionDescriptor()',cmt:'

Returns a unique identifier of type `YFUN_DESCR` corresponding to the function. This identifier can be used to test if two instances of `YFunction` reference the same physical function on the same physical device.

',ret:'an identifier of type `YFUN_DESCR`.',ext:'If the function has never been contacted, the returned value is `Y_FUNCTIONDESCRIPTOR_INVALID`.'}; doc['Watchdog']['get_functionId']={syn:'Returns the hardware identifier of the watchdog, without reference to the module.',lib:'watchdog.get_functionId()',pro:'function get_functionId()',cmt:'

Returns the hardware identifier of the watchdog, without reference to the module. For example `relay1`

',ret:'a string that identifies the watchdog (ex: `relay1`)',ext:'On failure, throws an exception or returns `Y_FUNCTIONID_INVALID`.'}; doc['Watchdog']['get_hardwareId']={syn:'Returns the unique hardware identifier of the watchdog in the form `SERIAL.FUNCTIONID`.',lib:'watchdog.get_hardwareId()',pro:'function get_hardwareId()',cmt:'

Returns the unique hardware identifier of the watchdog in the form `SERIAL.FUNCTIONID`. The unique hardware identifier is composed of the device serial number and of the hardware identifier of the watchdog (for example `RELAYLO1-123456.relay1`).

',ret:'a string that uniquely identifies the watchdog (ex: `RELAYLO1-123456.relay1`)',ext:'On failure, throws an exception or returns `Y_HARDWAREID_INVALID`.'}; doc['Watchdog']['get_logicalName']={syn:'Returns the logical name of the watchdog.',lib:'watchdog.get_logicalName()',pro:'function get_logicalName()',cmt:'

Returns the logical name of the watchdog.

',ret:'a string corresponding to the logical name of the watchdog.',ext:'On failure, throws an exception or returns `Y_LOGICALNAME_INVALID`.'}; doc['Watchdog']['get_maxTimeOnStateA']={syn:'Retourne the maximum time (ms) allowed for $THEFUNCTIONS$ to stay in state A before automatically switching back in to B state.',lib:'watchdog.get_maxTimeOnStateA()',pro:'function get_maxTimeOnStateA()',cmt:'

Retourne the maximum time (ms) allowed for $THEFUNCTIONS$ to stay in state A before automatically switching back in to B state. Zero means no maximum time.

',ret:'an integer',ext:'On failure, throws an exception or returns `Y_MAXTIMEONSTATEA_INVALID`.'}; doc['Watchdog']['get_maxTimeOnStateB']={syn:'Retourne the maximum time (ms) allowed for $THEFUNCTIONS$ to stay in state B before automatically switching back in to A state.',lib:'watchdog.get_maxTimeOnStateB()',pro:'function get_maxTimeOnStateB()',cmt:'

Retourne the maximum time (ms) allowed for $THEFUNCTIONS$ to stay in state B before automatically switching back in to A state. Zero means no maximum time.

',ret:'an integer',ext:'On failure, throws an exception or returns `Y_MAXTIMEONSTATEB_INVALID`.'}; doc['Watchdog']['get_module']={syn:'Gets the `YModule` object for the device on which the function is located.',lib:'watchdog.get_module()',pro:'function get_module()',cmt:'

Gets the `YModule` object for the device on which the function is located. If the function cannot be located on any module, the returned instance of `YModule` is not shown as on-line.

',ret:'an instance of `YModule`'}; doc['Watchdog']['get_module_async']={syn:'Gets the `YModule` object for the device on which the function is located (asynchronous version).',lib:'watchdog.get_module_async()',pro:'function get_module_async(callback, context)',cmt:'

Gets the `YModule` object for the device on which the function is located (asynchronous version). If the function cannot be located on any module, the returned `YModule` object does not show as on-line.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking Firefox javascript VM that does not implement context switching during blocking I/O calls. See the documentation section on asynchronous Javascript calls for more details.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the requested `YModule` object',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['Watchdog']['get_output']={syn:'Returns the output state of the watchdog, when used as a simple switch (single throw).',lib:'watchdog.get_output()',pro:'function get_output()',cmt:'

Returns the output state of the watchdog, when used as a simple switch (single throw).

',ret:'either `Y_OUTPUT_OFF` or `Y_OUTPUT_ON`, according to the output state of the watchdog, when used as a simple switch (single throw)',ext:'On failure, throws an exception or returns `Y_OUTPUT_INVALID`.'}; doc['Watchdog']['get_pulseTimer']={syn:'Returns the number of milliseconds remaining before the watchdog is returned to idle position (state A), during a measured pulse generation.',lib:'watchdog.get_pulseTimer()',pro:'function get_pulseTimer()',cmt:'

Returns the number of milliseconds remaining before the watchdog is returned to idle position (state A), during a measured pulse generation. When there is no ongoing pulse, returns zero.

',ret:'an integer corresponding to the number of milliseconds remaining before the watchdog is returned to idle position (state A), during a measured pulse generation',ext:'On failure, throws an exception or returns `Y_PULSETIMER_INVALID`.'}; doc['Watchdog']['get_running']={syn:'Returns the watchdog running state.',lib:'watchdog.get_running()',pro:'function get_running()',cmt:'

Returns the watchdog running state.

',ret:'either `Y_RUNNING_OFF` or `Y_RUNNING_ON`, according to the watchdog running state',ext:'On failure, throws an exception or returns `Y_RUNNING_INVALID`.'}; doc['Watchdog']['get_state']={syn:'Returns the state of the watchdog (A for the idle position, B for the active position).',lib:'watchdog.get_state()',pro:'function get_state()',cmt:'

Returns the state of the watchdog (A for the idle position, B for the active position).

',ret:'either `Y_STATE_A` or `Y_STATE_B`, according to the state of the watchdog (A for the idle position, B for the active position)',ext:'On failure, throws an exception or returns `Y_STATE_INVALID`.'}; doc['Watchdog']['get_stateAtPowerOn']={syn:'Returns the state of the watchdog at device startup (A for the idle position, B for the active position, UNCHANGED for no change).',lib:'watchdog.get_stateAtPowerOn()',pro:'function get_stateAtPowerOn()',cmt:'

Returns the state of the watchdog at device startup (A for the idle position, B for the active position, UNCHANGED for no change).

',ret:'a value among `Y_STATEATPOWERON_UNCHANGED`, `Y_STATEATPOWERON_A` and `Y_STATEATPOWERON_B` corresponding to the state of the watchdog at device startup (A for the idle position, B for the active position, UNCHANGED for no change)',ext:'On failure, throws an exception or returns `Y_STATEATPOWERON_INVALID`.'}; doc['Watchdog']['get_triggerDelay']={syn:'Returns the waiting duration before a reset is automatically triggered by the watchdog, in milliseconds.',lib:'watchdog.get_triggerDelay()',pro:'function get_triggerDelay()',cmt:'

Returns the waiting duration before a reset is automatically triggered by the watchdog, in milliseconds.

',ret:'an integer corresponding to the waiting duration before a reset is automatically triggered by the watchdog, in milliseconds',ext:'On failure, throws an exception or returns `Y_TRIGGERDELAY_INVALID`.'}; doc['Watchdog']['get_triggerDuration']={syn:'Returns the duration of resets caused by the watchdog, in milliseconds.',lib:'watchdog.get_triggerDuration()',pro:'function get_triggerDuration()',cmt:'

Returns the duration of resets caused by the watchdog, in milliseconds.

',ret:'an integer corresponding to the duration of resets caused by the watchdog, in milliseconds',ext:'On failure, throws an exception or returns `Y_TRIGGERDURATION_INVALID`.'}; doc['Watchdog']['get_userData']={syn:'Returns the value of the userData attribute, as previously stored using method `set_userData`.',lib:'watchdog.get_userData()',pro:'function get_userData()',cmt:'

Returns the value of the userData attribute, as previously stored using method `set_userData`. This attribute is never touched directly by the API, and is at disposal of the caller to store a context.

',ret:'the object stored previously by the caller.'}; doc['Watchdog']['isOnline']={syn:'Checks if the watchdog is currently reachable, without raising any error.',lib:'watchdog.isOnline()',pro:'function isOnline()',cmt:'

Checks if the watchdog is currently reachable, without raising any error. If there is a cached value for the watchdog in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the watchdog.

',ret:'`true` if the watchdog can be reached, and `false` otherwise'}; doc['Watchdog']['isOnline_async']={syn:'Checks if the watchdog is currently reachable, without raising any error (asynchronous version).',lib:'watchdog.isOnline_async()',pro:'function isOnline_async(callback, context)',cmt:'

Checks if the watchdog is currently reachable, without raising any error (asynchronous version). If there is a cached value for the watchdog in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the requested function.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the boolean result',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['Watchdog']['load']={syn:'Preloads the watchdog cache with a specified validity duration.',lib:'watchdog.load()',pro:'function load(msValidity)',cmt:'

Preloads the watchdog cache with a specified validity duration. By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network traffic for instance.

',par:{msValidity:'an integer corresponding to the validity attributed to the loaded function parameters, in milliseconds'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Watchdog']['loadAttribute']={syn:'Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.',lib:'watchdog.loadAttribute()',pro:'function loadAttribute(attrName)',cmt:'

Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.

',par:{attrName:'the name of the requested attribute'},ret:'a string with the value of the the attribute',ext:'On failure, throws an exception or returns an empty string.'}; doc['Watchdog']['load_async']={syn:'Preloads the watchdog cache with a specified validity duration (asynchronous version).',lib:'watchdog.load_async()',pro:'function load_async(msValidity, callback, context)',cmt:'

Preloads the watchdog cache with a specified validity duration (asynchronous version). By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network trafic for instance.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{msValidity:'an integer corresponding to the validity of the loaded function parameters, in milliseconds',callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the error code (or `YAPI_SUCCESS`)',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['Watchdog']['muteValueCallbacks']={syn:'Disables the propagation of every new advertised value to the parent hub.',lib:'watchdog.muteValueCallbacks()',pro:'function muteValueCallbacks()',cmt:'

Disables the propagation of every new advertised value to the parent hub. You can use this function to save bandwidth and CPU on computers with limited resources, or to prevent unwanted invocations of the HTTP callback. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Watchdog']['nextWatchdog']={syn:'Continues the enumeration of watchdog started using `yFirstWatchdog()`.',lib:'watchdog.nextWatchdog()',pro:'function nextWatchdog()',cmt:'

Continues the enumeration of watchdog started using `yFirstWatchdog()`.

',ret:'a pointer to a `YWatchdog` object, corresponding to a watchdog currently online, or a `null` pointer if there are no more watchdog to enumerate.'}; doc['Watchdog']['pulse']={syn:'Sets the relay to output B (active) for a specified duration, then brings it automatically back to output A (idle state).',lib:'watchdog.pulse()',pro:'function pulse(ms_duration)',cmt:'

Sets the relay to output B (active) for a specified duration, then brings it automatically back to output A (idle state).

',par:{ms_duration:'pulse duration, in millisecondes'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Watchdog']['registerValueCallback']={syn:'Registers the callback function that is invoked on every change of advertised value.',lib:'watchdog.registerValueCallback()',pro:'function registerValueCallback(callback)',cmt:'

Registers the callback function that is invoked on every change of advertised value. The callback is invoked only during the execution of `ySleep` or `yHandleEvents`. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a null pointer as argument.

',par:{callback:'the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and the character string describing the new advertised value.'}}; doc['Watchdog']['resetWatchdog']={syn:'Resets the watchdog.',lib:'watchdog.resetWatchdog()',pro:'function resetWatchdog()',cmt:'

Resets the watchdog. When the watchdog is running, this function must be called on a regular basis to prevent the watchog to trigger

',ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Watchdog']['set_autoStart']={syn:'Changes the watchdog runningsttae at module power on.',lib:'watchdog.set_autoStart()',pro:'function set_autoStart(newval)',cmt:'

Changes the watchdog runningsttae at module power on. Remember to call the `saveToFlash()` method and then to reboot the module to apply this setting.

',par:{newval:'either `Y_AUTOSTART_OFF` or `Y_AUTOSTART_ON`, according to the watchdog runningsttae at module power on'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Watchdog']['set_logicalName']={syn:'Changes the logical name of the watchdog.',lib:'watchdog.set_logicalName()',pro:'function set_logicalName(newval)',cmt:'

Changes the logical name of the watchdog. You can use `yCheckLogicalName()` prior to this call to make sure that your parameter is valid. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',par:{newval:'a string corresponding to the logical name of the watchdog.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Watchdog']['set_maxTimeOnStateA']={syn:'Sets the maximum time (ms) allowed for $THEFUNCTIONS$ to stay in state A before automatically switching back in to B state.',lib:'watchdog.set_maxTimeOnStateA()',pro:'function set_maxTimeOnStateA(newval)',cmt:'

Sets the maximum time (ms) allowed for $THEFUNCTIONS$ to stay in state A before automatically switching back in to B state. Use zero for no maximum time.

',par:{newval:'an integer'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Watchdog']['set_maxTimeOnStateB']={syn:'Sets the maximum time (ms) allowed for $THEFUNCTIONS$ to stay in state B before automatically switching back in to A state.',lib:'watchdog.set_maxTimeOnStateB()',pro:'function set_maxTimeOnStateB(newval)',cmt:'

Sets the maximum time (ms) allowed for $THEFUNCTIONS$ to stay in state B before automatically switching back in to A state. Use zero for no maximum time.

',par:{newval:'an integer'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Watchdog']['set_output']={syn:'Changes the output state of the watchdog, when used as a simple switch (single throw).',lib:'watchdog.set_output()',pro:'function set_output(newval)',cmt:'

Changes the output state of the watchdog, when used as a simple switch (single throw).

',par:{newval:'either `Y_OUTPUT_OFF` or `Y_OUTPUT_ON`, according to the output state of the watchdog, when used as a simple switch (single throw)'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Watchdog']['set_running']={syn:'Changes the running state of the watchdog.',lib:'watchdog.set_running()',pro:'function set_running(newval)',cmt:'

Changes the running state of the watchdog.

',par:{newval:'either `Y_RUNNING_OFF` or `Y_RUNNING_ON`, according to the running state of the watchdog'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Watchdog']['set_state']={syn:'Changes the state of the watchdog (A for the idle position, B for the active position).',lib:'watchdog.set_state()',pro:'function set_state(newval)',cmt:'

Changes the state of the watchdog (A for the idle position, B for the active position).

',par:{newval:'either `Y_STATE_A` or `Y_STATE_B`, according to the state of the watchdog (A for the idle position, B for the active position)'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Watchdog']['set_stateAtPowerOn']={syn:'Preset the state of the watchdog at device startup (A for the idle position, B for the active position, UNCHANGED for no modification).',lib:'watchdog.set_stateAtPowerOn()',pro:'function set_stateAtPowerOn(newval)',cmt:'

Preset the state of the watchdog at device startup (A for the idle position, B for the active position, UNCHANGED for no modification). Remember to call the matching module `saveToFlash()` method, otherwise this call will have no effect.

',par:{newval:'a value among `Y_STATEATPOWERON_UNCHANGED`, `Y_STATEATPOWERON_A` and `Y_STATEATPOWERON_B`'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Watchdog']['set_triggerDelay']={syn:'Changes the waiting delay before a reset is triggered by the watchdog, in milliseconds.',lib:'watchdog.set_triggerDelay()',pro:'function set_triggerDelay(newval)',cmt:'

Changes the waiting delay before a reset is triggered by the watchdog, in milliseconds.

',par:{newval:'an integer corresponding to the waiting delay before a reset is triggered by the watchdog, in milliseconds'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Watchdog']['set_triggerDuration']={syn:'Changes the duration of resets caused by the watchdog, in milliseconds.',lib:'watchdog.set_triggerDuration()',pro:'function set_triggerDuration(newval)',cmt:'

Changes the duration of resets caused by the watchdog, in milliseconds.

',par:{newval:'an integer corresponding to the duration of resets caused by the watchdog, in milliseconds'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Watchdog']['set_userData']={syn:'Stores a user context provided as argument in the userData attribute of the function.',lib:'watchdog.set_userData()',pro:'function set_userData(data)',cmt:'

Stores a user context provided as argument in the userData attribute of the function. This attribute is never touched by the API, and is at disposal of the caller to store a context.

',par:{data:'any kind of object to be stored'}}; doc['Watchdog']['unmuteValueCallbacks']={syn:'Re-enables the propagation of every new advertised value to the parent hub.',lib:'watchdog.unmuteValueCallbacks()',pro:'function unmuteValueCallbacks()',cmt:'

Re-enables the propagation of every new advertised value to the parent hub. This function reverts the effect of a previous call to `muteValueCallbacks()`. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Watchdog']['wait_async']={syn:'Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function.',lib:'watchdog.wait_async()',pro:'function wait_async(callback, context)',cmt:'

Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function. The callback function can therefore freely issue synchronous or asynchronous commands, without risking to block the Javascript VM.

',par:{callback:'callback function that is invoked when all pending commands on the module are completed. The callback function receives two arguments: the caller-specific context object and the receiving function object.',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing.'}; //--- (end of generated code: Watchdog) //--- (generated code: Power) doc['Power']={'':{syn:'Power function interface',inc:'<script type='text/javascript' src='yocto_power.js'></script>',cmt:'

The Yoctopuce class YPower allows you to read and configure Yoctopuce power sensors. It inherits from YSensor class the core functions to read measurements, to register callback functions, to access the autonomous datalogger. This class adds the ability to access the energy counter and the power factor.

'}}; doc['Power']['FindPower']={syn:'Retrieves a electrical power sensor for a given identifier.',lib:'YPower.FindPower()',pro:'function FindPower(func)',cmt:'

Retrieves a electrical power sensor for a given identifier. The identifier can be specified using several formats:

- FunctionLogicalName
- ModuleSerialNumber.FunctionIdentifier
- ModuleSerialNumber.FunctionLogicalName
- ModuleLogicalName.FunctionIdentifier
- ModuleLogicalName.FunctionLogicalName

This function does not require that the electrical power sensor is online at the time it is invoked. The returned object is nevertheless valid. Use the method `YPower.isOnline()` to test if the electrical power sensor is indeed online at a given time. In case of ambiguity when looking for a electrical power sensor by logical name, no error is notified: the first instance found is returned. The search is performed first by hardware name, then by logical name.

If a call to this object\x27s is_online() method returns FALSE although you are certain that the matching device is plugged, make sure that you did call registerHub() at application initialization time.

',par:{func:'a string that uniquely characterizes the electrical power sensor'},ret:'a `YPower` object allowing you to drive the electrical power sensor.'}; doc['Power']['FirstPower']={syn:'Starts the enumeration of electrical power sensors currently accessible.',lib:'YPower.FirstPower()',pro:'function FirstPower()',cmt:'

Starts the enumeration of electrical power sensors currently accessible. Use the method `YPower.nextPower()` to iterate on next electrical power sensors.

',ret:'a pointer to a `YPower` object, corresponding to the first electrical power sensor currently online, or a `null` pointer if there are none.'}; doc['Power']['calibrateFromPoints']={syn:'Configures error correction data points, in particular to compensate for a possible perturbation of the measure caused by an enclosure.',lib:'power.calibrateFromPoints()',pro:'function calibrateFromPoints(rawValues, refValues)',cmt:'

Configures error correction data points, in particular to compensate for a possible perturbation of the measure caused by an enclosure. It is possible to configure up to five correction points. Correction points must be provided in ascending order, and be in the range of the sensor. The device will automatically perform a linear interpolation of the error correction between specified points. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

For more information on advanced capabilities to refine the calibration of sensors, please contact support@yoctopuce.com.

',par:{rawValues:'array of floating point numbers, corresponding to the raw values returned by the sensor for the correction points.',refValues:'array of floating point numbers, corresponding to the corrected values for the correction points.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Power']['clearCache']={syn:'Invalidates the cache.',lib:'power.clearCache()',pro:'function clearCache()',cmt:'

Invalidates the cache. Invalidates the cache of the electrical power sensor attributes. Forces the next call to get_xxx() or loadxxx() to use values that come from the device.

'}; doc['Power']['describe']={syn:'Returns a short text that describes unambiguously the instance of the electrical power sensor in the form `TYPE(NAME)=SERIAL.FUNCTIONID`.',lib:'power.describe()',pro:'function describe()',cmt:'

Returns a short text that describes unambiguously the instance of the electrical power sensor in the form `TYPE(NAME)=SERIAL.FUNCTIONID`. More precisely, `TYPE` is the type of the function, `NAME` it the name used for the first access to the function, `SERIAL` is the serial number of the module if the module is connected or `\x22unresolved\x22`, and `FUNCTIONID` is the hardware identifier of the function if the module is connected. For example, this method returns `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1` if the module is already connected or `Relay(BadCustomeName.relay1)=unresolved` if the module has not yet been connected. This method does not trigger any USB or TCP transaction and can therefore be used in a debugger.

',ret:'a string that describes the electrical power sensor (ex: `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1`)'}; doc['Power']['get_advMode']={syn:'Returns the measuring mode used for the advertised value pushed to the parent hub.',lib:'power.get_advMode()',pro:'function get_advMode()',cmt:'

Returns the measuring mode used for the advertised value pushed to the parent hub.

',ret:'a value among `Y_ADVMODE_IMMEDIATE`, `Y_ADVMODE_PERIOD_AVG`, `Y_ADVMODE_PERIOD_MIN` and `Y_ADVMODE_PERIOD_MAX` corresponding to the measuring mode used for the advertised value pushed to the parent hub',ext:'On failure, throws an exception or returns `Y_ADVMODE_INVALID`.'}; doc['Power']['get_advertisedValue']={syn:'Returns the current value of the electrical power sensor (no more than 6 characters).',lib:'power.get_advertisedValue()',pro:'function get_advertisedValue()',cmt:'

Returns the current value of the electrical power sensor (no more than 6 characters).

',ret:'a string corresponding to the current value of the electrical power sensor (no more than 6 characters).',ext:'On failure, throws an exception or returns `Y_ADVERTISEDVALUE_INVALID`.'}; doc['Power']['get_cosPhi']={syn:'Returns the power factor (the ratio between the real power consumed, measured in W, and the apparent power provided, measured in VA).',lib:'power.get_cosPhi()',pro:'function get_cosPhi()',cmt:'

Returns the power factor (the ratio between the real power consumed, measured in W, and the apparent power provided, measured in VA).

',ret:'a floating point number corresponding to the power factor (the ratio between the real power consumed, measured in W, and the apparent power provided, measured in VA)',ext:'On failure, throws an exception or returns `Y_COSPHI_INVALID`.'}; doc['Power']['get_currentRawValue']={syn:'Returns the uncalibrated, unrounded raw value returned by the sensor, in Watt, as a floating point number.',lib:'power.get_currentRawValue()',pro:'function get_currentRawValue()',cmt:'

Returns the uncalibrated, unrounded raw value returned by the sensor, in Watt, as a floating point number.

',ret:'a floating point number corresponding to the uncalibrated, unrounded raw value returned by the sensor, in Watt, as a floating point number',ext:'On failure, throws an exception or returns `Y_CURRENTRAWVALUE_INVALID`.'}; doc['Power']['get_currentValue']={syn:'Returns the current value of the electrical power, in Watt, as a floating point number.',lib:'power.get_currentValue()',pro:'function get_currentValue()',cmt:'

Returns the current value of the electrical power, in Watt, as a floating point number.

',ret:'a floating point number corresponding to the current value of the electrical power, in Watt, as a floating point number',ext:'On failure, throws an exception or returns `Y_CURRENTVALUE_INVALID`.'}; doc['Power']['get_dataLogger']={syn:'Returns the YDatalogger object of the device hosting the sensor.',lib:'power.get_dataLogger()',pro:'function get_dataLogger()',cmt:'

Returns the YDatalogger object of the device hosting the sensor. This method returns an object of class YDatalogger that can control global parameters of the data logger. The returned object should not be freed.

',ret:'an YDataLogger object or null on error.'}; doc['Power']['get_errorMessage']={syn:'Returns the error message of the latest error with the electrical power sensor.',lib:'power.get_errorMessage()',pro:'function get_errorMessage()',cmt:'

Returns the error message of the latest error with the electrical power sensor. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a string corresponding to the latest error message that occured while using the electrical power sensor object'}; doc['Power']['get_errorType']={syn:'Returns the numerical error code of the latest error with the electrical power sensor.',lib:'power.get_errorType()',pro:'function get_errorType()',cmt:'

Returns the numerical error code of the latest error with the electrical power sensor. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a number corresponding to the code of the latest error that occurred while using the electrical power sensor object'}; doc['Power']['get_friendlyName']={syn:'Returns a global identifier of the electrical power sensor in the format `MODULE_NAME.FUNCTION_NAME`.',lib:'power.get_friendlyName()',pro:'function get_friendlyName()',cmt:'

Returns a global identifier of the electrical power sensor in the format `MODULE_NAME.FUNCTION_NAME`. The returned string uses the logical names of the module and of the electrical power sensor if they are defined, otherwise the serial number of the module and the hardware identifier of the electrical power sensor (for example: `MyCustomName.relay1`)

',ret:'a string that uniquely identifies the electrical power sensor using logical names (ex: `MyCustomName.relay1`)',ext:'On failure, throws an exception or returns `Y_FRIENDLYNAME_INVALID`.'}; doc['Power']['get_functionDescriptor']={syn:'Returns a unique identifier of type `YFUN_DESCR` corresponding to the function.',lib:'power.get_functionDescriptor()',pro:'function get_functionDescriptor()',cmt:'

Returns a unique identifier of type `YFUN_DESCR` corresponding to the function. This identifier can be used to test if two instances of `YFunction` reference the same physical function on the same physical device.

',ret:'an identifier of type `YFUN_DESCR`.',ext:'If the function has never been contacted, the returned value is `Y_FUNCTIONDESCRIPTOR_INVALID`.'}; doc['Power']['get_functionId']={syn:'Returns the hardware identifier of the electrical power sensor, without reference to the module.',lib:'power.get_functionId()',pro:'function get_functionId()',cmt:'

Returns the hardware identifier of the electrical power sensor, without reference to the module. For example `relay1`

',ret:'a string that identifies the electrical power sensor (ex: `relay1`)',ext:'On failure, throws an exception or returns `Y_FUNCTIONID_INVALID`.'}; doc['Power']['get_hardwareId']={syn:'Returns the unique hardware identifier of the electrical power sensor in the form `SERIAL.FUNCTIONID`.',lib:'power.get_hardwareId()',pro:'function get_hardwareId()',cmt:'

Returns the unique hardware identifier of the electrical power sensor in the form `SERIAL.FUNCTIONID`. The unique hardware identifier is composed of the device serial number and of the hardware identifier of the electrical power sensor (for example `RELAYLO1-123456.relay1`).

',ret:'a string that uniquely identifies the electrical power sensor (ex: `RELAYLO1-123456.relay1`)',ext:'On failure, throws an exception or returns `Y_HARDWAREID_INVALID`.'}; doc['Power']['get_highestValue']={syn:'Returns the maximal value observed for the electrical power since the device was started.',lib:'power.get_highestValue()',pro:'function get_highestValue()',cmt:'

Returns the maximal value observed for the electrical power since the device was started. Can be reset to an arbitrary value thanks to set_highestValue().

',ret:'a floating point number corresponding to the maximal value observed for the electrical power since the device was started',ext:'On failure, throws an exception or returns `Y_HIGHESTVALUE_INVALID`.'}; doc['Power']['get_logFrequency']={syn:'Returns the datalogger recording frequency for this function, or \x22OFF\x22 when measures are not stored in the data logger flash memory.',lib:'power.get_logFrequency()',pro:'function get_logFrequency()',cmt:'

Returns the datalogger recording frequency for this function, or \x22OFF\x22 when measures are not stored in the data logger flash memory.

',ret:'a string corresponding to the datalogger recording frequency for this function, or \x22OFF\x22 when measures are not stored in the data logger flash memory',ext:'On failure, throws an exception or returns `Y_LOGFREQUENCY_INVALID`.'}; doc['Power']['get_logicalName']={syn:'Returns the logical name of the electrical power sensor.',lib:'power.get_logicalName()',pro:'function get_logicalName()',cmt:'

Returns the logical name of the electrical power sensor.

',ret:'a string corresponding to the logical name of the electrical power sensor.',ext:'On failure, throws an exception or returns `Y_LOGICALNAME_INVALID`.'}; doc['Power']['get_lowestValue']={syn:'Returns the minimal value observed for the electrical power since the device was started.',lib:'power.get_lowestValue()',pro:'function get_lowestValue()',cmt:'

Returns the minimal value observed for the electrical power since the device was started. Can be reset to an arbitrary value thanks to set_lowestValue().

',ret:'a floating point number corresponding to the minimal value observed for the electrical power since the device was started',ext:'On failure, throws an exception or returns `Y_LOWESTVALUE_INVALID`.'}; doc['Power']['get_meter']={syn:'Returns the energy counter, maintained by the wattmeter by integrating the power consumption over time.',lib:'power.get_meter()',pro:'function get_meter()',cmt:'

Returns the energy counter, maintained by the wattmeter by integrating the power consumption over time. Note that this counter is reset at each start of the device.

',ret:'a floating point number corresponding to the energy counter, maintained by the wattmeter by integrating the power consumption over time',ext:'On failure, throws an exception or returns `Y_METER_INVALID`.'}; doc['Power']['get_meterTimer']={syn:'Returns the elapsed time since last energy counter reset, in seconds.',lib:'power.get_meterTimer()',pro:'function get_meterTimer()',cmt:'

Returns the elapsed time since last energy counter reset, in seconds.

',ret:'an integer corresponding to the elapsed time since last energy counter reset, in seconds',ext:'On failure, throws an exception or returns `Y_METERTIMER_INVALID`.'}; doc['Power']['get_module']={syn:'Gets the `YModule` object for the device on which the function is located.',lib:'power.get_module()',pro:'function get_module()',cmt:'

Gets the `YModule` object for the device on which the function is located. If the function cannot be located on any module, the returned instance of `YModule` is not shown as on-line.

',ret:'an instance of `YModule`'}; doc['Power']['get_module_async']={syn:'Gets the `YModule` object for the device on which the function is located (asynchronous version).',lib:'power.get_module_async()',pro:'function get_module_async(callback, context)',cmt:'

Gets the `YModule` object for the device on which the function is located (asynchronous version). If the function cannot be located on any module, the returned `YModule` object does not show as on-line.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking Firefox javascript VM that does not implement context switching during blocking I/O calls. See the documentation section on asynchronous Javascript calls for more details.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the requested `YModule` object',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['Power']['get_recordedData']={syn:'Retrieves a DataSet object holding historical data for this sensor, for a specified time interval.',lib:'power.get_recordedData()',pro:'function get_recordedData(startTime, endTime)',cmt:'

Retrieves a DataSet object holding historical data for this sensor, for a specified time interval. The measures will be retrieved from the data logger, which must have been turned on at the desired time. See the documentation of the DataSet class for information on how to get an overview of the recorded data, and how to load progressively a large set of measures from the data logger.

This function only works if the device uses a recent firmware, as DataSet objects are not supported by firmwares older than version 13000.

',par:{startTime:'the start of the desired measure time interval, as a Unix timestamp, i.e. the number of seconds since January 1, 1970 UTC. The special value 0 can be used to include any meaasure, without initial limit.',endTime:'the end of the desired measure time interval, as a Unix timestamp, i.e. the number of seconds since January 1, 1970 UTC. The special value 0 can be used to include any meaasure, without ending limit.'},ret:'an instance of YDataSet, providing access to historical data. Past measures can be loaded progressively using methods from the YDataSet object.'}; doc['Power']['get_reportFrequency']={syn:'Returns the timed value notification frequency, or \x22OFF\x22 if timed value notifications are disabled for this function.',lib:'power.get_reportFrequency()',pro:'function get_reportFrequency()',cmt:'

Returns the timed value notification frequency, or \x22OFF\x22 if timed value notifications are disabled for this function.

',ret:'a string corresponding to the timed value notification frequency, or \x22OFF\x22 if timed value notifications are disabled for this function',ext:'On failure, throws an exception or returns `Y_REPORTFREQUENCY_INVALID`.'}; doc['Power']['get_resolution']={syn:'Returns the resolution of the measured values.',lib:'power.get_resolution()',pro:'function get_resolution()',cmt:'

Returns the resolution of the measured values. The resolution corresponds to the numerical precision of the measures, which is not always the same as the actual precision of the sensor.

',ret:'a floating point number corresponding to the resolution of the measured values',ext:'On failure, throws an exception or returns `Y_RESOLUTION_INVALID`.'}; doc['Power']['get_sensorState']={syn:'Returns the sensor health state code, which is zero when there is an up-to-date measure available or a positive code if the sensor is not able to provide a measure right now.',lib:'power.get_sensorState()',pro:'function get_sensorState()',cmt:'

Returns the sensor health state code, which is zero when there is an up-to-date measure available or a positive code if the sensor is not able to provide a measure right now.

',ret:'an integer corresponding to the sensor health state code, which is zero when there is an up-to-date measure available or a positive code if the sensor is not able to provide a measure right now',ext:'On failure, throws an exception or returns `Y_SENSORSTATE_INVALID`.'}; doc['Power']['get_unit']={syn:'Returns the measuring unit for the electrical power.',lib:'power.get_unit()',pro:'function get_unit()',cmt:'

Returns the measuring unit for the electrical power.

',ret:'a string corresponding to the measuring unit for the electrical power',ext:'On failure, throws an exception or returns `Y_UNIT_INVALID`.'}; doc['Power']['get_userData']={syn:'Returns the value of the userData attribute, as previously stored using method `set_userData`.',lib:'power.get_userData()',pro:'function get_userData()',cmt:'

Returns the value of the userData attribute, as previously stored using method `set_userData`. This attribute is never touched directly by the API, and is at disposal of the caller to store a context.

',ret:'the object stored previously by the caller.'}; doc['Power']['isOnline']={syn:'Checks if the electrical power sensor is currently reachable, without raising any error.',lib:'power.isOnline()',pro:'function isOnline()',cmt:'

Checks if the electrical power sensor is currently reachable, without raising any error. If there is a cached value for the electrical power sensor in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the electrical power sensor.

',ret:'`true` if the electrical power sensor can be reached, and `false` otherwise'}; doc['Power']['isOnline_async']={syn:'Checks if the electrical power sensor is currently reachable, without raising any error (asynchronous version).',lib:'power.isOnline_async()',pro:'function isOnline_async(callback, context)',cmt:'

Checks if the electrical power sensor is currently reachable, without raising any error (asynchronous version). If there is a cached value for the electrical power sensor in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the requested function.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the boolean result',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['Power']['load']={syn:'Preloads the electrical power sensor cache with a specified validity duration.',lib:'power.load()',pro:'function load(msValidity)',cmt:'

Preloads the electrical power sensor cache with a specified validity duration. By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network traffic for instance.

',par:{msValidity:'an integer corresponding to the validity attributed to the loaded function parameters, in milliseconds'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Power']['loadAttribute']={syn:'Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.',lib:'power.loadAttribute()',pro:'function loadAttribute(attrName)',cmt:'

Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.

',par:{attrName:'the name of the requested attribute'},ret:'a string with the value of the the attribute',ext:'On failure, throws an exception or returns an empty string.'}; doc['Power']['loadCalibrationPoints']={syn:'Retrieves error correction data points previously entered using the method `calibrateFromPoints`.',lib:'power.loadCalibrationPoints()',pro:'function loadCalibrationPoints(rawValues, refValues)',cmt:'

Retrieves error correction data points previously entered using the method `calibrateFromPoints`.

',par:{rawValues:'array of floating point numbers, that will be filled by the function with the raw sensor values for the correction points.',refValues:'array of floating point numbers, that will be filled by the function with the desired values for the correction points.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Power']['load_async']={syn:'Preloads the electrical power sensor cache with a specified validity duration (asynchronous version).',lib:'power.load_async()',pro:'function load_async(msValidity, callback, context)',cmt:'

Preloads the electrical power sensor cache with a specified validity duration (asynchronous version). By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network trafic for instance.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{msValidity:'an integer corresponding to the validity of the loaded function parameters, in milliseconds',callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the error code (or `YAPI_SUCCESS`)',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['Power']['muteValueCallbacks']={syn:'Disables the propagation of every new advertised value to the parent hub.',lib:'power.muteValueCallbacks()',pro:'function muteValueCallbacks()',cmt:'

Disables the propagation of every new advertised value to the parent hub. You can use this function to save bandwidth and CPU on computers with limited resources, or to prevent unwanted invocations of the HTTP callback. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Power']['nextPower']={syn:'Continues the enumeration of electrical power sensors started using `yFirstPower()`.',lib:'power.nextPower()',pro:'function nextPower()',cmt:'

Continues the enumeration of electrical power sensors started using `yFirstPower()`.

',ret:'a pointer to a `YPower` object, corresponding to a electrical power sensor currently online, or a `null` pointer if there are no more electrical power sensors to enumerate.'}; doc['Power']['registerTimedReportCallback']={syn:'Registers the callback function that is invoked on every periodic timed notification.',lib:'power.registerTimedReportCallback()',pro:'function registerTimedReportCallback(callback)',cmt:'

Registers the callback function that is invoked on every periodic timed notification. The callback is invoked only during the execution of `ySleep` or `yHandleEvents`. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a null pointer as argument.

',par:{callback:'the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and an YMeasure object describing the new advertised value.'}}; doc['Power']['registerValueCallback']={syn:'Registers the callback function that is invoked on every change of advertised value.',lib:'power.registerValueCallback()',pro:'function registerValueCallback(callback)',cmt:'

Registers the callback function that is invoked on every change of advertised value. The callback is invoked only during the execution of `ySleep` or `yHandleEvents`. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a null pointer as argument.

',par:{callback:'the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and the character string describing the new advertised value.'}}; doc['Power']['reset']={syn:'Resets the energy counter.',lib:'power.reset()',pro:'function reset()',cmt:'

Resets the energy counter.

',ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Power']['set_advMode']={syn:'Changes the measuring mode used for the advertised value pushed to the parent hub.',lib:'power.set_advMode()',pro:'function set_advMode(newval)',cmt:'

Changes the measuring mode used for the advertised value pushed to the parent hub.

',par:{newval:'a value among `Y_ADVMODE_IMMEDIATE`, `Y_ADVMODE_PERIOD_AVG`, `Y_ADVMODE_PERIOD_MIN` and `Y_ADVMODE_PERIOD_MAX` corresponding to the measuring mode used for the advertised value pushed to the parent hub'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Power']['set_highestValue']={syn:'Changes the recorded maximal value observed.',lib:'power.set_highestValue()',pro:'function set_highestValue(newval)',cmt:'

Changes the recorded maximal value observed. Can be used to reset the value returned by get_lowestValue().

',par:{newval:'a floating point number corresponding to the recorded maximal value observed'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Power']['set_logFrequency']={syn:'Changes the datalogger recording frequency for this function.',lib:'power.set_logFrequency()',pro:'function set_logFrequency(newval)',cmt:'

Changes the datalogger recording frequency for this function. The frequency can be specified as samples per second, as sample per minute (for instance \x2215/m\x22) or in samples per hour (eg. \x224/h\x22). To disable recording for this function, use the value \x22OFF\x22.

',par:{newval:'a string corresponding to the datalogger recording frequency for this function'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Power']['set_logicalName']={syn:'Changes the logical name of the electrical power sensor.',lib:'power.set_logicalName()',pro:'function set_logicalName(newval)',cmt:'

Changes the logical name of the electrical power sensor. You can use `yCheckLogicalName()` prior to this call to make sure that your parameter is valid. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',par:{newval:'a string corresponding to the logical name of the electrical power sensor.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Power']['set_lowestValue']={syn:'Changes the recorded minimal value observed.',lib:'power.set_lowestValue()',pro:'function set_lowestValue(newval)',cmt:'

Changes the recorded minimal value observed. Can be used to reset the value returned by get_lowestValue().

',par:{newval:'a floating point number corresponding to the recorded minimal value observed'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Power']['set_reportFrequency']={syn:'Changes the timed value notification frequency for this function.',lib:'power.set_reportFrequency()',pro:'function set_reportFrequency(newval)',cmt:'

Changes the timed value notification frequency for this function. The frequency can be specified as samples per second, as sample per minute (for instance \x2215/m\x22) or in samples per hour (eg. \x224/h\x22). To disable timed value notifications for this function, use the value \x22OFF\x22.

',par:{newval:'a string corresponding to the timed value notification frequency for this function'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Power']['set_resolution']={syn:'Changes the resolution of the measured physical values.',lib:'power.set_resolution()',pro:'function set_resolution(newval)',cmt:'

Changes the resolution of the measured physical values. The resolution corresponds to the numerical precision when displaying value. It does not change the precision of the measure itself.

',par:{newval:'a floating point number corresponding to the resolution of the measured physical values'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Power']['set_userData']={syn:'Stores a user context provided as argument in the userData attribute of the function.',lib:'power.set_userData()',pro:'function set_userData(data)',cmt:'

Stores a user context provided as argument in the userData attribute of the function. This attribute is never touched by the API, and is at disposal of the caller to store a context.

',par:{data:'any kind of object to be stored'}}; doc['Power']['startDataLogger']={syn:'Starts the data logger on the device.',lib:'power.startDataLogger()',pro:'function startDataLogger()',cmt:'

Starts the data logger on the device. Note that the data logger will only save the measures on this sensor if the logFrequency is not set to \x22OFF\x22.

',ret:'`YAPI_SUCCESS` if the call succeeds.'}; doc['Power']['stopDataLogger']={syn:'Stops the datalogger on the device.',lib:'power.stopDataLogger()',pro:'function stopDataLogger()',cmt:'

Stops the datalogger on the device.

',ret:'`YAPI_SUCCESS` if the call succeeds.'}; doc['Power']['unmuteValueCallbacks']={syn:'Re-enables the propagation of every new advertised value to the parent hub.',lib:'power.unmuteValueCallbacks()',pro:'function unmuteValueCallbacks()',cmt:'

Re-enables the propagation of every new advertised value to the parent hub. This function reverts the effect of a previous call to `muteValueCallbacks()`. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Power']['wait_async']={syn:'Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function.',lib:'power.wait_async()',pro:'function wait_async(callback, context)',cmt:'

Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function. The callback function can therefore freely issue synchronous or asynchronous commands, without risking to block the Javascript VM.

',par:{callback:'callback function that is invoked when all pending commands on the module are completed. The callback function receives two arguments: the caller-specific context object and the receiving function object.',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing.'}; //--- (end of generated code: Power) //--- (generated code: Display) doc['Display']={'':{syn:'Display function interface',inc:'<script type='text/javascript' src='yocto_display.js'></script>',cmt:'

Yoctopuce display interface has been designed to easily show information and images. The device provides built-in multi-layer rendering. Layers can be drawn offline, individually, and freely moved on the display. It can also replay recorded sequences (animations).

'}}; doc['Display']['FindDisplay']={syn:'Retrieves a display for a given identifier.',lib:'YDisplay.FindDisplay()',pro:'function FindDisplay(func)',cmt:'

Retrieves a display for a given identifier. The identifier can be specified using several formats:

- FunctionLogicalName
- ModuleSerialNumber.FunctionIdentifier
- ModuleSerialNumber.FunctionLogicalName
- ModuleLogicalName.FunctionIdentifier
- ModuleLogicalName.FunctionLogicalName

This function does not require that the display is online at the time it is invoked. The returned object is nevertheless valid. Use the method `YDisplay.isOnline()` to test if the display is indeed online at a given time. In case of ambiguity when looking for a display by logical name, no error is notified: the first instance found is returned. The search is performed first by hardware name, then by logical name.

If a call to this object\x27s is_online() method returns FALSE although you are certain that the matching device is plugged, make sure that you did call registerHub() at application initialization time.

',par:{func:'a string that uniquely characterizes the display'},ret:'a `YDisplay` object allowing you to drive the display.'}; doc['Display']['FirstDisplay']={syn:'Starts the enumeration of displays currently accessible.',lib:'YDisplay.FirstDisplay()',pro:'function FirstDisplay()',cmt:'

Starts the enumeration of displays currently accessible. Use the method `YDisplay.nextDisplay()` to iterate on next displays.

',ret:'a pointer to a `YDisplay` object, corresponding to the first display currently online, or a `null` pointer if there are none.'}; doc['Display']['clearCache']={syn:'Invalidates the cache.',lib:'display.clearCache()',pro:'function clearCache()',cmt:'

Invalidates the cache. Invalidates the cache of the display attributes. Forces the next call to get_xxx() or loadxxx() to use values that come from the device.

'}; doc['Display']['copyLayerContent']={syn:'Copies the whole content of a layer to another layer.',lib:'display.copyLayerContent()',pro:'function copyLayerContent(srcLayerId, dstLayerId)',cmt:'

Copies the whole content of a layer to another layer. The color and transparency of all the pixels from the destination layer are set to match the source pixels. This method only affects the displayed content, but does not change any property of the layer object. Note that layer 0 has no transparency support (it is always completely opaque).

',par:{srcLayerId:'the identifier of the source layer (a number in range 0..layerCount-1)',dstLayerId:'the identifier of the destination layer (a number in range 0..layerCount-1)'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Display']['describe']={syn:'Returns a short text that describes unambiguously the instance of the display in the form `TYPE(NAME)=SERIAL.FUNCTIONID`.',lib:'display.describe()',pro:'function describe()',cmt:'

Returns a short text that describes unambiguously the instance of the display in the form `TYPE(NAME)=SERIAL.FUNCTIONID`. More precisely, `TYPE` is the type of the function, `NAME` it the name used for the first access to the function, `SERIAL` is the serial number of the module if the module is connected or `\x22unresolved\x22`, and `FUNCTIONID` is the hardware identifier of the function if the module is connected. For example, this method returns `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1` if the module is already connected or `Relay(BadCustomeName.relay1)=unresolved` if the module has not yet been connected. This method does not trigger any USB or TCP transaction and can therefore be used in a debugger.

',ret:'a string that describes the display (ex: `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1`)'}; doc['Display']['fade']={syn:'Smoothly changes the brightness of the screen to produce a fade-in or fade-out effect.',lib:'display.fade()',pro:'function fade(brightness, duration)',cmt:'

Smoothly changes the brightness of the screen to produce a fade-in or fade-out effect.

',par:{brightness:'the new screen brightness',duration:'duration of the brightness transition, in milliseconds.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Display']['get_advertisedValue']={syn:'Returns the current value of the display (no more than 6 characters).',lib:'display.get_advertisedValue()',pro:'function get_advertisedValue()',cmt:'

Returns the current value of the display (no more than 6 characters).

',ret:'a string corresponding to the current value of the display (no more than 6 characters).',ext:'On failure, throws an exception or returns `Y_ADVERTISEDVALUE_INVALID`.'}; doc['Display']['get_brightness']={syn:'Returns the luminosity of the module informative leds (from 0 to 100).',lib:'display.get_brightness()',pro:'function get_brightness()',cmt:'

Returns the luminosity of the module informative leds (from 0 to 100).

',ret:'an integer corresponding to the luminosity of the module informative leds (from 0 to 100)',ext:'On failure, throws an exception or returns `Y_BRIGHTNESS_INVALID`.'}; doc['Display']['get_displayHeight']={syn:'Returns the display height, in pixels.',lib:'display.get_displayHeight()',pro:'function get_displayHeight()',cmt:'

Returns the display height, in pixels.

',ret:'an integer corresponding to the display height, in pixels',ext:'On failure, throws an exception or returns `Y_DISPLAYHEIGHT_INVALID`.'}; doc['Display']['get_displayLayer']={syn:'Returns a YDisplayLayer object that can be used to draw on the specified layer.',lib:'display.get_displayLayer()',pro:'function get_displayLayer(layerId)',cmt:'

Returns a YDisplayLayer object that can be used to draw on the specified layer. The content is displayed only when the layer is active on the screen (and not masked by other overlapping layers).

',par:{layerId:'the identifier of the layer (a number in range 0..layerCount-1)'},ret:'an `YDisplayLayer` object',ext:'On failure, throws an exception or returns `null`.'}; doc['Display']['get_displayType']={syn:'Returns the display type: monochrome, gray levels or full color.',lib:'display.get_displayType()',pro:'function get_displayType()',cmt:'

Returns the display type: monochrome, gray levels or full color.

',ret:'a value among `Y_DISPLAYTYPE_MONO`, `Y_DISPLAYTYPE_GRAY` and `Y_DISPLAYTYPE_RGB` corresponding to the display type: monochrome, gray levels or full color',ext:'On failure, throws an exception or returns `Y_DISPLAYTYPE_INVALID`.'}; doc['Display']['get_displayWidth']={syn:'Returns the display width, in pixels.',lib:'display.get_displayWidth()',pro:'function get_displayWidth()',cmt:'

Returns the display width, in pixels.

',ret:'an integer corresponding to the display width, in pixels',ext:'On failure, throws an exception or returns `Y_DISPLAYWIDTH_INVALID`.'}; doc['Display']['get_enabled']={syn:'Returns true if the screen is powered, false otherwise.',lib:'display.get_enabled()',pro:'function get_enabled()',cmt:'

Returns true if the screen is powered, false otherwise.

',ret:'either `Y_ENABLED_FALSE` or `Y_ENABLED_TRUE`, according to true if the screen is powered, false otherwise',ext:'On failure, throws an exception or returns `Y_ENABLED_INVALID`.'}; doc['Display']['get_errorMessage']={syn:'Returns the error message of the latest error with the display.',lib:'display.get_errorMessage()',pro:'function get_errorMessage()',cmt:'

Returns the error message of the latest error with the display. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a string corresponding to the latest error message that occured while using the display object'}; doc['Display']['get_errorType']={syn:'Returns the numerical error code of the latest error with the display.',lib:'display.get_errorType()',pro:'function get_errorType()',cmt:'

Returns the numerical error code of the latest error with the display. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a number corresponding to the code of the latest error that occurred while using the display object'}; doc['Display']['get_friendlyName']={syn:'Returns a global identifier of the display in the format `MODULE_NAME.FUNCTION_NAME`.',lib:'display.get_friendlyName()',pro:'function get_friendlyName()',cmt:'

Returns a global identifier of the display in the format `MODULE_NAME.FUNCTION_NAME`. The returned string uses the logical names of the module and of the display if they are defined, otherwise the serial number of the module and the hardware identifier of the display (for example: `MyCustomName.relay1`)

',ret:'a string that uniquely identifies the display using logical names (ex: `MyCustomName.relay1`)',ext:'On failure, throws an exception or returns `Y_FRIENDLYNAME_INVALID`.'}; doc['Display']['get_functionDescriptor']={syn:'Returns a unique identifier of type `YFUN_DESCR` corresponding to the function.',lib:'display.get_functionDescriptor()',pro:'function get_functionDescriptor()',cmt:'

Returns a unique identifier of type `YFUN_DESCR` corresponding to the function. This identifier can be used to test if two instances of `YFunction` reference the same physical function on the same physical device.

',ret:'an identifier of type `YFUN_DESCR`.',ext:'If the function has never been contacted, the returned value is `Y_FUNCTIONDESCRIPTOR_INVALID`.'}; doc['Display']['get_functionId']={syn:'Returns the hardware identifier of the display, without reference to the module.',lib:'display.get_functionId()',pro:'function get_functionId()',cmt:'

Returns the hardware identifier of the display, without reference to the module. For example `relay1`

',ret:'a string that identifies the display (ex: `relay1`)',ext:'On failure, throws an exception or returns `Y_FUNCTIONID_INVALID`.'}; doc['Display']['get_hardwareId']={syn:'Returns the unique hardware identifier of the display in the form `SERIAL.FUNCTIONID`.',lib:'display.get_hardwareId()',pro:'function get_hardwareId()',cmt:'

Returns the unique hardware identifier of the display in the form `SERIAL.FUNCTIONID`. The unique hardware identifier is composed of the device serial number and of the hardware identifier of the display (for example `RELAYLO1-123456.relay1`).

',ret:'a string that uniquely identifies the display (ex: `RELAYLO1-123456.relay1`)',ext:'On failure, throws an exception or returns `Y_HARDWAREID_INVALID`.'}; doc['Display']['get_layerCount']={syn:'Returns the number of available layers to draw on.',lib:'display.get_layerCount()',pro:'function get_layerCount()',cmt:'

Returns the number of available layers to draw on.

',ret:'an integer corresponding to the number of available layers to draw on',ext:'On failure, throws an exception or returns `Y_LAYERCOUNT_INVALID`.'}; doc['Display']['get_layerHeight']={syn:'Returns the height of the layers to draw on, in pixels.',lib:'display.get_layerHeight()',pro:'function get_layerHeight()',cmt:'

Returns the height of the layers to draw on, in pixels.

',ret:'an integer corresponding to the height of the layers to draw on, in pixels',ext:'On failure, throws an exception or returns `Y_LAYERHEIGHT_INVALID`.'}; doc['Display']['get_layerWidth']={syn:'Returns the width of the layers to draw on, in pixels.',lib:'display.get_layerWidth()',pro:'function get_layerWidth()',cmt:'

Returns the width of the layers to draw on, in pixels.

',ret:'an integer corresponding to the width of the layers to draw on, in pixels',ext:'On failure, throws an exception or returns `Y_LAYERWIDTH_INVALID`.'}; doc['Display']['get_logicalName']={syn:'Returns the logical name of the display.',lib:'display.get_logicalName()',pro:'function get_logicalName()',cmt:'

Returns the logical name of the display.

',ret:'a string corresponding to the logical name of the display.',ext:'On failure, throws an exception or returns `Y_LOGICALNAME_INVALID`.'}; doc['Display']['get_module']={syn:'Gets the `YModule` object for the device on which the function is located.',lib:'display.get_module()',pro:'function get_module()',cmt:'

Gets the `YModule` object for the device on which the function is located. If the function cannot be located on any module, the returned instance of `YModule` is not shown as on-line.

',ret:'an instance of `YModule`'}; doc['Display']['get_module_async']={syn:'Gets the `YModule` object for the device on which the function is located (asynchronous version).',lib:'display.get_module_async()',pro:'function get_module_async(callback, context)',cmt:'

Gets the `YModule` object for the device on which the function is located (asynchronous version). If the function cannot be located on any module, the returned `YModule` object does not show as on-line.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking Firefox javascript VM that does not implement context switching during blocking I/O calls. See the documentation section on asynchronous Javascript calls for more details.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the requested `YModule` object',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['Display']['get_orientation']={syn:'Returns the currently selected display orientation.',lib:'display.get_orientation()',pro:'function get_orientation()',cmt:'

Returns the currently selected display orientation.

',ret:'a value among `Y_ORIENTATION_LEFT`, `Y_ORIENTATION_UP`, `Y_ORIENTATION_RIGHT` and `Y_ORIENTATION_DOWN` corresponding to the currently selected display orientation',ext:'On failure, throws an exception or returns `Y_ORIENTATION_INVALID`.'}; doc['Display']['get_startupSeq']={syn:'Returns the name of the sequence to play when the displayed is powered on.',lib:'display.get_startupSeq()',pro:'function get_startupSeq()',cmt:'

Returns the name of the sequence to play when the displayed is powered on.

',ret:'a string corresponding to the name of the sequence to play when the displayed is powered on',ext:'On failure, throws an exception or returns `Y_STARTUPSEQ_INVALID`.'}; doc['Display']['get_userData']={syn:'Returns the value of the userData attribute, as previously stored using method `set_userData`.',lib:'display.get_userData()',pro:'function get_userData()',cmt:'

Returns the value of the userData attribute, as previously stored using method `set_userData`. This attribute is never touched directly by the API, and is at disposal of the caller to store a context.

',ret:'the object stored previously by the caller.'}; doc['Display']['isOnline']={syn:'Checks if the display is currently reachable, without raising any error.',lib:'display.isOnline()',pro:'function isOnline()',cmt:'

Checks if the display is currently reachable, without raising any error. If there is a cached value for the display in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the display.

',ret:'`true` if the display can be reached, and `false` otherwise'}; doc['Display']['isOnline_async']={syn:'Checks if the display is currently reachable, without raising any error (asynchronous version).',lib:'display.isOnline_async()',pro:'function isOnline_async(callback, context)',cmt:'

Checks if the display is currently reachable, without raising any error (asynchronous version). If there is a cached value for the display in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the requested function.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the boolean result',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['Display']['load']={syn:'Preloads the display cache with a specified validity duration.',lib:'display.load()',pro:'function load(msValidity)',cmt:'

Preloads the display cache with a specified validity duration. By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network traffic for instance.

',par:{msValidity:'an integer corresponding to the validity attributed to the loaded function parameters, in milliseconds'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Display']['loadAttribute']={syn:'Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.',lib:'display.loadAttribute()',pro:'function loadAttribute(attrName)',cmt:'

Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.

',par:{attrName:'the name of the requested attribute'},ret:'a string with the value of the the attribute',ext:'On failure, throws an exception or returns an empty string.'}; doc['Display']['load_async']={syn:'Preloads the display cache with a specified validity duration (asynchronous version).',lib:'display.load_async()',pro:'function load_async(msValidity, callback, context)',cmt:'

Preloads the display cache with a specified validity duration (asynchronous version). By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network trafic for instance.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{msValidity:'an integer corresponding to the validity of the loaded function parameters, in milliseconds',callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the error code (or `YAPI_SUCCESS`)',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['Display']['muteValueCallbacks']={syn:'Disables the propagation of every new advertised value to the parent hub.',lib:'display.muteValueCallbacks()',pro:'function muteValueCallbacks()',cmt:'

Disables the propagation of every new advertised value to the parent hub. You can use this function to save bandwidth and CPU on computers with limited resources, or to prevent unwanted invocations of the HTTP callback. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Display']['newSequence']={syn:'Starts to record all display commands into a sequence, for later replay.',lib:'display.newSequence()',pro:'function newSequence()',cmt:'

Starts to record all display commands into a sequence, for later replay. The name used to store the sequence is specified when calling `saveSequence()`, once the recording is complete.

',ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Display']['nextDisplay']={syn:'Continues the enumeration of displays started using `yFirstDisplay()`.',lib:'display.nextDisplay()',pro:'function nextDisplay()',cmt:'

Continues the enumeration of displays started using `yFirstDisplay()`.

',ret:'a pointer to a `YDisplay` object, corresponding to a display currently online, or a `null` pointer if there are no more displays to enumerate.'}; doc['Display']['pauseSequence']={syn:'Waits for a specified delay (in milliseconds) before playing next commands in current sequence.',lib:'display.pauseSequence()',pro:'function pauseSequence(delay_ms)',cmt:'

Waits for a specified delay (in milliseconds) before playing next commands in current sequence. This method can be used while recording a display sequence, to insert a timed wait in the sequence (without any immediate effect). It can also be used dynamically while playing a pre-recorded sequence, to suspend or resume the execution of the sequence. To cancel a delay, call the same method with a zero delay.

',par:{delay_ms:'the duration to wait, in milliseconds'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Display']['playSequence']={syn:'Replays a display sequence previously recorded using `newSequence()` and `saveSequence()`.',lib:'display.playSequence()',pro:'function playSequence(sequenceName)',cmt:'

Replays a display sequence previously recorded using `newSequence()` and `saveSequence()`.

',par:{sequenceName:'the name of the newly created sequence'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Display']['registerValueCallback']={syn:'Registers the callback function that is invoked on every change of advertised value.',lib:'display.registerValueCallback()',pro:'function registerValueCallback(callback)',cmt:'

Registers the callback function that is invoked on every change of advertised value. The callback is invoked only during the execution of `ySleep` or `yHandleEvents`. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a null pointer as argument.

',par:{callback:'the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and the character string describing the new advertised value.'}}; doc['Display']['resetAll']={syn:'Clears the display screen and resets all display layers to their default state.',lib:'display.resetAll()',pro:'function resetAll()',cmt:'

Clears the display screen and resets all display layers to their default state. Using this function in a sequence will kill the sequence play-back. Don\x27t use that function to reset the display at sequence start-up.

',ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Display']['saveSequence']={syn:'Stops recording display commands and saves the sequence into the specified file on the display internal memory.',lib:'display.saveSequence()',pro:'function saveSequence(sequenceName)',cmt:'

Stops recording display commands and saves the sequence into the specified file on the display internal memory. The sequence can be later replayed using `playSequence()`.

',par:{sequenceName:'the name of the newly created sequence'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Display']['set_brightness']={syn:'Changes the brightness of the display.',lib:'display.set_brightness()',pro:'function set_brightness(newval)',cmt:'

Changes the brightness of the display. The parameter is a value between 0 and 100. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',par:{newval:'an integer corresponding to the brightness of the display'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Display']['set_enabled']={syn:'Changes the power state of the display.',lib:'display.set_enabled()',pro:'function set_enabled(newval)',cmt:'

Changes the power state of the display.

',par:{newval:'either `Y_ENABLED_FALSE` or `Y_ENABLED_TRUE`, according to the power state of the display'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Display']['set_logicalName']={syn:'Changes the logical name of the display.',lib:'display.set_logicalName()',pro:'function set_logicalName(newval)',cmt:'

Changes the logical name of the display. You can use `yCheckLogicalName()` prior to this call to make sure that your parameter is valid. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',par:{newval:'a string corresponding to the logical name of the display.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Display']['set_orientation']={syn:'Changes the display orientation.',lib:'display.set_orientation()',pro:'function set_orientation(newval)',cmt:'

Changes the display orientation. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',par:{newval:'a value among `Y_ORIENTATION_LEFT`, `Y_ORIENTATION_UP`, `Y_ORIENTATION_RIGHT` and `Y_ORIENTATION_DOWN` corresponding to the display orientation'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Display']['set_startupSeq']={syn:'Changes the name of the sequence to play when the displayed is powered on.',lib:'display.set_startupSeq()',pro:'function set_startupSeq(newval)',cmt:'

Changes the name of the sequence to play when the displayed is powered on. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',par:{newval:'a string corresponding to the name of the sequence to play when the displayed is powered on'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Display']['set_userData']={syn:'Stores a user context provided as argument in the userData attribute of the function.',lib:'display.set_userData()',pro:'function set_userData(data)',cmt:'

Stores a user context provided as argument in the userData attribute of the function. This attribute is never touched by the API, and is at disposal of the caller to store a context.

',par:{data:'any kind of object to be stored'}}; doc['Display']['stopSequence']={syn:'Stops immediately any ongoing sequence replay.',lib:'display.stopSequence()',pro:'function stopSequence()',cmt:'

Stops immediately any ongoing sequence replay. The display is left as is.

',ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Display']['swapLayerContent']={syn:'Swaps the whole content of two layers.',lib:'display.swapLayerContent()',pro:'function swapLayerContent(layerIdA, layerIdB)',cmt:'

Swaps the whole content of two layers. The color and transparency of all the pixels from the two layers are swapped. This method only affects the displayed content, but does not change any property of the layer objects. In particular, the visibility of each layer stays unchanged. When used between onae hidden layer and a visible layer, this method makes it possible to easily implement double-buffering. Note that layer 0 has no transparency support (it is always completely opaque).

',par:{layerIdA:'the first layer (a number in range 0..layerCount-1)',layerIdB:'the second layer (a number in range 0..layerCount-1)'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Display']['unmuteValueCallbacks']={syn:'Re-enables the propagation of every new advertised value to the parent hub.',lib:'display.unmuteValueCallbacks()',pro:'function unmuteValueCallbacks()',cmt:'

Re-enables the propagation of every new advertised value to the parent hub. This function reverts the effect of a previous call to `muteValueCallbacks()`. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Display']['upload']={syn:'Uploads an arbitrary file (for instance a GIF file) to the display, to the specified full path name.',lib:'display.upload()',pro:'function upload(pathname, content)',cmt:'

Uploads an arbitrary file (for instance a GIF file) to the display, to the specified full path name. If a file already exists with the same path name, its content is overwritten.

',par:{pathname:'path and name of the new file to create',content:'binary buffer with the content to set'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Display']['wait_async']={syn:'Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function.',lib:'display.wait_async()',pro:'function wait_async(callback, context)',cmt:'

Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function. The callback function can therefore freely issue synchronous or asynchronous commands, without risking to block the Javascript VM.

',par:{callback:'callback function that is invoked when all pending commands on the module are completed. The callback function receives two arguments: the caller-specific context object and the receiving function object.',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing.'}; //--- (end of generated code: Display) //--- (generated code: DisplayLayer) doc['DisplayLayer']={'':{syn:'DisplayLayer object interface',inc:'<script type='text/javascript' src='yocto_display.js'></script>',cmt:'

A DisplayLayer is an image layer containing objects to display (bitmaps, text, etc.). The content is displayed only when the layer is active on the screen (and not masked by other overlapping layers).

'}}; doc['DisplayLayer']['clear']={syn:'Erases the whole content of the layer (makes it fully transparent).',lib:'displaylayer.clear()',pro:'function clear()',cmt:'

Erases the whole content of the layer (makes it fully transparent). This method does not change any other attribute of the layer. To reinitialize the layer attributes to defaults settings, use the method `reset()` instead.

',ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['DisplayLayer']['clearConsole']={syn:'Blanks the console area within console margins, and resets the console pointer to the upper left corner of the console.',lib:'displaylayer.clearConsole()',pro:'function clearConsole()',cmt:'

Blanks the console area within console margins, and resets the console pointer to the upper left corner of the console.

',ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['DisplayLayer']['consoleOut']={syn:'Outputs a message in the console area, and advances the console pointer accordingly.',lib:'displaylayer.consoleOut()',pro:'function consoleOut(text)',cmt:'

Outputs a message in the console area, and advances the console pointer accordingly. The console pointer position is automatically moved to the beginning of the next line when a newline character is met, or when the right margin is hit. When the new text to display extends below the lower margin, the console area is automatically scrolled up.

',par:{text:'the message to display'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['DisplayLayer']['drawBar']={syn:'Draws a filled rectangular bar at a specified position.',lib:'displaylayer.drawBar()',pro:'function drawBar(x1, y1, x2, y2)',cmt:'

Draws a filled rectangular bar at a specified position.

',par:{x1:'the distance from left of layer to the left border of the rectangle, in pixels',y1:'the distance from top of layer to the top border of the rectangle, in pixels',x2:'the distance from left of layer to the right border of the rectangle, in pixels',y2:'the distance from top of layer to the bottom border of the rectangle, in pixels'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['DisplayLayer']['drawBitmap']={syn:'Draws a bitmap at the specified position.',lib:'displaylayer.drawBitmap()',pro:'function drawBitmap(x, y, w, bitmap, bgcol)',cmt:'

Draws a bitmap at the specified position. The bitmap is provided as a binary object, where each pixel maps to a bit, from left to right and from top to bottom. The most significant bit of each byte maps to the leftmost pixel, and the least significant bit maps to the rightmost pixel. Bits set to 1 are drawn using the layer selected pen color. Bits set to 0 are drawn using the specified background gray level, unless -1 is specified, in which case they are not drawn at all (as if transparent).

',par:{x:'the distance from left of layer to the left of the bitmap, in pixels',y:'the distance from top of layer to the top of the bitmap, in pixels',w:'the width of the bitmap, in pixels',bitmap:'a binary object',bgcol:'the background gray level to use for zero bits (0 = black, 255 = white), or -1 to leave the pixels unchanged'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['DisplayLayer']['drawCircle']={syn:'Draws an empty circle at a specified position.',lib:'displaylayer.drawCircle()',pro:'function drawCircle(x, y, r)',cmt:'

Draws an empty circle at a specified position.

',par:{x:'the distance from left of layer to the center of the circle, in pixels',y:'the distance from top of layer to the center of the circle, in pixels',r:'the radius of the circle, in pixels'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['DisplayLayer']['drawDisc']={syn:'Draws a filled disc at a given position.',lib:'displaylayer.drawDisc()',pro:'function drawDisc(x, y, r)',cmt:'

Draws a filled disc at a given position.

',par:{x:'the distance from left of layer to the center of the disc, in pixels',y:'the distance from top of layer to the center of the disc, in pixels',r:'the radius of the disc, in pixels'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['DisplayLayer']['drawImage']={syn:'Draws a GIF image at the specified position.',lib:'displaylayer.drawImage()',pro:'function drawImage(x, y, imagename)',cmt:'

Draws a GIF image at the specified position. The GIF image must have been previously uploaded to the device built-in memory. If you experience problems using an image file, check the device logs for any error message such as missing image file or bad image file format.

',par:{x:'the distance from left of layer to the left of the image, in pixels',y:'the distance from top of layer to the top of the image, in pixels',imagename:'the GIF file name'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['DisplayLayer']['drawPixel']={syn:'Draws a single pixel at the specified position.',lib:'displaylayer.drawPixel()',pro:'function drawPixel(x, y)',cmt:'

Draws a single pixel at the specified position.

',par:{x:'the distance from left of layer, in pixels',y:'the distance from top of layer, in pixels'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['DisplayLayer']['drawRect']={syn:'Draws an empty rectangle at a specified position.',lib:'displaylayer.drawRect()',pro:'function drawRect(x1, y1, x2, y2)',cmt:'

Draws an empty rectangle at a specified position.

',par:{x1:'the distance from left of layer to the left border of the rectangle, in pixels',y1:'the distance from top of layer to the top border of the rectangle, in pixels',x2:'the distance from left of layer to the right border of the rectangle, in pixels',y2:'the distance from top of layer to the bottom border of the rectangle, in pixels'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['DisplayLayer']['drawText']={syn:'Draws a text string at the specified position.',lib:'displaylayer.drawText()',pro:'function drawText(x, y, anchor, text)',cmt:'

Draws a text string at the specified position. The point of the text that is aligned to the specified pixel position is called the anchor point, and can be chosen among several options. Text is rendered from left to right, without implicit wrapping.

',par:{x:'the distance from left of layer to the text anchor point, in pixels',y:'the distance from top of layer to the text anchor point, in pixels',anchor:'the text anchor point, chosen among the `Y_ALIGN` enumeration: `Y_ALIGN_TOP_LEFT`, `Y_ALIGN_CENTER_LEFT`, `Y_ALIGN_BASELINE_LEFT`, `Y_ALIGN_BOTTOM_LEFT`, `Y_ALIGN_TOP_CENTER`, `Y_ALIGN_CENTER`, `Y_ALIGN_BASELINE_CENTER`, `Y_ALIGN_BOTTOM_CENTER`, `Y_ALIGN_TOP_DECIMAL`, `Y_ALIGN_CENTER_DECIMAL`, `Y_ALIGN_BASELINE_DECIMAL`, `Y_ALIGN_BOTTOM_DECIMAL`, `Y_ALIGN_TOP_RIGHT`, `Y_ALIGN_CENTER_RIGHT`, `Y_ALIGN_BASELINE_RIGHT`, `Y_ALIGN_BOTTOM_RIGHT`.',text:'the text string to draw'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['DisplayLayer']['get_display']={syn:'Gets parent YDisplay.',lib:'displaylayer.get_display()',pro:'function get_display()',cmt:'

Gets parent YDisplay. Returns the parent YDisplay object of the current YDisplayLayer.

',ret:'an `YDisplay` object'}; doc['DisplayLayer']['get_displayHeight']={syn:'Returns the display height, in pixels.',lib:'displaylayer.get_displayHeight()',pro:'function get_displayHeight()',cmt:'

Returns the display height, in pixels.

',ret:'an integer corresponding to the display height, in pixels',ext:'On failure, throws an exception or returns Y_DISPLAYHEIGHT_INVALID.'}; doc['DisplayLayer']['get_displayWidth']={syn:'Returns the display width, in pixels.',lib:'displaylayer.get_displayWidth()',pro:'function get_displayWidth()',cmt:'

Returns the display width, in pixels.

',ret:'an integer corresponding to the display width, in pixels',ext:'On failure, throws an exception or returns Y_DISPLAYWIDTH_INVALID.'}; doc['DisplayLayer']['get_layerHeight']={syn:'Returns the height of the layers to draw on, in pixels.',lib:'displaylayer.get_layerHeight()',pro:'function get_layerHeight()',cmt:'

Returns the height of the layers to draw on, in pixels.

',ret:'an integer corresponding to the height of the layers to draw on, in pixels',ext:'On failure, throws an exception or returns Y_LAYERHEIGHT_INVALID.'}; doc['DisplayLayer']['get_layerWidth']={syn:'Returns the width of the layers to draw on, in pixels.',lib:'displaylayer.get_layerWidth()',pro:'function get_layerWidth()',cmt:'

Returns the width of the layers to draw on, in pixels.

',ret:'an integer corresponding to the width of the layers to draw on, in pixels',ext:'On failure, throws an exception or returns Y_LAYERWIDTH_INVALID.'}; doc['DisplayLayer']['hide']={syn:'Hides the layer.',lib:'displaylayer.hide()',pro:'function hide()',cmt:'

Hides the layer. The state of the layer is perserved but the layer is not displayed on the screen until the next call to `unhide()`. Hiding the layer can positively affect the drawing speed, since it postpones the rendering until all operations are completed (double-buffering).

',ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['DisplayLayer']['lineTo']={syn:'Draws a line from current drawing pointer position to the specified position.',lib:'displaylayer.lineTo()',pro:'function lineTo(x, y)',cmt:'

Draws a line from current drawing pointer position to the specified position. The specified destination pixel is included in the line. The pointer position is then moved to the end point of the line.

',par:{x:'the distance from left of layer to the end point of the line, in pixels',y:'the distance from top of layer to the end point of the line, in pixels'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['DisplayLayer']['moveTo']={syn:'Moves the drawing pointer of this layer to the specified position.',lib:'displaylayer.moveTo()',pro:'function moveTo(x, y)',cmt:'

Moves the drawing pointer of this layer to the specified position.

',par:{x:'the distance from left of layer, in pixels',y:'the distance from top of layer, in pixels'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['DisplayLayer']['reset']={syn:'Reverts the layer to its initial state (fully transparent, default settings).',lib:'displaylayer.reset()',pro:'function reset()',cmt:'

Reverts the layer to its initial state (fully transparent, default settings). Reinitializes the drawing pointer to the upper left position, and selects the most visible pen color. If you only want to erase the layer content, use the method `clear()` instead.

',ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['DisplayLayer']['selectColorPen']={syn:'Selects the pen color for all subsequent drawing functions, including text drawing.',lib:'displaylayer.selectColorPen()',pro:'function selectColorPen(color)',cmt:'

Selects the pen color for all subsequent drawing functions, including text drawing. The pen color is provided as an RGB value. For grayscale or monochrome displays, the value is automatically converted to the proper range.

',par:{color:'the desired pen color, as a 24-bit RGB value'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['DisplayLayer']['selectEraser']={syn:'Selects an eraser instead of a pen for all subsequent drawing functions, except for bitmap copy functions.',lib:'displaylayer.selectEraser()',pro:'function selectEraser()',cmt:'

Selects an eraser instead of a pen for all subsequent drawing functions, except for bitmap copy functions. Any point drawn using the eraser becomes transparent (as when the layer is empty), showing the other layers beneath it.

',ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['DisplayLayer']['selectFont']={syn:'Selects a font to use for the next text drawing functions, by providing the name of the font file.',lib:'displaylayer.selectFont()',pro:'function selectFont(fontname)',cmt:'

Selects a font to use for the next text drawing functions, by providing the name of the font file. You can use a built-in font as well as a font file that you have previously uploaded to the device built-in memory. If you experience problems selecting a font file, check the device logs for any error message such as missing font file or bad font file format.

',par:{fontname:'the font file name'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['DisplayLayer']['selectGrayPen']={syn:'Selects the pen gray level for all subsequent drawing functions, including text drawing.',lib:'displaylayer.selectGrayPen()',pro:'function selectGrayPen(graylevel)',cmt:'

Selects the pen gray level for all subsequent drawing functions, including text drawing. The gray level is provided as a number between 0 (black) and 255 (white, or whichever the lighest color is). For monochrome displays (without gray levels), any value lower than 128 is rendered as black, and any value equal or above to 128 is non-black.

',par:{graylevel:'the desired gray level, from 0 to 255'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['DisplayLayer']['setAntialiasingMode']={syn:'Enables or disables anti-aliasing for drawing oblique lines and circles.',lib:'displaylayer.setAntialiasingMode()',pro:'function setAntialiasingMode(mode)',cmt:'

Enables or disables anti-aliasing for drawing oblique lines and circles. Anti-aliasing provides a smoother aspect when looked from far enough, but it can add fuzzyness when the display is looked from very close. At the end of the day, it is your personal choice. Anti-aliasing is enabled by default on grayscale and color displays, but you can disable it if you prefer. This setting has no effect on monochrome displays.

',par:{mode:'`true` to enable antialiasing, `false` to disable it.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['DisplayLayer']['setConsoleBackground']={syn:'Sets up the background color used by the `clearConsole` function and by the console scrolling feature.',lib:'displaylayer.setConsoleBackground()',pro:'function setConsoleBackground(bgcol)',cmt:'

Sets up the background color used by the `clearConsole` function and by the console scrolling feature.

',par:{bgcol:'the background gray level to use when scrolling (0 = black, 255 = white), or -1 for transparent'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['DisplayLayer']['setConsoleMargins']={syn:'Sets up display margins for the `consoleOut` function.',lib:'displaylayer.setConsoleMargins()',pro:'function setConsoleMargins(x1, y1, x2, y2)',cmt:'

Sets up display margins for the `consoleOut` function.

',par:{x1:'the distance from left of layer to the left margin, in pixels',y1:'the distance from top of layer to the top margin, in pixels',x2:'the distance from left of layer to the right margin, in pixels',y2:'the distance from top of layer to the bottom margin, in pixels'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['DisplayLayer']['setConsoleWordWrap']={syn:'Sets up the wrapping behaviour used by the `consoleOut` function.',lib:'displaylayer.setConsoleWordWrap()',pro:'function setConsoleWordWrap(wordwrap)',cmt:'

Sets up the wrapping behaviour used by the `consoleOut` function.

',par:{wordwrap:'`true` to wrap only between words, `false` to wrap on the last column anyway.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['DisplayLayer']['setLayerPosition']={syn:'Sets the position of the layer relative to the display upper left corner.',lib:'displaylayer.setLayerPosition()',pro:'function setLayerPosition(x, y, scrollTime)',cmt:'

Sets the position of the layer relative to the display upper left corner. When smooth scrolling is used, the display offset of the layer is automatically updated during the next milliseconds to animate the move of the layer.

',par:{x:'the distance from left of display to the upper left corner of the layer',y:'the distance from top of display to the upper left corner of the layer',scrollTime:'number of milliseconds to use for smooth scrolling, or 0 if the scrolling should be immediate.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['DisplayLayer']['unhide']={syn:'Shows the layer.',lib:'displaylayer.unhide()',pro:'function unhide()',cmt:'

Shows the layer. Shows the layer again after a hide command.

',ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; //--- (end of generated code: DisplayLayer) //--- (generated code: Files) doc['Files']={'':{syn:'Files function interface',inc:'<script type='text/javascript' src='yocto_files.js'></script>',cmt:'

The filesystem interface makes it possible to store files on some devices, for instance to design a custom web UI (for networked devices) or to add fonts (on display devices).

'}}; doc['Files']['FindFiles']={syn:'Retrieves a filesystem for a given identifier.',lib:'YFiles.FindFiles()',pro:'function FindFiles(func)',cmt:'

Retrieves a filesystem for a given identifier. The identifier can be specified using several formats:

- FunctionLogicalName
- ModuleSerialNumber.FunctionIdentifier
- ModuleSerialNumber.FunctionLogicalName
- ModuleLogicalName.FunctionIdentifier
- ModuleLogicalName.FunctionLogicalName

This function does not require that the filesystem is online at the time it is invoked. The returned object is nevertheless valid. Use the method `YFiles.isOnline()` to test if the filesystem is indeed online at a given time. In case of ambiguity when looking for a filesystem by logical name, no error is notified: the first instance found is returned. The search is performed first by hardware name, then by logical name.

If a call to this object\x27s is_online() method returns FALSE although you are certain that the matching device is plugged, make sure that you did call registerHub() at application initialization time.

',par:{func:'a string that uniquely characterizes the filesystem'},ret:'a `YFiles` object allowing you to drive the filesystem.'}; doc['Files']['FirstFiles']={syn:'Starts the enumeration of filesystems currently accessible.',lib:'YFiles.FirstFiles()',pro:'function FirstFiles()',cmt:'

Starts the enumeration of filesystems currently accessible. Use the method `YFiles.nextFiles()` to iterate on next filesystems.

',ret:'a pointer to a `YFiles` object, corresponding to the first filesystem currently online, or a `null` pointer if there are none.'}; doc['Files']['clearCache']={syn:'Invalidates the cache.',lib:'files.clearCache()',pro:'function clearCache()',cmt:'

Invalidates the cache. Invalidates the cache of the filesystem attributes. Forces the next call to get_xxx() or loadxxx() to use values that come from the device.

'}; doc['Files']['describe']={syn:'Returns a short text that describes unambiguously the instance of the filesystem in the form `TYPE(NAME)=SERIAL.FUNCTIONID`.',lib:'files.describe()',pro:'function describe()',cmt:'

Returns a short text that describes unambiguously the instance of the filesystem in the form `TYPE(NAME)=SERIAL.FUNCTIONID`. More precisely, `TYPE` is the type of the function, `NAME` it the name used for the first access to the function, `SERIAL` is the serial number of the module if the module is connected or `\x22unresolved\x22`, and `FUNCTIONID` is the hardware identifier of the function if the module is connected. For example, this method returns `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1` if the module is already connected or `Relay(BadCustomeName.relay1)=unresolved` if the module has not yet been connected. This method does not trigger any USB or TCP transaction and can therefore be used in a debugger.

',ret:'a string that describes the filesystem (ex: `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1`)'}; doc['Files']['download']={syn:'Downloads the requested file and returns a binary buffer with its content.',lib:'files.download()',pro:'function download(pathname)',cmt:'

Downloads the requested file and returns a binary buffer with its content.

',par:{pathname:'path and name of the file to download'},ret:'a binary buffer with the file content',ext:'On failure, throws an exception or returns an empty content.'}; doc['Files']['download_async']={syn:'Downloads the requested file and returns a binary buffer with its content.',lib:'files.download_async()',pro:'function download_async(pathname, callback, context)',cmt:'

Downloads the requested file and returns a binary buffer with its content. This is the asynchronous version that uses a callback to pass the result when the donwload is completed.

',par:{pathname:'path and name of the new file to load',callback:'callback function that is invoked when the w The callback function receives three arguments: - the user-specific context object - the YFiles object whose download_async was invoked - a binary buffer with the file content',context:'user-specific object that is passed as-is to the callback function'},ret:'nothing.'}; doc['Files']['fileExist']={syn:'Test if a file exist on the filesystem of the module.',lib:'files.fileExist()',pro:'function fileExist(filename)',cmt:'

Test if a file exist on the filesystem of the module.

',par:{filename:'the file name to test.'},ret:'a true if the file existe, false ortherwise.',ext:'On failure, throws an exception.'}; doc['Files']['format_fs']={syn:'Reinitialize the filesystem to its clean, unfragmented, empty state.',lib:'files.format_fs()',pro:'function format_fs()',cmt:'

Reinitialize the filesystem to its clean, unfragmented, empty state. All files previously uploaded are permanently lost.

',ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Files']['get_advertisedValue']={syn:'Returns the current value of the filesystem (no more than 6 characters).',lib:'files.get_advertisedValue()',pro:'function get_advertisedValue()',cmt:'

Returns the current value of the filesystem (no more than 6 characters).

',ret:'a string corresponding to the current value of the filesystem (no more than 6 characters).',ext:'On failure, throws an exception or returns `Y_ADVERTISEDVALUE_INVALID`.'}; doc['Files']['get_errorMessage']={syn:'Returns the error message of the latest error with the filesystem.',lib:'files.get_errorMessage()',pro:'function get_errorMessage()',cmt:'

Returns the error message of the latest error with the filesystem. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a string corresponding to the latest error message that occured while using the filesystem object'}; doc['Files']['get_errorType']={syn:'Returns the numerical error code of the latest error with the filesystem.',lib:'files.get_errorType()',pro:'function get_errorType()',cmt:'

Returns the numerical error code of the latest error with the filesystem. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a number corresponding to the code of the latest error that occurred while using the filesystem object'}; doc['Files']['get_filesCount']={syn:'Returns the number of files currently loaded in the filesystem.',lib:'files.get_filesCount()',pro:'function get_filesCount()',cmt:'

Returns the number of files currently loaded in the filesystem.

',ret:'an integer corresponding to the number of files currently loaded in the filesystem',ext:'On failure, throws an exception or returns `Y_FILESCOUNT_INVALID`.'}; doc['Files']['get_freeSpace']={syn:'Returns the free space for uploading new files to the filesystem, in bytes.',lib:'files.get_freeSpace()',pro:'function get_freeSpace()',cmt:'

Returns the free space for uploading new files to the filesystem, in bytes.

',ret:'an integer corresponding to the free space for uploading new files to the filesystem, in bytes',ext:'On failure, throws an exception or returns `Y_FREESPACE_INVALID`.'}; doc['Files']['get_friendlyName']={syn:'Returns a global identifier of the filesystem in the format `MODULE_NAME.FUNCTION_NAME`.',lib:'files.get_friendlyName()',pro:'function get_friendlyName()',cmt:'

Returns a global identifier of the filesystem in the format `MODULE_NAME.FUNCTION_NAME`. The returned string uses the logical names of the module and of the filesystem if they are defined, otherwise the serial number of the module and the hardware identifier of the filesystem (for example: `MyCustomName.relay1`)

',ret:'a string that uniquely identifies the filesystem using logical names (ex: `MyCustomName.relay1`)',ext:'On failure, throws an exception or returns `Y_FRIENDLYNAME_INVALID`.'}; doc['Files']['get_functionDescriptor']={syn:'Returns a unique identifier of type `YFUN_DESCR` corresponding to the function.',lib:'files.get_functionDescriptor()',pro:'function get_functionDescriptor()',cmt:'

Returns a unique identifier of type `YFUN_DESCR` corresponding to the function. This identifier can be used to test if two instances of `YFunction` reference the same physical function on the same physical device.

',ret:'an identifier of type `YFUN_DESCR`.',ext:'If the function has never been contacted, the returned value is `Y_FUNCTIONDESCRIPTOR_INVALID`.'}; doc['Files']['get_functionId']={syn:'Returns the hardware identifier of the filesystem, without reference to the module.',lib:'files.get_functionId()',pro:'function get_functionId()',cmt:'

Returns the hardware identifier of the filesystem, without reference to the module. For example `relay1`

',ret:'a string that identifies the filesystem (ex: `relay1`)',ext:'On failure, throws an exception or returns `Y_FUNCTIONID_INVALID`.'}; doc['Files']['get_hardwareId']={syn:'Returns the unique hardware identifier of the filesystem in the form `SERIAL.FUNCTIONID`.',lib:'files.get_hardwareId()',pro:'function get_hardwareId()',cmt:'

Returns the unique hardware identifier of the filesystem in the form `SERIAL.FUNCTIONID`. The unique hardware identifier is composed of the device serial number and of the hardware identifier of the filesystem (for example `RELAYLO1-123456.relay1`).

',ret:'a string that uniquely identifies the filesystem (ex: `RELAYLO1-123456.relay1`)',ext:'On failure, throws an exception or returns `Y_HARDWAREID_INVALID`.'}; doc['Files']['get_list']={syn:'Returns a list of YFileRecord objects that describe files currently loaded in the filesystem.',lib:'files.get_list()',pro:'function get_list(pattern)',cmt:'

Returns a list of YFileRecord objects that describe files currently loaded in the filesystem.

',par:{pattern:'an optional filter pattern, using star and question marks as wildcards. When an empty pattern is provided, all file records are returned.'},ret:'a list of `YFileRecord` objects, containing the file path and name, byte size and 32-bit CRC of the file content.',ext:'On failure, throws an exception or returns an empty list.'}; doc['Files']['get_logicalName']={syn:'Returns the logical name of the filesystem.',lib:'files.get_logicalName()',pro:'function get_logicalName()',cmt:'

Returns the logical name of the filesystem.

',ret:'a string corresponding to the logical name of the filesystem.',ext:'On failure, throws an exception or returns `Y_LOGICALNAME_INVALID`.'}; doc['Files']['get_module']={syn:'Gets the `YModule` object for the device on which the function is located.',lib:'files.get_module()',pro:'function get_module()',cmt:'

Gets the `YModule` object for the device on which the function is located. If the function cannot be located on any module, the returned instance of `YModule` is not shown as on-line.

',ret:'an instance of `YModule`'}; doc['Files']['get_module_async']={syn:'Gets the `YModule` object for the device on which the function is located (asynchronous version).',lib:'files.get_module_async()',pro:'function get_module_async(callback, context)',cmt:'

Gets the `YModule` object for the device on which the function is located (asynchronous version). If the function cannot be located on any module, the returned `YModule` object does not show as on-line.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking Firefox javascript VM that does not implement context switching during blocking I/O calls. See the documentation section on asynchronous Javascript calls for more details.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the requested `YModule` object',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['Files']['get_userData']={syn:'Returns the value of the userData attribute, as previously stored using method `set_userData`.',lib:'files.get_userData()',pro:'function get_userData()',cmt:'

Returns the value of the userData attribute, as previously stored using method `set_userData`. This attribute is never touched directly by the API, and is at disposal of the caller to store a context.

',ret:'the object stored previously by the caller.'}; doc['Files']['isOnline']={syn:'Checks if the filesystem is currently reachable, without raising any error.',lib:'files.isOnline()',pro:'function isOnline()',cmt:'

Checks if the filesystem is currently reachable, without raising any error. If there is a cached value for the filesystem in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the filesystem.

',ret:'`true` if the filesystem can be reached, and `false` otherwise'}; doc['Files']['isOnline_async']={syn:'Checks if the filesystem is currently reachable, without raising any error (asynchronous version).',lib:'files.isOnline_async()',pro:'function isOnline_async(callback, context)',cmt:'

Checks if the filesystem is currently reachable, without raising any error (asynchronous version). If there is a cached value for the filesystem in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the requested function.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the boolean result',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['Files']['load']={syn:'Preloads the filesystem cache with a specified validity duration.',lib:'files.load()',pro:'function load(msValidity)',cmt:'

Preloads the filesystem cache with a specified validity duration. By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network traffic for instance.

',par:{msValidity:'an integer corresponding to the validity attributed to the loaded function parameters, in milliseconds'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Files']['loadAttribute']={syn:'Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.',lib:'files.loadAttribute()',pro:'function loadAttribute(attrName)',cmt:'

Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.

',par:{attrName:'the name of the requested attribute'},ret:'a string with the value of the the attribute',ext:'On failure, throws an exception or returns an empty string.'}; doc['Files']['load_async']={syn:'Preloads the filesystem cache with a specified validity duration (asynchronous version).',lib:'files.load_async()',pro:'function load_async(msValidity, callback, context)',cmt:'

Preloads the filesystem cache with a specified validity duration (asynchronous version). By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network trafic for instance.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{msValidity:'an integer corresponding to the validity of the loaded function parameters, in milliseconds',callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the error code (or `YAPI_SUCCESS`)',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['Files']['muteValueCallbacks']={syn:'Disables the propagation of every new advertised value to the parent hub.',lib:'files.muteValueCallbacks()',pro:'function muteValueCallbacks()',cmt:'

Disables the propagation of every new advertised value to the parent hub. You can use this function to save bandwidth and CPU on computers with limited resources, or to prevent unwanted invocations of the HTTP callback. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Files']['nextFiles']={syn:'Continues the enumeration of filesystems started using `yFirstFiles()`.',lib:'files.nextFiles()',pro:'function nextFiles()',cmt:'

Continues the enumeration of filesystems started using `yFirstFiles()`.

',ret:'a pointer to a `YFiles` object, corresponding to a filesystem currently online, or a `null` pointer if there are no more filesystems to enumerate.'}; doc['Files']['registerValueCallback']={syn:'Registers the callback function that is invoked on every change of advertised value.',lib:'files.registerValueCallback()',pro:'function registerValueCallback(callback)',cmt:'

Registers the callback function that is invoked on every change of advertised value. The callback is invoked only during the execution of `ySleep` or `yHandleEvents`. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a null pointer as argument.

',par:{callback:'the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and the character string describing the new advertised value.'}}; doc['Files']['remove']={syn:'Deletes a file, given by its full path name, from the filesystem.',lib:'files.remove()',pro:'function remove(pathname)',cmt:'

Deletes a file, given by its full path name, from the filesystem. Because of filesystem fragmentation, deleting a file may not always free up the whole space used by the file. However, rewriting a file with the same path name will always reuse any space not freed previously. If you need to ensure that no space is taken by previously deleted files, you can use `format_fs` to fully reinitialize the filesystem.

',par:{pathname:'path and name of the file to remove.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Files']['set_logicalName']={syn:'Changes the logical name of the filesystem.',lib:'files.set_logicalName()',pro:'function set_logicalName(newval)',cmt:'

Changes the logical name of the filesystem. You can use `yCheckLogicalName()` prior to this call to make sure that your parameter is valid. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',par:{newval:'a string corresponding to the logical name of the filesystem.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Files']['set_userData']={syn:'Stores a user context provided as argument in the userData attribute of the function.',lib:'files.set_userData()',pro:'function set_userData(data)',cmt:'

Stores a user context provided as argument in the userData attribute of the function. This attribute is never touched by the API, and is at disposal of the caller to store a context.

',par:{data:'any kind of object to be stored'}}; doc['Files']['unmuteValueCallbacks']={syn:'Re-enables the propagation of every new advertised value to the parent hub.',lib:'files.unmuteValueCallbacks()',pro:'function unmuteValueCallbacks()',cmt:'

Re-enables the propagation of every new advertised value to the parent hub. This function reverts the effect of a previous call to `muteValueCallbacks()`. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Files']['upload']={syn:'Uploads a file to the filesystem, to the specified full path name.',lib:'files.upload()',pro:'function upload(pathname, content)',cmt:'

Uploads a file to the filesystem, to the specified full path name. If a file already exists with the same path name, its content is overwritten.

',par:{pathname:'path and name of the new file to create',content:'binary buffer with the content to set'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Files']['wait_async']={syn:'Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function.',lib:'files.wait_async()',pro:'function wait_async(callback, context)',cmt:'

Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function. The callback function can therefore freely issue synchronous or asynchronous commands, without risking to block the Javascript VM.

',par:{callback:'callback function that is invoked when all pending commands on the module are completed. The callback function receives two arguments: the caller-specific context object and the receiving function object.',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing.'}; //--- (end of generated code: Files) //--- (generated code: RealTimeClock) doc['RealTimeClock']={'':{syn:'Real Time Clock function interface',inc:'<script type='text/javascript' src='yocto_realtimeclock.js'></script>',cmt:'

The RealTimeClock function maintains and provides current date and time, even accross power cut lasting several days. It is the base for automated wake-up functions provided by the WakeUpScheduler. The current time may represent a local time as well as an UTC time, but no automatic time change will occur to account for daylight saving time.

'}}; doc['RealTimeClock']['FindRealTimeClock']={syn:'Retrieves a clock for a given identifier.',lib:'YRealTimeClock.FindRealTimeClock()',pro:'function FindRealTimeClock(func)',cmt:'

Retrieves a clock for a given identifier. The identifier can be specified using several formats:

- FunctionLogicalName
- ModuleSerialNumber.FunctionIdentifier
- ModuleSerialNumber.FunctionLogicalName
- ModuleLogicalName.FunctionIdentifier
- ModuleLogicalName.FunctionLogicalName

This function does not require that the clock is online at the time it is invoked. The returned object is nevertheless valid. Use the method `YRealTimeClock.isOnline()` to test if the clock is indeed online at a given time. In case of ambiguity when looking for a clock by logical name, no error is notified: the first instance found is returned. The search is performed first by hardware name, then by logical name.

If a call to this object\x27s is_online() method returns FALSE although you are certain that the matching device is plugged, make sure that you did call registerHub() at application initialization time.

',par:{func:'a string that uniquely characterizes the clock'},ret:'a `YRealTimeClock` object allowing you to drive the clock.'}; doc['RealTimeClock']['FirstRealTimeClock']={syn:'Starts the enumeration of clocks currently accessible.',lib:'YRealTimeClock.FirstRealTimeClock()',pro:'function FirstRealTimeClock()',cmt:'

Starts the enumeration of clocks currently accessible. Use the method `YRealTimeClock.nextRealTimeClock()` to iterate on next clocks.

',ret:'a pointer to a `YRealTimeClock` object, corresponding to the first clock currently online, or a `null` pointer if there are none.'}; doc['RealTimeClock']['clearCache']={syn:'Invalidates the cache.',lib:'realtimeclock.clearCache()',pro:'function clearCache()',cmt:'

Invalidates the cache. Invalidates the cache of the clock attributes. Forces the next call to get_xxx() or loadxxx() to use values that come from the device.

'}; doc['RealTimeClock']['describe']={syn:'Returns a short text that describes unambiguously the instance of the clock in the form `TYPE(NAME)=SERIAL.FUNCTIONID`.',lib:'realtimeclock.describe()',pro:'function describe()',cmt:'

Returns a short text that describes unambiguously the instance of the clock in the form `TYPE(NAME)=SERIAL.FUNCTIONID`. More precisely, `TYPE` is the type of the function, `NAME` it the name used for the first access to the function, `SERIAL` is the serial number of the module if the module is connected or `\x22unresolved\x22`, and `FUNCTIONID` is the hardware identifier of the function if the module is connected. For example, this method returns `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1` if the module is already connected or `Relay(BadCustomeName.relay1)=unresolved` if the module has not yet been connected. This method does not trigger any USB or TCP transaction and can therefore be used in a debugger.

',ret:'a string that describes the clock (ex: `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1`)'}; doc['RealTimeClock']['get_advertisedValue']={syn:'Returns the current value of the clock (no more than 6 characters).',lib:'realtimeclock.get_advertisedValue()',pro:'function get_advertisedValue()',cmt:'

Returns the current value of the clock (no more than 6 characters).

',ret:'a string corresponding to the current value of the clock (no more than 6 characters).',ext:'On failure, throws an exception or returns `Y_ADVERTISEDVALUE_INVALID`.'}; doc['RealTimeClock']['get_dateTime']={syn:'Returns the current time in the form \x22YYYY/MM/DD hh:mm:ss\x22.',lib:'realtimeclock.get_dateTime()',pro:'function get_dateTime()',cmt:'

Returns the current time in the form \x22YYYY/MM/DD hh:mm:ss\x22.

',ret:'a string corresponding to the current time in the form \x22YYYY/MM/DD hh:mm:ss\x22',ext:'On failure, throws an exception or returns `Y_DATETIME_INVALID`.'}; doc['RealTimeClock']['get_errorMessage']={syn:'Returns the error message of the latest error with the clock.',lib:'realtimeclock.get_errorMessage()',pro:'function get_errorMessage()',cmt:'

Returns the error message of the latest error with the clock. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a string corresponding to the latest error message that occured while using the clock object'}; doc['RealTimeClock']['get_errorType']={syn:'Returns the numerical error code of the latest error with the clock.',lib:'realtimeclock.get_errorType()',pro:'function get_errorType()',cmt:'

Returns the numerical error code of the latest error with the clock. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a number corresponding to the code of the latest error that occurred while using the clock object'}; doc['RealTimeClock']['get_friendlyName']={syn:'Returns a global identifier of the clock in the format `MODULE_NAME.FUNCTION_NAME`.',lib:'realtimeclock.get_friendlyName()',pro:'function get_friendlyName()',cmt:'

Returns a global identifier of the clock in the format `MODULE_NAME.FUNCTION_NAME`. The returned string uses the logical names of the module and of the clock if they are defined, otherwise the serial number of the module and the hardware identifier of the clock (for example: `MyCustomName.relay1`)

',ret:'a string that uniquely identifies the clock using logical names (ex: `MyCustomName.relay1`)',ext:'On failure, throws an exception or returns `Y_FRIENDLYNAME_INVALID`.'}; doc['RealTimeClock']['get_functionDescriptor']={syn:'Returns a unique identifier of type `YFUN_DESCR` corresponding to the function.',lib:'realtimeclock.get_functionDescriptor()',pro:'function get_functionDescriptor()',cmt:'

Returns a unique identifier of type `YFUN_DESCR` corresponding to the function. This identifier can be used to test if two instances of `YFunction` reference the same physical function on the same physical device.

',ret:'an identifier of type `YFUN_DESCR`.',ext:'If the function has never been contacted, the returned value is `Y_FUNCTIONDESCRIPTOR_INVALID`.'}; doc['RealTimeClock']['get_functionId']={syn:'Returns the hardware identifier of the clock, without reference to the module.',lib:'realtimeclock.get_functionId()',pro:'function get_functionId()',cmt:'

Returns the hardware identifier of the clock, without reference to the module. For example `relay1`

',ret:'a string that identifies the clock (ex: `relay1`)',ext:'On failure, throws an exception or returns `Y_FUNCTIONID_INVALID`.'}; doc['RealTimeClock']['get_hardwareId']={syn:'Returns the unique hardware identifier of the clock in the form `SERIAL.FUNCTIONID`.',lib:'realtimeclock.get_hardwareId()',pro:'function get_hardwareId()',cmt:'

Returns the unique hardware identifier of the clock in the form `SERIAL.FUNCTIONID`. The unique hardware identifier is composed of the device serial number and of the hardware identifier of the clock (for example `RELAYLO1-123456.relay1`).

',ret:'a string that uniquely identifies the clock (ex: `RELAYLO1-123456.relay1`)',ext:'On failure, throws an exception or returns `Y_HARDWAREID_INVALID`.'}; doc['RealTimeClock']['get_logicalName']={syn:'Returns the logical name of the clock.',lib:'realtimeclock.get_logicalName()',pro:'function get_logicalName()',cmt:'

Returns the logical name of the clock.

',ret:'a string corresponding to the logical name of the clock.',ext:'On failure, throws an exception or returns `Y_LOGICALNAME_INVALID`.'}; doc['RealTimeClock']['get_module']={syn:'Gets the `YModule` object for the device on which the function is located.',lib:'realtimeclock.get_module()',pro:'function get_module()',cmt:'

Gets the `YModule` object for the device on which the function is located. If the function cannot be located on any module, the returned instance of `YModule` is not shown as on-line.

',ret:'an instance of `YModule`'}; doc['RealTimeClock']['get_module_async']={syn:'Gets the `YModule` object for the device on which the function is located (asynchronous version).',lib:'realtimeclock.get_module_async()',pro:'function get_module_async(callback, context)',cmt:'

Gets the `YModule` object for the device on which the function is located (asynchronous version). If the function cannot be located on any module, the returned `YModule` object does not show as on-line.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking Firefox javascript VM that does not implement context switching during blocking I/O calls. See the documentation section on asynchronous Javascript calls for more details.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the requested `YModule` object',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['RealTimeClock']['get_timeSet']={syn:'Returns true if the clock has been set, and false otherwise.',lib:'realtimeclock.get_timeSet()',pro:'function get_timeSet()',cmt:'

Returns true if the clock has been set, and false otherwise.

',ret:'either `Y_TIMESET_FALSE` or `Y_TIMESET_TRUE`, according to true if the clock has been set, and false otherwise',ext:'On failure, throws an exception or returns `Y_TIMESET_INVALID`.'}; doc['RealTimeClock']['get_unixTime']={syn:'Returns the current time in Unix format (number of elapsed seconds since Jan 1st, 1970).',lib:'realtimeclock.get_unixTime()',pro:'function get_unixTime()',cmt:'

Returns the current time in Unix format (number of elapsed seconds since Jan 1st, 1970).

',ret:'an integer corresponding to the current time in Unix format (number of elapsed seconds since Jan 1st, 1970)',ext:'On failure, throws an exception or returns `Y_UNIXTIME_INVALID`.'}; doc['RealTimeClock']['get_userData']={syn:'Returns the value of the userData attribute, as previously stored using method `set_userData`.',lib:'realtimeclock.get_userData()',pro:'function get_userData()',cmt:'

Returns the value of the userData attribute, as previously stored using method `set_userData`. This attribute is never touched directly by the API, and is at disposal of the caller to store a context.

',ret:'the object stored previously by the caller.'}; doc['RealTimeClock']['get_utcOffset']={syn:'Returns the number of seconds between current time and UTC time (time zone).',lib:'realtimeclock.get_utcOffset()',pro:'function get_utcOffset()',cmt:'

Returns the number of seconds between current time and UTC time (time zone).

',ret:'an integer corresponding to the number of seconds between current time and UTC time (time zone)',ext:'On failure, throws an exception or returns `Y_UTCOFFSET_INVALID`.'}; doc['RealTimeClock']['isOnline']={syn:'Checks if the clock is currently reachable, without raising any error.',lib:'realtimeclock.isOnline()',pro:'function isOnline()',cmt:'

Checks if the clock is currently reachable, without raising any error. If there is a cached value for the clock in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the clock.

',ret:'`true` if the clock can be reached, and `false` otherwise'}; doc['RealTimeClock']['isOnline_async']={syn:'Checks if the clock is currently reachable, without raising any error (asynchronous version).',lib:'realtimeclock.isOnline_async()',pro:'function isOnline_async(callback, context)',cmt:'

Checks if the clock is currently reachable, without raising any error (asynchronous version). If there is a cached value for the clock in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the requested function.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the boolean result',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['RealTimeClock']['load']={syn:'Preloads the clock cache with a specified validity duration.',lib:'realtimeclock.load()',pro:'function load(msValidity)',cmt:'

Preloads the clock cache with a specified validity duration. By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network traffic for instance.

',par:{msValidity:'an integer corresponding to the validity attributed to the loaded function parameters, in milliseconds'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['RealTimeClock']['loadAttribute']={syn:'Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.',lib:'realtimeclock.loadAttribute()',pro:'function loadAttribute(attrName)',cmt:'

Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.

',par:{attrName:'the name of the requested attribute'},ret:'a string with the value of the the attribute',ext:'On failure, throws an exception or returns an empty string.'}; doc['RealTimeClock']['load_async']={syn:'Preloads the clock cache with a specified validity duration (asynchronous version).',lib:'realtimeclock.load_async()',pro:'function load_async(msValidity, callback, context)',cmt:'

Preloads the clock cache with a specified validity duration (asynchronous version). By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network trafic for instance.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{msValidity:'an integer corresponding to the validity of the loaded function parameters, in milliseconds',callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the error code (or `YAPI_SUCCESS`)',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['RealTimeClock']['muteValueCallbacks']={syn:'Disables the propagation of every new advertised value to the parent hub.',lib:'realtimeclock.muteValueCallbacks()',pro:'function muteValueCallbacks()',cmt:'

Disables the propagation of every new advertised value to the parent hub. You can use this function to save bandwidth and CPU on computers with limited resources, or to prevent unwanted invocations of the HTTP callback. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['RealTimeClock']['nextRealTimeClock']={syn:'Continues the enumeration of clocks started using `yFirstRealTimeClock()`.',lib:'realtimeclock.nextRealTimeClock()',pro:'function nextRealTimeClock()',cmt:'

Continues the enumeration of clocks started using `yFirstRealTimeClock()`.

',ret:'a pointer to a `YRealTimeClock` object, corresponding to a clock currently online, or a `null` pointer if there are no more clocks to enumerate.'}; doc['RealTimeClock']['registerValueCallback']={syn:'Registers the callback function that is invoked on every change of advertised value.',lib:'realtimeclock.registerValueCallback()',pro:'function registerValueCallback(callback)',cmt:'

Registers the callback function that is invoked on every change of advertised value. The callback is invoked only during the execution of `ySleep` or `yHandleEvents`. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a null pointer as argument.

',par:{callback:'the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and the character string describing the new advertised value.'}}; doc['RealTimeClock']['set_logicalName']={syn:'Changes the logical name of the clock.',lib:'realtimeclock.set_logicalName()',pro:'function set_logicalName(newval)',cmt:'

Changes the logical name of the clock. You can use `yCheckLogicalName()` prior to this call to make sure that your parameter is valid. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',par:{newval:'a string corresponding to the logical name of the clock.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['RealTimeClock']['set_unixTime']={syn:'Changes the current time.',lib:'realtimeclock.set_unixTime()',pro:'function set_unixTime(newval)',cmt:'

Changes the current time. Time is specifid in Unix format (number of elapsed seconds since Jan 1st, 1970).

',par:{newval:'an integer corresponding to the current time'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['RealTimeClock']['set_userData']={syn:'Stores a user context provided as argument in the userData attribute of the function.',lib:'realtimeclock.set_userData()',pro:'function set_userData(data)',cmt:'

Stores a user context provided as argument in the userData attribute of the function. This attribute is never touched by the API, and is at disposal of the caller to store a context.

',par:{data:'any kind of object to be stored'}}; doc['RealTimeClock']['set_utcOffset']={syn:'Changes the number of seconds between current time and UTC time (time zone).',lib:'realtimeclock.set_utcOffset()',pro:'function set_utcOffset(newval)',cmt:'

Changes the number of seconds between current time and UTC time (time zone). The timezone is automatically rounded to the nearest multiple of 15 minutes.

',par:{newval:'an integer corresponding to the number of seconds between current time and UTC time (time zone)'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['RealTimeClock']['unmuteValueCallbacks']={syn:'Re-enables the propagation of every new advertised value to the parent hub.',lib:'realtimeclock.unmuteValueCallbacks()',pro:'function unmuteValueCallbacks()',cmt:'

Re-enables the propagation of every new advertised value to the parent hub. This function reverts the effect of a previous call to `muteValueCallbacks()`. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['RealTimeClock']['wait_async']={syn:'Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function.',lib:'realtimeclock.wait_async()',pro:'function wait_async(callback, context)',cmt:'

Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function. The callback function can therefore freely issue synchronous or asynchronous commands, without risking to block the Javascript VM.

',par:{callback:'callback function that is invoked when all pending commands on the module are completed. The callback function receives two arguments: the caller-specific context object and the receiving function object.',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing.'}; //--- (end of generated code: RealTimeClock) //--- (generated code: WakeUpMonitor) doc['WakeUpMonitor']={'':{syn:'WakeUpMonitor function interface',inc:'<script type='text/javascript' src='yocto_wakeupmonitor.js'></script>',cmt:'

The WakeUpMonitor function handles globally all wake-up sources, as well as automated sleep mode.

'}}; doc['WakeUpMonitor']['FindWakeUpMonitor']={syn:'Retrieves a monitor for a given identifier.',lib:'YWakeUpMonitor.FindWakeUpMonitor()',pro:'function FindWakeUpMonitor(func)',cmt:'

Retrieves a monitor for a given identifier. The identifier can be specified using several formats:

- FunctionLogicalName
- ModuleSerialNumber.FunctionIdentifier
- ModuleSerialNumber.FunctionLogicalName
- ModuleLogicalName.FunctionIdentifier
- ModuleLogicalName.FunctionLogicalName

This function does not require that the monitor is online at the time it is invoked. The returned object is nevertheless valid. Use the method `YWakeUpMonitor.isOnline()` to test if the monitor is indeed online at a given time. In case of ambiguity when looking for a monitor by logical name, no error is notified: the first instance found is returned. The search is performed first by hardware name, then by logical name.

If a call to this object\x27s is_online() method returns FALSE although you are certain that the matching device is plugged, make sure that you did call registerHub() at application initialization time.

',par:{func:'a string that uniquely characterizes the monitor'},ret:'a `YWakeUpMonitor` object allowing you to drive the monitor.'}; doc['WakeUpMonitor']['FirstWakeUpMonitor']={syn:'Starts the enumeration of monitors currently accessible.',lib:'YWakeUpMonitor.FirstWakeUpMonitor()',pro:'function FirstWakeUpMonitor()',cmt:'

Starts the enumeration of monitors currently accessible. Use the method `YWakeUpMonitor.nextWakeUpMonitor()` to iterate on next monitors.

',ret:'a pointer to a `YWakeUpMonitor` object, corresponding to the first monitor currently online, or a `null` pointer if there are none.'}; doc['WakeUpMonitor']['clearCache']={syn:'Invalidates the cache.',lib:'wakeupmonitor.clearCache()',pro:'function clearCache()',cmt:'

Invalidates the cache. Invalidates the cache of the monitor attributes. Forces the next call to get_xxx() or loadxxx() to use values that come from the device.

'}; doc['WakeUpMonitor']['describe']={syn:'Returns a short text that describes unambiguously the instance of the monitor in the form `TYPE(NAME)=SERIAL.FUNCTIONID`.',lib:'wakeupmonitor.describe()',pro:'function describe()',cmt:'

Returns a short text that describes unambiguously the instance of the monitor in the form `TYPE(NAME)=SERIAL.FUNCTIONID`. More precisely, `TYPE` is the type of the function, `NAME` it the name used for the first access to the function, `SERIAL` is the serial number of the module if the module is connected or `\x22unresolved\x22`, and `FUNCTIONID` is the hardware identifier of the function if the module is connected. For example, this method returns `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1` if the module is already connected or `Relay(BadCustomeName.relay1)=unresolved` if the module has not yet been connected. This method does not trigger any USB or TCP transaction and can therefore be used in a debugger.

',ret:'a string that describes the monitor (ex: `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1`)'}; doc['WakeUpMonitor']['get_advertisedValue']={syn:'Returns the current value of the monitor (no more than 6 characters).',lib:'wakeupmonitor.get_advertisedValue()',pro:'function get_advertisedValue()',cmt:'

Returns the current value of the monitor (no more than 6 characters).

',ret:'a string corresponding to the current value of the monitor (no more than 6 characters).',ext:'On failure, throws an exception or returns `Y_ADVERTISEDVALUE_INVALID`.'}; doc['WakeUpMonitor']['get_errorMessage']={syn:'Returns the error message of the latest error with the monitor.',lib:'wakeupmonitor.get_errorMessage()',pro:'function get_errorMessage()',cmt:'

Returns the error message of the latest error with the monitor. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a string corresponding to the latest error message that occured while using the monitor object'}; doc['WakeUpMonitor']['get_errorType']={syn:'Returns the numerical error code of the latest error with the monitor.',lib:'wakeupmonitor.get_errorType()',pro:'function get_errorType()',cmt:'

Returns the numerical error code of the latest error with the monitor. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a number corresponding to the code of the latest error that occurred while using the monitor object'}; doc['WakeUpMonitor']['get_friendlyName']={syn:'Returns a global identifier of the monitor in the format `MODULE_NAME.FUNCTION_NAME`.',lib:'wakeupmonitor.get_friendlyName()',pro:'function get_friendlyName()',cmt:'

Returns a global identifier of the monitor in the format `MODULE_NAME.FUNCTION_NAME`. The returned string uses the logical names of the module and of the monitor if they are defined, otherwise the serial number of the module and the hardware identifier of the monitor (for example: `MyCustomName.relay1`)

',ret:'a string that uniquely identifies the monitor using logical names (ex: `MyCustomName.relay1`)',ext:'On failure, throws an exception or returns `Y_FRIENDLYNAME_INVALID`.'}; doc['WakeUpMonitor']['get_functionDescriptor']={syn:'Returns a unique identifier of type `YFUN_DESCR` corresponding to the function.',lib:'wakeupmonitor.get_functionDescriptor()',pro:'function get_functionDescriptor()',cmt:'

Returns a unique identifier of type `YFUN_DESCR` corresponding to the function. This identifier can be used to test if two instances of `YFunction` reference the same physical function on the same physical device.

',ret:'an identifier of type `YFUN_DESCR`.',ext:'If the function has never been contacted, the returned value is `Y_FUNCTIONDESCRIPTOR_INVALID`.'}; doc['WakeUpMonitor']['get_functionId']={syn:'Returns the hardware identifier of the monitor, without reference to the module.',lib:'wakeupmonitor.get_functionId()',pro:'function get_functionId()',cmt:'

Returns the hardware identifier of the monitor, without reference to the module. For example `relay1`

',ret:'a string that identifies the monitor (ex: `relay1`)',ext:'On failure, throws an exception or returns `Y_FUNCTIONID_INVALID`.'}; doc['WakeUpMonitor']['get_hardwareId']={syn:'Returns the unique hardware identifier of the monitor in the form `SERIAL.FUNCTIONID`.',lib:'wakeupmonitor.get_hardwareId()',pro:'function get_hardwareId()',cmt:'

Returns the unique hardware identifier of the monitor in the form `SERIAL.FUNCTIONID`. The unique hardware identifier is composed of the device serial number and of the hardware identifier of the monitor (for example `RELAYLO1-123456.relay1`).

',ret:'a string that uniquely identifies the monitor (ex: `RELAYLO1-123456.relay1`)',ext:'On failure, throws an exception or returns `Y_HARDWAREID_INVALID`.'}; doc['WakeUpMonitor']['get_logicalName']={syn:'Returns the logical name of the monitor.',lib:'wakeupmonitor.get_logicalName()',pro:'function get_logicalName()',cmt:'

Returns the logical name of the monitor.

',ret:'a string corresponding to the logical name of the monitor.',ext:'On failure, throws an exception or returns `Y_LOGICALNAME_INVALID`.'}; doc['WakeUpMonitor']['get_module']={syn:'Gets the `YModule` object for the device on which the function is located.',lib:'wakeupmonitor.get_module()',pro:'function get_module()',cmt:'

Gets the `YModule` object for the device on which the function is located. If the function cannot be located on any module, the returned instance of `YModule` is not shown as on-line.

',ret:'an instance of `YModule`'}; doc['WakeUpMonitor']['get_module_async']={syn:'Gets the `YModule` object for the device on which the function is located (asynchronous version).',lib:'wakeupmonitor.get_module_async()',pro:'function get_module_async(callback, context)',cmt:'

Gets the `YModule` object for the device on which the function is located (asynchronous version). If the function cannot be located on any module, the returned `YModule` object does not show as on-line.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking Firefox javascript VM that does not implement context switching during blocking I/O calls. See the documentation section on asynchronous Javascript calls for more details.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the requested `YModule` object',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['WakeUpMonitor']['get_nextWakeUp']={syn:'Returns the next scheduled wake up date/time (UNIX format).',lib:'wakeupmonitor.get_nextWakeUp()',pro:'function get_nextWakeUp()',cmt:'

Returns the next scheduled wake up date/time (UNIX format).

',ret:'an integer corresponding to the next scheduled wake up date/time (UNIX format)',ext:'On failure, throws an exception or returns `Y_NEXTWAKEUP_INVALID`.'}; doc['WakeUpMonitor']['get_powerDuration']={syn:'Returns the maximal wake up time (in seconds) before automatically going to sleep.',lib:'wakeupmonitor.get_powerDuration()',pro:'function get_powerDuration()',cmt:'

Returns the maximal wake up time (in seconds) before automatically going to sleep.

',ret:'an integer corresponding to the maximal wake up time (in seconds) before automatically going to sleep',ext:'On failure, throws an exception or returns `Y_POWERDURATION_INVALID`.'}; doc['WakeUpMonitor']['get_sleepCountdown']={syn:'Returns the delay before the next sleep period.',lib:'wakeupmonitor.get_sleepCountdown()',pro:'function get_sleepCountdown()',cmt:'

Returns the delay before the next sleep period.

',ret:'an integer corresponding to the delay before the next sleep period',ext:'On failure, throws an exception or returns `Y_SLEEPCOUNTDOWN_INVALID`.'}; doc['WakeUpMonitor']['get_userData']={syn:'Returns the value of the userData attribute, as previously stored using method `set_userData`.',lib:'wakeupmonitor.get_userData()',pro:'function get_userData()',cmt:'

Returns the value of the userData attribute, as previously stored using method `set_userData`. This attribute is never touched directly by the API, and is at disposal of the caller to store a context.

',ret:'the object stored previously by the caller.'}; doc['WakeUpMonitor']['get_wakeUpReason']={syn:'Returns the latest wake up reason.',lib:'wakeupmonitor.get_wakeUpReason()',pro:'function get_wakeUpReason()',cmt:'

Returns the latest wake up reason.

',ret:'a value among `Y_WAKEUPREASON_USBPOWER`, `Y_WAKEUPREASON_EXTPOWER`, `Y_WAKEUPREASON_ENDOFSLEEP`, `Y_WAKEUPREASON_EXTSIG1`, `Y_WAKEUPREASON_SCHEDULE1` and `Y_WAKEUPREASON_SCHEDULE2` corresponding to the latest wake up reason',ext:'On failure, throws an exception or returns `Y_WAKEUPREASON_INVALID`.'}; doc['WakeUpMonitor']['get_wakeUpState']={syn:'Returns the current state of the monitor.',lib:'wakeupmonitor.get_wakeUpState()',pro:'function get_wakeUpState()',cmt:'

Returns the current state of the monitor.

',ret:'either `Y_WAKEUPSTATE_SLEEPING` or `Y_WAKEUPSTATE_AWAKE`, according to the current state of the monitor',ext:'On failure, throws an exception or returns `Y_WAKEUPSTATE_INVALID`.'}; doc['WakeUpMonitor']['isOnline']={syn:'Checks if the monitor is currently reachable, without raising any error.',lib:'wakeupmonitor.isOnline()',pro:'function isOnline()',cmt:'

Checks if the monitor is currently reachable, without raising any error. If there is a cached value for the monitor in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the monitor.

',ret:'`true` if the monitor can be reached, and `false` otherwise'}; doc['WakeUpMonitor']['isOnline_async']={syn:'Checks if the monitor is currently reachable, without raising any error (asynchronous version).',lib:'wakeupmonitor.isOnline_async()',pro:'function isOnline_async(callback, context)',cmt:'

Checks if the monitor is currently reachable, without raising any error (asynchronous version). If there is a cached value for the monitor in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the requested function.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the boolean result',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['WakeUpMonitor']['load']={syn:'Preloads the monitor cache with a specified validity duration.',lib:'wakeupmonitor.load()',pro:'function load(msValidity)',cmt:'

Preloads the monitor cache with a specified validity duration. By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network traffic for instance.

',par:{msValidity:'an integer corresponding to the validity attributed to the loaded function parameters, in milliseconds'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['WakeUpMonitor']['loadAttribute']={syn:'Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.',lib:'wakeupmonitor.loadAttribute()',pro:'function loadAttribute(attrName)',cmt:'

Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.

',par:{attrName:'the name of the requested attribute'},ret:'a string with the value of the the attribute',ext:'On failure, throws an exception or returns an empty string.'}; doc['WakeUpMonitor']['load_async']={syn:'Preloads the monitor cache with a specified validity duration (asynchronous version).',lib:'wakeupmonitor.load_async()',pro:'function load_async(msValidity, callback, context)',cmt:'

Preloads the monitor cache with a specified validity duration (asynchronous version). By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network trafic for instance.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{msValidity:'an integer corresponding to the validity of the loaded function parameters, in milliseconds',callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the error code (or `YAPI_SUCCESS`)',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['WakeUpMonitor']['muteValueCallbacks']={syn:'Disables the propagation of every new advertised value to the parent hub.',lib:'wakeupmonitor.muteValueCallbacks()',pro:'function muteValueCallbacks()',cmt:'

Disables the propagation of every new advertised value to the parent hub. You can use this function to save bandwidth and CPU on computers with limited resources, or to prevent unwanted invocations of the HTTP callback. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['WakeUpMonitor']['nextWakeUpMonitor']={syn:'Continues the enumeration of monitors started using `yFirstWakeUpMonitor()`.',lib:'wakeupmonitor.nextWakeUpMonitor()',pro:'function nextWakeUpMonitor()',cmt:'

Continues the enumeration of monitors started using `yFirstWakeUpMonitor()`.

',ret:'a pointer to a `YWakeUpMonitor` object, corresponding to a monitor currently online, or a `null` pointer if there are no more monitors to enumerate.'}; doc['WakeUpMonitor']['registerValueCallback']={syn:'Registers the callback function that is invoked on every change of advertised value.',lib:'wakeupmonitor.registerValueCallback()',pro:'function registerValueCallback(callback)',cmt:'

Registers the callback function that is invoked on every change of advertised value. The callback is invoked only during the execution of `ySleep` or `yHandleEvents`. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a null pointer as argument.

',par:{callback:'the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and the character string describing the new advertised value.'}}; doc['WakeUpMonitor']['resetSleepCountDown']={syn:'Resets the sleep countdown.',lib:'wakeupmonitor.resetSleepCountDown()',pro:'function resetSleepCountDown()',cmt:'

Resets the sleep countdown.

',ret:'`YAPI_SUCCESS` if the call succeeds. On failure, throws an exception or returns a negative error code.'}; doc['WakeUpMonitor']['set_logicalName']={syn:'Changes the logical name of the monitor.',lib:'wakeupmonitor.set_logicalName()',pro:'function set_logicalName(newval)',cmt:'

Changes the logical name of the monitor. You can use `yCheckLogicalName()` prior to this call to make sure that your parameter is valid. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',par:{newval:'a string corresponding to the logical name of the monitor.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['WakeUpMonitor']['set_nextWakeUp']={syn:'Changes the days of the week when a wake up must take place.',lib:'wakeupmonitor.set_nextWakeUp()',pro:'function set_nextWakeUp(newval)',cmt:'

Changes the days of the week when a wake up must take place.

',par:{newval:'an integer corresponding to the days of the week when a wake up must take place'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['WakeUpMonitor']['set_powerDuration']={syn:'Changes the maximal wake up time (seconds) before automatically going to sleep.',lib:'wakeupmonitor.set_powerDuration()',pro:'function set_powerDuration(newval)',cmt:'

Changes the maximal wake up time (seconds) before automatically going to sleep.

',par:{newval:'an integer corresponding to the maximal wake up time (seconds) before automatically going to sleep'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['WakeUpMonitor']['set_sleepCountdown']={syn:'Changes the delay before the next sleep period.',lib:'wakeupmonitor.set_sleepCountdown()',pro:'function set_sleepCountdown(newval)',cmt:'

Changes the delay before the next sleep period.

',par:{newval:'an integer corresponding to the delay before the next sleep period'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['WakeUpMonitor']['set_userData']={syn:'Stores a user context provided as argument in the userData attribute of the function.',lib:'wakeupmonitor.set_userData()',pro:'function set_userData(data)',cmt:'

Stores a user context provided as argument in the userData attribute of the function. This attribute is never touched by the API, and is at disposal of the caller to store a context.

',par:{data:'any kind of object to be stored'}}; doc['WakeUpMonitor']['sleep']={syn:'Goes to sleep until the next wake up condition is met, the RTC time must have been set before calling this function.',lib:'wakeupmonitor.sleep()',pro:'function sleep(secBeforeSleep)',cmt:'

Goes to sleep until the next wake up condition is met, the RTC time must have been set before calling this function.

',par:{secBeforeSleep:'number of seconds before going into sleep mode,'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['WakeUpMonitor']['sleepFor']={syn:'Goes to sleep for a specific duration or until the next wake up condition is met, the RTC time must have been set before calling this function.',lib:'wakeupmonitor.sleepFor()',pro:'function sleepFor(secUntilWakeUp, secBeforeSleep)',cmt:'

Goes to sleep for a specific duration or until the next wake up condition is met, the RTC time must have been set before calling this function. The count down before sleep can be canceled with resetSleepCountDown.

',par:{secUntilWakeUp:'number of seconds before next wake up',secBeforeSleep:'number of seconds before going into sleep mode'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['WakeUpMonitor']['sleepUntil']={syn:'Go to sleep until a specific date is reached or until the next wake up condition is met, the RTC time must have been set before calling this function.',lib:'wakeupmonitor.sleepUntil()',pro:'function sleepUntil(wakeUpTime, secBeforeSleep)',cmt:'

Go to sleep until a specific date is reached or until the next wake up condition is met, the RTC time must have been set before calling this function. The count down before sleep can be canceled with resetSleepCountDown.

',par:{wakeUpTime:'wake-up datetime (UNIX format)',secBeforeSleep:'number of seconds before going into sleep mode'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['WakeUpMonitor']['unmuteValueCallbacks']={syn:'Re-enables the propagation of every new advertised value to the parent hub.',lib:'wakeupmonitor.unmuteValueCallbacks()',pro:'function unmuteValueCallbacks()',cmt:'

Re-enables the propagation of every new advertised value to the parent hub. This function reverts the effect of a previous call to `muteValueCallbacks()`. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['WakeUpMonitor']['wait_async']={syn:'Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function.',lib:'wakeupmonitor.wait_async()',pro:'function wait_async(callback, context)',cmt:'

Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function. The callback function can therefore freely issue synchronous or asynchronous commands, without risking to block the Javascript VM.

',par:{callback:'callback function that is invoked when all pending commands on the module are completed. The callback function receives two arguments: the caller-specific context object and the receiving function object.',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing.'}; doc['WakeUpMonitor']['wakeUp']={syn:'Forces a wake up.',lib:'wakeupmonitor.wakeUp()',pro:'function wakeUp()',cmt:'

Forces a wake up.

'}; //--- (end of generated code: WakeUpMonitor) //--- (generated code: WakeUpSchedule) doc['WakeUpSchedule']={'':{syn:'WakeUpSchedule function interface',inc:'<script type='text/javascript' src='yocto_wakeupschedule.js'></script>',cmt:'

The WakeUpSchedule function implements a wake up condition. The wake up time is specified as a set of months and/or days and/or hours and/or minutes when the wake up should happen.

'}}; doc['WakeUpSchedule']['FindWakeUpSchedule']={syn:'Retrieves a wake up schedule for a given identifier.',lib:'YWakeUpSchedule.FindWakeUpSchedule()',pro:'function FindWakeUpSchedule(func)',cmt:'

Retrieves a wake up schedule for a given identifier. The identifier can be specified using several formats:

- FunctionLogicalName
- ModuleSerialNumber.FunctionIdentifier
- ModuleSerialNumber.FunctionLogicalName
- ModuleLogicalName.FunctionIdentifier
- ModuleLogicalName.FunctionLogicalName

This function does not require that the wake up schedule is online at the time it is invoked. The returned object is nevertheless valid. Use the method `YWakeUpSchedule.isOnline()` to test if the wake up schedule is indeed online at a given time. In case of ambiguity when looking for a wake up schedule by logical name, no error is notified: the first instance found is returned. The search is performed first by hardware name, then by logical name.

If a call to this object\x27s is_online() method returns FALSE although you are certain that the matching device is plugged, make sure that you did call registerHub() at application initialization time.

',par:{func:'a string that uniquely characterizes the wake up schedule'},ret:'a `YWakeUpSchedule` object allowing you to drive the wake up schedule.'}; doc['WakeUpSchedule']['FirstWakeUpSchedule']={syn:'Starts the enumeration of wake up schedules currently accessible.',lib:'YWakeUpSchedule.FirstWakeUpSchedule()',pro:'function FirstWakeUpSchedule()',cmt:'

Starts the enumeration of wake up schedules currently accessible. Use the method `YWakeUpSchedule.nextWakeUpSchedule()` to iterate on next wake up schedules.

',ret:'a pointer to a `YWakeUpSchedule` object, corresponding to the first wake up schedule currently online, or a `null` pointer if there are none.'}; doc['WakeUpSchedule']['clearCache']={syn:'Invalidates the cache.',lib:'wakeupschedule.clearCache()',pro:'function clearCache()',cmt:'

Invalidates the cache. Invalidates the cache of the wake up schedule attributes. Forces the next call to get_xxx() or loadxxx() to use values that come from the device.

'}; doc['WakeUpSchedule']['describe']={syn:'Returns a short text that describes unambiguously the instance of the wake up schedule in the form `TYPE(NAME)=SERIAL.FUNCTIONID`.',lib:'wakeupschedule.describe()',pro:'function describe()',cmt:'

Returns a short text that describes unambiguously the instance of the wake up schedule in the form `TYPE(NAME)=SERIAL.FUNCTIONID`. More precisely, `TYPE` is the type of the function, `NAME` it the name used for the first access to the function, `SERIAL` is the serial number of the module if the module is connected or `\x22unresolved\x22`, and `FUNCTIONID` is the hardware identifier of the function if the module is connected. For example, this method returns `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1` if the module is already connected or `Relay(BadCustomeName.relay1)=unresolved` if the module has not yet been connected. This method does not trigger any USB or TCP transaction and can therefore be used in a debugger.

',ret:'a string that describes the wake up schedule (ex: `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1`)'}; doc['WakeUpSchedule']['get_advertisedValue']={syn:'Returns the current value of the wake up schedule (no more than 6 characters).',lib:'wakeupschedule.get_advertisedValue()',pro:'function get_advertisedValue()',cmt:'

Returns the current value of the wake up schedule (no more than 6 characters).

',ret:'a string corresponding to the current value of the wake up schedule (no more than 6 characters).',ext:'On failure, throws an exception or returns `Y_ADVERTISEDVALUE_INVALID`.'}; doc['WakeUpSchedule']['get_errorMessage']={syn:'Returns the error message of the latest error with the wake up schedule.',lib:'wakeupschedule.get_errorMessage()',pro:'function get_errorMessage()',cmt:'

Returns the error message of the latest error with the wake up schedule. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a string corresponding to the latest error message that occured while using the wake up schedule object'}; doc['WakeUpSchedule']['get_errorType']={syn:'Returns the numerical error code of the latest error with the wake up schedule.',lib:'wakeupschedule.get_errorType()',pro:'function get_errorType()',cmt:'

Returns the numerical error code of the latest error with the wake up schedule. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a number corresponding to the code of the latest error that occurred while using the wake up schedule object'}; doc['WakeUpSchedule']['get_friendlyName']={syn:'Returns a global identifier of the wake up schedule in the format `MODULE_NAME.FUNCTION_NAME`.',lib:'wakeupschedule.get_friendlyName()',pro:'function get_friendlyName()',cmt:'

Returns a global identifier of the wake up schedule in the format `MODULE_NAME.FUNCTION_NAME`. The returned string uses the logical names of the module and of the wake up schedule if they are defined, otherwise the serial number of the module and the hardware identifier of the wake up schedule (for example: `MyCustomName.relay1`)

',ret:'a string that uniquely identifies the wake up schedule using logical names (ex: `MyCustomName.relay1`)',ext:'On failure, throws an exception or returns `Y_FRIENDLYNAME_INVALID`.'}; doc['WakeUpSchedule']['get_functionDescriptor']={syn:'Returns a unique identifier of type `YFUN_DESCR` corresponding to the function.',lib:'wakeupschedule.get_functionDescriptor()',pro:'function get_functionDescriptor()',cmt:'

Returns a unique identifier of type `YFUN_DESCR` corresponding to the function. This identifier can be used to test if two instances of `YFunction` reference the same physical function on the same physical device.

',ret:'an identifier of type `YFUN_DESCR`.',ext:'If the function has never been contacted, the returned value is `Y_FUNCTIONDESCRIPTOR_INVALID`.'}; doc['WakeUpSchedule']['get_functionId']={syn:'Returns the hardware identifier of the wake up schedule, without reference to the module.',lib:'wakeupschedule.get_functionId()',pro:'function get_functionId()',cmt:'

Returns the hardware identifier of the wake up schedule, without reference to the module. For example `relay1`

',ret:'a string that identifies the wake up schedule (ex: `relay1`)',ext:'On failure, throws an exception or returns `Y_FUNCTIONID_INVALID`.'}; doc['WakeUpSchedule']['get_hardwareId']={syn:'Returns the unique hardware identifier of the wake up schedule in the form `SERIAL.FUNCTIONID`.',lib:'wakeupschedule.get_hardwareId()',pro:'function get_hardwareId()',cmt:'

Returns the unique hardware identifier of the wake up schedule in the form `SERIAL.FUNCTIONID`. The unique hardware identifier is composed of the device serial number and of the hardware identifier of the wake up schedule (for example `RELAYLO1-123456.relay1`).

',ret:'a string that uniquely identifies the wake up schedule (ex: `RELAYLO1-123456.relay1`)',ext:'On failure, throws an exception or returns `Y_HARDWAREID_INVALID`.'}; doc['WakeUpSchedule']['get_hours']={syn:'Returns the hours scheduled for wake up.',lib:'wakeupschedule.get_hours()',pro:'function get_hours()',cmt:'

Returns the hours scheduled for wake up.

',ret:'an integer corresponding to the hours scheduled for wake up',ext:'On failure, throws an exception or returns `Y_HOURS_INVALID`.'}; doc['WakeUpSchedule']['get_logicalName']={syn:'Returns the logical name of the wake up schedule.',lib:'wakeupschedule.get_logicalName()',pro:'function get_logicalName()',cmt:'

Returns the logical name of the wake up schedule.

',ret:'a string corresponding to the logical name of the wake up schedule.',ext:'On failure, throws an exception or returns `Y_LOGICALNAME_INVALID`.'}; doc['WakeUpSchedule']['get_minutes']={syn:'Returns all the minutes of each hour that are scheduled for wake up.',lib:'wakeupschedule.get_minutes()',pro:'function get_minutes()',cmt:'

Returns all the minutes of each hour that are scheduled for wake up.

'}; doc['WakeUpSchedule']['get_minutesA']={syn:'Returns the minutes in the 00-29 interval of each hour scheduled for wake up.',lib:'wakeupschedule.get_minutesA()',pro:'function get_minutesA()',cmt:'

Returns the minutes in the 00-29 interval of each hour scheduled for wake up.

',ret:'an integer corresponding to the minutes in the 00-29 interval of each hour scheduled for wake up',ext:'On failure, throws an exception or returns `Y_MINUTESA_INVALID`.'}; doc['WakeUpSchedule']['get_minutesB']={syn:'Returns the minutes in the 30-59 intervalof each hour scheduled for wake up.',lib:'wakeupschedule.get_minutesB()',pro:'function get_minutesB()',cmt:'

Returns the minutes in the 30-59 intervalof each hour scheduled for wake up.

',ret:'an integer corresponding to the minutes in the 30-59 intervalof each hour scheduled for wake up',ext:'On failure, throws an exception or returns `Y_MINUTESB_INVALID`.'}; doc['WakeUpSchedule']['get_module']={syn:'Gets the `YModule` object for the device on which the function is located.',lib:'wakeupschedule.get_module()',pro:'function get_module()',cmt:'

Gets the `YModule` object for the device on which the function is located. If the function cannot be located on any module, the returned instance of `YModule` is not shown as on-line.

',ret:'an instance of `YModule`'}; doc['WakeUpSchedule']['get_module_async']={syn:'Gets the `YModule` object for the device on which the function is located (asynchronous version).',lib:'wakeupschedule.get_module_async()',pro:'function get_module_async(callback, context)',cmt:'

Gets the `YModule` object for the device on which the function is located (asynchronous version). If the function cannot be located on any module, the returned `YModule` object does not show as on-line.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking Firefox javascript VM that does not implement context switching during blocking I/O calls. See the documentation section on asynchronous Javascript calls for more details.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the requested `YModule` object',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['WakeUpSchedule']['get_monthDays']={syn:'Returns the days of the month scheduled for wake up.',lib:'wakeupschedule.get_monthDays()',pro:'function get_monthDays()',cmt:'

Returns the days of the month scheduled for wake up.

',ret:'an integer corresponding to the days of the month scheduled for wake up',ext:'On failure, throws an exception or returns `Y_MONTHDAYS_INVALID`.'}; doc['WakeUpSchedule']['get_months']={syn:'Returns the months scheduled for wake up.',lib:'wakeupschedule.get_months()',pro:'function get_months()',cmt:'

Returns the months scheduled for wake up.

',ret:'an integer corresponding to the months scheduled for wake up',ext:'On failure, throws an exception or returns `Y_MONTHS_INVALID`.'}; doc['WakeUpSchedule']['get_nextOccurence']={syn:'Returns the date/time (seconds) of the next wake up occurence.',lib:'wakeupschedule.get_nextOccurence()',pro:'function get_nextOccurence()',cmt:'

Returns the date/time (seconds) of the next wake up occurence.

',ret:'an integer corresponding to the date/time (seconds) of the next wake up occurence',ext:'On failure, throws an exception or returns `Y_NEXTOCCURENCE_INVALID`.'}; doc['WakeUpSchedule']['get_userData']={syn:'Returns the value of the userData attribute, as previously stored using method `set_userData`.',lib:'wakeupschedule.get_userData()',pro:'function get_userData()',cmt:'

Returns the value of the userData attribute, as previously stored using method `set_userData`. This attribute is never touched directly by the API, and is at disposal of the caller to store a context.

',ret:'the object stored previously by the caller.'}; doc['WakeUpSchedule']['get_weekDays']={syn:'Returns the days of the week scheduled for wake up.',lib:'wakeupschedule.get_weekDays()',pro:'function get_weekDays()',cmt:'

Returns the days of the week scheduled for wake up.

',ret:'an integer corresponding to the days of the week scheduled for wake up',ext:'On failure, throws an exception or returns `Y_WEEKDAYS_INVALID`.'}; doc['WakeUpSchedule']['isOnline']={syn:'Checks if the wake up schedule is currently reachable, without raising any error.',lib:'wakeupschedule.isOnline()',pro:'function isOnline()',cmt:'

Checks if the wake up schedule is currently reachable, without raising any error. If there is a cached value for the wake up schedule in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the wake up schedule.

',ret:'`true` if the wake up schedule can be reached, and `false` otherwise'}; doc['WakeUpSchedule']['isOnline_async']={syn:'Checks if the wake up schedule is currently reachable, without raising any error (asynchronous version).',lib:'wakeupschedule.isOnline_async()',pro:'function isOnline_async(callback, context)',cmt:'

Checks if the wake up schedule is currently reachable, without raising any error (asynchronous version). If there is a cached value for the wake up schedule in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the requested function.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the boolean result',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['WakeUpSchedule']['load']={syn:'Preloads the wake up schedule cache with a specified validity duration.',lib:'wakeupschedule.load()',pro:'function load(msValidity)',cmt:'

Preloads the wake up schedule cache with a specified validity duration. By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network traffic for instance.

',par:{msValidity:'an integer corresponding to the validity attributed to the loaded function parameters, in milliseconds'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['WakeUpSchedule']['loadAttribute']={syn:'Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.',lib:'wakeupschedule.loadAttribute()',pro:'function loadAttribute(attrName)',cmt:'

Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.

',par:{attrName:'the name of the requested attribute'},ret:'a string with the value of the the attribute',ext:'On failure, throws an exception or returns an empty string.'}; doc['WakeUpSchedule']['load_async']={syn:'Preloads the wake up schedule cache with a specified validity duration (asynchronous version).',lib:'wakeupschedule.load_async()',pro:'function load_async(msValidity, callback, context)',cmt:'

Preloads the wake up schedule cache with a specified validity duration (asynchronous version). By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network trafic for instance.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{msValidity:'an integer corresponding to the validity of the loaded function parameters, in milliseconds',callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the error code (or `YAPI_SUCCESS`)',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['WakeUpSchedule']['muteValueCallbacks']={syn:'Disables the propagation of every new advertised value to the parent hub.',lib:'wakeupschedule.muteValueCallbacks()',pro:'function muteValueCallbacks()',cmt:'

Disables the propagation of every new advertised value to the parent hub. You can use this function to save bandwidth and CPU on computers with limited resources, or to prevent unwanted invocations of the HTTP callback. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['WakeUpSchedule']['nextWakeUpSchedule']={syn:'Continues the enumeration of wake up schedules started using `yFirstWakeUpSchedule()`.',lib:'wakeupschedule.nextWakeUpSchedule()',pro:'function nextWakeUpSchedule()',cmt:'

Continues the enumeration of wake up schedules started using `yFirstWakeUpSchedule()`.

',ret:'a pointer to a `YWakeUpSchedule` object, corresponding to a wake up schedule currently online, or a `null` pointer if there are no more wake up schedules to enumerate.'}; doc['WakeUpSchedule']['registerValueCallback']={syn:'Registers the callback function that is invoked on every change of advertised value.',lib:'wakeupschedule.registerValueCallback()',pro:'function registerValueCallback(callback)',cmt:'

Registers the callback function that is invoked on every change of advertised value. The callback is invoked only during the execution of `ySleep` or `yHandleEvents`. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a null pointer as argument.

',par:{callback:'the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and the character string describing the new advertised value.'}}; doc['WakeUpSchedule']['set_hours']={syn:'Changes the hours when a wake up must take place.',lib:'wakeupschedule.set_hours()',pro:'function set_hours(newval)',cmt:'

Changes the hours when a wake up must take place.

',par:{newval:'an integer corresponding to the hours when a wake up must take place'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['WakeUpSchedule']['set_logicalName']={syn:'Changes the logical name of the wake up schedule.',lib:'wakeupschedule.set_logicalName()',pro:'function set_logicalName(newval)',cmt:'

Changes the logical name of the wake up schedule. You can use `yCheckLogicalName()` prior to this call to make sure that your parameter is valid. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',par:{newval:'a string corresponding to the logical name of the wake up schedule.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['WakeUpSchedule']['set_minutes']={syn:'Changes all the minutes where a wake up must take place.',lib:'wakeupschedule.set_minutes()',pro:'function set_minutes(bitmap)',cmt:'

Changes all the minutes where a wake up must take place.

',par:{bitmap:'Minutes 00-59 of each hour scheduled for wake up.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['WakeUpSchedule']['set_minutesA']={syn:'Changes the minutes in the 00-29 interval when a wake up must take place.',lib:'wakeupschedule.set_minutesA()',pro:'function set_minutesA(newval)',cmt:'

Changes the minutes in the 00-29 interval when a wake up must take place.

',par:{newval:'an integer corresponding to the minutes in the 00-29 interval when a wake up must take place'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['WakeUpSchedule']['set_minutesB']={syn:'Changes the minutes in the 30-59 interval when a wake up must take place.',lib:'wakeupschedule.set_minutesB()',pro:'function set_minutesB(newval)',cmt:'

Changes the minutes in the 30-59 interval when a wake up must take place.

',par:{newval:'an integer corresponding to the minutes in the 30-59 interval when a wake up must take place'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['WakeUpSchedule']['set_monthDays']={syn:'Changes the days of the month when a wake up must take place.',lib:'wakeupschedule.set_monthDays()',pro:'function set_monthDays(newval)',cmt:'

Changes the days of the month when a wake up must take place.

',par:{newval:'an integer corresponding to the days of the month when a wake up must take place'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['WakeUpSchedule']['set_months']={syn:'Changes the months when a wake up must take place.',lib:'wakeupschedule.set_months()',pro:'function set_months(newval)',cmt:'

Changes the months when a wake up must take place.

',par:{newval:'an integer corresponding to the months when a wake up must take place'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['WakeUpSchedule']['set_userData']={syn:'Stores a user context provided as argument in the userData attribute of the function.',lib:'wakeupschedule.set_userData()',pro:'function set_userData(data)',cmt:'

Stores a user context provided as argument in the userData attribute of the function. This attribute is never touched by the API, and is at disposal of the caller to store a context.

',par:{data:'any kind of object to be stored'}}; doc['WakeUpSchedule']['set_weekDays']={syn:'Changes the days of the week when a wake up must take place.',lib:'wakeupschedule.set_weekDays()',pro:'function set_weekDays(newval)',cmt:'

Changes the days of the week when a wake up must take place.

',par:{newval:'an integer corresponding to the days of the week when a wake up must take place'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['WakeUpSchedule']['unmuteValueCallbacks']={syn:'Re-enables the propagation of every new advertised value to the parent hub.',lib:'wakeupschedule.unmuteValueCallbacks()',pro:'function unmuteValueCallbacks()',cmt:'

Re-enables the propagation of every new advertised value to the parent hub. This function reverts the effect of a previous call to `muteValueCallbacks()`. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['WakeUpSchedule']['wait_async']={syn:'Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function.',lib:'wakeupschedule.wait_async()',pro:'function wait_async(callback, context)',cmt:'

Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function. The callback function can therefore freely issue synchronous or asynchronous commands, without risking to block the Javascript VM.

',par:{callback:'callback function that is invoked when all pending commands on the module are completed. The callback function receives two arguments: the caller-specific context object and the receiving function object.',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing.'}; //--- (end of generated code: WakeUpSchedule) //--- (generated code: GenericSensor) doc['GenericSensor']={'':{syn:'GenericSensor function interface',inc:'<script type='text/javascript' src='yocto_genericsensor.js'></script>',cmt:'

The YGenericSensor class allows you to read and configure Yoctopuce signal transducers. It inherits from YSensor class the core functions to read measurements, to register callback functions, to access the autonomous datalogger. This class adds the ability to configure the automatic conversion between the measured signal and the corresponding engineering unit.

'}}; doc['GenericSensor']['FindGenericSensor']={syn:'Retrieves a generic sensor for a given identifier.',lib:'YGenericSensor.FindGenericSensor()',pro:'function FindGenericSensor(func)',cmt:'

Retrieves a generic sensor for a given identifier. The identifier can be specified using several formats:

- FunctionLogicalName
- ModuleSerialNumber.FunctionIdentifier
- ModuleSerialNumber.FunctionLogicalName
- ModuleLogicalName.FunctionIdentifier
- ModuleLogicalName.FunctionLogicalName

This function does not require that the generic sensor is online at the time it is invoked. The returned object is nevertheless valid. Use the method `YGenericSensor.isOnline()` to test if the generic sensor is indeed online at a given time. In case of ambiguity when looking for a generic sensor by logical name, no error is notified: the first instance found is returned. The search is performed first by hardware name, then by logical name.

If a call to this object\x27s is_online() method returns FALSE although you are certain that the matching device is plugged, make sure that you did call registerHub() at application initialization time.

',par:{func:'a string that uniquely characterizes the generic sensor'},ret:'a `YGenericSensor` object allowing you to drive the generic sensor.'}; doc['GenericSensor']['FirstGenericSensor']={syn:'Starts the enumeration of generic sensors currently accessible.',lib:'YGenericSensor.FirstGenericSensor()',pro:'function FirstGenericSensor()',cmt:'

Starts the enumeration of generic sensors currently accessible. Use the method `YGenericSensor.nextGenericSensor()` to iterate on next generic sensors.

',ret:'a pointer to a `YGenericSensor` object, corresponding to the first generic sensor currently online, or a `null` pointer if there are none.'}; doc['GenericSensor']['calibrateFromPoints']={syn:'Configures error correction data points, in particular to compensate for a possible perturbation of the measure caused by an enclosure.',lib:'genericsensor.calibrateFromPoints()',pro:'function calibrateFromPoints(rawValues, refValues)',cmt:'

Configures error correction data points, in particular to compensate for a possible perturbation of the measure caused by an enclosure. It is possible to configure up to five correction points. Correction points must be provided in ascending order, and be in the range of the sensor. The device will automatically perform a linear interpolation of the error correction between specified points. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

For more information on advanced capabilities to refine the calibration of sensors, please contact support@yoctopuce.com.

',par:{rawValues:'array of floating point numbers, corresponding to the raw values returned by the sensor for the correction points.',refValues:'array of floating point numbers, corresponding to the corrected values for the correction points.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['GenericSensor']['clearCache']={syn:'Invalidates the cache.',lib:'genericsensor.clearCache()',pro:'function clearCache()',cmt:'

Invalidates the cache. Invalidates the cache of the generic sensor attributes. Forces the next call to get_xxx() or loadxxx() to use values that come from the device.

'}; doc['GenericSensor']['describe']={syn:'Returns a short text that describes unambiguously the instance of the generic sensor in the form `TYPE(NAME)=SERIAL.FUNCTIONID`.',lib:'genericsensor.describe()',pro:'function describe()',cmt:'

Returns a short text that describes unambiguously the instance of the generic sensor in the form `TYPE(NAME)=SERIAL.FUNCTIONID`. More precisely, `TYPE` is the type of the function, `NAME` it the name used for the first access to the function, `SERIAL` is the serial number of the module if the module is connected or `\x22unresolved\x22`, and `FUNCTIONID` is the hardware identifier of the function if the module is connected. For example, this method returns `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1` if the module is already connected or `Relay(BadCustomeName.relay1)=unresolved` if the module has not yet been connected. This method does not trigger any USB or TCP transaction and can therefore be used in a debugger.

',ret:'a string that describes the generic sensor (ex: `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1`)'}; doc['GenericSensor']['get_advMode']={syn:'Returns the measuring mode used for the advertised value pushed to the parent hub.',lib:'genericsensor.get_advMode()',pro:'function get_advMode()',cmt:'

Returns the measuring mode used for the advertised value pushed to the parent hub.

',ret:'a value among `Y_ADVMODE_IMMEDIATE`, `Y_ADVMODE_PERIOD_AVG`, `Y_ADVMODE_PERIOD_MIN` and `Y_ADVMODE_PERIOD_MAX` corresponding to the measuring mode used for the advertised value pushed to the parent hub',ext:'On failure, throws an exception or returns `Y_ADVMODE_INVALID`.'}; doc['GenericSensor']['get_advertisedValue']={syn:'Returns the current value of the generic sensor (no more than 6 characters).',lib:'genericsensor.get_advertisedValue()',pro:'function get_advertisedValue()',cmt:'

Returns the current value of the generic sensor (no more than 6 characters).

',ret:'a string corresponding to the current value of the generic sensor (no more than 6 characters).',ext:'On failure, throws an exception or returns `Y_ADVERTISEDVALUE_INVALID`.'}; doc['GenericSensor']['get_currentRawValue']={syn:'Returns the uncalibrated, unrounded raw value returned by the sensor.',lib:'genericsensor.get_currentRawValue()',pro:'function get_currentRawValue()',cmt:'

Returns the uncalibrated, unrounded raw value returned by the sensor.

',ret:'a floating point number corresponding to the uncalibrated, unrounded raw value returned by the sensor',ext:'On failure, throws an exception or returns `Y_CURRENTRAWVALUE_INVALID`.'}; doc['GenericSensor']['get_currentValue']={syn:'Returns the current measured value.',lib:'genericsensor.get_currentValue()',pro:'function get_currentValue()',cmt:'

Returns the current measured value.

',ret:'a floating point number corresponding to the current measured value',ext:'On failure, throws an exception or returns `Y_CURRENTVALUE_INVALID`.'}; doc['GenericSensor']['get_dataLogger']={syn:'Returns the YDatalogger object of the device hosting the sensor.',lib:'genericsensor.get_dataLogger()',pro:'function get_dataLogger()',cmt:'

Returns the YDatalogger object of the device hosting the sensor. This method returns an object of class YDatalogger that can control global parameters of the data logger. The returned object should not be freed.

',ret:'an YDataLogger object or null on error.'}; doc['GenericSensor']['get_errorMessage']={syn:'Returns the error message of the latest error with the generic sensor.',lib:'genericsensor.get_errorMessage()',pro:'function get_errorMessage()',cmt:'

Returns the error message of the latest error with the generic sensor. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a string corresponding to the latest error message that occured while using the generic sensor object'}; doc['GenericSensor']['get_errorType']={syn:'Returns the numerical error code of the latest error with the generic sensor.',lib:'genericsensor.get_errorType()',pro:'function get_errorType()',cmt:'

Returns the numerical error code of the latest error with the generic sensor. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a number corresponding to the code of the latest error that occurred while using the generic sensor object'}; doc['GenericSensor']['get_friendlyName']={syn:'Returns a global identifier of the generic sensor in the format `MODULE_NAME.FUNCTION_NAME`.',lib:'genericsensor.get_friendlyName()',pro:'function get_friendlyName()',cmt:'

Returns a global identifier of the generic sensor in the format `MODULE_NAME.FUNCTION_NAME`. The returned string uses the logical names of the module and of the generic sensor if they are defined, otherwise the serial number of the module and the hardware identifier of the generic sensor (for example: `MyCustomName.relay1`)

',ret:'a string that uniquely identifies the generic sensor using logical names (ex: `MyCustomName.relay1`)',ext:'On failure, throws an exception or returns `Y_FRIENDLYNAME_INVALID`.'}; doc['GenericSensor']['get_functionDescriptor']={syn:'Returns a unique identifier of type `YFUN_DESCR` corresponding to the function.',lib:'genericsensor.get_functionDescriptor()',pro:'function get_functionDescriptor()',cmt:'

Returns a unique identifier of type `YFUN_DESCR` corresponding to the function. This identifier can be used to test if two instances of `YFunction` reference the same physical function on the same physical device.

',ret:'an identifier of type `YFUN_DESCR`.',ext:'If the function has never been contacted, the returned value is `Y_FUNCTIONDESCRIPTOR_INVALID`.'}; doc['GenericSensor']['get_functionId']={syn:'Returns the hardware identifier of the generic sensor, without reference to the module.',lib:'genericsensor.get_functionId()',pro:'function get_functionId()',cmt:'

Returns the hardware identifier of the generic sensor, without reference to the module. For example `relay1`

',ret:'a string that identifies the generic sensor (ex: `relay1`)',ext:'On failure, throws an exception or returns `Y_FUNCTIONID_INVALID`.'}; doc['GenericSensor']['get_hardwareId']={syn:'Returns the unique hardware identifier of the generic sensor in the form `SERIAL.FUNCTIONID`.',lib:'genericsensor.get_hardwareId()',pro:'function get_hardwareId()',cmt:'

Returns the unique hardware identifier of the generic sensor in the form `SERIAL.FUNCTIONID`. The unique hardware identifier is composed of the device serial number and of the hardware identifier of the generic sensor (for example `RELAYLO1-123456.relay1`).

',ret:'a string that uniquely identifies the generic sensor (ex: `RELAYLO1-123456.relay1`)',ext:'On failure, throws an exception or returns `Y_HARDWAREID_INVALID`.'}; doc['GenericSensor']['get_highestValue']={syn:'Returns the maximal value observed for the measure since the device was started.',lib:'genericsensor.get_highestValue()',pro:'function get_highestValue()',cmt:'

Returns the maximal value observed for the measure since the device was started. Can be reset to an arbitrary value thanks to set_highestValue().

',ret:'a floating point number corresponding to the maximal value observed for the measure since the device was started',ext:'On failure, throws an exception or returns `Y_HIGHESTVALUE_INVALID`.'}; doc['GenericSensor']['get_logFrequency']={syn:'Returns the datalogger recording frequency for this function, or \x22OFF\x22 when measures are not stored in the data logger flash memory.',lib:'genericsensor.get_logFrequency()',pro:'function get_logFrequency()',cmt:'

Returns the datalogger recording frequency for this function, or \x22OFF\x22 when measures are not stored in the data logger flash memory.

',ret:'a string corresponding to the datalogger recording frequency for this function, or \x22OFF\x22 when measures are not stored in the data logger flash memory',ext:'On failure, throws an exception or returns `Y_LOGFREQUENCY_INVALID`.'}; doc['GenericSensor']['get_logicalName']={syn:'Returns the logical name of the generic sensor.',lib:'genericsensor.get_logicalName()',pro:'function get_logicalName()',cmt:'

Returns the logical name of the generic sensor.

',ret:'a string corresponding to the logical name of the generic sensor.',ext:'On failure, throws an exception or returns `Y_LOGICALNAME_INVALID`.'}; doc['GenericSensor']['get_lowestValue']={syn:'Returns the minimal value observed for the measure since the device was started.',lib:'genericsensor.get_lowestValue()',pro:'function get_lowestValue()',cmt:'

Returns the minimal value observed for the measure since the device was started. Can be reset to an arbitrary value thanks to set_lowestValue().

',ret:'a floating point number corresponding to the minimal value observed for the measure since the device was started',ext:'On failure, throws an exception or returns `Y_LOWESTVALUE_INVALID`.'}; doc['GenericSensor']['get_module']={syn:'Gets the `YModule` object for the device on which the function is located.',lib:'genericsensor.get_module()',pro:'function get_module()',cmt:'

Gets the `YModule` object for the device on which the function is located. If the function cannot be located on any module, the returned instance of `YModule` is not shown as on-line.

',ret:'an instance of `YModule`'}; doc['GenericSensor']['get_module_async']={syn:'Gets the `YModule` object for the device on which the function is located (asynchronous version).',lib:'genericsensor.get_module_async()',pro:'function get_module_async(callback, context)',cmt:'

Gets the `YModule` object for the device on which the function is located (asynchronous version). If the function cannot be located on any module, the returned `YModule` object does not show as on-line.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking Firefox javascript VM that does not implement context switching during blocking I/O calls. See the documentation section on asynchronous Javascript calls for more details.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the requested `YModule` object',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['GenericSensor']['get_recordedData']={syn:'Retrieves a DataSet object holding historical data for this sensor, for a specified time interval.',lib:'genericsensor.get_recordedData()',pro:'function get_recordedData(startTime, endTime)',cmt:'

Retrieves a DataSet object holding historical data for this sensor, for a specified time interval. The measures will be retrieved from the data logger, which must have been turned on at the desired time. See the documentation of the DataSet class for information on how to get an overview of the recorded data, and how to load progressively a large set of measures from the data logger.

This function only works if the device uses a recent firmware, as DataSet objects are not supported by firmwares older than version 13000.

',par:{startTime:'the start of the desired measure time interval, as a Unix timestamp, i.e. the number of seconds since January 1, 1970 UTC. The special value 0 can be used to include any meaasure, without initial limit.',endTime:'the end of the desired measure time interval, as a Unix timestamp, i.e. the number of seconds since January 1, 1970 UTC. The special value 0 can be used to include any meaasure, without ending limit.'},ret:'an instance of YDataSet, providing access to historical data. Past measures can be loaded progressively using methods from the YDataSet object.'}; doc['GenericSensor']['get_reportFrequency']={syn:'Returns the timed value notification frequency, or \x22OFF\x22 if timed value notifications are disabled for this function.',lib:'genericsensor.get_reportFrequency()',pro:'function get_reportFrequency()',cmt:'

Returns the timed value notification frequency, or \x22OFF\x22 if timed value notifications are disabled for this function.

',ret:'a string corresponding to the timed value notification frequency, or \x22OFF\x22 if timed value notifications are disabled for this function',ext:'On failure, throws an exception or returns `Y_REPORTFREQUENCY_INVALID`.'}; doc['GenericSensor']['get_resolution']={syn:'Returns the resolution of the measured values.',lib:'genericsensor.get_resolution()',pro:'function get_resolution()',cmt:'

Returns the resolution of the measured values. The resolution corresponds to the numerical precision of the measures, which is not always the same as the actual precision of the sensor.

',ret:'a floating point number corresponding to the resolution of the measured values',ext:'On failure, throws an exception or returns `Y_RESOLUTION_INVALID`.'}; doc['GenericSensor']['get_sensorState']={syn:'Returns the sensor health state code, which is zero when there is an up-to-date measure available or a positive code if the sensor is not able to provide a measure right now.',lib:'genericsensor.get_sensorState()',pro:'function get_sensorState()',cmt:'

Returns the sensor health state code, which is zero when there is an up-to-date measure available or a positive code if the sensor is not able to provide a measure right now.

',ret:'an integer corresponding to the sensor health state code, which is zero when there is an up-to-date measure available or a positive code if the sensor is not able to provide a measure right now',ext:'On failure, throws an exception or returns `Y_SENSORSTATE_INVALID`.'}; doc['GenericSensor']['get_signalBias']={syn:'Returns the electric signal bias for zero shift adjustment.',lib:'genericsensor.get_signalBias()',pro:'function get_signalBias()',cmt:'

Returns the electric signal bias for zero shift adjustment. A positive bias means that the signal is over-reporting the measure, while a negative bias means that the signal is underreporting the measure.

',ret:'a floating point number corresponding to the electric signal bias for zero shift adjustment',ext:'On failure, throws an exception or returns `Y_SIGNALBIAS_INVALID`.'}; doc['GenericSensor']['get_signalRange']={syn:'Returns the electric signal range used by the sensor.',lib:'genericsensor.get_signalRange()',pro:'function get_signalRange()',cmt:'

Returns the electric signal range used by the sensor.

',ret:'a string corresponding to the electric signal range used by the sensor',ext:'On failure, throws an exception or returns `Y_SIGNALRANGE_INVALID`.'}; doc['GenericSensor']['get_signalSampling']={syn:'Returns the electric signal sampling method to use.',lib:'genericsensor.get_signalSampling()',pro:'function get_signalSampling()',cmt:'

Returns the electric signal sampling method to use. The `HIGH_RATE` method uses the highest sampling frequency, without any filtering. The `HIGH_RATE_FILTERED` method adds a windowed 7-sample median filter. The `LOW_NOISE` method uses a reduced acquisition frequency to reduce noise. The `LOW_NOISE_FILTERED` method combines a reduced frequency with the median filter to get measures as stable as possible when working on a noisy signal.

',ret:'a value among `Y_SIGNALSAMPLING_HIGH_RATE`, `Y_SIGNALSAMPLING_HIGH_RATE_FILTERED`, `Y_SIGNALSAMPLING_LOW_NOISE` and `Y_SIGNALSAMPLING_LOW_NOISE_FILTERED` corresponding to the electric signal sampling method to use',ext:'On failure, throws an exception or returns `Y_SIGNALSAMPLING_INVALID`.'}; doc['GenericSensor']['get_signalUnit']={syn:'Returns the measuring unit of the electrical signal used by the sensor.',lib:'genericsensor.get_signalUnit()',pro:'function get_signalUnit()',cmt:'

Returns the measuring unit of the electrical signal used by the sensor.

',ret:'a string corresponding to the measuring unit of the electrical signal used by the sensor',ext:'On failure, throws an exception or returns `Y_SIGNALUNIT_INVALID`.'}; doc['GenericSensor']['get_signalValue']={syn:'Returns the current value of the electrical signal measured by the sensor.',lib:'genericsensor.get_signalValue()',pro:'function get_signalValue()',cmt:'

Returns the current value of the electrical signal measured by the sensor.

',ret:'a floating point number corresponding to the current value of the electrical signal measured by the sensor',ext:'On failure, throws an exception or returns `Y_SIGNALVALUE_INVALID`.'}; doc['GenericSensor']['get_unit']={syn:'Returns the measuring unit for the measure.',lib:'genericsensor.get_unit()',pro:'function get_unit()',cmt:'

Returns the measuring unit for the measure.

',ret:'a string corresponding to the measuring unit for the measure',ext:'On failure, throws an exception or returns `Y_UNIT_INVALID`.'}; doc['GenericSensor']['get_userData']={syn:'Returns the value of the userData attribute, as previously stored using method `set_userData`.',lib:'genericsensor.get_userData()',pro:'function get_userData()',cmt:'

Returns the value of the userData attribute, as previously stored using method `set_userData`. This attribute is never touched directly by the API, and is at disposal of the caller to store a context.

',ret:'the object stored previously by the caller.'}; doc['GenericSensor']['get_valueRange']={syn:'Returns the physical value range measured by the sensor.',lib:'genericsensor.get_valueRange()',pro:'function get_valueRange()',cmt:'

Returns the physical value range measured by the sensor.

',ret:'a string corresponding to the physical value range measured by the sensor',ext:'On failure, throws an exception or returns `Y_VALUERANGE_INVALID`.'}; doc['GenericSensor']['isOnline']={syn:'Checks if the generic sensor is currently reachable, without raising any error.',lib:'genericsensor.isOnline()',pro:'function isOnline()',cmt:'

Checks if the generic sensor is currently reachable, without raising any error. If there is a cached value for the generic sensor in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the generic sensor.

',ret:'`true` if the generic sensor can be reached, and `false` otherwise'}; doc['GenericSensor']['isOnline_async']={syn:'Checks if the generic sensor is currently reachable, without raising any error (asynchronous version).',lib:'genericsensor.isOnline_async()',pro:'function isOnline_async(callback, context)',cmt:'

Checks if the generic sensor is currently reachable, without raising any error (asynchronous version). If there is a cached value for the generic sensor in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the requested function.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the boolean result',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['GenericSensor']['load']={syn:'Preloads the generic sensor cache with a specified validity duration.',lib:'genericsensor.load()',pro:'function load(msValidity)',cmt:'

Preloads the generic sensor cache with a specified validity duration. By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network traffic for instance.

',par:{msValidity:'an integer corresponding to the validity attributed to the loaded function parameters, in milliseconds'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['GenericSensor']['loadAttribute']={syn:'Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.',lib:'genericsensor.loadAttribute()',pro:'function loadAttribute(attrName)',cmt:'

Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.

',par:{attrName:'the name of the requested attribute'},ret:'a string with the value of the the attribute',ext:'On failure, throws an exception or returns an empty string.'}; doc['GenericSensor']['loadCalibrationPoints']={syn:'Retrieves error correction data points previously entered using the method `calibrateFromPoints`.',lib:'genericsensor.loadCalibrationPoints()',pro:'function loadCalibrationPoints(rawValues, refValues)',cmt:'

Retrieves error correction data points previously entered using the method `calibrateFromPoints`.

',par:{rawValues:'array of floating point numbers, that will be filled by the function with the raw sensor values for the correction points.',refValues:'array of floating point numbers, that will be filled by the function with the desired values for the correction points.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['GenericSensor']['load_async']={syn:'Preloads the generic sensor cache with a specified validity duration (asynchronous version).',lib:'genericsensor.load_async()',pro:'function load_async(msValidity, callback, context)',cmt:'

Preloads the generic sensor cache with a specified validity duration (asynchronous version). By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network trafic for instance.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{msValidity:'an integer corresponding to the validity of the loaded function parameters, in milliseconds',callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the error code (or `YAPI_SUCCESS`)',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['GenericSensor']['muteValueCallbacks']={syn:'Disables the propagation of every new advertised value to the parent hub.',lib:'genericsensor.muteValueCallbacks()',pro:'function muteValueCallbacks()',cmt:'

Disables the propagation of every new advertised value to the parent hub. You can use this function to save bandwidth and CPU on computers with limited resources, or to prevent unwanted invocations of the HTTP callback. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['GenericSensor']['nextGenericSensor']={syn:'Continues the enumeration of generic sensors started using `yFirstGenericSensor()`.',lib:'genericsensor.nextGenericSensor()',pro:'function nextGenericSensor()',cmt:'

Continues the enumeration of generic sensors started using `yFirstGenericSensor()`.

',ret:'a pointer to a `YGenericSensor` object, corresponding to a generic sensor currently online, or a `null` pointer if there are no more generic sensors to enumerate.'}; doc['GenericSensor']['registerTimedReportCallback']={syn:'Registers the callback function that is invoked on every periodic timed notification.',lib:'genericsensor.registerTimedReportCallback()',pro:'function registerTimedReportCallback(callback)',cmt:'

Registers the callback function that is invoked on every periodic timed notification. The callback is invoked only during the execution of `ySleep` or `yHandleEvents`. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a null pointer as argument.

',par:{callback:'the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and an YMeasure object describing the new advertised value.'}}; doc['GenericSensor']['registerValueCallback']={syn:'Registers the callback function that is invoked on every change of advertised value.',lib:'genericsensor.registerValueCallback()',pro:'function registerValueCallback(callback)',cmt:'

Registers the callback function that is invoked on every change of advertised value. The callback is invoked only during the execution of `ySleep` or `yHandleEvents`. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a null pointer as argument.

',par:{callback:'the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and the character string describing the new advertised value.'}}; doc['GenericSensor']['set_advMode']={syn:'Changes the measuring mode used for the advertised value pushed to the parent hub.',lib:'genericsensor.set_advMode()',pro:'function set_advMode(newval)',cmt:'

Changes the measuring mode used for the advertised value pushed to the parent hub.

',par:{newval:'a value among `Y_ADVMODE_IMMEDIATE`, `Y_ADVMODE_PERIOD_AVG`, `Y_ADVMODE_PERIOD_MIN` and `Y_ADVMODE_PERIOD_MAX` corresponding to the measuring mode used for the advertised value pushed to the parent hub'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['GenericSensor']['set_highestValue']={syn:'Changes the recorded maximal value observed.',lib:'genericsensor.set_highestValue()',pro:'function set_highestValue(newval)',cmt:'

Changes the recorded maximal value observed. Can be used to reset the value returned by get_lowestValue().

',par:{newval:'a floating point number corresponding to the recorded maximal value observed'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['GenericSensor']['set_logFrequency']={syn:'Changes the datalogger recording frequency for this function.',lib:'genericsensor.set_logFrequency()',pro:'function set_logFrequency(newval)',cmt:'

Changes the datalogger recording frequency for this function. The frequency can be specified as samples per second, as sample per minute (for instance \x2215/m\x22) or in samples per hour (eg. \x224/h\x22). To disable recording for this function, use the value \x22OFF\x22.

',par:{newval:'a string corresponding to the datalogger recording frequency for this function'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['GenericSensor']['set_logicalName']={syn:'Changes the logical name of the generic sensor.',lib:'genericsensor.set_logicalName()',pro:'function set_logicalName(newval)',cmt:'

Changes the logical name of the generic sensor. You can use `yCheckLogicalName()` prior to this call to make sure that your parameter is valid. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',par:{newval:'a string corresponding to the logical name of the generic sensor.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['GenericSensor']['set_lowestValue']={syn:'Changes the recorded minimal value observed.',lib:'genericsensor.set_lowestValue()',pro:'function set_lowestValue(newval)',cmt:'

Changes the recorded minimal value observed. Can be used to reset the value returned by get_lowestValue().

',par:{newval:'a floating point number corresponding to the recorded minimal value observed'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['GenericSensor']['set_reportFrequency']={syn:'Changes the timed value notification frequency for this function.',lib:'genericsensor.set_reportFrequency()',pro:'function set_reportFrequency(newval)',cmt:'

Changes the timed value notification frequency for this function. The frequency can be specified as samples per second, as sample per minute (for instance \x2215/m\x22) or in samples per hour (eg. \x224/h\x22). To disable timed value notifications for this function, use the value \x22OFF\x22.

',par:{newval:'a string corresponding to the timed value notification frequency for this function'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['GenericSensor']['set_resolution']={syn:'Changes the resolution of the measured physical values.',lib:'genericsensor.set_resolution()',pro:'function set_resolution(newval)',cmt:'

Changes the resolution of the measured physical values. The resolution corresponds to the numerical precision when displaying value. It does not change the precision of the measure itself.

',par:{newval:'a floating point number corresponding to the resolution of the measured physical values'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['GenericSensor']['set_signalBias']={syn:'Changes the electric signal bias for zero shift adjustment.',lib:'genericsensor.set_signalBias()',pro:'function set_signalBias(newval)',cmt:'

Changes the electric signal bias for zero shift adjustment. If your electric signal reads positif when it should be zero, setup a positive signalBias of the same value to fix the zero shift.

',par:{newval:'a floating point number corresponding to the electric signal bias for zero shift adjustment'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['GenericSensor']['set_signalRange']={syn:'Changes the electric signal range used by the sensor.',lib:'genericsensor.set_signalRange()',pro:'function set_signalRange(newval)',cmt:'

Changes the electric signal range used by the sensor. Default value is \x22-999999.999...999999.999\x22.

',par:{newval:'a string corresponding to the electric signal range used by the sensor'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['GenericSensor']['set_signalSampling']={syn:'Changes the electric signal sampling method to use.',lib:'genericsensor.set_signalSampling()',pro:'function set_signalSampling(newval)',cmt:'

Changes the electric signal sampling method to use. The `HIGH_RATE` method uses the highest sampling frequency, without any filtering. The `HIGH_RATE_FILTERED` method adds a windowed 7-sample median filter. The `LOW_NOISE` method uses a reduced acquisition frequency to reduce noise. The `LOW_NOISE_FILTERED` method combines a reduced frequency with the median filter to get measures as stable as possible when working on a noisy signal.

',par:{newval:'a value among `Y_SIGNALSAMPLING_HIGH_RATE`, `Y_SIGNALSAMPLING_HIGH_RATE_FILTERED`, `Y_SIGNALSAMPLING_LOW_NOISE` and `Y_SIGNALSAMPLING_LOW_NOISE_FILTERED` corresponding to the electric signal sampling method to use'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['GenericSensor']['set_unit']={syn:'Changes the measuring unit for the measured value.',lib:'genericsensor.set_unit()',pro:'function set_unit(newval)',cmt:'

Changes the measuring unit for the measured value. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',par:{newval:'a string corresponding to the measuring unit for the measured value'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['GenericSensor']['set_userData']={syn:'Stores a user context provided as argument in the userData attribute of the function.',lib:'genericsensor.set_userData()',pro:'function set_userData(data)',cmt:'

Stores a user context provided as argument in the userData attribute of the function. This attribute is never touched by the API, and is at disposal of the caller to store a context.

',par:{data:'any kind of object to be stored'}}; doc['GenericSensor']['set_valueRange']={syn:'Changes the physical value range measured by the sensor.',lib:'genericsensor.set_valueRange()',pro:'function set_valueRange(newval)',cmt:'

Changes the physical value range measured by the sensor. As a side effect, the range modification may automatically modify the display resolution. Default value is \x22-999999.999...999999.999\x22.

',par:{newval:'a string corresponding to the physical value range measured by the sensor'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['GenericSensor']['startDataLogger']={syn:'Starts the data logger on the device.',lib:'genericsensor.startDataLogger()',pro:'function startDataLogger()',cmt:'

Starts the data logger on the device. Note that the data logger will only save the measures on this sensor if the logFrequency is not set to \x22OFF\x22.

',ret:'`YAPI_SUCCESS` if the call succeeds.'}; doc['GenericSensor']['stopDataLogger']={syn:'Stops the datalogger on the device.',lib:'genericsensor.stopDataLogger()',pro:'function stopDataLogger()',cmt:'

Stops the datalogger on the device.

',ret:'`YAPI_SUCCESS` if the call succeeds.'}; doc['GenericSensor']['unmuteValueCallbacks']={syn:'Re-enables the propagation of every new advertised value to the parent hub.',lib:'genericsensor.unmuteValueCallbacks()',pro:'function unmuteValueCallbacks()',cmt:'

Re-enables the propagation of every new advertised value to the parent hub. This function reverts the effect of a previous call to `muteValueCallbacks()`. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['GenericSensor']['wait_async']={syn:'Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function.',lib:'genericsensor.wait_async()',pro:'function wait_async(callback, context)',cmt:'

Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function. The callback function can therefore freely issue synchronous or asynchronous commands, without risking to block the Javascript VM.

',par:{callback:'callback function that is invoked when all pending commands on the module are completed. The callback function receives two arguments: the caller-specific context object and the receiving function object.',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing.'}; doc['GenericSensor']['zeroAdjust']={syn:'Adjusts the signal bias so that the current signal value is need precisely as zero.',lib:'genericsensor.zeroAdjust()',pro:'function zeroAdjust()',cmt:'

Adjusts the signal bias so that the current signal value is need precisely as zero.

',ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; //--- (end of generated code: GenericSensor) //--- (generated code: DigitalIO) doc['DigitalIO']={'':{syn:'Digital IO function interface',inc:'<script type='text/javascript' src='yocto_digitalio.js'></script>',cmt:'

The Yoctopuce application programming interface allows you to switch the state of each bit of the I/O port. You can switch all bits at once, or one by one. The library can also automatically generate short pulses of a determined duration. Electrical behavior of each I/O can be modified (open drain and reverse polarity).

'}}; doc['DigitalIO']['FindDigitalIO']={syn:'Retrieves a digital IO port for a given identifier.',lib:'YDigitalIO.FindDigitalIO()',pro:'function FindDigitalIO(func)',cmt:'

Retrieves a digital IO port for a given identifier. The identifier can be specified using several formats:

- FunctionLogicalName
- ModuleSerialNumber.FunctionIdentifier
- ModuleSerialNumber.FunctionLogicalName
- ModuleLogicalName.FunctionIdentifier
- ModuleLogicalName.FunctionLogicalName

This function does not require that the digital IO port is online at the time it is invoked. The returned object is nevertheless valid. Use the method `YDigitalIO.isOnline()` to test if the digital IO port is indeed online at a given time. In case of ambiguity when looking for a digital IO port by logical name, no error is notified: the first instance found is returned. The search is performed first by hardware name, then by logical name.

If a call to this object\x27s is_online() method returns FALSE although you are certain that the matching device is plugged, make sure that you did call registerHub() at application initialization time.

',par:{func:'a string that uniquely characterizes the digital IO port'},ret:'a `YDigitalIO` object allowing you to drive the digital IO port.'}; doc['DigitalIO']['FirstDigitalIO']={syn:'Starts the enumeration of digital IO ports currently accessible.',lib:'YDigitalIO.FirstDigitalIO()',pro:'function FirstDigitalIO()',cmt:'

Starts the enumeration of digital IO ports currently accessible. Use the method `YDigitalIO.nextDigitalIO()` to iterate on next digital IO ports.

',ret:'a pointer to a `YDigitalIO` object, corresponding to the first digital IO port currently online, or a `null` pointer if there are none.'}; doc['DigitalIO']['clearCache']={syn:'Invalidates the cache.',lib:'digitalio.clearCache()',pro:'function clearCache()',cmt:'

Invalidates the cache. Invalidates the cache of the digital IO port attributes. Forces the next call to get_xxx() or loadxxx() to use values that come from the device.

'}; doc['DigitalIO']['delayedPulse']={syn:'Schedules a pulse on a single bit for a specified duration.',lib:'digitalio.delayedPulse()',pro:'function delayedPulse(bitno, ms_delay, ms_duration)',cmt:'

Schedules a pulse on a single bit for a specified duration. The specified bit will be turned to 1, and then back to 0 after the given duration.

',par:{bitno:'the bit number; lowest bit has index 0',ms_delay:'waiting time before the pulse, in milliseconds',ms_duration:'desired pulse duration in milliseconds. Be aware that the device time resolution is not guaranteed up to the millisecond.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['DigitalIO']['describe']={syn:'Returns a short text that describes unambiguously the instance of the digital IO port in the form `TYPE(NAME)=SERIAL.FUNCTIONID`.',lib:'digitalio.describe()',pro:'function describe()',cmt:'

Returns a short text that describes unambiguously the instance of the digital IO port in the form `TYPE(NAME)=SERIAL.FUNCTIONID`. More precisely, `TYPE` is the type of the function, `NAME` it the name used for the first access to the function, `SERIAL` is the serial number of the module if the module is connected or `\x22unresolved\x22`, and `FUNCTIONID` is the hardware identifier of the function if the module is connected. For example, this method returns `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1` if the module is already connected or `Relay(BadCustomeName.relay1)=unresolved` if the module has not yet been connected. This method does not trigger any USB or TCP transaction and can therefore be used in a debugger.

',ret:'a string that describes the digital IO port (ex: `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1`)'}; doc['DigitalIO']['get_advertisedValue']={syn:'Returns the current value of the digital IO port (no more than 6 characters).',lib:'digitalio.get_advertisedValue()',pro:'function get_advertisedValue()',cmt:'

Returns the current value of the digital IO port (no more than 6 characters).

',ret:'a string corresponding to the current value of the digital IO port (no more than 6 characters).',ext:'On failure, throws an exception or returns `Y_ADVERTISEDVALUE_INVALID`.'}; doc['DigitalIO']['get_bitDirection']={syn:'Returns the direction of a single bit from the I/O port (0 means the bit is an input, 1 an output).',lib:'digitalio.get_bitDirection()',pro:'function get_bitDirection(bitno)',cmt:'

Returns the direction of a single bit from the I/O port (0 means the bit is an input, 1 an output).

',par:{bitno:'the bit number; lowest bit has index 0'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['DigitalIO']['get_bitOpenDrain']={syn:'Returns the type of electrical interface of a single bit from the I/O port.',lib:'digitalio.get_bitOpenDrain()',pro:'function get_bitOpenDrain(bitno)',cmt:'

Returns the type of electrical interface of a single bit from the I/O port. (0 means the bit is an input, 1 an output).

',par:{bitno:'the bit number; lowest bit has index 0'},ret:'0 means the a bit is a regular input/output, 1 means the bit is an open-drain (open-collector) input/output.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['DigitalIO']['get_bitPolarity']={syn:'Returns the polarity of a single bit from the I/O port (0 means the I/O works in regular mode, 1 means the I/O works in reverse mode).',lib:'digitalio.get_bitPolarity()',pro:'function get_bitPolarity(bitno)',cmt:'

Returns the polarity of a single bit from the I/O port (0 means the I/O works in regular mode, 1 means the I/O works in reverse mode).

',par:{bitno:'the bit number; lowest bit has index 0'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['DigitalIO']['get_bitState']={syn:'Returns the state of a single bit of the I/O port.',lib:'digitalio.get_bitState()',pro:'function get_bitState(bitno)',cmt:'

Returns the state of a single bit of the I/O port.

',par:{bitno:'the bit number; lowest bit has index 0'},ret:'the bit state (0 or 1)',ext:'On failure, throws an exception or returns a negative error code.'}; doc['DigitalIO']['get_errorMessage']={syn:'Returns the error message of the latest error with the digital IO port.',lib:'digitalio.get_errorMessage()',pro:'function get_errorMessage()',cmt:'

Returns the error message of the latest error with the digital IO port. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a string corresponding to the latest error message that occured while using the digital IO port object'}; doc['DigitalIO']['get_errorType']={syn:'Returns the numerical error code of the latest error with the digital IO port.',lib:'digitalio.get_errorType()',pro:'function get_errorType()',cmt:'

Returns the numerical error code of the latest error with the digital IO port. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a number corresponding to the code of the latest error that occurred while using the digital IO port object'}; doc['DigitalIO']['get_friendlyName']={syn:'Returns a global identifier of the digital IO port in the format `MODULE_NAME.FUNCTION_NAME`.',lib:'digitalio.get_friendlyName()',pro:'function get_friendlyName()',cmt:'

Returns a global identifier of the digital IO port in the format `MODULE_NAME.FUNCTION_NAME`. The returned string uses the logical names of the module and of the digital IO port if they are defined, otherwise the serial number of the module and the hardware identifier of the digital IO port (for example: `MyCustomName.relay1`)

',ret:'a string that uniquely identifies the digital IO port using logical names (ex: `MyCustomName.relay1`)',ext:'On failure, throws an exception or returns `Y_FRIENDLYNAME_INVALID`.'}; doc['DigitalIO']['get_functionDescriptor']={syn:'Returns a unique identifier of type `YFUN_DESCR` corresponding to the function.',lib:'digitalio.get_functionDescriptor()',pro:'function get_functionDescriptor()',cmt:'

Returns a unique identifier of type `YFUN_DESCR` corresponding to the function. This identifier can be used to test if two instances of `YFunction` reference the same physical function on the same physical device.

',ret:'an identifier of type `YFUN_DESCR`.',ext:'If the function has never been contacted, the returned value is `Y_FUNCTIONDESCRIPTOR_INVALID`.'}; doc['DigitalIO']['get_functionId']={syn:'Returns the hardware identifier of the digital IO port, without reference to the module.',lib:'digitalio.get_functionId()',pro:'function get_functionId()',cmt:'

Returns the hardware identifier of the digital IO port, without reference to the module. For example `relay1`

',ret:'a string that identifies the digital IO port (ex: `relay1`)',ext:'On failure, throws an exception or returns `Y_FUNCTIONID_INVALID`.'}; doc['DigitalIO']['get_hardwareId']={syn:'Returns the unique hardware identifier of the digital IO port in the form `SERIAL.FUNCTIONID`.',lib:'digitalio.get_hardwareId()',pro:'function get_hardwareId()',cmt:'

Returns the unique hardware identifier of the digital IO port in the form `SERIAL.FUNCTIONID`. The unique hardware identifier is composed of the device serial number and of the hardware identifier of the digital IO port (for example `RELAYLO1-123456.relay1`).

',ret:'a string that uniquely identifies the digital IO port (ex: `RELAYLO1-123456.relay1`)',ext:'On failure, throws an exception or returns `Y_HARDWAREID_INVALID`.'}; doc['DigitalIO']['get_logicalName']={syn:'Returns the logical name of the digital IO port.',lib:'digitalio.get_logicalName()',pro:'function get_logicalName()',cmt:'

Returns the logical name of the digital IO port.

',ret:'a string corresponding to the logical name of the digital IO port.',ext:'On failure, throws an exception or returns `Y_LOGICALNAME_INVALID`.'}; doc['DigitalIO']['get_module']={syn:'Gets the `YModule` object for the device on which the function is located.',lib:'digitalio.get_module()',pro:'function get_module()',cmt:'

Gets the `YModule` object for the device on which the function is located. If the function cannot be located on any module, the returned instance of `YModule` is not shown as on-line.

',ret:'an instance of `YModule`'}; doc['DigitalIO']['get_module_async']={syn:'Gets the `YModule` object for the device on which the function is located (asynchronous version).',lib:'digitalio.get_module_async()',pro:'function get_module_async(callback, context)',cmt:'

Gets the `YModule` object for the device on which the function is located (asynchronous version). If the function cannot be located on any module, the returned `YModule` object does not show as on-line.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking Firefox javascript VM that does not implement context switching during blocking I/O calls. See the documentation section on asynchronous Javascript calls for more details.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the requested `YModule` object',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['DigitalIO']['get_outputVoltage']={syn:'Returns the voltage source used to drive output bits.',lib:'digitalio.get_outputVoltage()',pro:'function get_outputVoltage()',cmt:'

Returns the voltage source used to drive output bits.

',ret:'a value among `Y_OUTPUTVOLTAGE_USB_5V`, `Y_OUTPUTVOLTAGE_USB_3V` and `Y_OUTPUTVOLTAGE_EXT_V` corresponding to the voltage source used to drive output bits',ext:'On failure, throws an exception or returns `Y_OUTPUTVOLTAGE_INVALID`.'}; doc['DigitalIO']['get_portDiags']={syn:'Returns the port state diagnostics (Yocto-IO and Yocto-MaxiIO-V2 only).',lib:'digitalio.get_portDiags()',pro:'function get_portDiags()',cmt:'

Returns the port state diagnostics (Yocto-IO and Yocto-MaxiIO-V2 only). Bit 0 indicates a shortcut on output 0, etc. Bit 8 indicates a power failure, and bit 9 signals overheating (overcurrent). During normal use, all diagnostic bits should stay clear.

',ret:'an integer corresponding to the port state diagnostics (Yocto-IO and Yocto-MaxiIO-V2 only)',ext:'On failure, throws an exception or returns `Y_PORTDIAGS_INVALID`.'}; doc['DigitalIO']['get_portDirection']={syn:'Returns the IO direction of all bits of the port: 0 makes a bit an input, 1 makes it an output.',lib:'digitalio.get_portDirection()',pro:'function get_portDirection()',cmt:'

Returns the IO direction of all bits of the port: 0 makes a bit an input, 1 makes it an output.

',ret:'an integer corresponding to the IO direction of all bits of the port: 0 makes a bit an input, 1 makes it an output',ext:'On failure, throws an exception or returns `Y_PORTDIRECTION_INVALID`.'}; doc['DigitalIO']['get_portOpenDrain']={syn:'Returns the electrical interface for each bit of the port.',lib:'digitalio.get_portOpenDrain()',pro:'function get_portOpenDrain()',cmt:'

Returns the electrical interface for each bit of the port. For each bit set to 0 the matching I/O works in the regular, intuitive way, for each bit set to 1, the I/O works in reverse mode.

',ret:'an integer corresponding to the electrical interface for each bit of the port',ext:'On failure, throws an exception or returns `Y_PORTOPENDRAIN_INVALID`.'}; doc['DigitalIO']['get_portPolarity']={syn:'Returns the polarity of all the bits of the port.',lib:'digitalio.get_portPolarity()',pro:'function get_portPolarity()',cmt:'

Returns the polarity of all the bits of the port. For each bit set to 0, the matching I/O works the regular, intuitive way; for each bit set to 1, the I/O works in reverse mode.

',ret:'an integer corresponding to the polarity of all the bits of the port',ext:'On failure, throws an exception or returns `Y_PORTPOLARITY_INVALID`.'}; doc['DigitalIO']['get_portSize']={syn:'Returns the number of bits implemented in the I/O port.',lib:'digitalio.get_portSize()',pro:'function get_portSize()',cmt:'

Returns the number of bits implemented in the I/O port.

',ret:'an integer corresponding to the number of bits implemented in the I/O port',ext:'On failure, throws an exception or returns `Y_PORTSIZE_INVALID`.'}; doc['DigitalIO']['get_portState']={syn:'Returns the digital IO port state: bit 0 represents input 0, and so on.',lib:'digitalio.get_portState()',pro:'function get_portState()',cmt:'

Returns the digital IO port state: bit 0 represents input 0, and so on.

',ret:'an integer corresponding to the digital IO port state: bit 0 represents input 0, and so on',ext:'On failure, throws an exception or returns `Y_PORTSTATE_INVALID`.'}; doc['DigitalIO']['get_userData']={syn:'Returns the value of the userData attribute, as previously stored using method `set_userData`.',lib:'digitalio.get_userData()',pro:'function get_userData()',cmt:'

Returns the value of the userData attribute, as previously stored using method `set_userData`. This attribute is never touched directly by the API, and is at disposal of the caller to store a context.

',ret:'the object stored previously by the caller.'}; doc['DigitalIO']['isOnline']={syn:'Checks if the digital IO port is currently reachable, without raising any error.',lib:'digitalio.isOnline()',pro:'function isOnline()',cmt:'

Checks if the digital IO port is currently reachable, without raising any error. If there is a cached value for the digital IO port in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the digital IO port.

',ret:'`true` if the digital IO port can be reached, and `false` otherwise'}; doc['DigitalIO']['isOnline_async']={syn:'Checks if the digital IO port is currently reachable, without raising any error (asynchronous version).',lib:'digitalio.isOnline_async()',pro:'function isOnline_async(callback, context)',cmt:'

Checks if the digital IO port is currently reachable, without raising any error (asynchronous version). If there is a cached value for the digital IO port in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the requested function.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the boolean result',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['DigitalIO']['load']={syn:'Preloads the digital IO port cache with a specified validity duration.',lib:'digitalio.load()',pro:'function load(msValidity)',cmt:'

Preloads the digital IO port cache with a specified validity duration. By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network traffic for instance.

',par:{msValidity:'an integer corresponding to the validity attributed to the loaded function parameters, in milliseconds'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['DigitalIO']['loadAttribute']={syn:'Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.',lib:'digitalio.loadAttribute()',pro:'function loadAttribute(attrName)',cmt:'

Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.

',par:{attrName:'the name of the requested attribute'},ret:'a string with the value of the the attribute',ext:'On failure, throws an exception or returns an empty string.'}; doc['DigitalIO']['load_async']={syn:'Preloads the digital IO port cache with a specified validity duration (asynchronous version).',lib:'digitalio.load_async()',pro:'function load_async(msValidity, callback, context)',cmt:'

Preloads the digital IO port cache with a specified validity duration (asynchronous version). By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network trafic for instance.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{msValidity:'an integer corresponding to the validity of the loaded function parameters, in milliseconds',callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the error code (or `YAPI_SUCCESS`)',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['DigitalIO']['muteValueCallbacks']={syn:'Disables the propagation of every new advertised value to the parent hub.',lib:'digitalio.muteValueCallbacks()',pro:'function muteValueCallbacks()',cmt:'

Disables the propagation of every new advertised value to the parent hub. You can use this function to save bandwidth and CPU on computers with limited resources, or to prevent unwanted invocations of the HTTP callback. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['DigitalIO']['nextDigitalIO']={syn:'Continues the enumeration of digital IO ports started using `yFirstDigitalIO()`.',lib:'digitalio.nextDigitalIO()',pro:'function nextDigitalIO()',cmt:'

Continues the enumeration of digital IO ports started using `yFirstDigitalIO()`.

',ret:'a pointer to a `YDigitalIO` object, corresponding to a digital IO port currently online, or a `null` pointer if there are no more digital IO ports to enumerate.'}; doc['DigitalIO']['pulse']={syn:'Triggers a pulse on a single bit for a specified duration.',lib:'digitalio.pulse()',pro:'function pulse(bitno, ms_duration)',cmt:'

Triggers a pulse on a single bit for a specified duration. The specified bit will be turned to 1, and then back to 0 after the given duration.

',par:{bitno:'the bit number; lowest bit has index 0',ms_duration:'desired pulse duration in milliseconds. Be aware that the device time resolution is not guaranteed up to the millisecond.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['DigitalIO']['registerValueCallback']={syn:'Registers the callback function that is invoked on every change of advertised value.',lib:'digitalio.registerValueCallback()',pro:'function registerValueCallback(callback)',cmt:'

Registers the callback function that is invoked on every change of advertised value. The callback is invoked only during the execution of `ySleep` or `yHandleEvents`. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a null pointer as argument.

',par:{callback:'the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and the character string describing the new advertised value.'}}; doc['DigitalIO']['set_bitDirection']={syn:'Changes the direction of a single bit from the I/O port.',lib:'digitalio.set_bitDirection()',pro:'function set_bitDirection(bitno, bitdirection)',cmt:'

Changes the direction of a single bit from the I/O port.

',par:{bitno:'the bit number; lowest bit has index 0',bitdirection:'direction to set, 0 makes the bit an input, 1 makes it an output. Remember to call the `saveToFlash()` method to make sure the setting is kept after a reboot.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['DigitalIO']['set_bitOpenDrain']={syn:'Changes the electrical interface of a single bit from the I/O port.',lib:'digitalio.set_bitOpenDrain()',pro:'function set_bitOpenDrain(bitno, opendrain)',cmt:'

Changes the electrical interface of a single bit from the I/O port.

',par:{bitno:'the bit number; lowest bit has index 0',opendrain:'0 makes a bit a regular input/output, 1 makes it an open-drain (open-collector) input/output. Remember to call the `saveToFlash()` method to make sure the setting is kept after a reboot.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['DigitalIO']['set_bitPolarity']={syn:'Changes the polarity of a single bit from the I/O port.',lib:'digitalio.set_bitPolarity()',pro:'function set_bitPolarity(bitno, bitpolarity)',cmt:'

Changes the polarity of a single bit from the I/O port.

',par:{bitno:'the bit number; lowest bit has index 0.',bitpolarity:'polarity to set, 0 makes the I/O work in regular mode, 1 makes the I/O works in reverse mode. Remember to call the `saveToFlash()` method to make sure the setting is kept after a reboot.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['DigitalIO']['set_bitState']={syn:'Sets a single bit of the I/O port.',lib:'digitalio.set_bitState()',pro:'function set_bitState(bitno, bitstate)',cmt:'

Sets a single bit of the I/O port.

',par:{bitno:'the bit number; lowest bit has index 0',bitstate:'the state of the bit (1 or 0)'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['DigitalIO']['set_logicalName']={syn:'Changes the logical name of the digital IO port.',lib:'digitalio.set_logicalName()',pro:'function set_logicalName(newval)',cmt:'

Changes the logical name of the digital IO port. You can use `yCheckLogicalName()` prior to this call to make sure that your parameter is valid. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',par:{newval:'a string corresponding to the logical name of the digital IO port.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['DigitalIO']['set_outputVoltage']={syn:'Changes the voltage source used to drive output bits.',lib:'digitalio.set_outputVoltage()',pro:'function set_outputVoltage(newval)',cmt:'

Changes the voltage source used to drive output bits. Remember to call the `saveToFlash()` method to make sure the setting is kept after a reboot.

',par:{newval:'a value among `Y_OUTPUTVOLTAGE_USB_5V`, `Y_OUTPUTVOLTAGE_USB_3V` and `Y_OUTPUTVOLTAGE_EXT_V` corresponding to the voltage source used to drive output bits'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['DigitalIO']['set_portDirection']={syn:'Changes the IO direction of all bits of the port: 0 makes a bit an input, 1 makes it an output.',lib:'digitalio.set_portDirection()',pro:'function set_portDirection(newval)',cmt:'

Changes the IO direction of all bits of the port: 0 makes a bit an input, 1 makes it an output. Remember to call the `saveToFlash()` method to make sure the setting is kept after a reboot.

',par:{newval:'an integer corresponding to the IO direction of all bits of the port: 0 makes a bit an input, 1 makes it an output'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['DigitalIO']['set_portOpenDrain']={syn:'Changes the electrical interface for each bit of the port.',lib:'digitalio.set_portOpenDrain()',pro:'function set_portOpenDrain(newval)',cmt:'

Changes the electrical interface for each bit of the port. 0 makes a bit a regular input/output, 1 makes it an open-drain (open-collector) input/output. Remember to call the `saveToFlash()` method to make sure the setting is kept after a reboot.

',par:{newval:'an integer corresponding to the electrical interface for each bit of the port'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['DigitalIO']['set_portPolarity']={syn:'Changes the polarity of all the bits of the port: For each bit set to 0, the matching I/O works the regular, intuitive way; for each bit set to 1, the I/O works in reverse mode.',lib:'digitalio.set_portPolarity()',pro:'function set_portPolarity(newval)',cmt:'

Changes the polarity of all the bits of the port: For each bit set to 0, the matching I/O works the regular, intuitive way; for each bit set to 1, the I/O works in reverse mode. Remember to call the `saveToFlash()` method to make sure the setting will be kept after a reboot.

',par:{newval:'an integer corresponding to the polarity of all the bits of the port: For each bit set to 0, the matching I/O works the regular, intuitive way; for each bit set to 1, the I/O works in reverse mode'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['DigitalIO']['set_portState']={syn:'Changes the digital IO port state: bit 0 represents input 0, and so on.',lib:'digitalio.set_portState()',pro:'function set_portState(newval)',cmt:'

Changes the digital IO port state: bit 0 represents input 0, and so on. This function has no effect on bits configured as input in `portDirection`.

',par:{newval:'an integer corresponding to the digital IO port state: bit 0 represents input 0, and so on'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['DigitalIO']['set_userData']={syn:'Stores a user context provided as argument in the userData attribute of the function.',lib:'digitalio.set_userData()',pro:'function set_userData(data)',cmt:'

Stores a user context provided as argument in the userData attribute of the function. This attribute is never touched by the API, and is at disposal of the caller to store a context.

',par:{data:'any kind of object to be stored'}}; doc['DigitalIO']['toggle_bitState']={syn:'Reverts a single bit of the I/O port.',lib:'digitalio.toggle_bitState()',pro:'function toggle_bitState(bitno)',cmt:'

Reverts a single bit of the I/O port.

',par:{bitno:'the bit number; lowest bit has index 0'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['DigitalIO']['unmuteValueCallbacks']={syn:'Re-enables the propagation of every new advertised value to the parent hub.',lib:'digitalio.unmuteValueCallbacks()',pro:'function unmuteValueCallbacks()',cmt:'

Re-enables the propagation of every new advertised value to the parent hub. This function reverts the effect of a previous call to `muteValueCallbacks()`. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['DigitalIO']['wait_async']={syn:'Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function.',lib:'digitalio.wait_async()',pro:'function wait_async(callback, context)',cmt:'

Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function. The callback function can therefore freely issue synchronous or asynchronous commands, without risking to block the Javascript VM.

',par:{callback:'callback function that is invoked when all pending commands on the module are completed. The callback function receives two arguments: the caller-specific context object and the receiving function object.',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing.'}; //--- (end of generated code: DigitalIO) //--- (generated code: OsControl) doc['OsControl']={'':{syn:'OS control',inc:'<script type='text/javascript' src='yocto_oscontrol.js'></script>',cmt:'

The OScontrol object allows some control over the operating system running a VirtualHub. OsControl is available on the VirtualHub software only. This feature must be activated at the VirtualHub start up with -o option.

'}}; doc['OsControl']['FindOsControl']={syn:'Retrieves OS control for a given identifier.',lib:'YOsControl.FindOsControl()',pro:'function FindOsControl(func)',cmt:'

Retrieves OS control for a given identifier. The identifier can be specified using several formats:

- FunctionLogicalName
- ModuleSerialNumber.FunctionIdentifier
- ModuleSerialNumber.FunctionLogicalName
- ModuleLogicalName.FunctionIdentifier
- ModuleLogicalName.FunctionLogicalName

This function does not require that the OS control is online at the time it is invoked. The returned object is nevertheless valid. Use the method `YOsControl.isOnline()` to test if the OS control is indeed online at a given time. In case of ambiguity when looking for OS control by logical name, no error is notified: the first instance found is returned. The search is performed first by hardware name, then by logical name.

If a call to this object\x27s is_online() method returns FALSE although you are certain that the matching device is plugged, make sure that you did call registerHub() at application initialization time.

',par:{func:'a string that uniquely characterizes the OS control'},ret:'a `YOsControl` object allowing you to drive the OS control.'}; doc['OsControl']['FirstOsControl']={syn:'Starts the enumeration of OS control currently accessible.',lib:'YOsControl.FirstOsControl()',pro:'function FirstOsControl()',cmt:'

Starts the enumeration of OS control currently accessible. Use the method `YOsControl.nextOsControl()` to iterate on next OS control.

',ret:'a pointer to a `YOsControl` object, corresponding to the first OS control currently online, or a `null` pointer if there are none.'}; doc['OsControl']['clearCache']={syn:'Invalidates the cache.',lib:'oscontrol.clearCache()',pro:'function clearCache()',cmt:'

Invalidates the cache. Invalidates the cache of the OS control attributes. Forces the next call to get_xxx() or loadxxx() to use values that come from the device.

'}; doc['OsControl']['describe']={syn:'Returns a short text that describes unambiguously the instance of the OS control in the form `TYPE(NAME)=SERIAL.FUNCTIONID`.',lib:'oscontrol.describe()',pro:'function describe()',cmt:'

Returns a short text that describes unambiguously the instance of the OS control in the form `TYPE(NAME)=SERIAL.FUNCTIONID`. More precisely, `TYPE` is the type of the function, `NAME` it the name used for the first access to the function, `SERIAL` is the serial number of the module if the module is connected or `\x22unresolved\x22`, and `FUNCTIONID` is the hardware identifier of the function if the module is connected. For example, this method returns `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1` if the module is already connected or `Relay(BadCustomeName.relay1)=unresolved` if the module has not yet been connected. This method does not trigger any USB or TCP transaction and can therefore be used in a debugger.

',ret:'a string that describes the OS control (ex: `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1`)'}; doc['OsControl']['get_advertisedValue']={syn:'Returns the current value of the OS control (no more than 6 characters).',lib:'oscontrol.get_advertisedValue()',pro:'function get_advertisedValue()',cmt:'

Returns the current value of the OS control (no more than 6 characters).

',ret:'a string corresponding to the current value of the OS control (no more than 6 characters).',ext:'On failure, throws an exception or returns `Y_ADVERTISEDVALUE_INVALID`.'}; doc['OsControl']['get_errorMessage']={syn:'Returns the error message of the latest error with the OS control.',lib:'oscontrol.get_errorMessage()',pro:'function get_errorMessage()',cmt:'

Returns the error message of the latest error with the OS control. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a string corresponding to the latest error message that occured while using the OS control object'}; doc['OsControl']['get_errorType']={syn:'Returns the numerical error code of the latest error with the OS control.',lib:'oscontrol.get_errorType()',pro:'function get_errorType()',cmt:'

Returns the numerical error code of the latest error with the OS control. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a number corresponding to the code of the latest error that occurred while using the OS control object'}; doc['OsControl']['get_friendlyName']={syn:'Returns a global identifier of the OS control in the format `MODULE_NAME.FUNCTION_NAME`.',lib:'oscontrol.get_friendlyName()',pro:'function get_friendlyName()',cmt:'

Returns a global identifier of the OS control in the format `MODULE_NAME.FUNCTION_NAME`. The returned string uses the logical names of the module and of the OS control if they are defined, otherwise the serial number of the module and the hardware identifier of the OS control (for example: `MyCustomName.relay1`)

',ret:'a string that uniquely identifies the OS control using logical names (ex: `MyCustomName.relay1`)',ext:'On failure, throws an exception or returns `Y_FRIENDLYNAME_INVALID`.'}; doc['OsControl']['get_functionDescriptor']={syn:'Returns a unique identifier of type `YFUN_DESCR` corresponding to the function.',lib:'oscontrol.get_functionDescriptor()',pro:'function get_functionDescriptor()',cmt:'

Returns a unique identifier of type `YFUN_DESCR` corresponding to the function. This identifier can be used to test if two instances of `YFunction` reference the same physical function on the same physical device.

',ret:'an identifier of type `YFUN_DESCR`.',ext:'If the function has never been contacted, the returned value is `Y_FUNCTIONDESCRIPTOR_INVALID`.'}; doc['OsControl']['get_functionId']={syn:'Returns the hardware identifier of the OS control, without reference to the module.',lib:'oscontrol.get_functionId()',pro:'function get_functionId()',cmt:'

Returns the hardware identifier of the OS control, without reference to the module. For example `relay1`

',ret:'a string that identifies the OS control (ex: `relay1`)',ext:'On failure, throws an exception or returns `Y_FUNCTIONID_INVALID`.'}; doc['OsControl']['get_hardwareId']={syn:'Returns the unique hardware identifier of the OS control in the form `SERIAL.FUNCTIONID`.',lib:'oscontrol.get_hardwareId()',pro:'function get_hardwareId()',cmt:'

Returns the unique hardware identifier of the OS control in the form `SERIAL.FUNCTIONID`. The unique hardware identifier is composed of the device serial number and of the hardware identifier of the OS control (for example `RELAYLO1-123456.relay1`).

',ret:'a string that uniquely identifies the OS control (ex: `RELAYLO1-123456.relay1`)',ext:'On failure, throws an exception or returns `Y_HARDWAREID_INVALID`.'}; doc['OsControl']['get_logicalName']={syn:'Returns the logical name of the OS control.',lib:'oscontrol.get_logicalName()',pro:'function get_logicalName()',cmt:'

Returns the logical name of the OS control.

',ret:'a string corresponding to the logical name of the OS control.',ext:'On failure, throws an exception or returns `Y_LOGICALNAME_INVALID`.'}; doc['OsControl']['get_module']={syn:'Gets the `YModule` object for the device on which the function is located.',lib:'oscontrol.get_module()',pro:'function get_module()',cmt:'

Gets the `YModule` object for the device on which the function is located. If the function cannot be located on any module, the returned instance of `YModule` is not shown as on-line.

',ret:'an instance of `YModule`'}; doc['OsControl']['get_module_async']={syn:'Gets the `YModule` object for the device on which the function is located (asynchronous version).',lib:'oscontrol.get_module_async()',pro:'function get_module_async(callback, context)',cmt:'

Gets the `YModule` object for the device on which the function is located (asynchronous version). If the function cannot be located on any module, the returned `YModule` object does not show as on-line.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking Firefox javascript VM that does not implement context switching during blocking I/O calls. See the documentation section on asynchronous Javascript calls for more details.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the requested `YModule` object',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['OsControl']['get_shutdownCountdown']={syn:'Returns the remaining number of seconds before the OS shutdown, or zero when no shutdown has been scheduled.',lib:'oscontrol.get_shutdownCountdown()',pro:'function get_shutdownCountdown()',cmt:'

Returns the remaining number of seconds before the OS shutdown, or zero when no shutdown has been scheduled.

',ret:'an integer corresponding to the remaining number of seconds before the OS shutdown, or zero when no shutdown has been scheduled',ext:'On failure, throws an exception or returns `Y_SHUTDOWNCOUNTDOWN_INVALID`.'}; doc['OsControl']['get_userData']={syn:'Returns the value of the userData attribute, as previously stored using method `set_userData`.',lib:'oscontrol.get_userData()',pro:'function get_userData()',cmt:'

Returns the value of the userData attribute, as previously stored using method `set_userData`. This attribute is never touched directly by the API, and is at disposal of the caller to store a context.

',ret:'the object stored previously by the caller.'}; doc['OsControl']['isOnline']={syn:'Checks if the OS control is currently reachable, without raising any error.',lib:'oscontrol.isOnline()',pro:'function isOnline()',cmt:'

Checks if the OS control is currently reachable, without raising any error. If there is a cached value for the OS control in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the OS control.

',ret:'`true` if the OS control can be reached, and `false` otherwise'}; doc['OsControl']['isOnline_async']={syn:'Checks if the OS control is currently reachable, without raising any error (asynchronous version).',lib:'oscontrol.isOnline_async()',pro:'function isOnline_async(callback, context)',cmt:'

Checks if the OS control is currently reachable, without raising any error (asynchronous version). If there is a cached value for the OS control in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the requested function.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the boolean result',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['OsControl']['load']={syn:'Preloads the OS control cache with a specified validity duration.',lib:'oscontrol.load()',pro:'function load(msValidity)',cmt:'

Preloads the OS control cache with a specified validity duration. By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network traffic for instance.

',par:{msValidity:'an integer corresponding to the validity attributed to the loaded function parameters, in milliseconds'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['OsControl']['loadAttribute']={syn:'Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.',lib:'oscontrol.loadAttribute()',pro:'function loadAttribute(attrName)',cmt:'

Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.

',par:{attrName:'the name of the requested attribute'},ret:'a string with the value of the the attribute',ext:'On failure, throws an exception or returns an empty string.'}; doc['OsControl']['load_async']={syn:'Preloads the OS control cache with a specified validity duration (asynchronous version).',lib:'oscontrol.load_async()',pro:'function load_async(msValidity, callback, context)',cmt:'

Preloads the OS control cache with a specified validity duration (asynchronous version). By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network trafic for instance.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{msValidity:'an integer corresponding to the validity of the loaded function parameters, in milliseconds',callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the error code (or `YAPI_SUCCESS`)',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['OsControl']['muteValueCallbacks']={syn:'Disables the propagation of every new advertised value to the parent hub.',lib:'oscontrol.muteValueCallbacks()',pro:'function muteValueCallbacks()',cmt:'

Disables the propagation of every new advertised value to the parent hub. You can use this function to save bandwidth and CPU on computers with limited resources, or to prevent unwanted invocations of the HTTP callback. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['OsControl']['nextOsControl']={syn:'Continues the enumeration of OS control started using `yFirstOsControl()`.',lib:'oscontrol.nextOsControl()',pro:'function nextOsControl()',cmt:'

Continues the enumeration of OS control started using `yFirstOsControl()`.

',ret:'a pointer to a `YOsControl` object, corresponding to OS control currently online, or a `null` pointer if there are no more OS control to enumerate.'}; doc['OsControl']['registerValueCallback']={syn:'Registers the callback function that is invoked on every change of advertised value.',lib:'oscontrol.registerValueCallback()',pro:'function registerValueCallback(callback)',cmt:'

Registers the callback function that is invoked on every change of advertised value. The callback is invoked only during the execution of `ySleep` or `yHandleEvents`. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a null pointer as argument.

',par:{callback:'the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and the character string describing the new advertised value.'}}; doc['OsControl']['set_logicalName']={syn:'Changes the logical name of the OS control.',lib:'oscontrol.set_logicalName()',pro:'function set_logicalName(newval)',cmt:'

Changes the logical name of the OS control. You can use `yCheckLogicalName()` prior to this call to make sure that your parameter is valid. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',par:{newval:'a string corresponding to the logical name of the OS control.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['OsControl']['set_userData']={syn:'Stores a user context provided as argument in the userData attribute of the function.',lib:'oscontrol.set_userData()',pro:'function set_userData(data)',cmt:'

Stores a user context provided as argument in the userData attribute of the function. This attribute is never touched by the API, and is at disposal of the caller to store a context.

',par:{data:'any kind of object to be stored'}}; doc['OsControl']['shutdown']={syn:'Schedules an OS shutdown after a given number of seconds.',lib:'oscontrol.shutdown()',pro:'function shutdown(secBeforeShutDown)',cmt:'

Schedules an OS shutdown after a given number of seconds.

',par:{secBeforeShutDown:'number of seconds before shutdown'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['OsControl']['unmuteValueCallbacks']={syn:'Re-enables the propagation of every new advertised value to the parent hub.',lib:'oscontrol.unmuteValueCallbacks()',pro:'function unmuteValueCallbacks()',cmt:'

Re-enables the propagation of every new advertised value to the parent hub. This function reverts the effect of a previous call to `muteValueCallbacks()`. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['OsControl']['wait_async']={syn:'Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function.',lib:'oscontrol.wait_async()',pro:'function wait_async(callback, context)',cmt:'

Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function. The callback function can therefore freely issue synchronous or asynchronous commands, without risking to block the Javascript VM.

',par:{callback:'callback function that is invoked when all pending commands on the module are completed. The callback function receives two arguments: the caller-specific context object and the receiving function object.',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing.'}; //--- (end of generated code: OsControl) //--- (generated code: DataSet) doc['DataSet']={'':{syn:'Recorded data sequence',inc:'<script type='text/javascript' src='yocto_api.js'></script>',cmt:'

YDataSet objects make it possible to retrieve a set of recorded measures for a given sensor and a specified time interval. They can be used to load data points with a progress report. When the YDataSet object is instantiated by the `get_recordedData()` function, no data is yet loaded from the module. It is only when the `loadMore()` method is called over and over than data will be effectively loaded from the dataLogger.

A preview of available measures is available using the function `get_preview()` as soon as `loadMore()` has been called once. Measures themselves are available using function `get_measures()` when loaded by subsequent calls to `loadMore()`.

This class can only be used on devices that use a recent firmware, as YDataSet objects are not supported by firmwares older than version 13000.

'}}; doc['DataSet']['get_endTimeUTC']={syn:'Returns the end time of the dataset, relative to the Jan 1, 1970.',lib:'dataset.get_endTimeUTC()',pro:'function get_endTimeUTC()',cmt:'

Returns the end time of the dataset, relative to the Jan 1, 1970. When the YDataSet is created, the end time is the value passed in parameter to the `get_dataSet()` function. After the very first call to `loadMore()`, the end time is updated to reflect the timestamp of the last measure actually found in the dataLogger within the specified range.

',ret:'an unsigned number corresponding to the number of seconds between the Jan 1, 1970 and the end of this data set (i.e. Unix time representation of the absolute time).'}; doc['DataSet']['get_functionId']={syn:'Returns the hardware identifier of the function that performed the measure, without reference to the module.',lib:'dataset.get_functionId()',pro:'function get_functionId()',cmt:'

Returns the hardware identifier of the function that performed the measure, without reference to the module. For example `temperature1`.

',ret:'a string that identifies the function (ex: `temperature1`)'}; doc['DataSet']['get_hardwareId']={syn:'Returns the unique hardware identifier of the function who performed the measures, in the form `SERIAL.FUNCTIONID`.',lib:'dataset.get_hardwareId()',pro:'function get_hardwareId()',cmt:'

Returns the unique hardware identifier of the function who performed the measures, in the form `SERIAL.FUNCTIONID`. The unique hardware identifier is composed of the device serial number and of the hardware identifier of the function (for example `THRMCPL1-123456.temperature1`)

',ret:'a string that uniquely identifies the function (ex: `THRMCPL1-123456.temperature1`)',ext:'On failure, throws an exception or returns `Y_HARDWAREID_INVALID`.'}; doc['DataSet']['get_measures']={syn:'Returns all measured values currently available for this DataSet, as a list of YMeasure objects.',lib:'dataset.get_measures()',pro:'function get_measures()',cmt:'

Returns all measured values currently available for this DataSet, as a list of YMeasure objects. Each item includes: - the start of the measure time interval - the end of the measure time interval - the minimal value observed during the time interval - the average value observed during the time interval - the maximal value observed during the time interval

Before calling this method, you should call `loadMore()` to load data from the device. You may have to call loadMore() several time until all rows are loaded, but you can start looking at available data rows before the load is complete.

The oldest measures are always loaded first, and the most recent measures will be loaded last. As a result, timestamps are normally sorted in ascending order within the measure table, unless there was an unexpected adjustment of the datalogger UTC clock.

',ret:'a table of records, where each record depicts the measured value for a given time interval',ext:'On failure, throws an exception or returns an empty array.'}; doc['DataSet']['get_measuresAt']={syn:'Returns the detailed set of measures for the time interval corresponding to a given condensed measures previously returned by `get_preview()`.',lib:'dataset.get_measuresAt()',pro:'function get_measuresAt(measure)',cmt:'

Returns the detailed set of measures for the time interval corresponding to a given condensed measures previously returned by `get_preview()`. The result is provided as a list of YMeasure objects.

',par:{measure:'condensed measure from the list previously returned by `get_preview()`.'},ret:'a table of records, where each record depicts the measured values during a time interval',ext:'On failure, throws an exception or returns an empty array.'}; doc['DataSet']['get_preview']={syn:'Returns a condensed version of the measures that can retrieved in this YDataSet, as a list of YMeasure objects.',lib:'dataset.get_preview()',pro:'function get_preview()',cmt:'

Returns a condensed version of the measures that can retrieved in this YDataSet, as a list of YMeasure objects. Each item includes: - the start of a time interval - the end of a time interval - the minimal value observed during the time interval - the average value observed during the time interval - the maximal value observed during the time interval

This preview is available as soon as `loadMore()` has been called for the first time.

',ret:'a table of records, where each record depicts the measured values during a time interval',ext:'On failure, throws an exception or returns an empty array.'}; doc['DataSet']['get_progress']={syn:'Returns the progress of the downloads of the measures from the data logger, on a scale from 0 to 100.',lib:'dataset.get_progress()',pro:'function get_progress()',cmt:'

Returns the progress of the downloads of the measures from the data logger, on a scale from 0 to 100. When the object is instantiated by `get_dataSet`, the progress is zero. Each time `loadMore()` is invoked, the progress is updated, to reach the value 100 only once all measures have been loaded.

',ret:'an integer in the range 0 to 100 (percentage of completion).'}; doc['DataSet']['get_startTimeUTC']={syn:'Returns the start time of the dataset, relative to the Jan 1, 1970.',lib:'dataset.get_startTimeUTC()',pro:'function get_startTimeUTC()',cmt:'

Returns the start time of the dataset, relative to the Jan 1, 1970. When the YDataSet is created, the start time is the value passed in parameter to the `get_dataSet()` function. After the very first call to `loadMore()`, the start time is updated to reflect the timestamp of the first measure actually found in the dataLogger within the specified range.

',ret:'an unsigned number corresponding to the number of seconds between the Jan 1, 1970 and the beginning of this data set (i.e. Unix time representation of the absolute time).'}; doc['DataSet']['get_summary']={syn:'Returns an YMeasure object which summarizes the whole DataSet.',lib:'dataset.get_summary()',pro:'function get_summary()',cmt:'

Returns an YMeasure object which summarizes the whole DataSet. In includes the following information: - the start of a time interval - the end of a time interval - the minimal value observed during the time interval - the average value observed during the time interval - the maximal value observed during the time interval

This summary is available as soon as `loadMore()` has been called for the first time.

',ret:'an YMeasure object'}; doc['DataSet']['get_unit']={syn:'Returns the measuring unit for the measured value.',lib:'dataset.get_unit()',pro:'function get_unit()',cmt:'

Returns the measuring unit for the measured value.

',ret:'a string that represents a physical unit.',ext:'On failure, throws an exception or returns `Y_UNIT_INVALID`.'}; doc['DataSet']['loadMore']={syn:'Loads the the next block of measures from the dataLogger, and updates the progress indicator.',lib:'dataset.loadMore()',pro:'function loadMore()',cmt:'

Loads the the next block of measures from the dataLogger, and updates the progress indicator.

',ret:'an integer in the range 0 to 100 (percentage of completion), or a negative error code in case of failure.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['DataSet']['loadMore_async']={syn:'Loads the the next block of measures from the dataLogger asynchronously.',lib:'dataset.loadMore_async()',pro:'function loadMore_async(callback, context)',cmt:'

Loads the the next block of measures from the dataLogger asynchronously.

',par:{callback:'callback function that is invoked when the w The callback function receives three arguments: - the user-specific context object - the YDataSet object whose loadMore_async was invoked - the load result: either the progress indicator (0...100), or a negative error code in case of failure.',context:'user-specific object that is passed as-is to the callback function'},ret:'nothing.'}; //--- (end of generated code: DataSet) //--- (generated code: Measure) doc['Measure']={'':{syn:'Measured value',inc:'<script type='text/javascript' src='yocto_api.js'></script>',cmt:'

YMeasure objects are used within the API to represent a value measured at a specified time. These objects are used in particular in conjunction with the YDataSet class.

'}}; doc['Measure']['get_averageValue']={syn:'Returns the average value observed during the time interval covered by this measure.',lib:'measure.get_averageValue()',pro:'function get_averageValue()',cmt:'

Returns the average value observed during the time interval covered by this measure.

',ret:'a floating-point number corresponding to the average value observed.'}; doc['Measure']['get_endTimeUTC']={syn:'Returns the end time of the measure, relative to the Jan 1, 1970 UTC (Unix timestamp).',lib:'measure.get_endTimeUTC()',pro:'function get_endTimeUTC()',cmt:'

Returns the end time of the measure, relative to the Jan 1, 1970 UTC (Unix timestamp). When the recording rate is higher than 1 sample per second, the timestamp may have a fractional part.

',ret:'an floating point number corresponding to the number of seconds between the Jan 1, 1970 UTC and the end of this measure.'}; doc['Measure']['get_maxValue']={syn:'Returns the largest value observed during the time interval covered by this measure.',lib:'measure.get_maxValue()',pro:'function get_maxValue()',cmt:'

Returns the largest value observed during the time interval covered by this measure.

',ret:'a floating-point number corresponding to the largest value observed.'}; doc['Measure']['get_minValue']={syn:'Returns the smallest value observed during the time interval covered by this measure.',lib:'measure.get_minValue()',pro:'function get_minValue()',cmt:'

Returns the smallest value observed during the time interval covered by this measure.

',ret:'a floating-point number corresponding to the smallest value observed.'}; doc['Measure']['get_startTimeUTC']={syn:'Returns the start time of the measure, relative to the Jan 1, 1970 UTC (Unix timestamp).',lib:'measure.get_startTimeUTC()',pro:'function get_startTimeUTC()',cmt:'

Returns the start time of the measure, relative to the Jan 1, 1970 UTC (Unix timestamp). When the recording rate is higher then 1 sample per second, the timestamp may have a fractional part.

',ret:'an floating point number corresponding to the number of seconds between the Jan 1, 1970 UTC and the beginning of this measure.'}; //--- (end of generated code: Measure) //--- (generated code: Sensor) doc['Sensor']={'':{syn:'Sensor function interface',inc:'<script type='text/javascript' src='yocto_api.js'></script>',cmt:'

The YSensor class is the parent class for all Yoctopuce sensors. It can be used to read the current value and unit of any sensor, read the min/max value, configure autonomous recording frequency and access recorded data. It also provide a function to register a callback invoked each time the observed value changes, or at a predefined interval. Using this class rather than a specific subclass makes it possible to create generic applications that work with any Yoctopuce sensor, even those that do not yet exist. Note: The YAnButton class is the only analog input which does not inherit from YSensor.

'}}; doc['Sensor']['FindSensor']={syn:'Retrieves a sensor for a given identifier.',lib:'YSensor.FindSensor()',pro:'function FindSensor(func)',cmt:'

Retrieves a sensor for a given identifier. The identifier can be specified using several formats:

- FunctionLogicalName
- ModuleSerialNumber.FunctionIdentifier
- ModuleSerialNumber.FunctionLogicalName
- ModuleLogicalName.FunctionIdentifier
- ModuleLogicalName.FunctionLogicalName

This function does not require that the sensor is online at the time it is invoked. The returned object is nevertheless valid. Use the method `YSensor.isOnline()` to test if the sensor is indeed online at a given time. In case of ambiguity when looking for a sensor by logical name, no error is notified: the first instance found is returned. The search is performed first by hardware name, then by logical name.

If a call to this object\x27s is_online() method returns FALSE although you are certain that the matching device is plugged, make sure that you did call registerHub() at application initialization time.

',par:{func:'a string that uniquely characterizes the sensor'},ret:'a `YSensor` object allowing you to drive the sensor.'}; doc['Sensor']['FirstSensor']={syn:'Starts the enumeration of sensors currently accessible.',lib:'YSensor.FirstSensor()',pro:'function FirstSensor()',cmt:'

Starts the enumeration of sensors currently accessible. Use the method `YSensor.nextSensor()` to iterate on next sensors.

',ret:'a pointer to a `YSensor` object, corresponding to the first sensor currently online, or a `null` pointer if there are none.'}; doc['Sensor']['calibrateFromPoints']={syn:'Configures error correction data points, in particular to compensate for a possible perturbation of the measure caused by an enclosure.',lib:'sensor.calibrateFromPoints()',pro:'function calibrateFromPoints(rawValues, refValues)',cmt:'

Configures error correction data points, in particular to compensate for a possible perturbation of the measure caused by an enclosure. It is possible to configure up to five correction points. Correction points must be provided in ascending order, and be in the range of the sensor. The device will automatically perform a linear interpolation of the error correction between specified points. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

For more information on advanced capabilities to refine the calibration of sensors, please contact support@yoctopuce.com.

',par:{rawValues:'array of floating point numbers, corresponding to the raw values returned by the sensor for the correction points.',refValues:'array of floating point numbers, corresponding to the corrected values for the correction points.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Sensor']['clearCache']={syn:'Invalidates the cache.',lib:'sensor.clearCache()',pro:'function clearCache()',cmt:'

Invalidates the cache. Invalidates the cache of the sensor attributes. Forces the next call to get_xxx() or loadxxx() to use values that come from the device.

'}; doc['Sensor']['describe']={syn:'Returns a short text that describes unambiguously the instance of the sensor in the form `TYPE(NAME)=SERIAL.FUNCTIONID`.',lib:'sensor.describe()',pro:'function describe()',cmt:'

Returns a short text that describes unambiguously the instance of the sensor in the form `TYPE(NAME)=SERIAL.FUNCTIONID`. More precisely, `TYPE` is the type of the function, `NAME` it the name used for the first access to the function, `SERIAL` is the serial number of the module if the module is connected or `\x22unresolved\x22`, and `FUNCTIONID` is the hardware identifier of the function if the module is connected. For example, this method returns `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1` if the module is already connected or `Relay(BadCustomeName.relay1)=unresolved` if the module has not yet been connected. This method does not trigger any USB or TCP transaction and can therefore be used in a debugger.

',ret:'a string that describes the sensor (ex: `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1`)'}; doc['Sensor']['get_advMode']={syn:'Returns the measuring mode used for the advertised value pushed to the parent hub.',lib:'sensor.get_advMode()',pro:'function get_advMode()',cmt:'

Returns the measuring mode used for the advertised value pushed to the parent hub.

',ret:'a value among `Y_ADVMODE_IMMEDIATE`, `Y_ADVMODE_PERIOD_AVG`, `Y_ADVMODE_PERIOD_MIN` and `Y_ADVMODE_PERIOD_MAX` corresponding to the measuring mode used for the advertised value pushed to the parent hub',ext:'On failure, throws an exception or returns `Y_ADVMODE_INVALID`.'}; doc['Sensor']['get_advertisedValue']={syn:'Returns the current value of the sensor (no more than 6 characters).',lib:'sensor.get_advertisedValue()',pro:'function get_advertisedValue()',cmt:'

Returns the current value of the sensor (no more than 6 characters).

',ret:'a string corresponding to the current value of the sensor (no more than 6 characters).',ext:'On failure, throws an exception or returns `Y_ADVERTISEDVALUE_INVALID`.'}; doc['Sensor']['get_currentRawValue']={syn:'Returns the uncalibrated, unrounded raw value returned by the sensor, in the specified unit, as a floating point number.',lib:'sensor.get_currentRawValue()',pro:'function get_currentRawValue()',cmt:'

Returns the uncalibrated, unrounded raw value returned by the sensor, in the specified unit, as a floating point number.

',ret:'a floating point number corresponding to the uncalibrated, unrounded raw value returned by the sensor, in the specified unit, as a floating point number',ext:'On failure, throws an exception or returns `Y_CURRENTRAWVALUE_INVALID`.'}; doc['Sensor']['get_currentValue']={syn:'Returns the current value of the measure, in the specified unit, as a floating point number.',lib:'sensor.get_currentValue()',pro:'function get_currentValue()',cmt:'

Returns the current value of the measure, in the specified unit, as a floating point number.

',ret:'a floating point number corresponding to the current value of the measure, in the specified unit, as a floating point number',ext:'On failure, throws an exception or returns `Y_CURRENTVALUE_INVALID`.'}; doc['Sensor']['get_dataLogger']={syn:'Returns the YDatalogger object of the device hosting the sensor.',lib:'sensor.get_dataLogger()',pro:'function get_dataLogger()',cmt:'

Returns the YDatalogger object of the device hosting the sensor. This method returns an object of class YDatalogger that can control global parameters of the data logger. The returned object should not be freed.

',ret:'an YDataLogger object or null on error.'}; doc['Sensor']['get_errorMessage']={syn:'Returns the error message of the latest error with the sensor.',lib:'sensor.get_errorMessage()',pro:'function get_errorMessage()',cmt:'

Returns the error message of the latest error with the sensor. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a string corresponding to the latest error message that occured while using the sensor object'}; doc['Sensor']['get_errorType']={syn:'Returns the numerical error code of the latest error with the sensor.',lib:'sensor.get_errorType()',pro:'function get_errorType()',cmt:'

Returns the numerical error code of the latest error with the sensor. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a number corresponding to the code of the latest error that occurred while using the sensor object'}; doc['Sensor']['get_friendlyName']={syn:'Returns a global identifier of the sensor in the format `MODULE_NAME.FUNCTION_NAME`.',lib:'sensor.get_friendlyName()',pro:'function get_friendlyName()',cmt:'

Returns a global identifier of the sensor in the format `MODULE_NAME.FUNCTION_NAME`. The returned string uses the logical names of the module and of the sensor if they are defined, otherwise the serial number of the module and the hardware identifier of the sensor (for example: `MyCustomName.relay1`)

',ret:'a string that uniquely identifies the sensor using logical names (ex: `MyCustomName.relay1`)',ext:'On failure, throws an exception or returns `Y_FRIENDLYNAME_INVALID`.'}; doc['Sensor']['get_functionDescriptor']={syn:'Returns a unique identifier of type `YFUN_DESCR` corresponding to the function.',lib:'sensor.get_functionDescriptor()',pro:'function get_functionDescriptor()',cmt:'

Returns a unique identifier of type `YFUN_DESCR` corresponding to the function. This identifier can be used to test if two instances of `YFunction` reference the same physical function on the same physical device.

',ret:'an identifier of type `YFUN_DESCR`.',ext:'If the function has never been contacted, the returned value is `Y_FUNCTIONDESCRIPTOR_INVALID`.'}; doc['Sensor']['get_functionId']={syn:'Returns the hardware identifier of the sensor, without reference to the module.',lib:'sensor.get_functionId()',pro:'function get_functionId()',cmt:'

Returns the hardware identifier of the sensor, without reference to the module. For example `relay1`

',ret:'a string that identifies the sensor (ex: `relay1`)',ext:'On failure, throws an exception or returns `Y_FUNCTIONID_INVALID`.'}; doc['Sensor']['get_hardwareId']={syn:'Returns the unique hardware identifier of the sensor in the form `SERIAL.FUNCTIONID`.',lib:'sensor.get_hardwareId()',pro:'function get_hardwareId()',cmt:'

Returns the unique hardware identifier of the sensor in the form `SERIAL.FUNCTIONID`. The unique hardware identifier is composed of the device serial number and of the hardware identifier of the sensor (for example `RELAYLO1-123456.relay1`).

',ret:'a string that uniquely identifies the sensor (ex: `RELAYLO1-123456.relay1`)',ext:'On failure, throws an exception or returns `Y_HARDWAREID_INVALID`.'}; doc['Sensor']['get_highestValue']={syn:'Returns the maximal value observed for the measure since the device was started.',lib:'sensor.get_highestValue()',pro:'function get_highestValue()',cmt:'

Returns the maximal value observed for the measure since the device was started. Can be reset to an arbitrary value thanks to set_highestValue().

',ret:'a floating point number corresponding to the maximal value observed for the measure since the device was started',ext:'On failure, throws an exception or returns `Y_HIGHESTVALUE_INVALID`.'}; doc['Sensor']['get_logFrequency']={syn:'Returns the datalogger recording frequency for this function, or \x22OFF\x22 when measures are not stored in the data logger flash memory.',lib:'sensor.get_logFrequency()',pro:'function get_logFrequency()',cmt:'

Returns the datalogger recording frequency for this function, or \x22OFF\x22 when measures are not stored in the data logger flash memory.

',ret:'a string corresponding to the datalogger recording frequency for this function, or \x22OFF\x22 when measures are not stored in the data logger flash memory',ext:'On failure, throws an exception or returns `Y_LOGFREQUENCY_INVALID`.'}; doc['Sensor']['get_logicalName']={syn:'Returns the logical name of the sensor.',lib:'sensor.get_logicalName()',pro:'function get_logicalName()',cmt:'

Returns the logical name of the sensor.

',ret:'a string corresponding to the logical name of the sensor.',ext:'On failure, throws an exception or returns `Y_LOGICALNAME_INVALID`.'}; doc['Sensor']['get_lowestValue']={syn:'Returns the minimal value observed for the measure since the device was started.',lib:'sensor.get_lowestValue()',pro:'function get_lowestValue()',cmt:'

Returns the minimal value observed for the measure since the device was started. Can be reset to an arbitrary value thanks to set_lowestValue().

',ret:'a floating point number corresponding to the minimal value observed for the measure since the device was started',ext:'On failure, throws an exception or returns `Y_LOWESTVALUE_INVALID`.'}; doc['Sensor']['get_module']={syn:'Gets the `YModule` object for the device on which the function is located.',lib:'sensor.get_module()',pro:'function get_module()',cmt:'

Gets the `YModule` object for the device on which the function is located. If the function cannot be located on any module, the returned instance of `YModule` is not shown as on-line.

',ret:'an instance of `YModule`'}; doc['Sensor']['get_module_async']={syn:'Gets the `YModule` object for the device on which the function is located (asynchronous version).',lib:'sensor.get_module_async()',pro:'function get_module_async(callback, context)',cmt:'

Gets the `YModule` object for the device on which the function is located (asynchronous version). If the function cannot be located on any module, the returned `YModule` object does not show as on-line.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking Firefox javascript VM that does not implement context switching during blocking I/O calls. See the documentation section on asynchronous Javascript calls for more details.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the requested `YModule` object',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['Sensor']['get_recordedData']={syn:'Retrieves a DataSet object holding historical data for this sensor, for a specified time interval.',lib:'sensor.get_recordedData()',pro:'function get_recordedData(startTime, endTime)',cmt:'

Retrieves a DataSet object holding historical data for this sensor, for a specified time interval. The measures will be retrieved from the data logger, which must have been turned on at the desired time. See the documentation of the DataSet class for information on how to get an overview of the recorded data, and how to load progressively a large set of measures from the data logger.

This function only works if the device uses a recent firmware, as DataSet objects are not supported by firmwares older than version 13000.

',par:{startTime:'the start of the desired measure time interval, as a Unix timestamp, i.e. the number of seconds since January 1, 1970 UTC. The special value 0 can be used to include any meaasure, without initial limit.',endTime:'the end of the desired measure time interval, as a Unix timestamp, i.e. the number of seconds since January 1, 1970 UTC. The special value 0 can be used to include any meaasure, without ending limit.'},ret:'an instance of YDataSet, providing access to historical data. Past measures can be loaded progressively using methods from the YDataSet object.'}; doc['Sensor']['get_reportFrequency']={syn:'Returns the timed value notification frequency, or \x22OFF\x22 if timed value notifications are disabled for this function.',lib:'sensor.get_reportFrequency()',pro:'function get_reportFrequency()',cmt:'

Returns the timed value notification frequency, or \x22OFF\x22 if timed value notifications are disabled for this function.

',ret:'a string corresponding to the timed value notification frequency, or \x22OFF\x22 if timed value notifications are disabled for this function',ext:'On failure, throws an exception or returns `Y_REPORTFREQUENCY_INVALID`.'}; doc['Sensor']['get_resolution']={syn:'Returns the resolution of the measured values.',lib:'sensor.get_resolution()',pro:'function get_resolution()',cmt:'

Returns the resolution of the measured values. The resolution corresponds to the numerical precision of the measures, which is not always the same as the actual precision of the sensor.

',ret:'a floating point number corresponding to the resolution of the measured values',ext:'On failure, throws an exception or returns `Y_RESOLUTION_INVALID`.'}; doc['Sensor']['get_sensorState']={syn:'Returns the sensor health state code, which is zero when there is an up-to-date measure available or a positive code if the sensor is not able to provide a measure right now.',lib:'sensor.get_sensorState()',pro:'function get_sensorState()',cmt:'

Returns the sensor health state code, which is zero when there is an up-to-date measure available or a positive code if the sensor is not able to provide a measure right now.

',ret:'an integer corresponding to the sensor health state code, which is zero when there is an up-to-date measure available or a positive code if the sensor is not able to provide a measure right now',ext:'On failure, throws an exception or returns `Y_SENSORSTATE_INVALID`.'}; doc['Sensor']['get_unit']={syn:'Returns the measuring unit for the measure.',lib:'sensor.get_unit()',pro:'function get_unit()',cmt:'

Returns the measuring unit for the measure.

',ret:'a string corresponding to the measuring unit for the measure',ext:'On failure, throws an exception or returns `Y_UNIT_INVALID`.'}; doc['Sensor']['get_userData']={syn:'Returns the value of the userData attribute, as previously stored using method `set_userData`.',lib:'sensor.get_userData()',pro:'function get_userData()',cmt:'

Returns the value of the userData attribute, as previously stored using method `set_userData`. This attribute is never touched directly by the API, and is at disposal of the caller to store a context.

',ret:'the object stored previously by the caller.'}; doc['Sensor']['isOnline']={syn:'Checks if the sensor is currently reachable, without raising any error.',lib:'sensor.isOnline()',pro:'function isOnline()',cmt:'

Checks if the sensor is currently reachable, without raising any error. If there is a cached value for the sensor in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the sensor.

',ret:'`true` if the sensor can be reached, and `false` otherwise'}; doc['Sensor']['isOnline_async']={syn:'Checks if the sensor is currently reachable, without raising any error (asynchronous version).',lib:'sensor.isOnline_async()',pro:'function isOnline_async(callback, context)',cmt:'

Checks if the sensor is currently reachable, without raising any error (asynchronous version). If there is a cached value for the sensor in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the requested function.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the boolean result',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['Sensor']['isSensorReady']={syn:'Checks if the sensor is currently able to provide an up-to-date measure.',lib:'sensor.isSensorReady()',pro:'function isSensorReady()',cmt:'

Checks if the sensor is currently able to provide an up-to-date measure. Returns false if the device is unreachable, or if the sensor does not have a current measure to transmit. No exception is raised if there is an error while trying to contact the device hosting $THEFUNCTION$.

',ret:'`true` if the sensor can provide an up-to-date measure, and `false` otherwise'}; doc['Sensor']['load']={syn:'Preloads the sensor cache with a specified validity duration.',lib:'sensor.load()',pro:'function load(msValidity)',cmt:'

Preloads the sensor cache with a specified validity duration. By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network traffic for instance.

',par:{msValidity:'an integer corresponding to the validity attributed to the loaded function parameters, in milliseconds'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Sensor']['loadAttribute']={syn:'Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.',lib:'sensor.loadAttribute()',pro:'function loadAttribute(attrName)',cmt:'

Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.

',par:{attrName:'the name of the requested attribute'},ret:'a string with the value of the the attribute',ext:'On failure, throws an exception or returns an empty string.'}; doc['Sensor']['loadCalibrationPoints']={syn:'Retrieves error correction data points previously entered using the method `calibrateFromPoints`.',lib:'sensor.loadCalibrationPoints()',pro:'function loadCalibrationPoints(rawValues, refValues)',cmt:'

Retrieves error correction data points previously entered using the method `calibrateFromPoints`.

',par:{rawValues:'array of floating point numbers, that will be filled by the function with the raw sensor values for the correction points.',refValues:'array of floating point numbers, that will be filled by the function with the desired values for the correction points.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Sensor']['load_async']={syn:'Preloads the sensor cache with a specified validity duration (asynchronous version).',lib:'sensor.load_async()',pro:'function load_async(msValidity, callback, context)',cmt:'

Preloads the sensor cache with a specified validity duration (asynchronous version). By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network trafic for instance.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{msValidity:'an integer corresponding to the validity of the loaded function parameters, in milliseconds',callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the error code (or `YAPI_SUCCESS`)',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['Sensor']['muteValueCallbacks']={syn:'Disables the propagation of every new advertised value to the parent hub.',lib:'sensor.muteValueCallbacks()',pro:'function muteValueCallbacks()',cmt:'

Disables the propagation of every new advertised value to the parent hub. You can use this function to save bandwidth and CPU on computers with limited resources, or to prevent unwanted invocations of the HTTP callback. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Sensor']['nextSensor']={syn:'Continues the enumeration of sensors started using `yFirstSensor()`.',lib:'sensor.nextSensor()',pro:'function nextSensor()',cmt:'

Continues the enumeration of sensors started using `yFirstSensor()`.

',ret:'a pointer to a `YSensor` object, corresponding to a sensor currently online, or a `null` pointer if there are no more sensors to enumerate.'}; doc['Sensor']['registerTimedReportCallback']={syn:'Registers the callback function that is invoked on every periodic timed notification.',lib:'sensor.registerTimedReportCallback()',pro:'function registerTimedReportCallback(callback)',cmt:'

Registers the callback function that is invoked on every periodic timed notification. The callback is invoked only during the execution of `ySleep` or `yHandleEvents`. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a null pointer as argument.

',par:{callback:'the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and an YMeasure object describing the new advertised value.'}}; doc['Sensor']['registerValueCallback']={syn:'Registers the callback function that is invoked on every change of advertised value.',lib:'sensor.registerValueCallback()',pro:'function registerValueCallback(callback)',cmt:'

Registers the callback function that is invoked on every change of advertised value. The callback is invoked only during the execution of `ySleep` or `yHandleEvents`. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a null pointer as argument.

',par:{callback:'the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and the character string describing the new advertised value.'}}; doc['Sensor']['set_advMode']={syn:'Changes the measuring mode used for the advertised value pushed to the parent hub.',lib:'sensor.set_advMode()',pro:'function set_advMode(newval)',cmt:'

Changes the measuring mode used for the advertised value pushed to the parent hub.

',par:{newval:'a value among `Y_ADVMODE_IMMEDIATE`, `Y_ADVMODE_PERIOD_AVG`, `Y_ADVMODE_PERIOD_MIN` and `Y_ADVMODE_PERIOD_MAX` corresponding to the measuring mode used for the advertised value pushed to the parent hub'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Sensor']['set_highestValue']={syn:'Changes the recorded maximal value observed.',lib:'sensor.set_highestValue()',pro:'function set_highestValue(newval)',cmt:'

Changes the recorded maximal value observed. Can be used to reset the value returned by get_lowestValue().

',par:{newval:'a floating point number corresponding to the recorded maximal value observed'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Sensor']['set_logFrequency']={syn:'Changes the datalogger recording frequency for this function.',lib:'sensor.set_logFrequency()',pro:'function set_logFrequency(newval)',cmt:'

Changes the datalogger recording frequency for this function. The frequency can be specified as samples per second, as sample per minute (for instance \x2215/m\x22) or in samples per hour (eg. \x224/h\x22). To disable recording for this function, use the value \x22OFF\x22.

',par:{newval:'a string corresponding to the datalogger recording frequency for this function'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Sensor']['set_logicalName']={syn:'Changes the logical name of the sensor.',lib:'sensor.set_logicalName()',pro:'function set_logicalName(newval)',cmt:'

Changes the logical name of the sensor. You can use `yCheckLogicalName()` prior to this call to make sure that your parameter is valid. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',par:{newval:'a string corresponding to the logical name of the sensor.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Sensor']['set_lowestValue']={syn:'Changes the recorded minimal value observed.',lib:'sensor.set_lowestValue()',pro:'function set_lowestValue(newval)',cmt:'

Changes the recorded minimal value observed. Can be used to reset the value returned by get_lowestValue().

',par:{newval:'a floating point number corresponding to the recorded minimal value observed'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Sensor']['set_reportFrequency']={syn:'Changes the timed value notification frequency for this function.',lib:'sensor.set_reportFrequency()',pro:'function set_reportFrequency(newval)',cmt:'

Changes the timed value notification frequency for this function. The frequency can be specified as samples per second, as sample per minute (for instance \x2215/m\x22) or in samples per hour (eg. \x224/h\x22). To disable timed value notifications for this function, use the value \x22OFF\x22.

',par:{newval:'a string corresponding to the timed value notification frequency for this function'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Sensor']['set_resolution']={syn:'Changes the resolution of the measured physical values.',lib:'sensor.set_resolution()',pro:'function set_resolution(newval)',cmt:'

Changes the resolution of the measured physical values. The resolution corresponds to the numerical precision when displaying value. It does not change the precision of the measure itself.

',par:{newval:'a floating point number corresponding to the resolution of the measured physical values'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Sensor']['set_userData']={syn:'Stores a user context provided as argument in the userData attribute of the function.',lib:'sensor.set_userData()',pro:'function set_userData(data)',cmt:'

Stores a user context provided as argument in the userData attribute of the function. This attribute is never touched by the API, and is at disposal of the caller to store a context.

',par:{data:'any kind of object to be stored'}}; doc['Sensor']['startDataLogger']={syn:'Starts the data logger on the device.',lib:'sensor.startDataLogger()',pro:'function startDataLogger()',cmt:'

Starts the data logger on the device. Note that the data logger will only save the measures on this sensor if the logFrequency is not set to \x22OFF\x22.

',ret:'`YAPI_SUCCESS` if the call succeeds.'}; doc['Sensor']['stopDataLogger']={syn:'Stops the datalogger on the device.',lib:'sensor.stopDataLogger()',pro:'function stopDataLogger()',cmt:'

Stops the datalogger on the device.

',ret:'`YAPI_SUCCESS` if the call succeeds.'}; doc['Sensor']['unmuteValueCallbacks']={syn:'Re-enables the propagation of every new advertised value to the parent hub.',lib:'sensor.unmuteValueCallbacks()',pro:'function unmuteValueCallbacks()',cmt:'

Re-enables the propagation of every new advertised value to the parent hub. This function reverts the effect of a previous call to `muteValueCallbacks()`. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Sensor']['wait_async']={syn:'Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function.',lib:'sensor.wait_async()',pro:'function wait_async(callback, context)',cmt:'

Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function. The callback function can therefore freely issue synchronous or asynchronous commands, without risking to block the Javascript VM.

',par:{callback:'callback function that is invoked when all pending commands on the module are completed. The callback function receives two arguments: the caller-specific context object and the receiving function object.',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing.'}; //--- (end of generated code: Sensor) //--- (generated code: Accelerometer) doc['Accelerometer']={'':{syn:'Accelerometer function interface',inc:'<script type='text/javascript' src='yocto_accelerometer.js'></script>',cmt:'

The YSensor class is the parent class for all Yoctopuce sensors. It can be used to read the current value and unit of any sensor, read the min/max value, configure autonomous recording frequency and access recorded data. It also provide a function to register a callback invoked each time the observed value changes, or at a predefined interval. Using this class rather than a specific subclass makes it possible to create generic applications that work with any Yoctopuce sensor, even those that do not yet exist. Note: The YAnButton class is the only analog input which does not inherit from YSensor.

'}}; doc['Accelerometer']['FindAccelerometer']={syn:'Retrieves an accelerometer for a given identifier.',lib:'YAccelerometer.FindAccelerometer()',pro:'function FindAccelerometer(func)',cmt:'

Retrieves an accelerometer for a given identifier. The identifier can be specified using several formats:

- FunctionLogicalName
- ModuleSerialNumber.FunctionIdentifier
- ModuleSerialNumber.FunctionLogicalName
- ModuleLogicalName.FunctionIdentifier
- ModuleLogicalName.FunctionLogicalName

This function does not require that the accelerometer is online at the time it is invoked. The returned object is nevertheless valid. Use the method `YAccelerometer.isOnline()` to test if the accelerometer is indeed online at a given time. In case of ambiguity when looking for an accelerometer by logical name, no error is notified: the first instance found is returned. The search is performed first by hardware name, then by logical name.

If a call to this object\x27s is_online() method returns FALSE although you are certain that the matching device is plugged, make sure that you did call registerHub() at application initialization time.

',par:{func:'a string that uniquely characterizes the accelerometer'},ret:'a `YAccelerometer` object allowing you to drive the accelerometer.'}; doc['Accelerometer']['FirstAccelerometer']={syn:'Starts the enumeration of accelerometers currently accessible.',lib:'YAccelerometer.FirstAccelerometer()',pro:'function FirstAccelerometer()',cmt:'

Starts the enumeration of accelerometers currently accessible. Use the method `YAccelerometer.nextAccelerometer()` to iterate on next accelerometers.

',ret:'a pointer to a `YAccelerometer` object, corresponding to the first accelerometer currently online, or a `null` pointer if there are none.'}; doc['Accelerometer']['calibrateFromPoints']={syn:'Configures error correction data points, in particular to compensate for a possible perturbation of the measure caused by an enclosure.',lib:'accelerometer.calibrateFromPoints()',pro:'function calibrateFromPoints(rawValues, refValues)',cmt:'

Configures error correction data points, in particular to compensate for a possible perturbation of the measure caused by an enclosure. It is possible to configure up to five correction points. Correction points must be provided in ascending order, and be in the range of the sensor. The device will automatically perform a linear interpolation of the error correction between specified points. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

For more information on advanced capabilities to refine the calibration of sensors, please contact support@yoctopuce.com.

',par:{rawValues:'array of floating point numbers, corresponding to the raw values returned by the sensor for the correction points.',refValues:'array of floating point numbers, corresponding to the corrected values for the correction points.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Accelerometer']['clearCache']={syn:'Invalidates the cache.',lib:'accelerometer.clearCache()',pro:'function clearCache()',cmt:'

Invalidates the cache. Invalidates the cache of the accelerometer attributes. Forces the next call to get_xxx() or loadxxx() to use values that come from the device.

'}; doc['Accelerometer']['describe']={syn:'Returns a short text that describes unambiguously the instance of the accelerometer in the form `TYPE(NAME)=SERIAL.FUNCTIONID`.',lib:'accelerometer.describe()',pro:'function describe()',cmt:'

Returns a short text that describes unambiguously the instance of the accelerometer in the form `TYPE(NAME)=SERIAL.FUNCTIONID`. More precisely, `TYPE` is the type of the function, `NAME` it the name used for the first access to the function, `SERIAL` is the serial number of the module if the module is connected or `\x22unresolved\x22`, and `FUNCTIONID` is the hardware identifier of the function if the module is connected. For example, this method returns `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1` if the module is already connected or `Relay(BadCustomeName.relay1)=unresolved` if the module has not yet been connected. This method does not trigger any USB or TCP transaction and can therefore be used in a debugger.

',ret:'a string that describes the accelerometer (ex: `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1`)'}; doc['Accelerometer']['get_advMode']={syn:'Returns the measuring mode used for the advertised value pushed to the parent hub.',lib:'accelerometer.get_advMode()',pro:'function get_advMode()',cmt:'

Returns the measuring mode used for the advertised value pushed to the parent hub.

',ret:'a value among `Y_ADVMODE_IMMEDIATE`, `Y_ADVMODE_PERIOD_AVG`, `Y_ADVMODE_PERIOD_MIN` and `Y_ADVMODE_PERIOD_MAX` corresponding to the measuring mode used for the advertised value pushed to the parent hub',ext:'On failure, throws an exception or returns `Y_ADVMODE_INVALID`.'}; doc['Accelerometer']['get_advertisedValue']={syn:'Returns the current value of the accelerometer (no more than 6 characters).',lib:'accelerometer.get_advertisedValue()',pro:'function get_advertisedValue()',cmt:'

Returns the current value of the accelerometer (no more than 6 characters).

',ret:'a string corresponding to the current value of the accelerometer (no more than 6 characters).',ext:'On failure, throws an exception or returns `Y_ADVERTISEDVALUE_INVALID`.'}; doc['Accelerometer']['get_bandwidth']={syn:'Returns the measure update frequency, measured in Hz (Yocto-3D-V2 only).',lib:'accelerometer.get_bandwidth()',pro:'function get_bandwidth()',cmt:'

Returns the measure update frequency, measured in Hz (Yocto-3D-V2 only).

',ret:'an integer corresponding to the measure update frequency, measured in Hz (Yocto-3D-V2 only)',ext:'On failure, throws an exception or returns `Y_BANDWIDTH_INVALID`.'}; doc['Accelerometer']['get_currentRawValue']={syn:'Returns the uncalibrated, unrounded raw value returned by the sensor, in g, as a floating point number.',lib:'accelerometer.get_currentRawValue()',pro:'function get_currentRawValue()',cmt:'

Returns the uncalibrated, unrounded raw value returned by the sensor, in g, as a floating point number.

',ret:'a floating point number corresponding to the uncalibrated, unrounded raw value returned by the sensor, in g, as a floating point number',ext:'On failure, throws an exception or returns `Y_CURRENTRAWVALUE_INVALID`.'}; doc['Accelerometer']['get_currentValue']={syn:'Returns the current value of the acceleration, in g, as a floating point number.',lib:'accelerometer.get_currentValue()',pro:'function get_currentValue()',cmt:'

Returns the current value of the acceleration, in g, as a floating point number.

',ret:'a floating point number corresponding to the current value of the acceleration, in g, as a floating point number',ext:'On failure, throws an exception or returns `Y_CURRENTVALUE_INVALID`.'}; doc['Accelerometer']['get_dataLogger']={syn:'Returns the YDatalogger object of the device hosting the sensor.',lib:'accelerometer.get_dataLogger()',pro:'function get_dataLogger()',cmt:'

Returns the YDatalogger object of the device hosting the sensor. This method returns an object of class YDatalogger that can control global parameters of the data logger. The returned object should not be freed.

',ret:'an YDataLogger object or null on error.'}; doc['Accelerometer']['get_errorMessage']={syn:'Returns the error message of the latest error with the accelerometer.',lib:'accelerometer.get_errorMessage()',pro:'function get_errorMessage()',cmt:'

Returns the error message of the latest error with the accelerometer. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a string corresponding to the latest error message that occured while using the accelerometer object'}; doc['Accelerometer']['get_errorType']={syn:'Returns the numerical error code of the latest error with the accelerometer.',lib:'accelerometer.get_errorType()',pro:'function get_errorType()',cmt:'

Returns the numerical error code of the latest error with the accelerometer. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a number corresponding to the code of the latest error that occurred while using the accelerometer object'}; doc['Accelerometer']['get_friendlyName']={syn:'Returns a global identifier of the accelerometer in the format `MODULE_NAME.FUNCTION_NAME`.',lib:'accelerometer.get_friendlyName()',pro:'function get_friendlyName()',cmt:'

Returns a global identifier of the accelerometer in the format `MODULE_NAME.FUNCTION_NAME`. The returned string uses the logical names of the module and of the accelerometer if they are defined, otherwise the serial number of the module and the hardware identifier of the accelerometer (for example: `MyCustomName.relay1`)

',ret:'a string that uniquely identifies the accelerometer using logical names (ex: `MyCustomName.relay1`)',ext:'On failure, throws an exception or returns `Y_FRIENDLYNAME_INVALID`.'}; doc['Accelerometer']['get_functionDescriptor']={syn:'Returns a unique identifier of type `YFUN_DESCR` corresponding to the function.',lib:'accelerometer.get_functionDescriptor()',pro:'function get_functionDescriptor()',cmt:'

Returns a unique identifier of type `YFUN_DESCR` corresponding to the function. This identifier can be used to test if two instances of `YFunction` reference the same physical function on the same physical device.

',ret:'an identifier of type `YFUN_DESCR`.',ext:'If the function has never been contacted, the returned value is `Y_FUNCTIONDESCRIPTOR_INVALID`.'}; doc['Accelerometer']['get_functionId']={syn:'Returns the hardware identifier of the accelerometer, without reference to the module.',lib:'accelerometer.get_functionId()',pro:'function get_functionId()',cmt:'

Returns the hardware identifier of the accelerometer, without reference to the module. For example `relay1`

',ret:'a string that identifies the accelerometer (ex: `relay1`)',ext:'On failure, throws an exception or returns `Y_FUNCTIONID_INVALID`.'}; doc['Accelerometer']['get_hardwareId']={syn:'Returns the unique hardware identifier of the accelerometer in the form `SERIAL.FUNCTIONID`.',lib:'accelerometer.get_hardwareId()',pro:'function get_hardwareId()',cmt:'

Returns the unique hardware identifier of the accelerometer in the form `SERIAL.FUNCTIONID`. The unique hardware identifier is composed of the device serial number and of the hardware identifier of the accelerometer (for example `RELAYLO1-123456.relay1`).

',ret:'a string that uniquely identifies the accelerometer (ex: `RELAYLO1-123456.relay1`)',ext:'On failure, throws an exception or returns `Y_HARDWAREID_INVALID`.'}; doc['Accelerometer']['get_highestValue']={syn:'Returns the maximal value observed for the acceleration since the device was started.',lib:'accelerometer.get_highestValue()',pro:'function get_highestValue()',cmt:'

Returns the maximal value observed for the acceleration since the device was started. Can be reset to an arbitrary value thanks to set_highestValue().

',ret:'a floating point number corresponding to the maximal value observed for the acceleration since the device was started',ext:'On failure, throws an exception or returns `Y_HIGHESTVALUE_INVALID`.'}; doc['Accelerometer']['get_logFrequency']={syn:'Returns the datalogger recording frequency for this function, or \x22OFF\x22 when measures are not stored in the data logger flash memory.',lib:'accelerometer.get_logFrequency()',pro:'function get_logFrequency()',cmt:'

Returns the datalogger recording frequency for this function, or \x22OFF\x22 when measures are not stored in the data logger flash memory.

',ret:'a string corresponding to the datalogger recording frequency for this function, or \x22OFF\x22 when measures are not stored in the data logger flash memory',ext:'On failure, throws an exception or returns `Y_LOGFREQUENCY_INVALID`.'}; doc['Accelerometer']['get_logicalName']={syn:'Returns the logical name of the accelerometer.',lib:'accelerometer.get_logicalName()',pro:'function get_logicalName()',cmt:'

Returns the logical name of the accelerometer.

',ret:'a string corresponding to the logical name of the accelerometer.',ext:'On failure, throws an exception or returns `Y_LOGICALNAME_INVALID`.'}; doc['Accelerometer']['get_lowestValue']={syn:'Returns the minimal value observed for the acceleration since the device was started.',lib:'accelerometer.get_lowestValue()',pro:'function get_lowestValue()',cmt:'

Returns the minimal value observed for the acceleration since the device was started. Can be reset to an arbitrary value thanks to set_lowestValue().

',ret:'a floating point number corresponding to the minimal value observed for the acceleration since the device was started',ext:'On failure, throws an exception or returns `Y_LOWESTVALUE_INVALID`.'}; doc['Accelerometer']['get_module']={syn:'Gets the `YModule` object for the device on which the function is located.',lib:'accelerometer.get_module()',pro:'function get_module()',cmt:'

Gets the `YModule` object for the device on which the function is located. If the function cannot be located on any module, the returned instance of `YModule` is not shown as on-line.

',ret:'an instance of `YModule`'}; doc['Accelerometer']['get_module_async']={syn:'Gets the `YModule` object for the device on which the function is located (asynchronous version).',lib:'accelerometer.get_module_async()',pro:'function get_module_async(callback, context)',cmt:'

Gets the `YModule` object for the device on which the function is located (asynchronous version). If the function cannot be located on any module, the returned `YModule` object does not show as on-line.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking Firefox javascript VM that does not implement context switching during blocking I/O calls. See the documentation section on asynchronous Javascript calls for more details.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the requested `YModule` object',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['Accelerometer']['get_recordedData']={syn:'Retrieves a DataSet object holding historical data for this sensor, for a specified time interval.',lib:'accelerometer.get_recordedData()',pro:'function get_recordedData(startTime, endTime)',cmt:'

Retrieves a DataSet object holding historical data for this sensor, for a specified time interval. The measures will be retrieved from the data logger, which must have been turned on at the desired time. See the documentation of the DataSet class for information on how to get an overview of the recorded data, and how to load progressively a large set of measures from the data logger.

This function only works if the device uses a recent firmware, as DataSet objects are not supported by firmwares older than version 13000.

',par:{startTime:'the start of the desired measure time interval, as a Unix timestamp, i.e. the number of seconds since January 1, 1970 UTC. The special value 0 can be used to include any meaasure, without initial limit.',endTime:'the end of the desired measure time interval, as a Unix timestamp, i.e. the number of seconds since January 1, 1970 UTC. The special value 0 can be used to include any meaasure, without ending limit.'},ret:'an instance of YDataSet, providing access to historical data. Past measures can be loaded progressively using methods from the YDataSet object.'}; doc['Accelerometer']['get_reportFrequency']={syn:'Returns the timed value notification frequency, or \x22OFF\x22 if timed value notifications are disabled for this function.',lib:'accelerometer.get_reportFrequency()',pro:'function get_reportFrequency()',cmt:'

Returns the timed value notification frequency, or \x22OFF\x22 if timed value notifications are disabled for this function.

',ret:'a string corresponding to the timed value notification frequency, or \x22OFF\x22 if timed value notifications are disabled for this function',ext:'On failure, throws an exception or returns `Y_REPORTFREQUENCY_INVALID`.'}; doc['Accelerometer']['get_resolution']={syn:'Returns the resolution of the measured values.',lib:'accelerometer.get_resolution()',pro:'function get_resolution()',cmt:'

Returns the resolution of the measured values. The resolution corresponds to the numerical precision of the measures, which is not always the same as the actual precision of the sensor.

',ret:'a floating point number corresponding to the resolution of the measured values',ext:'On failure, throws an exception or returns `Y_RESOLUTION_INVALID`.'}; doc['Accelerometer']['get_sensorState']={syn:'Returns the sensor health state code, which is zero when there is an up-to-date measure available or a positive code if the sensor is not able to provide a measure right now.',lib:'accelerometer.get_sensorState()',pro:'function get_sensorState()',cmt:'

Returns the sensor health state code, which is zero when there is an up-to-date measure available or a positive code if the sensor is not able to provide a measure right now.

',ret:'an integer corresponding to the sensor health state code, which is zero when there is an up-to-date measure available or a positive code if the sensor is not able to provide a measure right now',ext:'On failure, throws an exception or returns `Y_SENSORSTATE_INVALID`.'}; doc['Accelerometer']['get_unit']={syn:'Returns the measuring unit for the acceleration.',lib:'accelerometer.get_unit()',pro:'function get_unit()',cmt:'

Returns the measuring unit for the acceleration.

',ret:'a string corresponding to the measuring unit for the acceleration',ext:'On failure, throws an exception or returns `Y_UNIT_INVALID`.'}; doc['Accelerometer']['get_userData']={syn:'Returns the value of the userData attribute, as previously stored using method `set_userData`.',lib:'accelerometer.get_userData()',pro:'function get_userData()',cmt:'

Returns the value of the userData attribute, as previously stored using method `set_userData`. This attribute is never touched directly by the API, and is at disposal of the caller to store a context.

',ret:'the object stored previously by the caller.'}; doc['Accelerometer']['get_xValue']={syn:'Returns the X component of the acceleration, as a floating point number.',lib:'accelerometer.get_xValue()',pro:'function get_xValue()',cmt:'

Returns the X component of the acceleration, as a floating point number.

',ret:'a floating point number corresponding to the X component of the acceleration, as a floating point number',ext:'On failure, throws an exception or returns `Y_XVALUE_INVALID`.'}; doc['Accelerometer']['get_yValue']={syn:'Returns the Y component of the acceleration, as a floating point number.',lib:'accelerometer.get_yValue()',pro:'function get_yValue()',cmt:'

Returns the Y component of the acceleration, as a floating point number.

',ret:'a floating point number corresponding to the Y component of the acceleration, as a floating point number',ext:'On failure, throws an exception or returns `Y_YVALUE_INVALID`.'}; doc['Accelerometer']['get_zValue']={syn:'Returns the Z component of the acceleration, as a floating point number.',lib:'accelerometer.get_zValue()',pro:'function get_zValue()',cmt:'

Returns the Z component of the acceleration, as a floating point number.

',ret:'a floating point number corresponding to the Z component of the acceleration, as a floating point number',ext:'On failure, throws an exception or returns `Y_ZVALUE_INVALID`.'}; doc['Accelerometer']['isOnline']={syn:'Checks if the accelerometer is currently reachable, without raising any error.',lib:'accelerometer.isOnline()',pro:'function isOnline()',cmt:'

Checks if the accelerometer is currently reachable, without raising any error. If there is a cached value for the accelerometer in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the accelerometer.

',ret:'`true` if the accelerometer can be reached, and `false` otherwise'}; doc['Accelerometer']['isOnline_async']={syn:'Checks if the accelerometer is currently reachable, without raising any error (asynchronous version).',lib:'accelerometer.isOnline_async()',pro:'function isOnline_async(callback, context)',cmt:'

Checks if the accelerometer is currently reachable, without raising any error (asynchronous version). If there is a cached value for the accelerometer in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the requested function.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the boolean result',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['Accelerometer']['load']={syn:'Preloads the accelerometer cache with a specified validity duration.',lib:'accelerometer.load()',pro:'function load(msValidity)',cmt:'

Preloads the accelerometer cache with a specified validity duration. By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network traffic for instance.

',par:{msValidity:'an integer corresponding to the validity attributed to the loaded function parameters, in milliseconds'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Accelerometer']['loadAttribute']={syn:'Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.',lib:'accelerometer.loadAttribute()',pro:'function loadAttribute(attrName)',cmt:'

Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.

',par:{attrName:'the name of the requested attribute'},ret:'a string with the value of the the attribute',ext:'On failure, throws an exception or returns an empty string.'}; doc['Accelerometer']['loadCalibrationPoints']={syn:'Retrieves error correction data points previously entered using the method `calibrateFromPoints`.',lib:'accelerometer.loadCalibrationPoints()',pro:'function loadCalibrationPoints(rawValues, refValues)',cmt:'

Retrieves error correction data points previously entered using the method `calibrateFromPoints`.

',par:{rawValues:'array of floating point numbers, that will be filled by the function with the raw sensor values for the correction points.',refValues:'array of floating point numbers, that will be filled by the function with the desired values for the correction points.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Accelerometer']['load_async']={syn:'Preloads the accelerometer cache with a specified validity duration (asynchronous version).',lib:'accelerometer.load_async()',pro:'function load_async(msValidity, callback, context)',cmt:'

Preloads the accelerometer cache with a specified validity duration (asynchronous version). By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network trafic for instance.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{msValidity:'an integer corresponding to the validity of the loaded function parameters, in milliseconds',callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the error code (or `YAPI_SUCCESS`)',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['Accelerometer']['muteValueCallbacks']={syn:'Disables the propagation of every new advertised value to the parent hub.',lib:'accelerometer.muteValueCallbacks()',pro:'function muteValueCallbacks()',cmt:'

Disables the propagation of every new advertised value to the parent hub. You can use this function to save bandwidth and CPU on computers with limited resources, or to prevent unwanted invocations of the HTTP callback. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Accelerometer']['nextAccelerometer']={syn:'Continues the enumeration of accelerometers started using `yFirstAccelerometer()`.',lib:'accelerometer.nextAccelerometer()',pro:'function nextAccelerometer()',cmt:'

Continues the enumeration of accelerometers started using `yFirstAccelerometer()`.

',ret:'a pointer to a `YAccelerometer` object, corresponding to an accelerometer currently online, or a `null` pointer if there are no more accelerometers to enumerate.'}; doc['Accelerometer']['registerTimedReportCallback']={syn:'Registers the callback function that is invoked on every periodic timed notification.',lib:'accelerometer.registerTimedReportCallback()',pro:'function registerTimedReportCallback(callback)',cmt:'

Registers the callback function that is invoked on every periodic timed notification. The callback is invoked only during the execution of `ySleep` or `yHandleEvents`. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a null pointer as argument.

',par:{callback:'the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and an YMeasure object describing the new advertised value.'}}; doc['Accelerometer']['registerValueCallback']={syn:'Registers the callback function that is invoked on every change of advertised value.',lib:'accelerometer.registerValueCallback()',pro:'function registerValueCallback(callback)',cmt:'

Registers the callback function that is invoked on every change of advertised value. The callback is invoked only during the execution of `ySleep` or `yHandleEvents`. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a null pointer as argument.

',par:{callback:'the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and the character string describing the new advertised value.'}}; doc['Accelerometer']['set_advMode']={syn:'Changes the measuring mode used for the advertised value pushed to the parent hub.',lib:'accelerometer.set_advMode()',pro:'function set_advMode(newval)',cmt:'

Changes the measuring mode used for the advertised value pushed to the parent hub.

',par:{newval:'a value among `Y_ADVMODE_IMMEDIATE`, `Y_ADVMODE_PERIOD_AVG`, `Y_ADVMODE_PERIOD_MIN` and `Y_ADVMODE_PERIOD_MAX` corresponding to the measuring mode used for the advertised value pushed to the parent hub'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Accelerometer']['set_bandwidth']={syn:'Changes the measure update frequency, measured in Hz (Yocto-3D-V2 only).',lib:'accelerometer.set_bandwidth()',pro:'function set_bandwidth(newval)',cmt:'

Changes the measure update frequency, measured in Hz (Yocto-3D-V2 only). When the frequency is lower, the device performs averaging.

',par:{newval:'an integer corresponding to the measure update frequency, measured in Hz (Yocto-3D-V2 only)'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Accelerometer']['set_highestValue']={syn:'Changes the recorded maximal value observed.',lib:'accelerometer.set_highestValue()',pro:'function set_highestValue(newval)',cmt:'

Changes the recorded maximal value observed. Can be used to reset the value returned by get_lowestValue().

',par:{newval:'a floating point number corresponding to the recorded maximal value observed'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Accelerometer']['set_logFrequency']={syn:'Changes the datalogger recording frequency for this function.',lib:'accelerometer.set_logFrequency()',pro:'function set_logFrequency(newval)',cmt:'

Changes the datalogger recording frequency for this function. The frequency can be specified as samples per second, as sample per minute (for instance \x2215/m\x22) or in samples per hour (eg. \x224/h\x22). To disable recording for this function, use the value \x22OFF\x22.

',par:{newval:'a string corresponding to the datalogger recording frequency for this function'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Accelerometer']['set_logicalName']={syn:'Changes the logical name of the accelerometer.',lib:'accelerometer.set_logicalName()',pro:'function set_logicalName(newval)',cmt:'

Changes the logical name of the accelerometer. You can use `yCheckLogicalName()` prior to this call to make sure that your parameter is valid. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',par:{newval:'a string corresponding to the logical name of the accelerometer.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Accelerometer']['set_lowestValue']={syn:'Changes the recorded minimal value observed.',lib:'accelerometer.set_lowestValue()',pro:'function set_lowestValue(newval)',cmt:'

Changes the recorded minimal value observed. Can be used to reset the value returned by get_lowestValue().

',par:{newval:'a floating point number corresponding to the recorded minimal value observed'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Accelerometer']['set_reportFrequency']={syn:'Changes the timed value notification frequency for this function.',lib:'accelerometer.set_reportFrequency()',pro:'function set_reportFrequency(newval)',cmt:'

Changes the timed value notification frequency for this function. The frequency can be specified as samples per second, as sample per minute (for instance \x2215/m\x22) or in samples per hour (eg. \x224/h\x22). To disable timed value notifications for this function, use the value \x22OFF\x22.

',par:{newval:'a string corresponding to the timed value notification frequency for this function'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Accelerometer']['set_resolution']={syn:'Changes the resolution of the measured physical values.',lib:'accelerometer.set_resolution()',pro:'function set_resolution(newval)',cmt:'

Changes the resolution of the measured physical values. The resolution corresponds to the numerical precision when displaying value. It does not change the precision of the measure itself.

',par:{newval:'a floating point number corresponding to the resolution of the measured physical values'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Accelerometer']['set_userData']={syn:'Stores a user context provided as argument in the userData attribute of the function.',lib:'accelerometer.set_userData()',pro:'function set_userData(data)',cmt:'

Stores a user context provided as argument in the userData attribute of the function. This attribute is never touched by the API, and is at disposal of the caller to store a context.

',par:{data:'any kind of object to be stored'}}; doc['Accelerometer']['startDataLogger']={syn:'Starts the data logger on the device.',lib:'accelerometer.startDataLogger()',pro:'function startDataLogger()',cmt:'

Starts the data logger on the device. Note that the data logger will only save the measures on this sensor if the logFrequency is not set to \x22OFF\x22.

',ret:'`YAPI_SUCCESS` if the call succeeds.'}; doc['Accelerometer']['stopDataLogger']={syn:'Stops the datalogger on the device.',lib:'accelerometer.stopDataLogger()',pro:'function stopDataLogger()',cmt:'

Stops the datalogger on the device.

',ret:'`YAPI_SUCCESS` if the call succeeds.'}; doc['Accelerometer']['unmuteValueCallbacks']={syn:'Re-enables the propagation of every new advertised value to the parent hub.',lib:'accelerometer.unmuteValueCallbacks()',pro:'function unmuteValueCallbacks()',cmt:'

Re-enables the propagation of every new advertised value to the parent hub. This function reverts the effect of a previous call to `muteValueCallbacks()`. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Accelerometer']['wait_async']={syn:'Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function.',lib:'accelerometer.wait_async()',pro:'function wait_async(callback, context)',cmt:'

Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function. The callback function can therefore freely issue synchronous or asynchronous commands, without risking to block the Javascript VM.

',par:{callback:'callback function that is invoked when all pending commands on the module are completed. The callback function receives two arguments: the caller-specific context object and the receiving function object.',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing.'}; //--- (end of generated code: Accelerometer) //--- (generated code: Magnetometer) doc['Magnetometer']={'':{syn:'Magnetometer function interface',inc:'<script type='text/javascript' src='yocto_magnetometer.js'></script>',cmt:'

The YSensor class is the parent class for all Yoctopuce sensors. It can be used to read the current value and unit of any sensor, read the min/max value, configure autonomous recording frequency and access recorded data. It also provide a function to register a callback invoked each time the observed value changes, or at a predefined interval. Using this class rather than a specific subclass makes it possible to create generic applications that work with any Yoctopuce sensor, even those that do not yet exist. Note: The YAnButton class is the only analog input which does not inherit from YSensor.

'}}; doc['Magnetometer']['FindMagnetometer']={syn:'Retrieves a magnetometer for a given identifier.',lib:'YMagnetometer.FindMagnetometer()',pro:'function FindMagnetometer(func)',cmt:'

Retrieves a magnetometer for a given identifier. The identifier can be specified using several formats:

- FunctionLogicalName
- ModuleSerialNumber.FunctionIdentifier
- ModuleSerialNumber.FunctionLogicalName
- ModuleLogicalName.FunctionIdentifier
- ModuleLogicalName.FunctionLogicalName

This function does not require that the magnetometer is online at the time it is invoked. The returned object is nevertheless valid. Use the method `YMagnetometer.isOnline()` to test if the magnetometer is indeed online at a given time. In case of ambiguity when looking for a magnetometer by logical name, no error is notified: the first instance found is returned. The search is performed first by hardware name, then by logical name.

If a call to this object\x27s is_online() method returns FALSE although you are certain that the matching device is plugged, make sure that you did call registerHub() at application initialization time.

',par:{func:'a string that uniquely characterizes the magnetometer'},ret:'a `YMagnetometer` object allowing you to drive the magnetometer.'}; doc['Magnetometer']['FirstMagnetometer']={syn:'Starts the enumeration of magnetometers currently accessible.',lib:'YMagnetometer.FirstMagnetometer()',pro:'function FirstMagnetometer()',cmt:'

Starts the enumeration of magnetometers currently accessible. Use the method `YMagnetometer.nextMagnetometer()` to iterate on next magnetometers.

',ret:'a pointer to a `YMagnetometer` object, corresponding to the first magnetometer currently online, or a `null` pointer if there are none.'}; doc['Magnetometer']['calibrateFromPoints']={syn:'Configures error correction data points, in particular to compensate for a possible perturbation of the measure caused by an enclosure.',lib:'magnetometer.calibrateFromPoints()',pro:'function calibrateFromPoints(rawValues, refValues)',cmt:'

Configures error correction data points, in particular to compensate for a possible perturbation of the measure caused by an enclosure. It is possible to configure up to five correction points. Correction points must be provided in ascending order, and be in the range of the sensor. The device will automatically perform a linear interpolation of the error correction between specified points. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

For more information on advanced capabilities to refine the calibration of sensors, please contact support@yoctopuce.com.

',par:{rawValues:'array of floating point numbers, corresponding to the raw values returned by the sensor for the correction points.',refValues:'array of floating point numbers, corresponding to the corrected values for the correction points.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Magnetometer']['clearCache']={syn:'Invalidates the cache.',lib:'magnetometer.clearCache()',pro:'function clearCache()',cmt:'

Invalidates the cache. Invalidates the cache of the magnetometer attributes. Forces the next call to get_xxx() or loadxxx() to use values that come from the device.

'}; doc['Magnetometer']['describe']={syn:'Returns a short text that describes unambiguously the instance of the magnetometer in the form `TYPE(NAME)=SERIAL.FUNCTIONID`.',lib:'magnetometer.describe()',pro:'function describe()',cmt:'

Returns a short text that describes unambiguously the instance of the magnetometer in the form `TYPE(NAME)=SERIAL.FUNCTIONID`. More precisely, `TYPE` is the type of the function, `NAME` it the name used for the first access to the function, `SERIAL` is the serial number of the module if the module is connected or `\x22unresolved\x22`, and `FUNCTIONID` is the hardware identifier of the function if the module is connected. For example, this method returns `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1` if the module is already connected or `Relay(BadCustomeName.relay1)=unresolved` if the module has not yet been connected. This method does not trigger any USB or TCP transaction and can therefore be used in a debugger.

',ret:'a string that describes the magnetometer (ex: `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1`)'}; doc['Magnetometer']['get_advMode']={syn:'Returns the measuring mode used for the advertised value pushed to the parent hub.',lib:'magnetometer.get_advMode()',pro:'function get_advMode()',cmt:'

Returns the measuring mode used for the advertised value pushed to the parent hub.

',ret:'a value among `Y_ADVMODE_IMMEDIATE`, `Y_ADVMODE_PERIOD_AVG`, `Y_ADVMODE_PERIOD_MIN` and `Y_ADVMODE_PERIOD_MAX` corresponding to the measuring mode used for the advertised value pushed to the parent hub',ext:'On failure, throws an exception or returns `Y_ADVMODE_INVALID`.'}; doc['Magnetometer']['get_advertisedValue']={syn:'Returns the current value of the magnetometer (no more than 6 characters).',lib:'magnetometer.get_advertisedValue()',pro:'function get_advertisedValue()',cmt:'

Returns the current value of the magnetometer (no more than 6 characters).

',ret:'a string corresponding to the current value of the magnetometer (no more than 6 characters).',ext:'On failure, throws an exception or returns `Y_ADVERTISEDVALUE_INVALID`.'}; doc['Magnetometer']['get_bandwidth']={syn:'Returns the measure update frequency, measured in Hz (Yocto-3D-V2 only).',lib:'magnetometer.get_bandwidth()',pro:'function get_bandwidth()',cmt:'

Returns the measure update frequency, measured in Hz (Yocto-3D-V2 only).

',ret:'an integer corresponding to the measure update frequency, measured in Hz (Yocto-3D-V2 only)',ext:'On failure, throws an exception or returns `Y_BANDWIDTH_INVALID`.'}; doc['Magnetometer']['get_currentRawValue']={syn:'Returns the uncalibrated, unrounded raw value returned by the sensor, in mT, as a floating point number.',lib:'magnetometer.get_currentRawValue()',pro:'function get_currentRawValue()',cmt:'

Returns the uncalibrated, unrounded raw value returned by the sensor, in mT, as a floating point number.

',ret:'a floating point number corresponding to the uncalibrated, unrounded raw value returned by the sensor, in mT, as a floating point number',ext:'On failure, throws an exception or returns `Y_CURRENTRAWVALUE_INVALID`.'}; doc['Magnetometer']['get_currentValue']={syn:'Returns the current value of the magnetic field, in mT, as a floating point number.',lib:'magnetometer.get_currentValue()',pro:'function get_currentValue()',cmt:'

Returns the current value of the magnetic field, in mT, as a floating point number.

',ret:'a floating point number corresponding to the current value of the magnetic field, in mT, as a floating point number',ext:'On failure, throws an exception or returns `Y_CURRENTVALUE_INVALID`.'}; doc['Magnetometer']['get_dataLogger']={syn:'Returns the YDatalogger object of the device hosting the sensor.',lib:'magnetometer.get_dataLogger()',pro:'function get_dataLogger()',cmt:'

Returns the YDatalogger object of the device hosting the sensor. This method returns an object of class YDatalogger that can control global parameters of the data logger. The returned object should not be freed.

',ret:'an YDataLogger object or null on error.'}; doc['Magnetometer']['get_errorMessage']={syn:'Returns the error message of the latest error with the magnetometer.',lib:'magnetometer.get_errorMessage()',pro:'function get_errorMessage()',cmt:'

Returns the error message of the latest error with the magnetometer. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a string corresponding to the latest error message that occured while using the magnetometer object'}; doc['Magnetometer']['get_errorType']={syn:'Returns the numerical error code of the latest error with the magnetometer.',lib:'magnetometer.get_errorType()',pro:'function get_errorType()',cmt:'

Returns the numerical error code of the latest error with the magnetometer. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a number corresponding to the code of the latest error that occurred while using the magnetometer object'}; doc['Magnetometer']['get_friendlyName']={syn:'Returns a global identifier of the magnetometer in the format `MODULE_NAME.FUNCTION_NAME`.',lib:'magnetometer.get_friendlyName()',pro:'function get_friendlyName()',cmt:'

Returns a global identifier of the magnetometer in the format `MODULE_NAME.FUNCTION_NAME`. The returned string uses the logical names of the module and of the magnetometer if they are defined, otherwise the serial number of the module and the hardware identifier of the magnetometer (for example: `MyCustomName.relay1`)

',ret:'a string that uniquely identifies the magnetometer using logical names (ex: `MyCustomName.relay1`)',ext:'On failure, throws an exception or returns `Y_FRIENDLYNAME_INVALID`.'}; doc['Magnetometer']['get_functionDescriptor']={syn:'Returns a unique identifier of type `YFUN_DESCR` corresponding to the function.',lib:'magnetometer.get_functionDescriptor()',pro:'function get_functionDescriptor()',cmt:'

Returns a unique identifier of type `YFUN_DESCR` corresponding to the function. This identifier can be used to test if two instances of `YFunction` reference the same physical function on the same physical device.

',ret:'an identifier of type `YFUN_DESCR`.',ext:'If the function has never been contacted, the returned value is `Y_FUNCTIONDESCRIPTOR_INVALID`.'}; doc['Magnetometer']['get_functionId']={syn:'Returns the hardware identifier of the magnetometer, without reference to the module.',lib:'magnetometer.get_functionId()',pro:'function get_functionId()',cmt:'

Returns the hardware identifier of the magnetometer, without reference to the module. For example `relay1`

',ret:'a string that identifies the magnetometer (ex: `relay1`)',ext:'On failure, throws an exception or returns `Y_FUNCTIONID_INVALID`.'}; doc['Magnetometer']['get_hardwareId']={syn:'Returns the unique hardware identifier of the magnetometer in the form `SERIAL.FUNCTIONID`.',lib:'magnetometer.get_hardwareId()',pro:'function get_hardwareId()',cmt:'

Returns the unique hardware identifier of the magnetometer in the form `SERIAL.FUNCTIONID`. The unique hardware identifier is composed of the device serial number and of the hardware identifier of the magnetometer (for example `RELAYLO1-123456.relay1`).

',ret:'a string that uniquely identifies the magnetometer (ex: `RELAYLO1-123456.relay1`)',ext:'On failure, throws an exception or returns `Y_HARDWAREID_INVALID`.'}; doc['Magnetometer']['get_highestValue']={syn:'Returns the maximal value observed for the magnetic field since the device was started.',lib:'magnetometer.get_highestValue()',pro:'function get_highestValue()',cmt:'

Returns the maximal value observed for the magnetic field since the device was started. Can be reset to an arbitrary value thanks to set_highestValue().

',ret:'a floating point number corresponding to the maximal value observed for the magnetic field since the device was started',ext:'On failure, throws an exception or returns `Y_HIGHESTVALUE_INVALID`.'}; doc['Magnetometer']['get_logFrequency']={syn:'Returns the datalogger recording frequency for this function, or \x22OFF\x22 when measures are not stored in the data logger flash memory.',lib:'magnetometer.get_logFrequency()',pro:'function get_logFrequency()',cmt:'

Returns the datalogger recording frequency for this function, or \x22OFF\x22 when measures are not stored in the data logger flash memory.

',ret:'a string corresponding to the datalogger recording frequency for this function, or \x22OFF\x22 when measures are not stored in the data logger flash memory',ext:'On failure, throws an exception or returns `Y_LOGFREQUENCY_INVALID`.'}; doc['Magnetometer']['get_logicalName']={syn:'Returns the logical name of the magnetometer.',lib:'magnetometer.get_logicalName()',pro:'function get_logicalName()',cmt:'

Returns the logical name of the magnetometer.

',ret:'a string corresponding to the logical name of the magnetometer.',ext:'On failure, throws an exception or returns `Y_LOGICALNAME_INVALID`.'}; doc['Magnetometer']['get_lowestValue']={syn:'Returns the minimal value observed for the magnetic field since the device was started.',lib:'magnetometer.get_lowestValue()',pro:'function get_lowestValue()',cmt:'

Returns the minimal value observed for the magnetic field since the device was started. Can be reset to an arbitrary value thanks to set_lowestValue().

',ret:'a floating point number corresponding to the minimal value observed for the magnetic field since the device was started',ext:'On failure, throws an exception or returns `Y_LOWESTVALUE_INVALID`.'}; doc['Magnetometer']['get_module']={syn:'Gets the `YModule` object for the device on which the function is located.',lib:'magnetometer.get_module()',pro:'function get_module()',cmt:'

Gets the `YModule` object for the device on which the function is located. If the function cannot be located on any module, the returned instance of `YModule` is not shown as on-line.

',ret:'an instance of `YModule`'}; doc['Magnetometer']['get_module_async']={syn:'Gets the `YModule` object for the device on which the function is located (asynchronous version).',lib:'magnetometer.get_module_async()',pro:'function get_module_async(callback, context)',cmt:'

Gets the `YModule` object for the device on which the function is located (asynchronous version). If the function cannot be located on any module, the returned `YModule` object does not show as on-line.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking Firefox javascript VM that does not implement context switching during blocking I/O calls. See the documentation section on asynchronous Javascript calls for more details.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the requested `YModule` object',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['Magnetometer']['get_recordedData']={syn:'Retrieves a DataSet object holding historical data for this sensor, for a specified time interval.',lib:'magnetometer.get_recordedData()',pro:'function get_recordedData(startTime, endTime)',cmt:'

Retrieves a DataSet object holding historical data for this sensor, for a specified time interval. The measures will be retrieved from the data logger, which must have been turned on at the desired time. See the documentation of the DataSet class for information on how to get an overview of the recorded data, and how to load progressively a large set of measures from the data logger.

This function only works if the device uses a recent firmware, as DataSet objects are not supported by firmwares older than version 13000.

',par:{startTime:'the start of the desired measure time interval, as a Unix timestamp, i.e. the number of seconds since January 1, 1970 UTC. The special value 0 can be used to include any meaasure, without initial limit.',endTime:'the end of the desired measure time interval, as a Unix timestamp, i.e. the number of seconds since January 1, 1970 UTC. The special value 0 can be used to include any meaasure, without ending limit.'},ret:'an instance of YDataSet, providing access to historical data. Past measures can be loaded progressively using methods from the YDataSet object.'}; doc['Magnetometer']['get_reportFrequency']={syn:'Returns the timed value notification frequency, or \x22OFF\x22 if timed value notifications are disabled for this function.',lib:'magnetometer.get_reportFrequency()',pro:'function get_reportFrequency()',cmt:'

Returns the timed value notification frequency, or \x22OFF\x22 if timed value notifications are disabled for this function.

',ret:'a string corresponding to the timed value notification frequency, or \x22OFF\x22 if timed value notifications are disabled for this function',ext:'On failure, throws an exception or returns `Y_REPORTFREQUENCY_INVALID`.'}; doc['Magnetometer']['get_resolution']={syn:'Returns the resolution of the measured values.',lib:'magnetometer.get_resolution()',pro:'function get_resolution()',cmt:'

Returns the resolution of the measured values. The resolution corresponds to the numerical precision of the measures, which is not always the same as the actual precision of the sensor.

',ret:'a floating point number corresponding to the resolution of the measured values',ext:'On failure, throws an exception or returns `Y_RESOLUTION_INVALID`.'}; doc['Magnetometer']['get_sensorState']={syn:'Returns the sensor health state code, which is zero when there is an up-to-date measure available or a positive code if the sensor is not able to provide a measure right now.',lib:'magnetometer.get_sensorState()',pro:'function get_sensorState()',cmt:'

Returns the sensor health state code, which is zero when there is an up-to-date measure available or a positive code if the sensor is not able to provide a measure right now.

',ret:'an integer corresponding to the sensor health state code, which is zero when there is an up-to-date measure available or a positive code if the sensor is not able to provide a measure right now',ext:'On failure, throws an exception or returns `Y_SENSORSTATE_INVALID`.'}; doc['Magnetometer']['get_unit']={syn:'Returns the measuring unit for the magnetic field.',lib:'magnetometer.get_unit()',pro:'function get_unit()',cmt:'

Returns the measuring unit for the magnetic field.

',ret:'a string corresponding to the measuring unit for the magnetic field',ext:'On failure, throws an exception or returns `Y_UNIT_INVALID`.'}; doc['Magnetometer']['get_userData']={syn:'Returns the value of the userData attribute, as previously stored using method `set_userData`.',lib:'magnetometer.get_userData()',pro:'function get_userData()',cmt:'

Returns the value of the userData attribute, as previously stored using method `set_userData`. This attribute is never touched directly by the API, and is at disposal of the caller to store a context.

',ret:'the object stored previously by the caller.'}; doc['Magnetometer']['get_xValue']={syn:'Returns the X component of the magnetic field, as a floating point number.',lib:'magnetometer.get_xValue()',pro:'function get_xValue()',cmt:'

Returns the X component of the magnetic field, as a floating point number.

',ret:'a floating point number corresponding to the X component of the magnetic field, as a floating point number',ext:'On failure, throws an exception or returns `Y_XVALUE_INVALID`.'}; doc['Magnetometer']['get_yValue']={syn:'Returns the Y component of the magnetic field, as a floating point number.',lib:'magnetometer.get_yValue()',pro:'function get_yValue()',cmt:'

Returns the Y component of the magnetic field, as a floating point number.

',ret:'a floating point number corresponding to the Y component of the magnetic field, as a floating point number',ext:'On failure, throws an exception or returns `Y_YVALUE_INVALID`.'}; doc['Magnetometer']['get_zValue']={syn:'Returns the Z component of the magnetic field, as a floating point number.',lib:'magnetometer.get_zValue()',pro:'function get_zValue()',cmt:'

Returns the Z component of the magnetic field, as a floating point number.

',ret:'a floating point number corresponding to the Z component of the magnetic field, as a floating point number',ext:'On failure, throws an exception or returns `Y_ZVALUE_INVALID`.'}; doc['Magnetometer']['isOnline']={syn:'Checks if the magnetometer is currently reachable, without raising any error.',lib:'magnetometer.isOnline()',pro:'function isOnline()',cmt:'

Checks if the magnetometer is currently reachable, without raising any error. If there is a cached value for the magnetometer in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the magnetometer.

',ret:'`true` if the magnetometer can be reached, and `false` otherwise'}; doc['Magnetometer']['isOnline_async']={syn:'Checks if the magnetometer is currently reachable, without raising any error (asynchronous version).',lib:'magnetometer.isOnline_async()',pro:'function isOnline_async(callback, context)',cmt:'

Checks if the magnetometer is currently reachable, without raising any error (asynchronous version). If there is a cached value for the magnetometer in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the requested function.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the boolean result',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['Magnetometer']['load']={syn:'Preloads the magnetometer cache with a specified validity duration.',lib:'magnetometer.load()',pro:'function load(msValidity)',cmt:'

Preloads the magnetometer cache with a specified validity duration. By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network traffic for instance.

',par:{msValidity:'an integer corresponding to the validity attributed to the loaded function parameters, in milliseconds'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Magnetometer']['loadAttribute']={syn:'Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.',lib:'magnetometer.loadAttribute()',pro:'function loadAttribute(attrName)',cmt:'

Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.

',par:{attrName:'the name of the requested attribute'},ret:'a string with the value of the the attribute',ext:'On failure, throws an exception or returns an empty string.'}; doc['Magnetometer']['loadCalibrationPoints']={syn:'Retrieves error correction data points previously entered using the method `calibrateFromPoints`.',lib:'magnetometer.loadCalibrationPoints()',pro:'function loadCalibrationPoints(rawValues, refValues)',cmt:'

Retrieves error correction data points previously entered using the method `calibrateFromPoints`.

',par:{rawValues:'array of floating point numbers, that will be filled by the function with the raw sensor values for the correction points.',refValues:'array of floating point numbers, that will be filled by the function with the desired values for the correction points.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Magnetometer']['load_async']={syn:'Preloads the magnetometer cache with a specified validity duration (asynchronous version).',lib:'magnetometer.load_async()',pro:'function load_async(msValidity, callback, context)',cmt:'

Preloads the magnetometer cache with a specified validity duration (asynchronous version). By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network trafic for instance.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{msValidity:'an integer corresponding to the validity of the loaded function parameters, in milliseconds',callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the error code (or `YAPI_SUCCESS`)',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['Magnetometer']['muteValueCallbacks']={syn:'Disables the propagation of every new advertised value to the parent hub.',lib:'magnetometer.muteValueCallbacks()',pro:'function muteValueCallbacks()',cmt:'

Disables the propagation of every new advertised value to the parent hub. You can use this function to save bandwidth and CPU on computers with limited resources, or to prevent unwanted invocations of the HTTP callback. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Magnetometer']['nextMagnetometer']={syn:'Continues the enumeration of magnetometers started using `yFirstMagnetometer()`.',lib:'magnetometer.nextMagnetometer()',pro:'function nextMagnetometer()',cmt:'

Continues the enumeration of magnetometers started using `yFirstMagnetometer()`.

',ret:'a pointer to a `YMagnetometer` object, corresponding to a magnetometer currently online, or a `null` pointer if there are no more magnetometers to enumerate.'}; doc['Magnetometer']['registerTimedReportCallback']={syn:'Registers the callback function that is invoked on every periodic timed notification.',lib:'magnetometer.registerTimedReportCallback()',pro:'function registerTimedReportCallback(callback)',cmt:'

Registers the callback function that is invoked on every periodic timed notification. The callback is invoked only during the execution of `ySleep` or `yHandleEvents`. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a null pointer as argument.

',par:{callback:'the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and an YMeasure object describing the new advertised value.'}}; doc['Magnetometer']['registerValueCallback']={syn:'Registers the callback function that is invoked on every change of advertised value.',lib:'magnetometer.registerValueCallback()',pro:'function registerValueCallback(callback)',cmt:'

Registers the callback function that is invoked on every change of advertised value. The callback is invoked only during the execution of `ySleep` or `yHandleEvents`. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a null pointer as argument.

',par:{callback:'the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and the character string describing the new advertised value.'}}; doc['Magnetometer']['set_advMode']={syn:'Changes the measuring mode used for the advertised value pushed to the parent hub.',lib:'magnetometer.set_advMode()',pro:'function set_advMode(newval)',cmt:'

Changes the measuring mode used for the advertised value pushed to the parent hub.

',par:{newval:'a value among `Y_ADVMODE_IMMEDIATE`, `Y_ADVMODE_PERIOD_AVG`, `Y_ADVMODE_PERIOD_MIN` and `Y_ADVMODE_PERIOD_MAX` corresponding to the measuring mode used for the advertised value pushed to the parent hub'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Magnetometer']['set_bandwidth']={syn:'Changes the measure update frequency, measured in Hz (Yocto-3D-V2 only).',lib:'magnetometer.set_bandwidth()',pro:'function set_bandwidth(newval)',cmt:'

Changes the measure update frequency, measured in Hz (Yocto-3D-V2 only). When the frequency is lower, the device performs averaging.

',par:{newval:'an integer corresponding to the measure update frequency, measured in Hz (Yocto-3D-V2 only)'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Magnetometer']['set_highestValue']={syn:'Changes the recorded maximal value observed.',lib:'magnetometer.set_highestValue()',pro:'function set_highestValue(newval)',cmt:'

Changes the recorded maximal value observed. Can be used to reset the value returned by get_lowestValue().

',par:{newval:'a floating point number corresponding to the recorded maximal value observed'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Magnetometer']['set_logFrequency']={syn:'Changes the datalogger recording frequency for this function.',lib:'magnetometer.set_logFrequency()',pro:'function set_logFrequency(newval)',cmt:'

Changes the datalogger recording frequency for this function. The frequency can be specified as samples per second, as sample per minute (for instance \x2215/m\x22) or in samples per hour (eg. \x224/h\x22). To disable recording for this function, use the value \x22OFF\x22.

',par:{newval:'a string corresponding to the datalogger recording frequency for this function'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Magnetometer']['set_logicalName']={syn:'Changes the logical name of the magnetometer.',lib:'magnetometer.set_logicalName()',pro:'function set_logicalName(newval)',cmt:'

Changes the logical name of the magnetometer. You can use `yCheckLogicalName()` prior to this call to make sure that your parameter is valid. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',par:{newval:'a string corresponding to the logical name of the magnetometer.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Magnetometer']['set_lowestValue']={syn:'Changes the recorded minimal value observed.',lib:'magnetometer.set_lowestValue()',pro:'function set_lowestValue(newval)',cmt:'

Changes the recorded minimal value observed. Can be used to reset the value returned by get_lowestValue().

',par:{newval:'a floating point number corresponding to the recorded minimal value observed'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Magnetometer']['set_reportFrequency']={syn:'Changes the timed value notification frequency for this function.',lib:'magnetometer.set_reportFrequency()',pro:'function set_reportFrequency(newval)',cmt:'

Changes the timed value notification frequency for this function. The frequency can be specified as samples per second, as sample per minute (for instance \x2215/m\x22) or in samples per hour (eg. \x224/h\x22). To disable timed value notifications for this function, use the value \x22OFF\x22.

',par:{newval:'a string corresponding to the timed value notification frequency for this function'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Magnetometer']['set_resolution']={syn:'Changes the resolution of the measured physical values.',lib:'magnetometer.set_resolution()',pro:'function set_resolution(newval)',cmt:'

Changes the resolution of the measured physical values. The resolution corresponds to the numerical precision when displaying value. It does not change the precision of the measure itself.

',par:{newval:'a floating point number corresponding to the resolution of the measured physical values'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Magnetometer']['set_userData']={syn:'Stores a user context provided as argument in the userData attribute of the function.',lib:'magnetometer.set_userData()',pro:'function set_userData(data)',cmt:'

Stores a user context provided as argument in the userData attribute of the function. This attribute is never touched by the API, and is at disposal of the caller to store a context.

',par:{data:'any kind of object to be stored'}}; doc['Magnetometer']['startDataLogger']={syn:'Starts the data logger on the device.',lib:'magnetometer.startDataLogger()',pro:'function startDataLogger()',cmt:'

Starts the data logger on the device. Note that the data logger will only save the measures on this sensor if the logFrequency is not set to \x22OFF\x22.

',ret:'`YAPI_SUCCESS` if the call succeeds.'}; doc['Magnetometer']['stopDataLogger']={syn:'Stops the datalogger on the device.',lib:'magnetometer.stopDataLogger()',pro:'function stopDataLogger()',cmt:'

Stops the datalogger on the device.

',ret:'`YAPI_SUCCESS` if the call succeeds.'}; doc['Magnetometer']['unmuteValueCallbacks']={syn:'Re-enables the propagation of every new advertised value to the parent hub.',lib:'magnetometer.unmuteValueCallbacks()',pro:'function unmuteValueCallbacks()',cmt:'

Re-enables the propagation of every new advertised value to the parent hub. This function reverts the effect of a previous call to `muteValueCallbacks()`. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Magnetometer']['wait_async']={syn:'Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function.',lib:'magnetometer.wait_async()',pro:'function wait_async(callback, context)',cmt:'

Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function. The callback function can therefore freely issue synchronous or asynchronous commands, without risking to block the Javascript VM.

',par:{callback:'callback function that is invoked when all pending commands on the module are completed. The callback function receives two arguments: the caller-specific context object and the receiving function object.',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing.'}; //--- (end of generated code: Magnetometer) //--- (generated code: RefFrame) doc['RefFrame']={'':{syn:'Reference frame configuration',inc:'<script type='text/javascript' src='yocto_refframe.js'></script>',cmt:'

This class is used to setup the base orientation of the Yocto-3D, so that the orientation functions, relative to the earth surface plane, use the proper reference frame. The class also implements a tridimensional sensor calibration process, which can compensate for local variations of standard gravity and improve the precision of the tilt sensors.

'}}; doc['RefFrame']['FindRefFrame']={syn:'Retrieves a reference frame for a given identifier.',lib:'YRefFrame.FindRefFrame()',pro:'function FindRefFrame(func)',cmt:'

Retrieves a reference frame for a given identifier. The identifier can be specified using several formats:

- FunctionLogicalName
- ModuleSerialNumber.FunctionIdentifier
- ModuleSerialNumber.FunctionLogicalName
- ModuleLogicalName.FunctionIdentifier
- ModuleLogicalName.FunctionLogicalName

This function does not require that the reference frame is online at the time it is invoked. The returned object is nevertheless valid. Use the method `YRefFrame.isOnline()` to test if the reference frame is indeed online at a given time. In case of ambiguity when looking for a reference frame by logical name, no error is notified: the first instance found is returned. The search is performed first by hardware name, then by logical name.

If a call to this object\x27s is_online() method returns FALSE although you are certain that the matching device is plugged, make sure that you did call registerHub() at application initialization time.

',par:{func:'a string that uniquely characterizes the reference frame'},ret:'a `YRefFrame` object allowing you to drive the reference frame.'}; doc['RefFrame']['FirstRefFrame']={syn:'Starts the enumeration of reference frames currently accessible.',lib:'YRefFrame.FirstRefFrame()',pro:'function FirstRefFrame()',cmt:'

Starts the enumeration of reference frames currently accessible. Use the method `YRefFrame.nextRefFrame()` to iterate on next reference frames.

',ret:'a pointer to a `YRefFrame` object, corresponding to the first reference frame currently online, or a `null` pointer if there are none.'}; doc['RefFrame']['cancel3DCalibration']={syn:'Aborts the sensors tridimensional calibration process et restores normal settings.',lib:'refframe.cancel3DCalibration()',pro:'function cancel3DCalibration()',cmt:'

Aborts the sensors tridimensional calibration process et restores normal settings.

On failure, throws an exception or returns a negative error code.

'}; doc['RefFrame']['clearCache']={syn:'Invalidates the cache.',lib:'refframe.clearCache()',pro:'function clearCache()',cmt:'

Invalidates the cache. Invalidates the cache of the reference frame attributes. Forces the next call to get_xxx() or loadxxx() to use values that come from the device.

'}; doc['RefFrame']['describe']={syn:'Returns a short text that describes unambiguously the instance of the reference frame in the form `TYPE(NAME)=SERIAL.FUNCTIONID`.',lib:'refframe.describe()',pro:'function describe()',cmt:'

Returns a short text that describes unambiguously the instance of the reference frame in the form `TYPE(NAME)=SERIAL.FUNCTIONID`. More precisely, `TYPE` is the type of the function, `NAME` it the name used for the first access to the function, `SERIAL` is the serial number of the module if the module is connected or `\x22unresolved\x22`, and `FUNCTIONID` is the hardware identifier of the function if the module is connected. For example, this method returns `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1` if the module is already connected or `Relay(BadCustomeName.relay1)=unresolved` if the module has not yet been connected. This method does not trigger any USB or TCP transaction and can therefore be used in a debugger.

',ret:'a string that describes the reference frame (ex: `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1`)'}; doc['RefFrame']['get_3DCalibrationHint']={syn:'Returns instructions to proceed to the tridimensional calibration initiated with method `start3DCalibration`.',lib:'refframe.get_3DCalibrationHint()',pro:'function get_3DCalibrationHint()',cmt:'

Returns instructions to proceed to the tridimensional calibration initiated with method `start3DCalibration`.

',ret:'a character string.'}; doc['RefFrame']['get_3DCalibrationLogMsg']={syn:'Returns the latest log message from the calibration process.',lib:'refframe.get_3DCalibrationLogMsg()',pro:'function get_3DCalibrationLogMsg()',cmt:'

Returns the latest log message from the calibration process. When no new message is available, returns an empty string.

',ret:'a character string.'}; doc['RefFrame']['get_3DCalibrationProgress']={syn:'Returns the global process indicator for the tridimensional calibration initiated with method `start3DCalibration`.',lib:'refframe.get_3DCalibrationProgress()',pro:'function get_3DCalibrationProgress()',cmt:'

Returns the global process indicator for the tridimensional calibration initiated with method `start3DCalibration`.

',ret:'an integer between 0 (not started) and 100 (stage completed).'}; doc['RefFrame']['get_3DCalibrationStage']={syn:'Returns index of the current stage of the calibration initiated with method `start3DCalibration`.',lib:'refframe.get_3DCalibrationStage()',pro:'function get_3DCalibrationStage()',cmt:'

Returns index of the current stage of the calibration initiated with method `start3DCalibration`.

',ret:'an integer, growing each time a calibration stage is completed.'}; doc['RefFrame']['get_3DCalibrationStageProgress']={syn:'Returns the process indicator for the current stage of the calibration initiated with method `start3DCalibration`.',lib:'refframe.get_3DCalibrationStageProgress()',pro:'function get_3DCalibrationStageProgress()',cmt:'

Returns the process indicator for the current stage of the calibration initiated with method `start3DCalibration`.

',ret:'an integer between 0 (not started) and 100 (stage completed).'}; doc['RefFrame']['get_advertisedValue']={syn:'Returns the current value of the reference frame (no more than 6 characters).',lib:'refframe.get_advertisedValue()',pro:'function get_advertisedValue()',cmt:'

Returns the current value of the reference frame (no more than 6 characters).

',ret:'a string corresponding to the current value of the reference frame (no more than 6 characters).',ext:'On failure, throws an exception or returns `Y_ADVERTISEDVALUE_INVALID`.'}; doc['RefFrame']['get_bearing']={syn:'Returns the reference bearing used by the compass.',lib:'refframe.get_bearing()',pro:'function get_bearing()',cmt:'

Returns the reference bearing used by the compass. The relative bearing indicated by the compass is the difference between the measured magnetic heading and the reference bearing indicated here.

',ret:'a floating point number corresponding to the reference bearing used by the compass',ext:'On failure, throws an exception or returns `Y_BEARING_INVALID`.'}; doc['RefFrame']['get_calibrationState']={syn:'Returns the 3D sensor calibration state (Yocto-3D-V2 only).',lib:'refframe.get_calibrationState()',pro:'function get_calibrationState()',cmt:'

Returns the 3D sensor calibration state (Yocto-3D-V2 only). This function returns an integer representing the calibration state of the 3 inertial sensors of the BNO055 chip, found in the Yocto-3D-V2. Hundredths show the calibration state of the accelerometer, tenths show the calibration state of the magnetometer while units show the calibration state of the gyroscope. For each sensor, the value 0 means no calibration and the value 3 means full calibration.

',ret:'an integer representing the calibration state of Yocto-3D-V2: 333 when fully calibrated, 0 when not calibrated at all.',ext:'On failure, throws an exception or returns a negative error code. For the Yocto-3D (V1), this function always return -3 (unsupported function).'}; doc['RefFrame']['get_errorMessage']={syn:'Returns the error message of the latest error with the reference frame.',lib:'refframe.get_errorMessage()',pro:'function get_errorMessage()',cmt:'

Returns the error message of the latest error with the reference frame. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a string corresponding to the latest error message that occured while using the reference frame object'}; doc['RefFrame']['get_errorType']={syn:'Returns the numerical error code of the latest error with the reference frame.',lib:'refframe.get_errorType()',pro:'function get_errorType()',cmt:'

Returns the numerical error code of the latest error with the reference frame. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a number corresponding to the code of the latest error that occurred while using the reference frame object'}; doc['RefFrame']['get_friendlyName']={syn:'Returns a global identifier of the reference frame in the format `MODULE_NAME.FUNCTION_NAME`.',lib:'refframe.get_friendlyName()',pro:'function get_friendlyName()',cmt:'

Returns a global identifier of the reference frame in the format `MODULE_NAME.FUNCTION_NAME`. The returned string uses the logical names of the module and of the reference frame if they are defined, otherwise the serial number of the module and the hardware identifier of the reference frame (for example: `MyCustomName.relay1`)

',ret:'a string that uniquely identifies the reference frame using logical names (ex: `MyCustomName.relay1`)',ext:'On failure, throws an exception or returns `Y_FRIENDLYNAME_INVALID`.'}; doc['RefFrame']['get_functionDescriptor']={syn:'Returns a unique identifier of type `YFUN_DESCR` corresponding to the function.',lib:'refframe.get_functionDescriptor()',pro:'function get_functionDescriptor()',cmt:'

Returns a unique identifier of type `YFUN_DESCR` corresponding to the function. This identifier can be used to test if two instances of `YFunction` reference the same physical function on the same physical device.

',ret:'an identifier of type `YFUN_DESCR`.',ext:'If the function has never been contacted, the returned value is `Y_FUNCTIONDESCRIPTOR_INVALID`.'}; doc['RefFrame']['get_functionId']={syn:'Returns the hardware identifier of the reference frame, without reference to the module.',lib:'refframe.get_functionId()',pro:'function get_functionId()',cmt:'

Returns the hardware identifier of the reference frame, without reference to the module. For example `relay1`

',ret:'a string that identifies the reference frame (ex: `relay1`)',ext:'On failure, throws an exception or returns `Y_FUNCTIONID_INVALID`.'}; doc['RefFrame']['get_hardwareId']={syn:'Returns the unique hardware identifier of the reference frame in the form `SERIAL.FUNCTIONID`.',lib:'refframe.get_hardwareId()',pro:'function get_hardwareId()',cmt:'

Returns the unique hardware identifier of the reference frame in the form `SERIAL.FUNCTIONID`. The unique hardware identifier is composed of the device serial number and of the hardware identifier of the reference frame (for example `RELAYLO1-123456.relay1`).

',ret:'a string that uniquely identifies the reference frame (ex: `RELAYLO1-123456.relay1`)',ext:'On failure, throws an exception or returns `Y_HARDWAREID_INVALID`.'}; doc['RefFrame']['get_logicalName']={syn:'Returns the logical name of the reference frame.',lib:'refframe.get_logicalName()',pro:'function get_logicalName()',cmt:'

Returns the logical name of the reference frame.

',ret:'a string corresponding to the logical name of the reference frame.',ext:'On failure, throws an exception or returns `Y_LOGICALNAME_INVALID`.'}; doc['RefFrame']['get_measureQuality']={syn:'Returns estimated quality of the orientation (Yocto-3D-V2 only).',lib:'refframe.get_measureQuality()',pro:'function get_measureQuality()',cmt:'

Returns estimated quality of the orientation (Yocto-3D-V2 only). This function returns an integer between 0 and 3 representing the degree of confidence of the position estimate. When the value is 3, the estimation is reliable. Below 3, one should expect sudden corrections, in particular for heading (`compass` function). The most frequent causes for values below 3 are magnetic interferences, and accelerations or rotations beyond the sensor range.

',ret:'an integer between 0 and 3 (3 when the measure is reliable)',ext:'On failure, throws an exception or returns a negative error code. For the Yocto-3D (V1), this function always return -3 (unsupported function).'}; doc['RefFrame']['get_module']={syn:'Gets the `YModule` object for the device on which the function is located.',lib:'refframe.get_module()',pro:'function get_module()',cmt:'

Gets the `YModule` object for the device on which the function is located. If the function cannot be located on any module, the returned instance of `YModule` is not shown as on-line.

',ret:'an instance of `YModule`'}; doc['RefFrame']['get_module_async']={syn:'Gets the `YModule` object for the device on which the function is located (asynchronous version).',lib:'refframe.get_module_async()',pro:'function get_module_async(callback, context)',cmt:'

Gets the `YModule` object for the device on which the function is located (asynchronous version). If the function cannot be located on any module, the returned `YModule` object does not show as on-line.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking Firefox javascript VM that does not implement context switching during blocking I/O calls. See the documentation section on asynchronous Javascript calls for more details.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the requested `YModule` object',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['RefFrame']['get_mountOrientation']={syn:'Returns the installation orientation of the device, as configured in order to define the reference frame for the compass and the pitch/roll tilt sensors.',lib:'refframe.get_mountOrientation()',pro:'function get_mountOrientation()',cmt:'

Returns the installation orientation of the device, as configured in order to define the reference frame for the compass and the pitch/roll tilt sensors.

',ret:'a value among the enumeration `Y_MOUNTORIENTATION` (`Y_MOUNTORIENTATION_TWELVE`, `Y_MOUNTORIENTATION_THREE`, `Y_MOUNTORIENTATION_SIX`, `Y_MOUNTORIENTATION_NINE`) corresponding to the orientation of the \x22X\x22 arrow on the device, as on a clock dial seen from an observer in the center of the box. On the bottom face, the 12H orientation points to the front, while on the top face, the 12H orientation points to the rear.',ext:'On failure, throws an exception or returns Y_MOUNTORIENTATION_INVALID.'}; doc['RefFrame']['get_mountPosition']={syn:'Returns the installation position of the device, as configured in order to define the reference frame for the compass and the pitch/roll tilt sensors.',lib:'refframe.get_mountPosition()',pro:'function get_mountPosition()',cmt:'

Returns the installation position of the device, as configured in order to define the reference frame for the compass and the pitch/roll tilt sensors.

',ret:'a value among the `Y_MOUNTPOSITION` enumeration (`Y_MOUNTPOSITION_BOTTOM`, `Y_MOUNTPOSITION_TOP`, `Y_MOUNTPOSITION_FRONT`, `Y_MOUNTPOSITION_RIGHT`, `Y_MOUNTPOSITION_REAR`, `Y_MOUNTPOSITION_LEFT`), corresponding to the installation in a box, on one of the six faces.',ext:'On failure, throws an exception or returns Y_MOUNTPOSITION_INVALID.'}; doc['RefFrame']['get_userData']={syn:'Returns the value of the userData attribute, as previously stored using method `set_userData`.',lib:'refframe.get_userData()',pro:'function get_userData()',cmt:'

Returns the value of the userData attribute, as previously stored using method `set_userData`. This attribute is never touched directly by the API, and is at disposal of the caller to store a context.

',ret:'the object stored previously by the caller.'}; doc['RefFrame']['isOnline']={syn:'Checks if the reference frame is currently reachable, without raising any error.',lib:'refframe.isOnline()',pro:'function isOnline()',cmt:'

Checks if the reference frame is currently reachable, without raising any error. If there is a cached value for the reference frame in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the reference frame.

',ret:'`true` if the reference frame can be reached, and `false` otherwise'}; doc['RefFrame']['isOnline_async']={syn:'Checks if the reference frame is currently reachable, without raising any error (asynchronous version).',lib:'refframe.isOnline_async()',pro:'function isOnline_async(callback, context)',cmt:'

Checks if the reference frame is currently reachable, without raising any error (asynchronous version). If there is a cached value for the reference frame in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the requested function.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the boolean result',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['RefFrame']['load']={syn:'Preloads the reference frame cache with a specified validity duration.',lib:'refframe.load()',pro:'function load(msValidity)',cmt:'

Preloads the reference frame cache with a specified validity duration. By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network traffic for instance.

',par:{msValidity:'an integer corresponding to the validity attributed to the loaded function parameters, in milliseconds'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['RefFrame']['loadAttribute']={syn:'Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.',lib:'refframe.loadAttribute()',pro:'function loadAttribute(attrName)',cmt:'

Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.

',par:{attrName:'the name of the requested attribute'},ret:'a string with the value of the the attribute',ext:'On failure, throws an exception or returns an empty string.'}; doc['RefFrame']['load_async']={syn:'Preloads the reference frame cache with a specified validity duration (asynchronous version).',lib:'refframe.load_async()',pro:'function load_async(msValidity, callback, context)',cmt:'

Preloads the reference frame cache with a specified validity duration (asynchronous version). By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network trafic for instance.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{msValidity:'an integer corresponding to the validity of the loaded function parameters, in milliseconds',callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the error code (or `YAPI_SUCCESS`)',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['RefFrame']['more3DCalibration']={syn:'Continues the sensors tridimensional calibration process previously initiated using method `start3DCalibration`.',lib:'refframe.more3DCalibration()',pro:'function more3DCalibration()',cmt:'

Continues the sensors tridimensional calibration process previously initiated using method `start3DCalibration`. This method should be called approximately 5 times per second, while positioning the device according to the instructions provided by method `get_3DCalibrationHint`. Note that the instructions change during the calibration process.

On failure, throws an exception or returns a negative error code.

'}; doc['RefFrame']['muteValueCallbacks']={syn:'Disables the propagation of every new advertised value to the parent hub.',lib:'refframe.muteValueCallbacks()',pro:'function muteValueCallbacks()',cmt:'

Disables the propagation of every new advertised value to the parent hub. You can use this function to save bandwidth and CPU on computers with limited resources, or to prevent unwanted invocations of the HTTP callback. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['RefFrame']['nextRefFrame']={syn:'Continues the enumeration of reference frames started using `yFirstRefFrame()`.',lib:'refframe.nextRefFrame()',pro:'function nextRefFrame()',cmt:'

Continues the enumeration of reference frames started using `yFirstRefFrame()`.

',ret:'a pointer to a `YRefFrame` object, corresponding to a reference frame currently online, or a `null` pointer if there are no more reference frames to enumerate.'}; doc['RefFrame']['registerValueCallback']={syn:'Registers the callback function that is invoked on every change of advertised value.',lib:'refframe.registerValueCallback()',pro:'function registerValueCallback(callback)',cmt:'

Registers the callback function that is invoked on every change of advertised value. The callback is invoked only during the execution of `ySleep` or `yHandleEvents`. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a null pointer as argument.

',par:{callback:'the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and the character string describing the new advertised value.'}}; doc['RefFrame']['save3DCalibration']={syn:'Applies the sensors tridimensional calibration parameters that have just been computed.',lib:'refframe.save3DCalibration()',pro:'function save3DCalibration()',cmt:'

Applies the sensors tridimensional calibration parameters that have just been computed. Remember to call the `saveToFlash()` method of the module if the changes must be kept when the device is restarted.

On failure, throws an exception or returns a negative error code.

'}; doc['RefFrame']['set_bearing']={syn:'Changes the reference bearing used by the compass.',lib:'refframe.set_bearing()',pro:'function set_bearing(newval)',cmt:'

Changes the reference bearing used by the compass. The relative bearing indicated by the compass is the difference between the measured magnetic heading and the reference bearing indicated here.

For instance, if you setup as reference bearing the value of the earth magnetic declination, the compass will provide the orientation relative to the geographic North.

Similarly, when the sensor is not mounted along the standard directions because it has an additional yaw angle, you can set this angle in the reference bearing so that the compass provides the expected natural direction.

Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',par:{newval:'a floating point number corresponding to the reference bearing used by the compass'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['RefFrame']['set_logicalName']={syn:'Changes the logical name of the reference frame.',lib:'refframe.set_logicalName()',pro:'function set_logicalName(newval)',cmt:'

Changes the logical name of the reference frame. You can use `yCheckLogicalName()` prior to this call to make sure that your parameter is valid. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',par:{newval:'a string corresponding to the logical name of the reference frame.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['RefFrame']['set_mountPosition']={syn:'Changes the compass and tilt sensor frame of reference.',lib:'refframe.set_mountPosition()',pro:'function set_mountPosition(position, orientation)',cmt:'

Changes the compass and tilt sensor frame of reference. The magnetic compass and the tilt sensors (pitch and roll) naturally work in the plane parallel to the earth surface. In case the device is not installed upright and horizontally, you must select its reference orientation (parallel to the earth surface) so that the measures are made relative to this position.

',par:{position:'a value among the `Y_MOUNTPOSITION` enumeration (`Y_MOUNTPOSITION_BOTTOM`, `Y_MOUNTPOSITION_TOP`, `Y_MOUNTPOSITION_FRONT`, `Y_MOUNTPOSITION_RIGHT`, `Y_MOUNTPOSITION_REAR`, `Y_MOUNTPOSITION_LEFT`), corresponding to the installation in a box, on one of the six faces.',orientation:'a value among the enumeration `Y_MOUNTORIENTATION` (`Y_MOUNTORIENTATION_TWELVE`, `Y_MOUNTORIENTATION_THREE`, `Y_MOUNTORIENTATION_SIX`, `Y_MOUNTORIENTATION_NINE`) corresponding to the orientation of the \x22X\x22 arrow on the device, as on a clock dial seen from an observer in the center of the box. On the bottom face, the 12H orientation points to the front, while on the top face, the 12H orientation points to the rear.'},ext:'On failure, throws an exception or returns a negative error code.'}; doc['RefFrame']['set_userData']={syn:'Stores a user context provided as argument in the userData attribute of the function.',lib:'refframe.set_userData()',pro:'function set_userData(data)',cmt:'

Stores a user context provided as argument in the userData attribute of the function. This attribute is never touched by the API, and is at disposal of the caller to store a context.

',par:{data:'any kind of object to be stored'}}; doc['RefFrame']['start3DCalibration']={syn:'Initiates the sensors tridimensional calibration process.',lib:'refframe.start3DCalibration()',pro:'function start3DCalibration()',cmt:'

Initiates the sensors tridimensional calibration process. This calibration is used at low level for inertial position estimation and to enhance the precision of the tilt sensors.

After calling this method, the device should be moved according to the instructions provided by method `get_3DCalibrationHint`, and `more3DCalibration` should be invoked about 5 times per second. The calibration procedure is completed when the method `get_3DCalibrationProgress` returns 100. At this point, the computed calibration parameters can be applied using method `save3DCalibration`. The calibration process can be canceled at any time using method `cancel3DCalibration`.

On failure, throws an exception or returns a negative error code.

'}; doc['RefFrame']['unmuteValueCallbacks']={syn:'Re-enables the propagation of every new advertised value to the parent hub.',lib:'refframe.unmuteValueCallbacks()',pro:'function unmuteValueCallbacks()',cmt:'

Re-enables the propagation of every new advertised value to the parent hub. This function reverts the effect of a previous call to `muteValueCallbacks()`. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['RefFrame']['wait_async']={syn:'Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function.',lib:'refframe.wait_async()',pro:'function wait_async(callback, context)',cmt:'

Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function. The callback function can therefore freely issue synchronous or asynchronous commands, without risking to block the Javascript VM.

',par:{callback:'callback function that is invoked when all pending commands on the module are completed. The callback function receives two arguments: the caller-specific context object and the receiving function object.',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing.'}; //--- (end of generated code: RefFrame) //--- (generated code: Compass) doc['Compass']={'':{syn:'Compass function interface',inc:'<script type='text/javascript' src='yocto_compass.js'></script>',cmt:'

The YSensor class is the parent class for all Yoctopuce sensors. It can be used to read the current value and unit of any sensor, read the min/max value, configure autonomous recording frequency and access recorded data. It also provide a function to register a callback invoked each time the observed value changes, or at a predefined interval. Using this class rather than a specific subclass makes it possible to create generic applications that work with any Yoctopuce sensor, even those that do not yet exist. Note: The YAnButton class is the only analog input which does not inherit from YSensor.

'}}; doc['Compass']['FindCompass']={syn:'Retrieves a compass for a given identifier.',lib:'YCompass.FindCompass()',pro:'function FindCompass(func)',cmt:'

Retrieves a compass for a given identifier. The identifier can be specified using several formats:

- FunctionLogicalName
- ModuleSerialNumber.FunctionIdentifier
- ModuleSerialNumber.FunctionLogicalName
- ModuleLogicalName.FunctionIdentifier
- ModuleLogicalName.FunctionLogicalName

This function does not require that the compass is online at the time it is invoked. The returned object is nevertheless valid. Use the method `YCompass.isOnline()` to test if the compass is indeed online at a given time. In case of ambiguity when looking for a compass by logical name, no error is notified: the first instance found is returned. The search is performed first by hardware name, then by logical name.

If a call to this object\x27s is_online() method returns FALSE although you are certain that the matching device is plugged, make sure that you did call registerHub() at application initialization time.

',par:{func:'a string that uniquely characterizes the compass'},ret:'a `YCompass` object allowing you to drive the compass.'}; doc['Compass']['FirstCompass']={syn:'Starts the enumeration of compasses currently accessible.',lib:'YCompass.FirstCompass()',pro:'function FirstCompass()',cmt:'

Starts the enumeration of compasses currently accessible. Use the method `YCompass.nextCompass()` to iterate on next compasses.

',ret:'a pointer to a `YCompass` object, corresponding to the first compass currently online, or a `null` pointer if there are none.'}; doc['Compass']['calibrateFromPoints']={syn:'Configures error correction data points, in particular to compensate for a possible perturbation of the measure caused by an enclosure.',lib:'compass.calibrateFromPoints()',pro:'function calibrateFromPoints(rawValues, refValues)',cmt:'

Configures error correction data points, in particular to compensate for a possible perturbation of the measure caused by an enclosure. It is possible to configure up to five correction points. Correction points must be provided in ascending order, and be in the range of the sensor. The device will automatically perform a linear interpolation of the error correction between specified points. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

For more information on advanced capabilities to refine the calibration of sensors, please contact support@yoctopuce.com.

',par:{rawValues:'array of floating point numbers, corresponding to the raw values returned by the sensor for the correction points.',refValues:'array of floating point numbers, corresponding to the corrected values for the correction points.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Compass']['clearCache']={syn:'Invalidates the cache.',lib:'compass.clearCache()',pro:'function clearCache()',cmt:'

Invalidates the cache. Invalidates the cache of the compass attributes. Forces the next call to get_xxx() or loadxxx() to use values that come from the device.

'}; doc['Compass']['describe']={syn:'Returns a short text that describes unambiguously the instance of the compass in the form `TYPE(NAME)=SERIAL.FUNCTIONID`.',lib:'compass.describe()',pro:'function describe()',cmt:'

Returns a short text that describes unambiguously the instance of the compass in the form `TYPE(NAME)=SERIAL.FUNCTIONID`. More precisely, `TYPE` is the type of the function, `NAME` it the name used for the first access to the function, `SERIAL` is the serial number of the module if the module is connected or `\x22unresolved\x22`, and `FUNCTIONID` is the hardware identifier of the function if the module is connected. For example, this method returns `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1` if the module is already connected or `Relay(BadCustomeName.relay1)=unresolved` if the module has not yet been connected. This method does not trigger any USB or TCP transaction and can therefore be used in a debugger.

',ret:'a string that describes the compass (ex: `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1`)'}; doc['Compass']['get_advMode']={syn:'Returns the measuring mode used for the advertised value pushed to the parent hub.',lib:'compass.get_advMode()',pro:'function get_advMode()',cmt:'

Returns the measuring mode used for the advertised value pushed to the parent hub.

',ret:'a value among `Y_ADVMODE_IMMEDIATE`, `Y_ADVMODE_PERIOD_AVG`, `Y_ADVMODE_PERIOD_MIN` and `Y_ADVMODE_PERIOD_MAX` corresponding to the measuring mode used for the advertised value pushed to the parent hub',ext:'On failure, throws an exception or returns `Y_ADVMODE_INVALID`.'}; doc['Compass']['get_advertisedValue']={syn:'Returns the current value of the compass (no more than 6 characters).',lib:'compass.get_advertisedValue()',pro:'function get_advertisedValue()',cmt:'

Returns the current value of the compass (no more than 6 characters).

',ret:'a string corresponding to the current value of the compass (no more than 6 characters).',ext:'On failure, throws an exception or returns `Y_ADVERTISEDVALUE_INVALID`.'}; doc['Compass']['get_bandwidth']={syn:'Returns the measure update frequency, measured in Hz (Yocto-3D-V2 only).',lib:'compass.get_bandwidth()',pro:'function get_bandwidth()',cmt:'

Returns the measure update frequency, measured in Hz (Yocto-3D-V2 only).

',ret:'an integer corresponding to the measure update frequency, measured in Hz (Yocto-3D-V2 only)',ext:'On failure, throws an exception or returns `Y_BANDWIDTH_INVALID`.'}; doc['Compass']['get_currentRawValue']={syn:'Returns the uncalibrated, unrounded raw value returned by the sensor, in degrees, as a floating point number.',lib:'compass.get_currentRawValue()',pro:'function get_currentRawValue()',cmt:'

Returns the uncalibrated, unrounded raw value returned by the sensor, in degrees, as a floating point number.

',ret:'a floating point number corresponding to the uncalibrated, unrounded raw value returned by the sensor, in degrees, as a floating point number',ext:'On failure, throws an exception or returns `Y_CURRENTRAWVALUE_INVALID`.'}; doc['Compass']['get_currentValue']={syn:'Returns the current value of the relative bearing, in degrees, as a floating point number.',lib:'compass.get_currentValue()',pro:'function get_currentValue()',cmt:'

Returns the current value of the relative bearing, in degrees, as a floating point number.

',ret:'a floating point number corresponding to the current value of the relative bearing, in degrees, as a floating point number',ext:'On failure, throws an exception or returns `Y_CURRENTVALUE_INVALID`.'}; doc['Compass']['get_dataLogger']={syn:'Returns the YDatalogger object of the device hosting the sensor.',lib:'compass.get_dataLogger()',pro:'function get_dataLogger()',cmt:'

Returns the YDatalogger object of the device hosting the sensor. This method returns an object of class YDatalogger that can control global parameters of the data logger. The returned object should not be freed.

',ret:'an YDataLogger object or null on error.'}; doc['Compass']['get_errorMessage']={syn:'Returns the error message of the latest error with the compass.',lib:'compass.get_errorMessage()',pro:'function get_errorMessage()',cmt:'

Returns the error message of the latest error with the compass. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a string corresponding to the latest error message that occured while using the compass object'}; doc['Compass']['get_errorType']={syn:'Returns the numerical error code of the latest error with the compass.',lib:'compass.get_errorType()',pro:'function get_errorType()',cmt:'

Returns the numerical error code of the latest error with the compass. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a number corresponding to the code of the latest error that occurred while using the compass object'}; doc['Compass']['get_friendlyName']={syn:'Returns a global identifier of the compass in the format `MODULE_NAME.FUNCTION_NAME`.',lib:'compass.get_friendlyName()',pro:'function get_friendlyName()',cmt:'

Returns a global identifier of the compass in the format `MODULE_NAME.FUNCTION_NAME`. The returned string uses the logical names of the module and of the compass if they are defined, otherwise the serial number of the module and the hardware identifier of the compass (for example: `MyCustomName.relay1`)

',ret:'a string that uniquely identifies the compass using logical names (ex: `MyCustomName.relay1`)',ext:'On failure, throws an exception or returns `Y_FRIENDLYNAME_INVALID`.'}; doc['Compass']['get_functionDescriptor']={syn:'Returns a unique identifier of type `YFUN_DESCR` corresponding to the function.',lib:'compass.get_functionDescriptor()',pro:'function get_functionDescriptor()',cmt:'

Returns a unique identifier of type `YFUN_DESCR` corresponding to the function. This identifier can be used to test if two instances of `YFunction` reference the same physical function on the same physical device.

',ret:'an identifier of type `YFUN_DESCR`.',ext:'If the function has never been contacted, the returned value is `Y_FUNCTIONDESCRIPTOR_INVALID`.'}; doc['Compass']['get_functionId']={syn:'Returns the hardware identifier of the compass, without reference to the module.',lib:'compass.get_functionId()',pro:'function get_functionId()',cmt:'

Returns the hardware identifier of the compass, without reference to the module. For example `relay1`

',ret:'a string that identifies the compass (ex: `relay1`)',ext:'On failure, throws an exception or returns `Y_FUNCTIONID_INVALID`.'}; doc['Compass']['get_hardwareId']={syn:'Returns the unique hardware identifier of the compass in the form `SERIAL.FUNCTIONID`.',lib:'compass.get_hardwareId()',pro:'function get_hardwareId()',cmt:'

Returns the unique hardware identifier of the compass in the form `SERIAL.FUNCTIONID`. The unique hardware identifier is composed of the device serial number and of the hardware identifier of the compass (for example `RELAYLO1-123456.relay1`).

',ret:'a string that uniquely identifies the compass (ex: `RELAYLO1-123456.relay1`)',ext:'On failure, throws an exception or returns `Y_HARDWAREID_INVALID`.'}; doc['Compass']['get_highestValue']={syn:'Returns the maximal value observed for the relative bearing since the device was started.',lib:'compass.get_highestValue()',pro:'function get_highestValue()',cmt:'

Returns the maximal value observed for the relative bearing since the device was started. Can be reset to an arbitrary value thanks to set_highestValue().

',ret:'a floating point number corresponding to the maximal value observed for the relative bearing since the device was started',ext:'On failure, throws an exception or returns `Y_HIGHESTVALUE_INVALID`.'}; doc['Compass']['get_logFrequency']={syn:'Returns the datalogger recording frequency for this function, or \x22OFF\x22 when measures are not stored in the data logger flash memory.',lib:'compass.get_logFrequency()',pro:'function get_logFrequency()',cmt:'

Returns the datalogger recording frequency for this function, or \x22OFF\x22 when measures are not stored in the data logger flash memory.

',ret:'a string corresponding to the datalogger recording frequency for this function, or \x22OFF\x22 when measures are not stored in the data logger flash memory',ext:'On failure, throws an exception or returns `Y_LOGFREQUENCY_INVALID`.'}; doc['Compass']['get_logicalName']={syn:'Returns the logical name of the compass.',lib:'compass.get_logicalName()',pro:'function get_logicalName()',cmt:'

Returns the logical name of the compass.

',ret:'a string corresponding to the logical name of the compass.',ext:'On failure, throws an exception or returns `Y_LOGICALNAME_INVALID`.'}; doc['Compass']['get_lowestValue']={syn:'Returns the minimal value observed for the relative bearing since the device was started.',lib:'compass.get_lowestValue()',pro:'function get_lowestValue()',cmt:'

Returns the minimal value observed for the relative bearing since the device was started. Can be reset to an arbitrary value thanks to set_lowestValue().

',ret:'a floating point number corresponding to the minimal value observed for the relative bearing since the device was started',ext:'On failure, throws an exception or returns `Y_LOWESTVALUE_INVALID`.'}; doc['Compass']['get_magneticHeading']={syn:'Returns the magnetic heading, regardless of the configured bearing.',lib:'compass.get_magneticHeading()',pro:'function get_magneticHeading()',cmt:'

Returns the magnetic heading, regardless of the configured bearing.

',ret:'a floating point number corresponding to the magnetic heading, regardless of the configured bearing',ext:'On failure, throws an exception or returns `Y_MAGNETICHEADING_INVALID`.'}; doc['Compass']['get_module']={syn:'Gets the `YModule` object for the device on which the function is located.',lib:'compass.get_module()',pro:'function get_module()',cmt:'

Gets the `YModule` object for the device on which the function is located. If the function cannot be located on any module, the returned instance of `YModule` is not shown as on-line.

',ret:'an instance of `YModule`'}; doc['Compass']['get_module_async']={syn:'Gets the `YModule` object for the device on which the function is located (asynchronous version).',lib:'compass.get_module_async()',pro:'function get_module_async(callback, context)',cmt:'

Gets the `YModule` object for the device on which the function is located (asynchronous version). If the function cannot be located on any module, the returned `YModule` object does not show as on-line.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking Firefox javascript VM that does not implement context switching during blocking I/O calls. See the documentation section on asynchronous Javascript calls for more details.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the requested `YModule` object',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['Compass']['get_recordedData']={syn:'Retrieves a DataSet object holding historical data for this sensor, for a specified time interval.',lib:'compass.get_recordedData()',pro:'function get_recordedData(startTime, endTime)',cmt:'

Retrieves a DataSet object holding historical data for this sensor, for a specified time interval. The measures will be retrieved from the data logger, which must have been turned on at the desired time. See the documentation of the DataSet class for information on how to get an overview of the recorded data, and how to load progressively a large set of measures from the data logger.

This function only works if the device uses a recent firmware, as DataSet objects are not supported by firmwares older than version 13000.

',par:{startTime:'the start of the desired measure time interval, as a Unix timestamp, i.e. the number of seconds since January 1, 1970 UTC. The special value 0 can be used to include any meaasure, without initial limit.',endTime:'the end of the desired measure time interval, as a Unix timestamp, i.e. the number of seconds since January 1, 1970 UTC. The special value 0 can be used to include any meaasure, without ending limit.'},ret:'an instance of YDataSet, providing access to historical data. Past measures can be loaded progressively using methods from the YDataSet object.'}; doc['Compass']['get_reportFrequency']={syn:'Returns the timed value notification frequency, or \x22OFF\x22 if timed value notifications are disabled for this function.',lib:'compass.get_reportFrequency()',pro:'function get_reportFrequency()',cmt:'

Returns the timed value notification frequency, or \x22OFF\x22 if timed value notifications are disabled for this function.

',ret:'a string corresponding to the timed value notification frequency, or \x22OFF\x22 if timed value notifications are disabled for this function',ext:'On failure, throws an exception or returns `Y_REPORTFREQUENCY_INVALID`.'}; doc['Compass']['get_resolution']={syn:'Returns the resolution of the measured values.',lib:'compass.get_resolution()',pro:'function get_resolution()',cmt:'

Returns the resolution of the measured values. The resolution corresponds to the numerical precision of the measures, which is not always the same as the actual precision of the sensor.

',ret:'a floating point number corresponding to the resolution of the measured values',ext:'On failure, throws an exception or returns `Y_RESOLUTION_INVALID`.'}; doc['Compass']['get_sensorState']={syn:'Returns the sensor health state code, which is zero when there is an up-to-date measure available or a positive code if the sensor is not able to provide a measure right now.',lib:'compass.get_sensorState()',pro:'function get_sensorState()',cmt:'

Returns the sensor health state code, which is zero when there is an up-to-date measure available or a positive code if the sensor is not able to provide a measure right now.

',ret:'an integer corresponding to the sensor health state code, which is zero when there is an up-to-date measure available or a positive code if the sensor is not able to provide a measure right now',ext:'On failure, throws an exception or returns `Y_SENSORSTATE_INVALID`.'}; doc['Compass']['get_unit']={syn:'Returns the measuring unit for the relative bearing.',lib:'compass.get_unit()',pro:'function get_unit()',cmt:'

Returns the measuring unit for the relative bearing.

',ret:'a string corresponding to the measuring unit for the relative bearing',ext:'On failure, throws an exception or returns `Y_UNIT_INVALID`.'}; doc['Compass']['get_userData']={syn:'Returns the value of the userData attribute, as previously stored using method `set_userData`.',lib:'compass.get_userData()',pro:'function get_userData()',cmt:'

Returns the value of the userData attribute, as previously stored using method `set_userData`. This attribute is never touched directly by the API, and is at disposal of the caller to store a context.

',ret:'the object stored previously by the caller.'}; doc['Compass']['isOnline']={syn:'Checks if the compass is currently reachable, without raising any error.',lib:'compass.isOnline()',pro:'function isOnline()',cmt:'

Checks if the compass is currently reachable, without raising any error. If there is a cached value for the compass in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the compass.

',ret:'`true` if the compass can be reached, and `false` otherwise'}; doc['Compass']['isOnline_async']={syn:'Checks if the compass is currently reachable, without raising any error (asynchronous version).',lib:'compass.isOnline_async()',pro:'function isOnline_async(callback, context)',cmt:'

Checks if the compass is currently reachable, without raising any error (asynchronous version). If there is a cached value for the compass in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the requested function.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the boolean result',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['Compass']['load']={syn:'Preloads the compass cache with a specified validity duration.',lib:'compass.load()',pro:'function load(msValidity)',cmt:'

Preloads the compass cache with a specified validity duration. By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network traffic for instance.

',par:{msValidity:'an integer corresponding to the validity attributed to the loaded function parameters, in milliseconds'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Compass']['loadAttribute']={syn:'Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.',lib:'compass.loadAttribute()',pro:'function loadAttribute(attrName)',cmt:'

Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.

',par:{attrName:'the name of the requested attribute'},ret:'a string with the value of the the attribute',ext:'On failure, throws an exception or returns an empty string.'}; doc['Compass']['loadCalibrationPoints']={syn:'Retrieves error correction data points previously entered using the method `calibrateFromPoints`.',lib:'compass.loadCalibrationPoints()',pro:'function loadCalibrationPoints(rawValues, refValues)',cmt:'

Retrieves error correction data points previously entered using the method `calibrateFromPoints`.

',par:{rawValues:'array of floating point numbers, that will be filled by the function with the raw sensor values for the correction points.',refValues:'array of floating point numbers, that will be filled by the function with the desired values for the correction points.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Compass']['load_async']={syn:'Preloads the compass cache with a specified validity duration (asynchronous version).',lib:'compass.load_async()',pro:'function load_async(msValidity, callback, context)',cmt:'

Preloads the compass cache with a specified validity duration (asynchronous version). By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network trafic for instance.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{msValidity:'an integer corresponding to the validity of the loaded function parameters, in milliseconds',callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the error code (or `YAPI_SUCCESS`)',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['Compass']['muteValueCallbacks']={syn:'Disables the propagation of every new advertised value to the parent hub.',lib:'compass.muteValueCallbacks()',pro:'function muteValueCallbacks()',cmt:'

Disables the propagation of every new advertised value to the parent hub. You can use this function to save bandwidth and CPU on computers with limited resources, or to prevent unwanted invocations of the HTTP callback. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Compass']['nextCompass']={syn:'Continues the enumeration of compasses started using `yFirstCompass()`.',lib:'compass.nextCompass()',pro:'function nextCompass()',cmt:'

Continues the enumeration of compasses started using `yFirstCompass()`.

',ret:'a pointer to a `YCompass` object, corresponding to a compass currently online, or a `null` pointer if there are no more compasses to enumerate.'}; doc['Compass']['registerTimedReportCallback']={syn:'Registers the callback function that is invoked on every periodic timed notification.',lib:'compass.registerTimedReportCallback()',pro:'function registerTimedReportCallback(callback)',cmt:'

Registers the callback function that is invoked on every periodic timed notification. The callback is invoked only during the execution of `ySleep` or `yHandleEvents`. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a null pointer as argument.

',par:{callback:'the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and an YMeasure object describing the new advertised value.'}}; doc['Compass']['registerValueCallback']={syn:'Registers the callback function that is invoked on every change of advertised value.',lib:'compass.registerValueCallback()',pro:'function registerValueCallback(callback)',cmt:'

Registers the callback function that is invoked on every change of advertised value. The callback is invoked only during the execution of `ySleep` or `yHandleEvents`. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a null pointer as argument.

',par:{callback:'the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and the character string describing the new advertised value.'}}; doc['Compass']['set_advMode']={syn:'Changes the measuring mode used for the advertised value pushed to the parent hub.',lib:'compass.set_advMode()',pro:'function set_advMode(newval)',cmt:'

Changes the measuring mode used for the advertised value pushed to the parent hub.

',par:{newval:'a value among `Y_ADVMODE_IMMEDIATE`, `Y_ADVMODE_PERIOD_AVG`, `Y_ADVMODE_PERIOD_MIN` and `Y_ADVMODE_PERIOD_MAX` corresponding to the measuring mode used for the advertised value pushed to the parent hub'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Compass']['set_bandwidth']={syn:'Changes the measure update frequency, measured in Hz (Yocto-3D-V2 only).',lib:'compass.set_bandwidth()',pro:'function set_bandwidth(newval)',cmt:'

Changes the measure update frequency, measured in Hz (Yocto-3D-V2 only). When the frequency is lower, the device performs averaging.

',par:{newval:'an integer corresponding to the measure update frequency, measured in Hz (Yocto-3D-V2 only)'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Compass']['set_highestValue']={syn:'Changes the recorded maximal value observed.',lib:'compass.set_highestValue()',pro:'function set_highestValue(newval)',cmt:'

Changes the recorded maximal value observed. Can be used to reset the value returned by get_lowestValue().

',par:{newval:'a floating point number corresponding to the recorded maximal value observed'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Compass']['set_logFrequency']={syn:'Changes the datalogger recording frequency for this function.',lib:'compass.set_logFrequency()',pro:'function set_logFrequency(newval)',cmt:'

Changes the datalogger recording frequency for this function. The frequency can be specified as samples per second, as sample per minute (for instance \x2215/m\x22) or in samples per hour (eg. \x224/h\x22). To disable recording for this function, use the value \x22OFF\x22.

',par:{newval:'a string corresponding to the datalogger recording frequency for this function'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Compass']['set_logicalName']={syn:'Changes the logical name of the compass.',lib:'compass.set_logicalName()',pro:'function set_logicalName(newval)',cmt:'

Changes the logical name of the compass. You can use `yCheckLogicalName()` prior to this call to make sure that your parameter is valid. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',par:{newval:'a string corresponding to the logical name of the compass.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Compass']['set_lowestValue']={syn:'Changes the recorded minimal value observed.',lib:'compass.set_lowestValue()',pro:'function set_lowestValue(newval)',cmt:'

Changes the recorded minimal value observed. Can be used to reset the value returned by get_lowestValue().

',par:{newval:'a floating point number corresponding to the recorded minimal value observed'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Compass']['set_reportFrequency']={syn:'Changes the timed value notification frequency for this function.',lib:'compass.set_reportFrequency()',pro:'function set_reportFrequency(newval)',cmt:'

Changes the timed value notification frequency for this function. The frequency can be specified as samples per second, as sample per minute (for instance \x2215/m\x22) or in samples per hour (eg. \x224/h\x22). To disable timed value notifications for this function, use the value \x22OFF\x22.

',par:{newval:'a string corresponding to the timed value notification frequency for this function'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Compass']['set_resolution']={syn:'Changes the resolution of the measured physical values.',lib:'compass.set_resolution()',pro:'function set_resolution(newval)',cmt:'

Changes the resolution of the measured physical values. The resolution corresponds to the numerical precision when displaying value. It does not change the precision of the measure itself.

',par:{newval:'a floating point number corresponding to the resolution of the measured physical values'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Compass']['set_userData']={syn:'Stores a user context provided as argument in the userData attribute of the function.',lib:'compass.set_userData()',pro:'function set_userData(data)',cmt:'

Stores a user context provided as argument in the userData attribute of the function. This attribute is never touched by the API, and is at disposal of the caller to store a context.

',par:{data:'any kind of object to be stored'}}; doc['Compass']['startDataLogger']={syn:'Starts the data logger on the device.',lib:'compass.startDataLogger()',pro:'function startDataLogger()',cmt:'

Starts the data logger on the device. Note that the data logger will only save the measures on this sensor if the logFrequency is not set to \x22OFF\x22.

',ret:'`YAPI_SUCCESS` if the call succeeds.'}; doc['Compass']['stopDataLogger']={syn:'Stops the datalogger on the device.',lib:'compass.stopDataLogger()',pro:'function stopDataLogger()',cmt:'

Stops the datalogger on the device.

',ret:'`YAPI_SUCCESS` if the call succeeds.'}; doc['Compass']['unmuteValueCallbacks']={syn:'Re-enables the propagation of every new advertised value to the parent hub.',lib:'compass.unmuteValueCallbacks()',pro:'function unmuteValueCallbacks()',cmt:'

Re-enables the propagation of every new advertised value to the parent hub. This function reverts the effect of a previous call to `muteValueCallbacks()`. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Compass']['wait_async']={syn:'Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function.',lib:'compass.wait_async()',pro:'function wait_async(callback, context)',cmt:'

Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function. The callback function can therefore freely issue synchronous or asynchronous commands, without risking to block the Javascript VM.

',par:{callback:'callback function that is invoked when all pending commands on the module are completed. The callback function receives two arguments: the caller-specific context object and the receiving function object.',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing.'}; //--- (end of generated code: Compass) //--- (generated code: Gyro) doc['Gyro']={'':{syn:'Gyroscope function interface',inc:'<script type='text/javascript' src='yocto_gyro.js'></script>',cmt:'

The YSensor class is the parent class for all Yoctopuce sensors. It can be used to read the current value and unit of any sensor, read the min/max value, configure autonomous recording frequency and access recorded data. It also provide a function to register a callback invoked each time the observed value changes, or at a predefined interval. Using this class rather than a specific subclass makes it possible to create generic applications that work with any Yoctopuce sensor, even those that do not yet exist. Note: The YAnButton class is the only analog input which does not inherit from YSensor.

'}}; doc['Gyro']['FindGyro']={syn:'Retrieves a gyroscope for a given identifier.',lib:'YGyro.FindGyro()',pro:'function FindGyro(func)',cmt:'

Retrieves a gyroscope for a given identifier. The identifier can be specified using several formats:

- FunctionLogicalName
- ModuleSerialNumber.FunctionIdentifier
- ModuleSerialNumber.FunctionLogicalName
- ModuleLogicalName.FunctionIdentifier
- ModuleLogicalName.FunctionLogicalName

This function does not require that the gyroscope is online at the time it is invoked. The returned object is nevertheless valid. Use the method `YGyro.isOnline()` to test if the gyroscope is indeed online at a given time. In case of ambiguity when looking for a gyroscope by logical name, no error is notified: the first instance found is returned. The search is performed first by hardware name, then by logical name.

If a call to this object\x27s is_online() method returns FALSE although you are certain that the matching device is plugged, make sure that you did call registerHub() at application initialization time.

',par:{func:'a string that uniquely characterizes the gyroscope'},ret:'a `YGyro` object allowing you to drive the gyroscope.'}; doc['Gyro']['FirstGyro']={syn:'Starts the enumeration of gyroscopes currently accessible.',lib:'YGyro.FirstGyro()',pro:'function FirstGyro()',cmt:'

Starts the enumeration of gyroscopes currently accessible. Use the method `YGyro.nextGyro()` to iterate on next gyroscopes.

',ret:'a pointer to a `YGyro` object, corresponding to the first gyro currently online, or a `null` pointer if there are none.'}; doc['Gyro']['calibrateFromPoints']={syn:'Configures error correction data points, in particular to compensate for a possible perturbation of the measure caused by an enclosure.',lib:'gyro.calibrateFromPoints()',pro:'function calibrateFromPoints(rawValues, refValues)',cmt:'

Configures error correction data points, in particular to compensate for a possible perturbation of the measure caused by an enclosure. It is possible to configure up to five correction points. Correction points must be provided in ascending order, and be in the range of the sensor. The device will automatically perform a linear interpolation of the error correction between specified points. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

For more information on advanced capabilities to refine the calibration of sensors, please contact support@yoctopuce.com.

',par:{rawValues:'array of floating point numbers, corresponding to the raw values returned by the sensor for the correction points.',refValues:'array of floating point numbers, corresponding to the corrected values for the correction points.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Gyro']['clearCache']={syn:'Invalidates the cache.',lib:'gyro.clearCache()',pro:'function clearCache()',cmt:'

Invalidates the cache. Invalidates the cache of the gyroscope attributes. Forces the next call to get_xxx() or loadxxx() to use values that come from the device.

'}; doc['Gyro']['describe']={syn:'Returns a short text that describes unambiguously the instance of the gyroscope in the form `TYPE(NAME)=SERIAL.FUNCTIONID`.',lib:'gyro.describe()',pro:'function describe()',cmt:'

Returns a short text that describes unambiguously the instance of the gyroscope in the form `TYPE(NAME)=SERIAL.FUNCTIONID`. More precisely, `TYPE` is the type of the function, `NAME` it the name used for the first access to the function, `SERIAL` is the serial number of the module if the module is connected or `\x22unresolved\x22`, and `FUNCTIONID` is the hardware identifier of the function if the module is connected. For example, this method returns `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1` if the module is already connected or `Relay(BadCustomeName.relay1)=unresolved` if the module has not yet been connected. This method does not trigger any USB or TCP transaction and can therefore be used in a debugger.

',ret:'a string that describes the gyroscope (ex: `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1`)'}; doc['Gyro']['get_advMode']={syn:'Returns the measuring mode used for the advertised value pushed to the parent hub.',lib:'gyro.get_advMode()',pro:'function get_advMode()',cmt:'

Returns the measuring mode used for the advertised value pushed to the parent hub.

',ret:'a value among `Y_ADVMODE_IMMEDIATE`, `Y_ADVMODE_PERIOD_AVG`, `Y_ADVMODE_PERIOD_MIN` and `Y_ADVMODE_PERIOD_MAX` corresponding to the measuring mode used for the advertised value pushed to the parent hub',ext:'On failure, throws an exception or returns `Y_ADVMODE_INVALID`.'}; doc['Gyro']['get_advertisedValue']={syn:'Returns the current value of the gyroscope (no more than 6 characters).',lib:'gyro.get_advertisedValue()',pro:'function get_advertisedValue()',cmt:'

Returns the current value of the gyroscope (no more than 6 characters).

',ret:'a string corresponding to the current value of the gyroscope (no more than 6 characters).',ext:'On failure, throws an exception or returns `Y_ADVERTISEDVALUE_INVALID`.'}; doc['Gyro']['get_bandwidth']={syn:'Returns the measure update frequency, measured in Hz (Yocto-3D-V2 only).',lib:'gyro.get_bandwidth()',pro:'function get_bandwidth()',cmt:'

Returns the measure update frequency, measured in Hz (Yocto-3D-V2 only).

',ret:'an integer corresponding to the measure update frequency, measured in Hz (Yocto-3D-V2 only)',ext:'On failure, throws an exception or returns `Y_BANDWIDTH_INVALID`.'}; doc['Gyro']['get_currentRawValue']={syn:'Returns the uncalibrated, unrounded raw value returned by the sensor, in degrees per second, as a floating point number.',lib:'gyro.get_currentRawValue()',pro:'function get_currentRawValue()',cmt:'

Returns the uncalibrated, unrounded raw value returned by the sensor, in degrees per second, as a floating point number.

',ret:'a floating point number corresponding to the uncalibrated, unrounded raw value returned by the sensor, in degrees per second, as a floating point number',ext:'On failure, throws an exception or returns `Y_CURRENTRAWVALUE_INVALID`.'}; doc['Gyro']['get_currentValue']={syn:'Returns the current value of the angular velocity, in degrees per second, as a floating point number.',lib:'gyro.get_currentValue()',pro:'function get_currentValue()',cmt:'

Returns the current value of the angular velocity, in degrees per second, as a floating point number.

',ret:'a floating point number corresponding to the current value of the angular velocity, in degrees per second, as a floating point number',ext:'On failure, throws an exception or returns `Y_CURRENTVALUE_INVALID`.'}; doc['Gyro']['get_dataLogger']={syn:'Returns the YDatalogger object of the device hosting the sensor.',lib:'gyro.get_dataLogger()',pro:'function get_dataLogger()',cmt:'

Returns the YDatalogger object of the device hosting the sensor. This method returns an object of class YDatalogger that can control global parameters of the data logger. The returned object should not be freed.

',ret:'an YDataLogger object or null on error.'}; doc['Gyro']['get_errorMessage']={syn:'Returns the error message of the latest error with the gyroscope.',lib:'gyro.get_errorMessage()',pro:'function get_errorMessage()',cmt:'

Returns the error message of the latest error with the gyroscope. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a string corresponding to the latest error message that occured while using the gyroscope object'}; doc['Gyro']['get_errorType']={syn:'Returns the numerical error code of the latest error with the gyroscope.',lib:'gyro.get_errorType()',pro:'function get_errorType()',cmt:'

Returns the numerical error code of the latest error with the gyroscope. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a number corresponding to the code of the latest error that occurred while using the gyroscope object'}; doc['Gyro']['get_friendlyName']={syn:'Returns a global identifier of the gyroscope in the format `MODULE_NAME.FUNCTION_NAME`.',lib:'gyro.get_friendlyName()',pro:'function get_friendlyName()',cmt:'

Returns a global identifier of the gyroscope in the format `MODULE_NAME.FUNCTION_NAME`. The returned string uses the logical names of the module and of the gyroscope if they are defined, otherwise the serial number of the module and the hardware identifier of the gyroscope (for example: `MyCustomName.relay1`)

',ret:'a string that uniquely identifies the gyroscope using logical names (ex: `MyCustomName.relay1`)',ext:'On failure, throws an exception or returns `Y_FRIENDLYNAME_INVALID`.'}; doc['Gyro']['get_functionDescriptor']={syn:'Returns a unique identifier of type `YFUN_DESCR` corresponding to the function.',lib:'gyro.get_functionDescriptor()',pro:'function get_functionDescriptor()',cmt:'

Returns a unique identifier of type `YFUN_DESCR` corresponding to the function. This identifier can be used to test if two instances of `YFunction` reference the same physical function on the same physical device.

',ret:'an identifier of type `YFUN_DESCR`.',ext:'If the function has never been contacted, the returned value is `Y_FUNCTIONDESCRIPTOR_INVALID`.'}; doc['Gyro']['get_functionId']={syn:'Returns the hardware identifier of the gyroscope, without reference to the module.',lib:'gyro.get_functionId()',pro:'function get_functionId()',cmt:'

Returns the hardware identifier of the gyroscope, without reference to the module. For example `relay1`

',ret:'a string that identifies the gyroscope (ex: `relay1`)',ext:'On failure, throws an exception or returns `Y_FUNCTIONID_INVALID`.'}; doc['Gyro']['get_hardwareId']={syn:'Returns the unique hardware identifier of the gyroscope in the form `SERIAL.FUNCTIONID`.',lib:'gyro.get_hardwareId()',pro:'function get_hardwareId()',cmt:'

Returns the unique hardware identifier of the gyroscope in the form `SERIAL.FUNCTIONID`. The unique hardware identifier is composed of the device serial number and of the hardware identifier of the gyroscope (for example `RELAYLO1-123456.relay1`).

',ret:'a string that uniquely identifies the gyroscope (ex: `RELAYLO1-123456.relay1`)',ext:'On failure, throws an exception or returns `Y_HARDWAREID_INVALID`.'}; doc['Gyro']['get_heading']={syn:'Returns the estimated heading angle, based on the integration of gyroscopic measures combined with acceleration and magnetic field measurements.',lib:'gyro.get_heading()',pro:'function get_heading()',cmt:'

Returns the estimated heading angle, based on the integration of gyroscopic measures combined with acceleration and magnetic field measurements. The axis corresponding to the heading can be mapped to any of the device X, Y or Z physical directions using methods of the class `YRefFrame`.

',ret:'a floating-point number corresponding to heading in degrees, between 0 and 360.'}; doc['Gyro']['get_highestValue']={syn:'Returns the maximal value observed for the angular velocity since the device was started.',lib:'gyro.get_highestValue()',pro:'function get_highestValue()',cmt:'

Returns the maximal value observed for the angular velocity since the device was started. Can be reset to an arbitrary value thanks to set_highestValue().

',ret:'a floating point number corresponding to the maximal value observed for the angular velocity since the device was started',ext:'On failure, throws an exception or returns `Y_HIGHESTVALUE_INVALID`.'}; doc['Gyro']['get_logFrequency']={syn:'Returns the datalogger recording frequency for this function, or \x22OFF\x22 when measures are not stored in the data logger flash memory.',lib:'gyro.get_logFrequency()',pro:'function get_logFrequency()',cmt:'

Returns the datalogger recording frequency for this function, or \x22OFF\x22 when measures are not stored in the data logger flash memory.

',ret:'a string corresponding to the datalogger recording frequency for this function, or \x22OFF\x22 when measures are not stored in the data logger flash memory',ext:'On failure, throws an exception or returns `Y_LOGFREQUENCY_INVALID`.'}; doc['Gyro']['get_logicalName']={syn:'Returns the logical name of the gyroscope.',lib:'gyro.get_logicalName()',pro:'function get_logicalName()',cmt:'

Returns the logical name of the gyroscope.

',ret:'a string corresponding to the logical name of the gyroscope.',ext:'On failure, throws an exception or returns `Y_LOGICALNAME_INVALID`.'}; doc['Gyro']['get_lowestValue']={syn:'Returns the minimal value observed for the angular velocity since the device was started.',lib:'gyro.get_lowestValue()',pro:'function get_lowestValue()',cmt:'

Returns the minimal value observed for the angular velocity since the device was started. Can be reset to an arbitrary value thanks to set_lowestValue().

',ret:'a floating point number corresponding to the minimal value observed for the angular velocity since the device was started',ext:'On failure, throws an exception or returns `Y_LOWESTVALUE_INVALID`.'}; doc['Gyro']['get_module']={syn:'Gets the `YModule` object for the device on which the function is located.',lib:'gyro.get_module()',pro:'function get_module()',cmt:'

Gets the `YModule` object for the device on which the function is located. If the function cannot be located on any module, the returned instance of `YModule` is not shown as on-line.

',ret:'an instance of `YModule`'}; doc['Gyro']['get_module_async']={syn:'Gets the `YModule` object for the device on which the function is located (asynchronous version).',lib:'gyro.get_module_async()',pro:'function get_module_async(callback, context)',cmt:'

Gets the `YModule` object for the device on which the function is located (asynchronous version). If the function cannot be located on any module, the returned `YModule` object does not show as on-line.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking Firefox javascript VM that does not implement context switching during blocking I/O calls. See the documentation section on asynchronous Javascript calls for more details.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the requested `YModule` object',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['Gyro']['get_pitch']={syn:'Returns the estimated pitch angle, based on the integration of gyroscopic measures combined with acceleration and magnetic field measurements.',lib:'gyro.get_pitch()',pro:'function get_pitch()',cmt:'

Returns the estimated pitch angle, based on the integration of gyroscopic measures combined with acceleration and magnetic field measurements. The axis corresponding to the pitch angle can be mapped to any of the device X, Y or Z physical directions using methods of the class `YRefFrame`.

',ret:'a floating-point number corresponding to pitch angle in degrees, between -90 and +90.'}; doc['Gyro']['get_quaternionW']={syn:'Returns the `w` component (real part) of the quaternion describing the device estimated orientation, based on the integration of gyroscopic measures combined with acceleration and magnetic field measurements.',lib:'gyro.get_quaternionW()',pro:'function get_quaternionW()',cmt:'

Returns the `w` component (real part) of the quaternion describing the device estimated orientation, based on the integration of gyroscopic measures combined with acceleration and magnetic field measurements.

',ret:'a floating-point number corresponding to the `w` component of the quaternion.'}; doc['Gyro']['get_quaternionX']={syn:'Returns the `x` component of the quaternion describing the device estimated orientation, based on the integration of gyroscopic measures combined with acceleration and magnetic field measurements.',lib:'gyro.get_quaternionX()',pro:'function get_quaternionX()',cmt:'

Returns the `x` component of the quaternion describing the device estimated orientation, based on the integration of gyroscopic measures combined with acceleration and magnetic field measurements. The `x` component is mostly correlated with rotations on the roll axis.

',ret:'a floating-point number corresponding to the `x` component of the quaternion.'}; doc['Gyro']['get_quaternionY']={syn:'Returns the `y` component of the quaternion describing the device estimated orientation, based on the integration of gyroscopic measures combined with acceleration and magnetic field measurements.',lib:'gyro.get_quaternionY()',pro:'function get_quaternionY()',cmt:'

Returns the `y` component of the quaternion describing the device estimated orientation, based on the integration of gyroscopic measures combined with acceleration and magnetic field measurements. The `y` component is mostly correlated with rotations on the pitch axis.

',ret:'a floating-point number corresponding to the `y` component of the quaternion.'}; doc['Gyro']['get_quaternionZ']={syn:'Returns the `x` component of the quaternion describing the device estimated orientation, based on the integration of gyroscopic measures combined with acceleration and magnetic field measurements.',lib:'gyro.get_quaternionZ()',pro:'function get_quaternionZ()',cmt:'

Returns the `x` component of the quaternion describing the device estimated orientation, based on the integration of gyroscopic measures combined with acceleration and magnetic field measurements. The `x` component is mostly correlated with changes of heading.

',ret:'a floating-point number corresponding to the `z` component of the quaternion.'}; doc['Gyro']['get_recordedData']={syn:'Retrieves a DataSet object holding historical data for this sensor, for a specified time interval.',lib:'gyro.get_recordedData()',pro:'function get_recordedData(startTime, endTime)',cmt:'

Retrieves a DataSet object holding historical data for this sensor, for a specified time interval. The measures will be retrieved from the data logger, which must have been turned on at the desired time. See the documentation of the DataSet class for information on how to get an overview of the recorded data, and how to load progressively a large set of measures from the data logger.

This function only works if the device uses a recent firmware, as DataSet objects are not supported by firmwares older than version 13000.

',par:{startTime:'the start of the desired measure time interval, as a Unix timestamp, i.e. the number of seconds since January 1, 1970 UTC. The special value 0 can be used to include any meaasure, without initial limit.',endTime:'the end of the desired measure time interval, as a Unix timestamp, i.e. the number of seconds since January 1, 1970 UTC. The special value 0 can be used to include any meaasure, without ending limit.'},ret:'an instance of YDataSet, providing access to historical data. Past measures can be loaded progressively using methods from the YDataSet object.'}; doc['Gyro']['get_reportFrequency']={syn:'Returns the timed value notification frequency, or \x22OFF\x22 if timed value notifications are disabled for this function.',lib:'gyro.get_reportFrequency()',pro:'function get_reportFrequency()',cmt:'

Returns the timed value notification frequency, or \x22OFF\x22 if timed value notifications are disabled for this function.

',ret:'a string corresponding to the timed value notification frequency, or \x22OFF\x22 if timed value notifications are disabled for this function',ext:'On failure, throws an exception or returns `Y_REPORTFREQUENCY_INVALID`.'}; doc['Gyro']['get_resolution']={syn:'Returns the resolution of the measured values.',lib:'gyro.get_resolution()',pro:'function get_resolution()',cmt:'

Returns the resolution of the measured values. The resolution corresponds to the numerical precision of the measures, which is not always the same as the actual precision of the sensor.

',ret:'a floating point number corresponding to the resolution of the measured values',ext:'On failure, throws an exception or returns `Y_RESOLUTION_INVALID`.'}; doc['Gyro']['get_roll']={syn:'Returns the estimated roll angle, based on the integration of gyroscopic measures combined with acceleration and magnetic field measurements.',lib:'gyro.get_roll()',pro:'function get_roll()',cmt:'

Returns the estimated roll angle, based on the integration of gyroscopic measures combined with acceleration and magnetic field measurements. The axis corresponding to the roll angle can be mapped to any of the device X, Y or Z physical directions using methods of the class `YRefFrame`.

',ret:'a floating-point number corresponding to roll angle in degrees, between -180 and +180.'}; doc['Gyro']['get_sensorState']={syn:'Returns the sensor health state code, which is zero when there is an up-to-date measure available or a positive code if the sensor is not able to provide a measure right now.',lib:'gyro.get_sensorState()',pro:'function get_sensorState()',cmt:'

Returns the sensor health state code, which is zero when there is an up-to-date measure available or a positive code if the sensor is not able to provide a measure right now.

',ret:'an integer corresponding to the sensor health state code, which is zero when there is an up-to-date measure available or a positive code if the sensor is not able to provide a measure right now',ext:'On failure, throws an exception or returns `Y_SENSORSTATE_INVALID`.'}; doc['Gyro']['get_unit']={syn:'Returns the measuring unit for the angular velocity.',lib:'gyro.get_unit()',pro:'function get_unit()',cmt:'

Returns the measuring unit for the angular velocity.

',ret:'a string corresponding to the measuring unit for the angular velocity',ext:'On failure, throws an exception or returns `Y_UNIT_INVALID`.'}; doc['Gyro']['get_userData']={syn:'Returns the value of the userData attribute, as previously stored using method `set_userData`.',lib:'gyro.get_userData()',pro:'function get_userData()',cmt:'

Returns the value of the userData attribute, as previously stored using method `set_userData`. This attribute is never touched directly by the API, and is at disposal of the caller to store a context.

',ret:'the object stored previously by the caller.'}; doc['Gyro']['get_xValue']={syn:'Returns the angular velocity around the X axis of the device, as a floating point number.',lib:'gyro.get_xValue()',pro:'function get_xValue()',cmt:'

Returns the angular velocity around the X axis of the device, as a floating point number.

',ret:'a floating point number corresponding to the angular velocity around the X axis of the device, as a floating point number',ext:'On failure, throws an exception or returns `Y_XVALUE_INVALID`.'}; doc['Gyro']['get_yValue']={syn:'Returns the angular velocity around the Y axis of the device, as a floating point number.',lib:'gyro.get_yValue()',pro:'function get_yValue()',cmt:'

Returns the angular velocity around the Y axis of the device, as a floating point number.

',ret:'a floating point number corresponding to the angular velocity around the Y axis of the device, as a floating point number',ext:'On failure, throws an exception or returns `Y_YVALUE_INVALID`.'}; doc['Gyro']['get_zValue']={syn:'Returns the angular velocity around the Z axis of the device, as a floating point number.',lib:'gyro.get_zValue()',pro:'function get_zValue()',cmt:'

Returns the angular velocity around the Z axis of the device, as a floating point number.

',ret:'a floating point number corresponding to the angular velocity around the Z axis of the device, as a floating point number',ext:'On failure, throws an exception or returns `Y_ZVALUE_INVALID`.'}; doc['Gyro']['isOnline']={syn:'Checks if the gyroscope is currently reachable, without raising any error.',lib:'gyro.isOnline()',pro:'function isOnline()',cmt:'

Checks if the gyroscope is currently reachable, without raising any error. If there is a cached value for the gyroscope in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the gyroscope.

',ret:'`true` if the gyroscope can be reached, and `false` otherwise'}; doc['Gyro']['isOnline_async']={syn:'Checks if the gyroscope is currently reachable, without raising any error (asynchronous version).',lib:'gyro.isOnline_async()',pro:'function isOnline_async(callback, context)',cmt:'

Checks if the gyroscope is currently reachable, without raising any error (asynchronous version). If there is a cached value for the gyroscope in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the requested function.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the boolean result',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['Gyro']['load']={syn:'Preloads the gyroscope cache with a specified validity duration.',lib:'gyro.load()',pro:'function load(msValidity)',cmt:'

Preloads the gyroscope cache with a specified validity duration. By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network traffic for instance.

',par:{msValidity:'an integer corresponding to the validity attributed to the loaded function parameters, in milliseconds'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Gyro']['loadAttribute']={syn:'Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.',lib:'gyro.loadAttribute()',pro:'function loadAttribute(attrName)',cmt:'

Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.

',par:{attrName:'the name of the requested attribute'},ret:'a string with the value of the the attribute',ext:'On failure, throws an exception or returns an empty string.'}; doc['Gyro']['loadCalibrationPoints']={syn:'Retrieves error correction data points previously entered using the method `calibrateFromPoints`.',lib:'gyro.loadCalibrationPoints()',pro:'function loadCalibrationPoints(rawValues, refValues)',cmt:'

Retrieves error correction data points previously entered using the method `calibrateFromPoints`.

',par:{rawValues:'array of floating point numbers, that will be filled by the function with the raw sensor values for the correction points.',refValues:'array of floating point numbers, that will be filled by the function with the desired values for the correction points.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Gyro']['load_async']={syn:'Preloads the gyroscope cache with a specified validity duration (asynchronous version).',lib:'gyro.load_async()',pro:'function load_async(msValidity, callback, context)',cmt:'

Preloads the gyroscope cache with a specified validity duration (asynchronous version). By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network trafic for instance.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{msValidity:'an integer corresponding to the validity of the loaded function parameters, in milliseconds',callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the error code (or `YAPI_SUCCESS`)',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['Gyro']['muteValueCallbacks']={syn:'Disables the propagation of every new advertised value to the parent hub.',lib:'gyro.muteValueCallbacks()',pro:'function muteValueCallbacks()',cmt:'

Disables the propagation of every new advertised value to the parent hub. You can use this function to save bandwidth and CPU on computers with limited resources, or to prevent unwanted invocations of the HTTP callback. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Gyro']['nextGyro']={syn:'Continues the enumeration of gyroscopes started using `yFirstGyro()`.',lib:'gyro.nextGyro()',pro:'function nextGyro()',cmt:'

Continues the enumeration of gyroscopes started using `yFirstGyro()`.

',ret:'a pointer to a `YGyro` object, corresponding to a gyroscope currently online, or a `null` pointer if there are no more gyroscopes to enumerate.'}; doc['Gyro']['registerAnglesCallback']={syn:'Registers a callback function that will be invoked each time that the estimated device orientation has changed.',lib:'gyro.registerAnglesCallback()',pro:'function registerAnglesCallback(callback)',cmt:'

Registers a callback function that will be invoked each time that the estimated device orientation has changed. The call frequency is typically around 95Hz during a move. The callback is invoked only during the execution of `ySleep` or `yHandleEvents`. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a null pointer as argument.

',par:{callback:'the callback function to invoke, or a null pointer. The callback function should take four arguments: the YGyro object of the turning device, and the floating point values of the three angles roll, pitch and heading in degrees (as floating-point numbers).'}}; doc['Gyro']['registerQuaternionCallback']={syn:'Registers a callback function that will be invoked each time that the estimated device orientation has changed.',lib:'gyro.registerQuaternionCallback()',pro:'function registerQuaternionCallback(callback)',cmt:'

Registers a callback function that will be invoked each time that the estimated device orientation has changed. The call frequency is typically around 95Hz during a move. The callback is invoked only during the execution of `ySleep` or `yHandleEvents`. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a null pointer as argument.

',par:{callback:'the callback function to invoke, or a null pointer. The callback function should take five arguments: the YGyro object of the turning device, and the floating point values of the four components w, x, y and z (as floating-point numbers).'}}; doc['Gyro']['registerTimedReportCallback']={syn:'Registers the callback function that is invoked on every periodic timed notification.',lib:'gyro.registerTimedReportCallback()',pro:'function registerTimedReportCallback(callback)',cmt:'

Registers the callback function that is invoked on every periodic timed notification. The callback is invoked only during the execution of `ySleep` or `yHandleEvents`. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a null pointer as argument.

',par:{callback:'the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and an YMeasure object describing the new advertised value.'}}; doc['Gyro']['registerValueCallback']={syn:'Registers the callback function that is invoked on every change of advertised value.',lib:'gyro.registerValueCallback()',pro:'function registerValueCallback(callback)',cmt:'

Registers the callback function that is invoked on every change of advertised value. The callback is invoked only during the execution of `ySleep` or `yHandleEvents`. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a null pointer as argument.

',par:{callback:'the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and the character string describing the new advertised value.'}}; doc['Gyro']['set_advMode']={syn:'Changes the measuring mode used for the advertised value pushed to the parent hub.',lib:'gyro.set_advMode()',pro:'function set_advMode(newval)',cmt:'

Changes the measuring mode used for the advertised value pushed to the parent hub.

',par:{newval:'a value among `Y_ADVMODE_IMMEDIATE`, `Y_ADVMODE_PERIOD_AVG`, `Y_ADVMODE_PERIOD_MIN` and `Y_ADVMODE_PERIOD_MAX` corresponding to the measuring mode used for the advertised value pushed to the parent hub'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Gyro']['set_bandwidth']={syn:'Changes the measure update frequency, measured in Hz (Yocto-3D-V2 only).',lib:'gyro.set_bandwidth()',pro:'function set_bandwidth(newval)',cmt:'

Changes the measure update frequency, measured in Hz (Yocto-3D-V2 only). When the frequency is lower, the device performs averaging.

',par:{newval:'an integer corresponding to the measure update frequency, measured in Hz (Yocto-3D-V2 only)'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Gyro']['set_highestValue']={syn:'Changes the recorded maximal value observed.',lib:'gyro.set_highestValue()',pro:'function set_highestValue(newval)',cmt:'

Changes the recorded maximal value observed. Can be used to reset the value returned by get_lowestValue().

',par:{newval:'a floating point number corresponding to the recorded maximal value observed'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Gyro']['set_logFrequency']={syn:'Changes the datalogger recording frequency for this function.',lib:'gyro.set_logFrequency()',pro:'function set_logFrequency(newval)',cmt:'

Changes the datalogger recording frequency for this function. The frequency can be specified as samples per second, as sample per minute (for instance \x2215/m\x22) or in samples per hour (eg. \x224/h\x22). To disable recording for this function, use the value \x22OFF\x22.

',par:{newval:'a string corresponding to the datalogger recording frequency for this function'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Gyro']['set_logicalName']={syn:'Changes the logical name of the gyroscope.',lib:'gyro.set_logicalName()',pro:'function set_logicalName(newval)',cmt:'

Changes the logical name of the gyroscope. You can use `yCheckLogicalName()` prior to this call to make sure that your parameter is valid. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',par:{newval:'a string corresponding to the logical name of the gyroscope.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Gyro']['set_lowestValue']={syn:'Changes the recorded minimal value observed.',lib:'gyro.set_lowestValue()',pro:'function set_lowestValue(newval)',cmt:'

Changes the recorded minimal value observed. Can be used to reset the value returned by get_lowestValue().

',par:{newval:'a floating point number corresponding to the recorded minimal value observed'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Gyro']['set_reportFrequency']={syn:'Changes the timed value notification frequency for this function.',lib:'gyro.set_reportFrequency()',pro:'function set_reportFrequency(newval)',cmt:'

Changes the timed value notification frequency for this function. The frequency can be specified as samples per second, as sample per minute (for instance \x2215/m\x22) or in samples per hour (eg. \x224/h\x22). To disable timed value notifications for this function, use the value \x22OFF\x22.

',par:{newval:'a string corresponding to the timed value notification frequency for this function'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Gyro']['set_resolution']={syn:'Changes the resolution of the measured physical values.',lib:'gyro.set_resolution()',pro:'function set_resolution(newval)',cmt:'

Changes the resolution of the measured physical values. The resolution corresponds to the numerical precision when displaying value. It does not change the precision of the measure itself.

',par:{newval:'a floating point number corresponding to the resolution of the measured physical values'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Gyro']['set_userData']={syn:'Stores a user context provided as argument in the userData attribute of the function.',lib:'gyro.set_userData()',pro:'function set_userData(data)',cmt:'

Stores a user context provided as argument in the userData attribute of the function. This attribute is never touched by the API, and is at disposal of the caller to store a context.

',par:{data:'any kind of object to be stored'}}; doc['Gyro']['startDataLogger']={syn:'Starts the data logger on the device.',lib:'gyro.startDataLogger()',pro:'function startDataLogger()',cmt:'

Starts the data logger on the device. Note that the data logger will only save the measures on this sensor if the logFrequency is not set to \x22OFF\x22.

',ret:'`YAPI_SUCCESS` if the call succeeds.'}; doc['Gyro']['stopDataLogger']={syn:'Stops the datalogger on the device.',lib:'gyro.stopDataLogger()',pro:'function stopDataLogger()',cmt:'

Stops the datalogger on the device.

',ret:'`YAPI_SUCCESS` if the call succeeds.'}; doc['Gyro']['unmuteValueCallbacks']={syn:'Re-enables the propagation of every new advertised value to the parent hub.',lib:'gyro.unmuteValueCallbacks()',pro:'function unmuteValueCallbacks()',cmt:'

Re-enables the propagation of every new advertised value to the parent hub. This function reverts the effect of a previous call to `muteValueCallbacks()`. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Gyro']['wait_async']={syn:'Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function.',lib:'gyro.wait_async()',pro:'function wait_async(callback, context)',cmt:'

Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function. The callback function can therefore freely issue synchronous or asynchronous commands, without risking to block the Javascript VM.

',par:{callback:'callback function that is invoked when all pending commands on the module are completed. The callback function receives two arguments: the caller-specific context object and the receiving function object.',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing.'}; //--- (end of generated code: Gyro) //--- (generated code: Tilt) doc['Tilt']={'':{syn:'Tilt function interface',inc:'<script type='text/javascript' src='yocto_tilt.js'></script>',cmt:'

The YSensor class is the parent class for all Yoctopuce sensors. It can be used to read the current value and unit of any sensor, read the min/max value, configure autonomous recording frequency and access recorded data. It also provide a function to register a callback invoked each time the observed value changes, or at a predefined interval. Using this class rather than a specific subclass makes it possible to create generic applications that work with any Yoctopuce sensor, even those that do not yet exist. Note: The YAnButton class is the only analog input which does not inherit from YSensor.

'}}; doc['Tilt']['FindTilt']={syn:'Retrieves a tilt sensor for a given identifier.',lib:'YTilt.FindTilt()',pro:'function FindTilt(func)',cmt:'

Retrieves a tilt sensor for a given identifier. The identifier can be specified using several formats:

- FunctionLogicalName
- ModuleSerialNumber.FunctionIdentifier
- ModuleSerialNumber.FunctionLogicalName
- ModuleLogicalName.FunctionIdentifier
- ModuleLogicalName.FunctionLogicalName

This function does not require that the tilt sensor is online at the time it is invoked. The returned object is nevertheless valid. Use the method `YTilt.isOnline()` to test if the tilt sensor is indeed online at a given time. In case of ambiguity when looking for a tilt sensor by logical name, no error is notified: the first instance found is returned. The search is performed first by hardware name, then by logical name.

If a call to this object\x27s is_online() method returns FALSE although you are certain that the matching device is plugged, make sure that you did call registerHub() at application initialization time.

',par:{func:'a string that uniquely characterizes the tilt sensor'},ret:'a `YTilt` object allowing you to drive the tilt sensor.'}; doc['Tilt']['FirstTilt']={syn:'Starts the enumeration of tilt sensors currently accessible.',lib:'YTilt.FirstTilt()',pro:'function FirstTilt()',cmt:'

Starts the enumeration of tilt sensors currently accessible. Use the method `YTilt.nextTilt()` to iterate on next tilt sensors.

',ret:'a pointer to a `YTilt` object, corresponding to the first tilt sensor currently online, or a `null` pointer if there are none.'}; doc['Tilt']['calibrateFromPoints']={syn:'Configures error correction data points, in particular to compensate for a possible perturbation of the measure caused by an enclosure.',lib:'tilt.calibrateFromPoints()',pro:'function calibrateFromPoints(rawValues, refValues)',cmt:'

Configures error correction data points, in particular to compensate for a possible perturbation of the measure caused by an enclosure. It is possible to configure up to five correction points. Correction points must be provided in ascending order, and be in the range of the sensor. The device will automatically perform a linear interpolation of the error correction between specified points. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

For more information on advanced capabilities to refine the calibration of sensors, please contact support@yoctopuce.com.

',par:{rawValues:'array of floating point numbers, corresponding to the raw values returned by the sensor for the correction points.',refValues:'array of floating point numbers, corresponding to the corrected values for the correction points.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Tilt']['clearCache']={syn:'Invalidates the cache.',lib:'tilt.clearCache()',pro:'function clearCache()',cmt:'

Invalidates the cache. Invalidates the cache of the tilt sensor attributes. Forces the next call to get_xxx() or loadxxx() to use values that come from the device.

'}; doc['Tilt']['describe']={syn:'Returns a short text that describes unambiguously the instance of the tilt sensor in the form `TYPE(NAME)=SERIAL.FUNCTIONID`.',lib:'tilt.describe()',pro:'function describe()',cmt:'

Returns a short text that describes unambiguously the instance of the tilt sensor in the form `TYPE(NAME)=SERIAL.FUNCTIONID`. More precisely, `TYPE` is the type of the function, `NAME` it the name used for the first access to the function, `SERIAL` is the serial number of the module if the module is connected or `\x22unresolved\x22`, and `FUNCTIONID` is the hardware identifier of the function if the module is connected. For example, this method returns `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1` if the module is already connected or `Relay(BadCustomeName.relay1)=unresolved` if the module has not yet been connected. This method does not trigger any USB or TCP transaction and can therefore be used in a debugger.

',ret:'a string that describes the tilt sensor (ex: `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1`)'}; doc['Tilt']['get_advMode']={syn:'Returns the measuring mode used for the advertised value pushed to the parent hub.',lib:'tilt.get_advMode()',pro:'function get_advMode()',cmt:'

Returns the measuring mode used for the advertised value pushed to the parent hub.

',ret:'a value among `Y_ADVMODE_IMMEDIATE`, `Y_ADVMODE_PERIOD_AVG`, `Y_ADVMODE_PERIOD_MIN` and `Y_ADVMODE_PERIOD_MAX` corresponding to the measuring mode used for the advertised value pushed to the parent hub',ext:'On failure, throws an exception or returns `Y_ADVMODE_INVALID`.'}; doc['Tilt']['get_advertisedValue']={syn:'Returns the current value of the tilt sensor (no more than 6 characters).',lib:'tilt.get_advertisedValue()',pro:'function get_advertisedValue()',cmt:'

Returns the current value of the tilt sensor (no more than 6 characters).

',ret:'a string corresponding to the current value of the tilt sensor (no more than 6 characters).',ext:'On failure, throws an exception or returns `Y_ADVERTISEDVALUE_INVALID`.'}; doc['Tilt']['get_bandwidth']={syn:'Returns the measure update frequency, measured in Hz (Yocto-3D-V2 only).',lib:'tilt.get_bandwidth()',pro:'function get_bandwidth()',cmt:'

Returns the measure update frequency, measured in Hz (Yocto-3D-V2 only).

',ret:'an integer corresponding to the measure update frequency, measured in Hz (Yocto-3D-V2 only)',ext:'On failure, throws an exception or returns `Y_BANDWIDTH_INVALID`.'}; doc['Tilt']['get_currentRawValue']={syn:'Returns the uncalibrated, unrounded raw value returned by the sensor, in degrees, as a floating point number.',lib:'tilt.get_currentRawValue()',pro:'function get_currentRawValue()',cmt:'

Returns the uncalibrated, unrounded raw value returned by the sensor, in degrees, as a floating point number.

',ret:'a floating point number corresponding to the uncalibrated, unrounded raw value returned by the sensor, in degrees, as a floating point number',ext:'On failure, throws an exception or returns `Y_CURRENTRAWVALUE_INVALID`.'}; doc['Tilt']['get_currentValue']={syn:'Returns the current value of the inclination, in degrees, as a floating point number.',lib:'tilt.get_currentValue()',pro:'function get_currentValue()',cmt:'

Returns the current value of the inclination, in degrees, as a floating point number.

',ret:'a floating point number corresponding to the current value of the inclination, in degrees, as a floating point number',ext:'On failure, throws an exception or returns `Y_CURRENTVALUE_INVALID`.'}; doc['Tilt']['get_dataLogger']={syn:'Returns the YDatalogger object of the device hosting the sensor.',lib:'tilt.get_dataLogger()',pro:'function get_dataLogger()',cmt:'

Returns the YDatalogger object of the device hosting the sensor. This method returns an object of class YDatalogger that can control global parameters of the data logger. The returned object should not be freed.

',ret:'an YDataLogger object or null on error.'}; doc['Tilt']['get_errorMessage']={syn:'Returns the error message of the latest error with the tilt sensor.',lib:'tilt.get_errorMessage()',pro:'function get_errorMessage()',cmt:'

Returns the error message of the latest error with the tilt sensor. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a string corresponding to the latest error message that occured while using the tilt sensor object'}; doc['Tilt']['get_errorType']={syn:'Returns the numerical error code of the latest error with the tilt sensor.',lib:'tilt.get_errorType()',pro:'function get_errorType()',cmt:'

Returns the numerical error code of the latest error with the tilt sensor. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a number corresponding to the code of the latest error that occurred while using the tilt sensor object'}; doc['Tilt']['get_friendlyName']={syn:'Returns a global identifier of the tilt sensor in the format `MODULE_NAME.FUNCTION_NAME`.',lib:'tilt.get_friendlyName()',pro:'function get_friendlyName()',cmt:'

Returns a global identifier of the tilt sensor in the format `MODULE_NAME.FUNCTION_NAME`. The returned string uses the logical names of the module and of the tilt sensor if they are defined, otherwise the serial number of the module and the hardware identifier of the tilt sensor (for example: `MyCustomName.relay1`)

',ret:'a string that uniquely identifies the tilt sensor using logical names (ex: `MyCustomName.relay1`)',ext:'On failure, throws an exception or returns `Y_FRIENDLYNAME_INVALID`.'}; doc['Tilt']['get_functionDescriptor']={syn:'Returns a unique identifier of type `YFUN_DESCR` corresponding to the function.',lib:'tilt.get_functionDescriptor()',pro:'function get_functionDescriptor()',cmt:'

Returns a unique identifier of type `YFUN_DESCR` corresponding to the function. This identifier can be used to test if two instances of `YFunction` reference the same physical function on the same physical device.

',ret:'an identifier of type `YFUN_DESCR`.',ext:'If the function has never been contacted, the returned value is `Y_FUNCTIONDESCRIPTOR_INVALID`.'}; doc['Tilt']['get_functionId']={syn:'Returns the hardware identifier of the tilt sensor, without reference to the module.',lib:'tilt.get_functionId()',pro:'function get_functionId()',cmt:'

Returns the hardware identifier of the tilt sensor, without reference to the module. For example `relay1`

',ret:'a string that identifies the tilt sensor (ex: `relay1`)',ext:'On failure, throws an exception or returns `Y_FUNCTIONID_INVALID`.'}; doc['Tilt']['get_hardwareId']={syn:'Returns the unique hardware identifier of the tilt sensor in the form `SERIAL.FUNCTIONID`.',lib:'tilt.get_hardwareId()',pro:'function get_hardwareId()',cmt:'

Returns the unique hardware identifier of the tilt sensor in the form `SERIAL.FUNCTIONID`. The unique hardware identifier is composed of the device serial number and of the hardware identifier of the tilt sensor (for example `RELAYLO1-123456.relay1`).

',ret:'a string that uniquely identifies the tilt sensor (ex: `RELAYLO1-123456.relay1`)',ext:'On failure, throws an exception or returns `Y_HARDWAREID_INVALID`.'}; doc['Tilt']['get_highestValue']={syn:'Returns the maximal value observed for the inclination since the device was started.',lib:'tilt.get_highestValue()',pro:'function get_highestValue()',cmt:'

Returns the maximal value observed for the inclination since the device was started. Can be reset to an arbitrary value thanks to set_highestValue().

',ret:'a floating point number corresponding to the maximal value observed for the inclination since the device was started',ext:'On failure, throws an exception or returns `Y_HIGHESTVALUE_INVALID`.'}; doc['Tilt']['get_logFrequency']={syn:'Returns the datalogger recording frequency for this function, or \x22OFF\x22 when measures are not stored in the data logger flash memory.',lib:'tilt.get_logFrequency()',pro:'function get_logFrequency()',cmt:'

Returns the datalogger recording frequency for this function, or \x22OFF\x22 when measures are not stored in the data logger flash memory.

',ret:'a string corresponding to the datalogger recording frequency for this function, or \x22OFF\x22 when measures are not stored in the data logger flash memory',ext:'On failure, throws an exception or returns `Y_LOGFREQUENCY_INVALID`.'}; doc['Tilt']['get_logicalName']={syn:'Returns the logical name of the tilt sensor.',lib:'tilt.get_logicalName()',pro:'function get_logicalName()',cmt:'

Returns the logical name of the tilt sensor.

',ret:'a string corresponding to the logical name of the tilt sensor.',ext:'On failure, throws an exception or returns `Y_LOGICALNAME_INVALID`.'}; doc['Tilt']['get_lowestValue']={syn:'Returns the minimal value observed for the inclination since the device was started.',lib:'tilt.get_lowestValue()',pro:'function get_lowestValue()',cmt:'

Returns the minimal value observed for the inclination since the device was started. Can be reset to an arbitrary value thanks to set_lowestValue().

',ret:'a floating point number corresponding to the minimal value observed for the inclination since the device was started',ext:'On failure, throws an exception or returns `Y_LOWESTVALUE_INVALID`.'}; doc['Tilt']['get_module']={syn:'Gets the `YModule` object for the device on which the function is located.',lib:'tilt.get_module()',pro:'function get_module()',cmt:'

Gets the `YModule` object for the device on which the function is located. If the function cannot be located on any module, the returned instance of `YModule` is not shown as on-line.

',ret:'an instance of `YModule`'}; doc['Tilt']['get_module_async']={syn:'Gets the `YModule` object for the device on which the function is located (asynchronous version).',lib:'tilt.get_module_async()',pro:'function get_module_async(callback, context)',cmt:'

Gets the `YModule` object for the device on which the function is located (asynchronous version). If the function cannot be located on any module, the returned `YModule` object does not show as on-line.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking Firefox javascript VM that does not implement context switching during blocking I/O calls. See the documentation section on asynchronous Javascript calls for more details.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the requested `YModule` object',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['Tilt']['get_recordedData']={syn:'Retrieves a DataSet object holding historical data for this sensor, for a specified time interval.',lib:'tilt.get_recordedData()',pro:'function get_recordedData(startTime, endTime)',cmt:'

Retrieves a DataSet object holding historical data for this sensor, for a specified time interval. The measures will be retrieved from the data logger, which must have been turned on at the desired time. See the documentation of the DataSet class for information on how to get an overview of the recorded data, and how to load progressively a large set of measures from the data logger.

This function only works if the device uses a recent firmware, as DataSet objects are not supported by firmwares older than version 13000.

',par:{startTime:'the start of the desired measure time interval, as a Unix timestamp, i.e. the number of seconds since January 1, 1970 UTC. The special value 0 can be used to include any meaasure, without initial limit.',endTime:'the end of the desired measure time interval, as a Unix timestamp, i.e. the number of seconds since January 1, 1970 UTC. The special value 0 can be used to include any meaasure, without ending limit.'},ret:'an instance of YDataSet, providing access to historical data. Past measures can be loaded progressively using methods from the YDataSet object.'}; doc['Tilt']['get_reportFrequency']={syn:'Returns the timed value notification frequency, or \x22OFF\x22 if timed value notifications are disabled for this function.',lib:'tilt.get_reportFrequency()',pro:'function get_reportFrequency()',cmt:'

Returns the timed value notification frequency, or \x22OFF\x22 if timed value notifications are disabled for this function.

',ret:'a string corresponding to the timed value notification frequency, or \x22OFF\x22 if timed value notifications are disabled for this function',ext:'On failure, throws an exception or returns `Y_REPORTFREQUENCY_INVALID`.'}; doc['Tilt']['get_resolution']={syn:'Returns the resolution of the measured values.',lib:'tilt.get_resolution()',pro:'function get_resolution()',cmt:'

Returns the resolution of the measured values. The resolution corresponds to the numerical precision of the measures, which is not always the same as the actual precision of the sensor.

',ret:'a floating point number corresponding to the resolution of the measured values',ext:'On failure, throws an exception or returns `Y_RESOLUTION_INVALID`.'}; doc['Tilt']['get_sensorState']={syn:'Returns the sensor health state code, which is zero when there is an up-to-date measure available or a positive code if the sensor is not able to provide a measure right now.',lib:'tilt.get_sensorState()',pro:'function get_sensorState()',cmt:'

Returns the sensor health state code, which is zero when there is an up-to-date measure available or a positive code if the sensor is not able to provide a measure right now.

',ret:'an integer corresponding to the sensor health state code, which is zero when there is an up-to-date measure available or a positive code if the sensor is not able to provide a measure right now',ext:'On failure, throws an exception or returns `Y_SENSORSTATE_INVALID`.'}; doc['Tilt']['get_unit']={syn:'Returns the measuring unit for the inclination.',lib:'tilt.get_unit()',pro:'function get_unit()',cmt:'

Returns the measuring unit for the inclination.

',ret:'a string corresponding to the measuring unit for the inclination',ext:'On failure, throws an exception or returns `Y_UNIT_INVALID`.'}; doc['Tilt']['get_userData']={syn:'Returns the value of the userData attribute, as previously stored using method `set_userData`.',lib:'tilt.get_userData()',pro:'function get_userData()',cmt:'

Returns the value of the userData attribute, as previously stored using method `set_userData`. This attribute is never touched directly by the API, and is at disposal of the caller to store a context.

',ret:'the object stored previously by the caller.'}; doc['Tilt']['isOnline']={syn:'Checks if the tilt sensor is currently reachable, without raising any error.',lib:'tilt.isOnline()',pro:'function isOnline()',cmt:'

Checks if the tilt sensor is currently reachable, without raising any error. If there is a cached value for the tilt sensor in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the tilt sensor.

',ret:'`true` if the tilt sensor can be reached, and `false` otherwise'}; doc['Tilt']['isOnline_async']={syn:'Checks if the tilt sensor is currently reachable, without raising any error (asynchronous version).',lib:'tilt.isOnline_async()',pro:'function isOnline_async(callback, context)',cmt:'

Checks if the tilt sensor is currently reachable, without raising any error (asynchronous version). If there is a cached value for the tilt sensor in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the requested function.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the boolean result',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['Tilt']['load']={syn:'Preloads the tilt sensor cache with a specified validity duration.',lib:'tilt.load()',pro:'function load(msValidity)',cmt:'

Preloads the tilt sensor cache with a specified validity duration. By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network traffic for instance.

',par:{msValidity:'an integer corresponding to the validity attributed to the loaded function parameters, in milliseconds'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Tilt']['loadAttribute']={syn:'Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.',lib:'tilt.loadAttribute()',pro:'function loadAttribute(attrName)',cmt:'

Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.

',par:{attrName:'the name of the requested attribute'},ret:'a string with the value of the the attribute',ext:'On failure, throws an exception or returns an empty string.'}; doc['Tilt']['loadCalibrationPoints']={syn:'Retrieves error correction data points previously entered using the method `calibrateFromPoints`.',lib:'tilt.loadCalibrationPoints()',pro:'function loadCalibrationPoints(rawValues, refValues)',cmt:'

Retrieves error correction data points previously entered using the method `calibrateFromPoints`.

',par:{rawValues:'array of floating point numbers, that will be filled by the function with the raw sensor values for the correction points.',refValues:'array of floating point numbers, that will be filled by the function with the desired values for the correction points.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Tilt']['load_async']={syn:'Preloads the tilt sensor cache with a specified validity duration (asynchronous version).',lib:'tilt.load_async()',pro:'function load_async(msValidity, callback, context)',cmt:'

Preloads the tilt sensor cache with a specified validity duration (asynchronous version). By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network trafic for instance.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{msValidity:'an integer corresponding to the validity of the loaded function parameters, in milliseconds',callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the error code (or `YAPI_SUCCESS`)',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['Tilt']['muteValueCallbacks']={syn:'Disables the propagation of every new advertised value to the parent hub.',lib:'tilt.muteValueCallbacks()',pro:'function muteValueCallbacks()',cmt:'

Disables the propagation of every new advertised value to the parent hub. You can use this function to save bandwidth and CPU on computers with limited resources, or to prevent unwanted invocations of the HTTP callback. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Tilt']['nextTilt']={syn:'Continues the enumeration of tilt sensors started using `yFirstTilt()`.',lib:'tilt.nextTilt()',pro:'function nextTilt()',cmt:'

Continues the enumeration of tilt sensors started using `yFirstTilt()`.

',ret:'a pointer to a `YTilt` object, corresponding to a tilt sensor currently online, or a `null` pointer if there are no more tilt sensors to enumerate.'}; doc['Tilt']['registerTimedReportCallback']={syn:'Registers the callback function that is invoked on every periodic timed notification.',lib:'tilt.registerTimedReportCallback()',pro:'function registerTimedReportCallback(callback)',cmt:'

Registers the callback function that is invoked on every periodic timed notification. The callback is invoked only during the execution of `ySleep` or `yHandleEvents`. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a null pointer as argument.

',par:{callback:'the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and an YMeasure object describing the new advertised value.'}}; doc['Tilt']['registerValueCallback']={syn:'Registers the callback function that is invoked on every change of advertised value.',lib:'tilt.registerValueCallback()',pro:'function registerValueCallback(callback)',cmt:'

Registers the callback function that is invoked on every change of advertised value. The callback is invoked only during the execution of `ySleep` or `yHandleEvents`. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a null pointer as argument.

',par:{callback:'the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and the character string describing the new advertised value.'}}; doc['Tilt']['set_advMode']={syn:'Changes the measuring mode used for the advertised value pushed to the parent hub.',lib:'tilt.set_advMode()',pro:'function set_advMode(newval)',cmt:'

Changes the measuring mode used for the advertised value pushed to the parent hub.

',par:{newval:'a value among `Y_ADVMODE_IMMEDIATE`, `Y_ADVMODE_PERIOD_AVG`, `Y_ADVMODE_PERIOD_MIN` and `Y_ADVMODE_PERIOD_MAX` corresponding to the measuring mode used for the advertised value pushed to the parent hub'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Tilt']['set_bandwidth']={syn:'Changes the measure update frequency, measured in Hz (Yocto-3D-V2 only).',lib:'tilt.set_bandwidth()',pro:'function set_bandwidth(newval)',cmt:'

Changes the measure update frequency, measured in Hz (Yocto-3D-V2 only). When the frequency is lower, the device performs averaging.

',par:{newval:'an integer corresponding to the measure update frequency, measured in Hz (Yocto-3D-V2 only)'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Tilt']['set_highestValue']={syn:'Changes the recorded maximal value observed.',lib:'tilt.set_highestValue()',pro:'function set_highestValue(newval)',cmt:'

Changes the recorded maximal value observed. Can be used to reset the value returned by get_lowestValue().

',par:{newval:'a floating point number corresponding to the recorded maximal value observed'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Tilt']['set_logFrequency']={syn:'Changes the datalogger recording frequency for this function.',lib:'tilt.set_logFrequency()',pro:'function set_logFrequency(newval)',cmt:'

Changes the datalogger recording frequency for this function. The frequency can be specified as samples per second, as sample per minute (for instance \x2215/m\x22) or in samples per hour (eg. \x224/h\x22). To disable recording for this function, use the value \x22OFF\x22.

',par:{newval:'a string corresponding to the datalogger recording frequency for this function'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Tilt']['set_logicalName']={syn:'Changes the logical name of the tilt sensor.',lib:'tilt.set_logicalName()',pro:'function set_logicalName(newval)',cmt:'

Changes the logical name of the tilt sensor. You can use `yCheckLogicalName()` prior to this call to make sure that your parameter is valid. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',par:{newval:'a string corresponding to the logical name of the tilt sensor.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Tilt']['set_lowestValue']={syn:'Changes the recorded minimal value observed.',lib:'tilt.set_lowestValue()',pro:'function set_lowestValue(newval)',cmt:'

Changes the recorded minimal value observed. Can be used to reset the value returned by get_lowestValue().

',par:{newval:'a floating point number corresponding to the recorded minimal value observed'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Tilt']['set_reportFrequency']={syn:'Changes the timed value notification frequency for this function.',lib:'tilt.set_reportFrequency()',pro:'function set_reportFrequency(newval)',cmt:'

Changes the timed value notification frequency for this function. The frequency can be specified as samples per second, as sample per minute (for instance \x2215/m\x22) or in samples per hour (eg. \x224/h\x22). To disable timed value notifications for this function, use the value \x22OFF\x22.

',par:{newval:'a string corresponding to the timed value notification frequency for this function'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Tilt']['set_resolution']={syn:'Changes the resolution of the measured physical values.',lib:'tilt.set_resolution()',pro:'function set_resolution(newval)',cmt:'

Changes the resolution of the measured physical values. The resolution corresponds to the numerical precision when displaying value. It does not change the precision of the measure itself.

',par:{newval:'a floating point number corresponding to the resolution of the measured physical values'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Tilt']['set_userData']={syn:'Stores a user context provided as argument in the userData attribute of the function.',lib:'tilt.set_userData()',pro:'function set_userData(data)',cmt:'

Stores a user context provided as argument in the userData attribute of the function. This attribute is never touched by the API, and is at disposal of the caller to store a context.

',par:{data:'any kind of object to be stored'}}; doc['Tilt']['startDataLogger']={syn:'Starts the data logger on the device.',lib:'tilt.startDataLogger()',pro:'function startDataLogger()',cmt:'

Starts the data logger on the device. Note that the data logger will only save the measures on this sensor if the logFrequency is not set to \x22OFF\x22.

',ret:'`YAPI_SUCCESS` if the call succeeds.'}; doc['Tilt']['stopDataLogger']={syn:'Stops the datalogger on the device.',lib:'tilt.stopDataLogger()',pro:'function stopDataLogger()',cmt:'

Stops the datalogger on the device.

',ret:'`YAPI_SUCCESS` if the call succeeds.'}; doc['Tilt']['unmuteValueCallbacks']={syn:'Re-enables the propagation of every new advertised value to the parent hub.',lib:'tilt.unmuteValueCallbacks()',pro:'function unmuteValueCallbacks()',cmt:'

Re-enables the propagation of every new advertised value to the parent hub. This function reverts the effect of a previous call to `muteValueCallbacks()`. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Tilt']['wait_async']={syn:'Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function.',lib:'tilt.wait_async()',pro:'function wait_async(callback, context)',cmt:'

Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function. The callback function can therefore freely issue synchronous or asynchronous commands, without risking to block the Javascript VM.

',par:{callback:'callback function that is invoked when all pending commands on the module are completed. The callback function receives two arguments: the caller-specific context object and the receiving function object.',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing.'}; //--- (end of generated code: Tilt) //--- (generated code: Qt) doc['Qt']={'':{syn:'Quaternion interface',inc:'<script type='text/javascript' src='yocto_gyro.js'></script>',cmt:'

The Yoctopuce API YQt class provides direct access to the Yocto3D attitude estimation using a quaternion. It is usually not needed to use the YQt class directly, as the YGyro class provides a more convenient higher-level interface.

'}}; doc['Qt']['FindQt']={syn:'Retrieves a quaternion component for a given identifier.',lib:'YQt.FindQt()',pro:'function FindQt(func)',cmt:'

Retrieves a quaternion component for a given identifier. The identifier can be specified using several formats:

- FunctionLogicalName
- ModuleSerialNumber.FunctionIdentifier
- ModuleSerialNumber.FunctionLogicalName
- ModuleLogicalName.FunctionIdentifier
- ModuleLogicalName.FunctionLogicalName

This function does not require that the quaternion component is online at the time it is invoked. The returned object is nevertheless valid. Use the method `YQt.isOnline()` to test if the quaternion component is indeed online at a given time. In case of ambiguity when looking for a quaternion component by logical name, no error is notified: the first instance found is returned. The search is performed first by hardware name, then by logical name.

If a call to this object\x27s is_online() method returns FALSE although you are certain that the matching device is plugged, make sure that you did call registerHub() at application initialization time.

',par:{func:'a string that uniquely characterizes the quaternion component'},ret:'a `YQt` object allowing you to drive the quaternion component.'}; doc['Qt']['FirstQt']={syn:'Starts the enumeration of quaternion components currently accessible.',lib:'YQt.FirstQt()',pro:'function FirstQt()',cmt:'

Starts the enumeration of quaternion components currently accessible. Use the method `YQt.nextQt()` to iterate on next quaternion components.

',ret:'a pointer to a `YQt` object, corresponding to the first quaternion component currently online, or a `null` pointer if there are none.'}; doc['Qt']['calibrateFromPoints']={syn:'Configures error correction data points, in particular to compensate for a possible perturbation of the measure caused by an enclosure.',lib:'qt.calibrateFromPoints()',pro:'function calibrateFromPoints(rawValues, refValues)',cmt:'

Configures error correction data points, in particular to compensate for a possible perturbation of the measure caused by an enclosure. It is possible to configure up to five correction points. Correction points must be provided in ascending order, and be in the range of the sensor. The device will automatically perform a linear interpolation of the error correction between specified points. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

For more information on advanced capabilities to refine the calibration of sensors, please contact support@yoctopuce.com.

',par:{rawValues:'array of floating point numbers, corresponding to the raw values returned by the sensor for the correction points.',refValues:'array of floating point numbers, corresponding to the corrected values for the correction points.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Qt']['clearCache']={syn:'Invalidates the cache.',lib:'qt.clearCache()',pro:'function clearCache()',cmt:'

Invalidates the cache. Invalidates the cache of the quaternion component attributes. Forces the next call to get_xxx() or loadxxx() to use values that come from the device.

'}; doc['Qt']['describe']={syn:'Returns a short text that describes unambiguously the instance of the quaternion component in the form `TYPE(NAME)=SERIAL.FUNCTIONID`.',lib:'qt.describe()',pro:'function describe()',cmt:'

Returns a short text that describes unambiguously the instance of the quaternion component in the form `TYPE(NAME)=SERIAL.FUNCTIONID`. More precisely, `TYPE` is the type of the function, `NAME` it the name used for the first access to the function, `SERIAL` is the serial number of the module if the module is connected or `\x22unresolved\x22`, and `FUNCTIONID` is the hardware identifier of the function if the module is connected. For example, this method returns `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1` if the module is already connected or `Relay(BadCustomeName.relay1)=unresolved` if the module has not yet been connected. This method does not trigger any USB or TCP transaction and can therefore be used in a debugger.

',ret:'a string that describes the quaternion component (ex: `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1`)'}; doc['Qt']['get_advMode']={syn:'Returns the measuring mode used for the advertised value pushed to the parent hub.',lib:'qt.get_advMode()',pro:'function get_advMode()',cmt:'

Returns the measuring mode used for the advertised value pushed to the parent hub.

',ret:'a value among `Y_ADVMODE_IMMEDIATE`, `Y_ADVMODE_PERIOD_AVG`, `Y_ADVMODE_PERIOD_MIN` and `Y_ADVMODE_PERIOD_MAX` corresponding to the measuring mode used for the advertised value pushed to the parent hub',ext:'On failure, throws an exception or returns `Y_ADVMODE_INVALID`.'}; doc['Qt']['get_advertisedValue']={syn:'Returns the current value of the quaternion component (no more than 6 characters).',lib:'qt.get_advertisedValue()',pro:'function get_advertisedValue()',cmt:'

Returns the current value of the quaternion component (no more than 6 characters).

',ret:'a string corresponding to the current value of the quaternion component (no more than 6 characters).',ext:'On failure, throws an exception or returns `Y_ADVERTISEDVALUE_INVALID`.'}; doc['Qt']['get_currentRawValue']={syn:'Returns the uncalibrated, unrounded raw value returned by the sensor, in units, as a floating point number.',lib:'qt.get_currentRawValue()',pro:'function get_currentRawValue()',cmt:'

Returns the uncalibrated, unrounded raw value returned by the sensor, in units, as a floating point number.

',ret:'a floating point number corresponding to the uncalibrated, unrounded raw value returned by the sensor, in units, as a floating point number',ext:'On failure, throws an exception or returns `Y_CURRENTRAWVALUE_INVALID`.'}; doc['Qt']['get_currentValue']={syn:'Returns the current value of the value, in units, as a floating point number.',lib:'qt.get_currentValue()',pro:'function get_currentValue()',cmt:'

Returns the current value of the value, in units, as a floating point number.

',ret:'a floating point number corresponding to the current value of the value, in units, as a floating point number',ext:'On failure, throws an exception or returns `Y_CURRENTVALUE_INVALID`.'}; doc['Qt']['get_dataLogger']={syn:'Returns the YDatalogger object of the device hosting the sensor.',lib:'qt.get_dataLogger()',pro:'function get_dataLogger()',cmt:'

Returns the YDatalogger object of the device hosting the sensor. This method returns an object of class YDatalogger that can control global parameters of the data logger. The returned object should not be freed.

',ret:'an YDataLogger object or null on error.'}; doc['Qt']['get_errorMessage']={syn:'Returns the error message of the latest error with the quaternion component.',lib:'qt.get_errorMessage()',pro:'function get_errorMessage()',cmt:'

Returns the error message of the latest error with the quaternion component. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a string corresponding to the latest error message that occured while using the quaternion component object'}; doc['Qt']['get_errorType']={syn:'Returns the numerical error code of the latest error with the quaternion component.',lib:'qt.get_errorType()',pro:'function get_errorType()',cmt:'

Returns the numerical error code of the latest error with the quaternion component. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a number corresponding to the code of the latest error that occurred while using the quaternion component object'}; doc['Qt']['get_friendlyName']={syn:'Returns a global identifier of the quaternion component in the format `MODULE_NAME.FUNCTION_NAME`.',lib:'qt.get_friendlyName()',pro:'function get_friendlyName()',cmt:'

Returns a global identifier of the quaternion component in the format `MODULE_NAME.FUNCTION_NAME`. The returned string uses the logical names of the module and of the quaternion component if they are defined, otherwise the serial number of the module and the hardware identifier of the quaternion component (for example: `MyCustomName.relay1`)

',ret:'a string that uniquely identifies the quaternion component using logical names (ex: `MyCustomName.relay1`)',ext:'On failure, throws an exception or returns `Y_FRIENDLYNAME_INVALID`.'}; doc['Qt']['get_functionDescriptor']={syn:'Returns a unique identifier of type `YFUN_DESCR` corresponding to the function.',lib:'qt.get_functionDescriptor()',pro:'function get_functionDescriptor()',cmt:'

Returns a unique identifier of type `YFUN_DESCR` corresponding to the function. This identifier can be used to test if two instances of `YFunction` reference the same physical function on the same physical device.

',ret:'an identifier of type `YFUN_DESCR`.',ext:'If the function has never been contacted, the returned value is `Y_FUNCTIONDESCRIPTOR_INVALID`.'}; doc['Qt']['get_functionId']={syn:'Returns the hardware identifier of the quaternion component, without reference to the module.',lib:'qt.get_functionId()',pro:'function get_functionId()',cmt:'

Returns the hardware identifier of the quaternion component, without reference to the module. For example `relay1`

',ret:'a string that identifies the quaternion component (ex: `relay1`)',ext:'On failure, throws an exception or returns `Y_FUNCTIONID_INVALID`.'}; doc['Qt']['get_hardwareId']={syn:'Returns the unique hardware identifier of the quaternion component in the form `SERIAL.FUNCTIONID`.',lib:'qt.get_hardwareId()',pro:'function get_hardwareId()',cmt:'

Returns the unique hardware identifier of the quaternion component in the form `SERIAL.FUNCTIONID`. The unique hardware identifier is composed of the device serial number and of the hardware identifier of the quaternion component (for example `RELAYLO1-123456.relay1`).

',ret:'a string that uniquely identifies the quaternion component (ex: `RELAYLO1-123456.relay1`)',ext:'On failure, throws an exception or returns `Y_HARDWAREID_INVALID`.'}; doc['Qt']['get_highestValue']={syn:'Returns the maximal value observed for the value since the device was started.',lib:'qt.get_highestValue()',pro:'function get_highestValue()',cmt:'

Returns the maximal value observed for the value since the device was started. Can be reset to an arbitrary value thanks to set_highestValue().

',ret:'a floating point number corresponding to the maximal value observed for the value since the device was started',ext:'On failure, throws an exception or returns `Y_HIGHESTVALUE_INVALID`.'}; doc['Qt']['get_logFrequency']={syn:'Returns the datalogger recording frequency for this function, or \x22OFF\x22 when measures are not stored in the data logger flash memory.',lib:'qt.get_logFrequency()',pro:'function get_logFrequency()',cmt:'

Returns the datalogger recording frequency for this function, or \x22OFF\x22 when measures are not stored in the data logger flash memory.

',ret:'a string corresponding to the datalogger recording frequency for this function, or \x22OFF\x22 when measures are not stored in the data logger flash memory',ext:'On failure, throws an exception or returns `Y_LOGFREQUENCY_INVALID`.'}; doc['Qt']['get_logicalName']={syn:'Returns the logical name of the quaternion component.',lib:'qt.get_logicalName()',pro:'function get_logicalName()',cmt:'

Returns the logical name of the quaternion component.

',ret:'a string corresponding to the logical name of the quaternion component.',ext:'On failure, throws an exception or returns `Y_LOGICALNAME_INVALID`.'}; doc['Qt']['get_lowestValue']={syn:'Returns the minimal value observed for the value since the device was started.',lib:'qt.get_lowestValue()',pro:'function get_lowestValue()',cmt:'

Returns the minimal value observed for the value since the device was started. Can be reset to an arbitrary value thanks to set_lowestValue().

',ret:'a floating point number corresponding to the minimal value observed for the value since the device was started',ext:'On failure, throws an exception or returns `Y_LOWESTVALUE_INVALID`.'}; doc['Qt']['get_module']={syn:'Gets the `YModule` object for the device on which the function is located.',lib:'qt.get_module()',pro:'function get_module()',cmt:'

Gets the `YModule` object for the device on which the function is located. If the function cannot be located on any module, the returned instance of `YModule` is not shown as on-line.

',ret:'an instance of `YModule`'}; doc['Qt']['get_module_async']={syn:'Gets the `YModule` object for the device on which the function is located (asynchronous version).',lib:'qt.get_module_async()',pro:'function get_module_async(callback, context)',cmt:'

Gets the `YModule` object for the device on which the function is located (asynchronous version). If the function cannot be located on any module, the returned `YModule` object does not show as on-line.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking Firefox javascript VM that does not implement context switching during blocking I/O calls. See the documentation section on asynchronous Javascript calls for more details.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the requested `YModule` object',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['Qt']['get_recordedData']={syn:'Retrieves a DataSet object holding historical data for this sensor, for a specified time interval.',lib:'qt.get_recordedData()',pro:'function get_recordedData(startTime, endTime)',cmt:'

Retrieves a DataSet object holding historical data for this sensor, for a specified time interval. The measures will be retrieved from the data logger, which must have been turned on at the desired time. See the documentation of the DataSet class for information on how to get an overview of the recorded data, and how to load progressively a large set of measures from the data logger.

This function only works if the device uses a recent firmware, as DataSet objects are not supported by firmwares older than version 13000.

',par:{startTime:'the start of the desired measure time interval, as a Unix timestamp, i.e. the number of seconds since January 1, 1970 UTC. The special value 0 can be used to include any meaasure, without initial limit.',endTime:'the end of the desired measure time interval, as a Unix timestamp, i.e. the number of seconds since January 1, 1970 UTC. The special value 0 can be used to include any meaasure, without ending limit.'},ret:'an instance of YDataSet, providing access to historical data. Past measures can be loaded progressively using methods from the YDataSet object.'}; doc['Qt']['get_reportFrequency']={syn:'Returns the timed value notification frequency, or \x22OFF\x22 if timed value notifications are disabled for this function.',lib:'qt.get_reportFrequency()',pro:'function get_reportFrequency()',cmt:'

Returns the timed value notification frequency, or \x22OFF\x22 if timed value notifications are disabled for this function.

',ret:'a string corresponding to the timed value notification frequency, or \x22OFF\x22 if timed value notifications are disabled for this function',ext:'On failure, throws an exception or returns `Y_REPORTFREQUENCY_INVALID`.'}; doc['Qt']['get_resolution']={syn:'Returns the resolution of the measured values.',lib:'qt.get_resolution()',pro:'function get_resolution()',cmt:'

Returns the resolution of the measured values. The resolution corresponds to the numerical precision of the measures, which is not always the same as the actual precision of the sensor.

',ret:'a floating point number corresponding to the resolution of the measured values',ext:'On failure, throws an exception or returns `Y_RESOLUTION_INVALID`.'}; doc['Qt']['get_sensorState']={syn:'Returns the sensor health state code, which is zero when there is an up-to-date measure available or a positive code if the sensor is not able to provide a measure right now.',lib:'qt.get_sensorState()',pro:'function get_sensorState()',cmt:'

Returns the sensor health state code, which is zero when there is an up-to-date measure available or a positive code if the sensor is not able to provide a measure right now.

',ret:'an integer corresponding to the sensor health state code, which is zero when there is an up-to-date measure available or a positive code if the sensor is not able to provide a measure right now',ext:'On failure, throws an exception or returns `Y_SENSORSTATE_INVALID`.'}; doc['Qt']['get_unit']={syn:'Returns the measuring unit for the value.',lib:'qt.get_unit()',pro:'function get_unit()',cmt:'

Returns the measuring unit for the value.

',ret:'a string corresponding to the measuring unit for the value',ext:'On failure, throws an exception or returns `Y_UNIT_INVALID`.'}; doc['Qt']['get_userData']={syn:'Returns the value of the userData attribute, as previously stored using method `set_userData`.',lib:'qt.get_userData()',pro:'function get_userData()',cmt:'

Returns the value of the userData attribute, as previously stored using method `set_userData`. This attribute is never touched directly by the API, and is at disposal of the caller to store a context.

',ret:'the object stored previously by the caller.'}; doc['Qt']['isOnline']={syn:'Checks if the quaternion component is currently reachable, without raising any error.',lib:'qt.isOnline()',pro:'function isOnline()',cmt:'

Checks if the quaternion component is currently reachable, without raising any error. If there is a cached value for the quaternion component in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the quaternion component.

',ret:'`true` if the quaternion component can be reached, and `false` otherwise'}; doc['Qt']['isOnline_async']={syn:'Checks if the quaternion component is currently reachable, without raising any error (asynchronous version).',lib:'qt.isOnline_async()',pro:'function isOnline_async(callback, context)',cmt:'

Checks if the quaternion component is currently reachable, without raising any error (asynchronous version). If there is a cached value for the quaternion component in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the requested function.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the boolean result',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['Qt']['load']={syn:'Preloads the quaternion component cache with a specified validity duration.',lib:'qt.load()',pro:'function load(msValidity)',cmt:'

Preloads the quaternion component cache with a specified validity duration. By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network traffic for instance.

',par:{msValidity:'an integer corresponding to the validity attributed to the loaded function parameters, in milliseconds'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Qt']['loadAttribute']={syn:'Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.',lib:'qt.loadAttribute()',pro:'function loadAttribute(attrName)',cmt:'

Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.

',par:{attrName:'the name of the requested attribute'},ret:'a string with the value of the the attribute',ext:'On failure, throws an exception or returns an empty string.'}; doc['Qt']['loadCalibrationPoints']={syn:'Retrieves error correction data points previously entered using the method `calibrateFromPoints`.',lib:'qt.loadCalibrationPoints()',pro:'function loadCalibrationPoints(rawValues, refValues)',cmt:'

Retrieves error correction data points previously entered using the method `calibrateFromPoints`.

',par:{rawValues:'array of floating point numbers, that will be filled by the function with the raw sensor values for the correction points.',refValues:'array of floating point numbers, that will be filled by the function with the desired values for the correction points.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Qt']['load_async']={syn:'Preloads the quaternion component cache with a specified validity duration (asynchronous version).',lib:'qt.load_async()',pro:'function load_async(msValidity, callback, context)',cmt:'

Preloads the quaternion component cache with a specified validity duration (asynchronous version). By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network trafic for instance.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{msValidity:'an integer corresponding to the validity of the loaded function parameters, in milliseconds',callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the error code (or `YAPI_SUCCESS`)',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['Qt']['muteValueCallbacks']={syn:'Disables the propagation of every new advertised value to the parent hub.',lib:'qt.muteValueCallbacks()',pro:'function muteValueCallbacks()',cmt:'

Disables the propagation of every new advertised value to the parent hub. You can use this function to save bandwidth and CPU on computers with limited resources, or to prevent unwanted invocations of the HTTP callback. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Qt']['nextQt']={syn:'Continues the enumeration of quaternion components started using `yFirstQt()`.',lib:'qt.nextQt()',pro:'function nextQt()',cmt:'

Continues the enumeration of quaternion components started using `yFirstQt()`.

',ret:'a pointer to a `YQt` object, corresponding to a quaternion component currently online, or a `null` pointer if there are no more quaternion components to enumerate.'}; doc['Qt']['registerTimedReportCallback']={syn:'Registers the callback function that is invoked on every periodic timed notification.',lib:'qt.registerTimedReportCallback()',pro:'function registerTimedReportCallback(callback)',cmt:'

Registers the callback function that is invoked on every periodic timed notification. The callback is invoked only during the execution of `ySleep` or `yHandleEvents`. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a null pointer as argument.

',par:{callback:'the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and an YMeasure object describing the new advertised value.'}}; doc['Qt']['registerValueCallback']={syn:'Registers the callback function that is invoked on every change of advertised value.',lib:'qt.registerValueCallback()',pro:'function registerValueCallback(callback)',cmt:'

Registers the callback function that is invoked on every change of advertised value. The callback is invoked only during the execution of `ySleep` or `yHandleEvents`. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a null pointer as argument.

',par:{callback:'the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and the character string describing the new advertised value.'}}; doc['Qt']['set_advMode']={syn:'Changes the measuring mode used for the advertised value pushed to the parent hub.',lib:'qt.set_advMode()',pro:'function set_advMode(newval)',cmt:'

Changes the measuring mode used for the advertised value pushed to the parent hub.

',par:{newval:'a value among `Y_ADVMODE_IMMEDIATE`, `Y_ADVMODE_PERIOD_AVG`, `Y_ADVMODE_PERIOD_MIN` and `Y_ADVMODE_PERIOD_MAX` corresponding to the measuring mode used for the advertised value pushed to the parent hub'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Qt']['set_highestValue']={syn:'Changes the recorded maximal value observed.',lib:'qt.set_highestValue()',pro:'function set_highestValue(newval)',cmt:'

Changes the recorded maximal value observed. Can be used to reset the value returned by get_lowestValue().

',par:{newval:'a floating point number corresponding to the recorded maximal value observed'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Qt']['set_logFrequency']={syn:'Changes the datalogger recording frequency for this function.',lib:'qt.set_logFrequency()',pro:'function set_logFrequency(newval)',cmt:'

Changes the datalogger recording frequency for this function. The frequency can be specified as samples per second, as sample per minute (for instance \x2215/m\x22) or in samples per hour (eg. \x224/h\x22). To disable recording for this function, use the value \x22OFF\x22.

',par:{newval:'a string corresponding to the datalogger recording frequency for this function'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Qt']['set_logicalName']={syn:'Changes the logical name of the quaternion component.',lib:'qt.set_logicalName()',pro:'function set_logicalName(newval)',cmt:'

Changes the logical name of the quaternion component. You can use `yCheckLogicalName()` prior to this call to make sure that your parameter is valid. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',par:{newval:'a string corresponding to the logical name of the quaternion component.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Qt']['set_lowestValue']={syn:'Changes the recorded minimal value observed.',lib:'qt.set_lowestValue()',pro:'function set_lowestValue(newval)',cmt:'

Changes the recorded minimal value observed. Can be used to reset the value returned by get_lowestValue().

',par:{newval:'a floating point number corresponding to the recorded minimal value observed'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Qt']['set_reportFrequency']={syn:'Changes the timed value notification frequency for this function.',lib:'qt.set_reportFrequency()',pro:'function set_reportFrequency(newval)',cmt:'

Changes the timed value notification frequency for this function. The frequency can be specified as samples per second, as sample per minute (for instance \x2215/m\x22) or in samples per hour (eg. \x224/h\x22). To disable timed value notifications for this function, use the value \x22OFF\x22.

',par:{newval:'a string corresponding to the timed value notification frequency for this function'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Qt']['set_resolution']={syn:'Changes the resolution of the measured physical values.',lib:'qt.set_resolution()',pro:'function set_resolution(newval)',cmt:'

Changes the resolution of the measured physical values. The resolution corresponds to the numerical precision when displaying value. It does not change the precision of the measure itself.

',par:{newval:'a floating point number corresponding to the resolution of the measured physical values'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Qt']['set_userData']={syn:'Stores a user context provided as argument in the userData attribute of the function.',lib:'qt.set_userData()',pro:'function set_userData(data)',cmt:'

Stores a user context provided as argument in the userData attribute of the function. This attribute is never touched by the API, and is at disposal of the caller to store a context.

',par:{data:'any kind of object to be stored'}}; doc['Qt']['startDataLogger']={syn:'Starts the data logger on the device.',lib:'qt.startDataLogger()',pro:'function startDataLogger()',cmt:'

Starts the data logger on the device. Note that the data logger will only save the measures on this sensor if the logFrequency is not set to \x22OFF\x22.

',ret:'`YAPI_SUCCESS` if the call succeeds.'}; doc['Qt']['stopDataLogger']={syn:'Stops the datalogger on the device.',lib:'qt.stopDataLogger()',pro:'function stopDataLogger()',cmt:'

Stops the datalogger on the device.

',ret:'`YAPI_SUCCESS` if the call succeeds.'}; doc['Qt']['unmuteValueCallbacks']={syn:'Re-enables the propagation of every new advertised value to the parent hub.',lib:'qt.unmuteValueCallbacks()',pro:'function unmuteValueCallbacks()',cmt:'

Re-enables the propagation of every new advertised value to the parent hub. This function reverts the effect of a previous call to `muteValueCallbacks()`. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Qt']['wait_async']={syn:'Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function.',lib:'qt.wait_async()',pro:'function wait_async(callback, context)',cmt:'

Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function. The callback function can therefore freely issue synchronous or asynchronous commands, without risking to block the Javascript VM.

',par:{callback:'callback function that is invoked when all pending commands on the module are completed. The callback function receives two arguments: the caller-specific context object and the receiving function object.',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing.'}; //--- (end of generated code: Qt) //--- (generated code: PwmOutput) doc['PwmOutput']={'':{syn:'PwmOutput function interface',inc:'<script type='text/javascript' src='yocto_pwmoutput.js'></script>',cmt:'

The Yoctopuce application programming interface allows you to configure, start, and stop the PWM.

'}}; doc['PwmOutput']['FindPwmOutput']={syn:'Retrieves a PWM for a given identifier.',lib:'YPwmOutput.FindPwmOutput()',pro:'function FindPwmOutput(func)',cmt:'

Retrieves a PWM for a given identifier. The identifier can be specified using several formats:

- FunctionLogicalName
- ModuleSerialNumber.FunctionIdentifier
- ModuleSerialNumber.FunctionLogicalName
- ModuleLogicalName.FunctionIdentifier
- ModuleLogicalName.FunctionLogicalName

This function does not require that the PWM is online at the time it is invoked. The returned object is nevertheless valid. Use the method `YPwmOutput.isOnline()` to test if the PWM is indeed online at a given time. In case of ambiguity when looking for a PWM by logical name, no error is notified: the first instance found is returned. The search is performed first by hardware name, then by logical name.

If a call to this object\x27s is_online() method returns FALSE although you are certain that the matching device is plugged, make sure that you did call registerHub() at application initialization time.

',par:{func:'a string that uniquely characterizes the PWM'},ret:'a `YPwmOutput` object allowing you to drive the PWM.'}; doc['PwmOutput']['FirstPwmOutput']={syn:'Starts the enumeration of PWMs currently accessible.',lib:'YPwmOutput.FirstPwmOutput()',pro:'function FirstPwmOutput()',cmt:'

Starts the enumeration of PWMs currently accessible. Use the method `YPwmOutput.nextPwmOutput()` to iterate on next PWMs.

',ret:'a pointer to a `YPwmOutput` object, corresponding to the first PWM currently online, or a `null` pointer if there are none.'}; doc['PwmOutput']['clearCache']={syn:'Invalidates the cache.',lib:'pwmoutput.clearCache()',pro:'function clearCache()',cmt:'

Invalidates the cache. Invalidates the cache of the PWM attributes. Forces the next call to get_xxx() or loadxxx() to use values that come from the device.

'}; doc['PwmOutput']['describe']={syn:'Returns a short text that describes unambiguously the instance of the PWM in the form `TYPE(NAME)=SERIAL.FUNCTIONID`.',lib:'pwmoutput.describe()',pro:'function describe()',cmt:'

Returns a short text that describes unambiguously the instance of the PWM in the form `TYPE(NAME)=SERIAL.FUNCTIONID`. More precisely, `TYPE` is the type of the function, `NAME` it the name used for the first access to the function, `SERIAL` is the serial number of the module if the module is connected or `\x22unresolved\x22`, and `FUNCTIONID` is the hardware identifier of the function if the module is connected. For example, this method returns `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1` if the module is already connected or `Relay(BadCustomeName.relay1)=unresolved` if the module has not yet been connected. This method does not trigger any USB or TCP transaction and can therefore be used in a debugger.

',ret:'a string that describes the PWM (ex: `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1`)'}; doc['PwmOutput']['dutyCycleMove']={syn:'Performs a smooth change of the pulse duration toward a given value.',lib:'pwmoutput.dutyCycleMove()',pro:'function dutyCycleMove(target, ms_duration)',cmt:'

Performs a smooth change of the pulse duration toward a given value.

',par:{target:'new duty cycle at the end of the transition (floating-point number, between 0 and 1)',ms_duration:'total duration of the transition, in milliseconds'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['PwmOutput']['get_advertisedValue']={syn:'Returns the current value of the PWM (no more than 6 characters).',lib:'pwmoutput.get_advertisedValue()',pro:'function get_advertisedValue()',cmt:'

Returns the current value of the PWM (no more than 6 characters).

',ret:'a string corresponding to the current value of the PWM (no more than 6 characters).',ext:'On failure, throws an exception or returns `Y_ADVERTISEDVALUE_INVALID`.'}; doc['PwmOutput']['get_dutyCycle']={syn:'Returns the PWM duty cycle, in per cents.',lib:'pwmoutput.get_dutyCycle()',pro:'function get_dutyCycle()',cmt:'

Returns the PWM duty cycle, in per cents.

',ret:'a floating point number corresponding to the PWM duty cycle, in per cents',ext:'On failure, throws an exception or returns `Y_DUTYCYCLE_INVALID`.'}; doc['PwmOutput']['get_dutyCycleAtPowerOn']={syn:'Returns the PWMs duty cycle at device power on as a floating point number between 0 and 100.',lib:'pwmoutput.get_dutyCycleAtPowerOn()',pro:'function get_dutyCycleAtPowerOn()',cmt:'

Returns the PWMs duty cycle at device power on as a floating point number between 0 and 100.

',ret:'a floating point number corresponding to the PWMs duty cycle at device power on as a floating point number between 0 and 100',ext:'On failure, throws an exception or returns `Y_DUTYCYCLEATPOWERON_INVALID`.'}; doc['PwmOutput']['get_enabled']={syn:'Returns the state of the PWMs.',lib:'pwmoutput.get_enabled()',pro:'function get_enabled()',cmt:'

Returns the state of the PWMs.

',ret:'either `Y_ENABLED_FALSE` or `Y_ENABLED_TRUE`, according to the state of the PWMs',ext:'On failure, throws an exception or returns `Y_ENABLED_INVALID`.'}; doc['PwmOutput']['get_enabledAtPowerOn']={syn:'Returns the state of the PWM at device power on.',lib:'pwmoutput.get_enabledAtPowerOn()',pro:'function get_enabledAtPowerOn()',cmt:'

Returns the state of the PWM at device power on.

',ret:'either `Y_ENABLEDATPOWERON_FALSE` or `Y_ENABLEDATPOWERON_TRUE`, according to the state of the PWM at device power on',ext:'On failure, throws an exception or returns `Y_ENABLEDATPOWERON_INVALID`.'}; doc['PwmOutput']['get_errorMessage']={syn:'Returns the error message of the latest error with the PWM.',lib:'pwmoutput.get_errorMessage()',pro:'function get_errorMessage()',cmt:'

Returns the error message of the latest error with the PWM. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a string corresponding to the latest error message that occured while using the PWM object'}; doc['PwmOutput']['get_errorType']={syn:'Returns the numerical error code of the latest error with the PWM.',lib:'pwmoutput.get_errorType()',pro:'function get_errorType()',cmt:'

Returns the numerical error code of the latest error with the PWM. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a number corresponding to the code of the latest error that occurred while using the PWM object'}; doc['PwmOutput']['get_frequency']={syn:'Returns the PWM frequency in Hz.',lib:'pwmoutput.get_frequency()',pro:'function get_frequency()',cmt:'

Returns the PWM frequency in Hz.

',ret:'a floating point number corresponding to the PWM frequency in Hz',ext:'On failure, throws an exception or returns `Y_FREQUENCY_INVALID`.'}; doc['PwmOutput']['get_friendlyName']={syn:'Returns a global identifier of the PWM in the format `MODULE_NAME.FUNCTION_NAME`.',lib:'pwmoutput.get_friendlyName()',pro:'function get_friendlyName()',cmt:'

Returns a global identifier of the PWM in the format `MODULE_NAME.FUNCTION_NAME`. The returned string uses the logical names of the module and of the PWM if they are defined, otherwise the serial number of the module and the hardware identifier of the PWM (for example: `MyCustomName.relay1`)

',ret:'a string that uniquely identifies the PWM using logical names (ex: `MyCustomName.relay1`)',ext:'On failure, throws an exception or returns `Y_FRIENDLYNAME_INVALID`.'}; doc['PwmOutput']['get_functionDescriptor']={syn:'Returns a unique identifier of type `YFUN_DESCR` corresponding to the function.',lib:'pwmoutput.get_functionDescriptor()',pro:'function get_functionDescriptor()',cmt:'

Returns a unique identifier of type `YFUN_DESCR` corresponding to the function. This identifier can be used to test if two instances of `YFunction` reference the same physical function on the same physical device.

',ret:'an identifier of type `YFUN_DESCR`.',ext:'If the function has never been contacted, the returned value is `Y_FUNCTIONDESCRIPTOR_INVALID`.'}; doc['PwmOutput']['get_functionId']={syn:'Returns the hardware identifier of the PWM, without reference to the module.',lib:'pwmoutput.get_functionId()',pro:'function get_functionId()',cmt:'

Returns the hardware identifier of the PWM, without reference to the module. For example `relay1`

',ret:'a string that identifies the PWM (ex: `relay1`)',ext:'On failure, throws an exception or returns `Y_FUNCTIONID_INVALID`.'}; doc['PwmOutput']['get_hardwareId']={syn:'Returns the unique hardware identifier of the PWM in the form `SERIAL.FUNCTIONID`.',lib:'pwmoutput.get_hardwareId()',pro:'function get_hardwareId()',cmt:'

Returns the unique hardware identifier of the PWM in the form `SERIAL.FUNCTIONID`. The unique hardware identifier is composed of the device serial number and of the hardware identifier of the PWM (for example `RELAYLO1-123456.relay1`).

',ret:'a string that uniquely identifies the PWM (ex: `RELAYLO1-123456.relay1`)',ext:'On failure, throws an exception or returns `Y_HARDWAREID_INVALID`.'}; doc['PwmOutput']['get_logicalName']={syn:'Returns the logical name of the PWM.',lib:'pwmoutput.get_logicalName()',pro:'function get_logicalName()',cmt:'

Returns the logical name of the PWM.

',ret:'a string corresponding to the logical name of the PWM.',ext:'On failure, throws an exception or returns `Y_LOGICALNAME_INVALID`.'}; doc['PwmOutput']['get_module']={syn:'Gets the `YModule` object for the device on which the function is located.',lib:'pwmoutput.get_module()',pro:'function get_module()',cmt:'

Gets the `YModule` object for the device on which the function is located. If the function cannot be located on any module, the returned instance of `YModule` is not shown as on-line.

',ret:'an instance of `YModule`'}; doc['PwmOutput']['get_module_async']={syn:'Gets the `YModule` object for the device on which the function is located (asynchronous version).',lib:'pwmoutput.get_module_async()',pro:'function get_module_async(callback, context)',cmt:'

Gets the `YModule` object for the device on which the function is located (asynchronous version). If the function cannot be located on any module, the returned `YModule` object does not show as on-line.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking Firefox javascript VM that does not implement context switching during blocking I/O calls. See the documentation section on asynchronous Javascript calls for more details.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the requested `YModule` object',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['PwmOutput']['get_period']={syn:'Returns the PWM period in milliseconds.',lib:'pwmoutput.get_period()',pro:'function get_period()',cmt:'

Returns the PWM period in milliseconds.

',ret:'a floating point number corresponding to the PWM period in milliseconds',ext:'On failure, throws an exception or returns `Y_PERIOD_INVALID`.'}; doc['PwmOutput']['get_pulseDuration']={syn:'Returns the PWM pulse length in milliseconds, as a floating point number.',lib:'pwmoutput.get_pulseDuration()',pro:'function get_pulseDuration()',cmt:'

Returns the PWM pulse length in milliseconds, as a floating point number.

',ret:'a floating point number corresponding to the PWM pulse length in milliseconds, as a floating point number',ext:'On failure, throws an exception or returns `Y_PULSEDURATION_INVALID`.'}; doc['PwmOutput']['get_userData']={syn:'Returns the value of the userData attribute, as previously stored using method `set_userData`.',lib:'pwmoutput.get_userData()',pro:'function get_userData()',cmt:'

Returns the value of the userData attribute, as previously stored using method `set_userData`. This attribute is never touched directly by the API, and is at disposal of the caller to store a context.

',ret:'the object stored previously by the caller.'}; doc['PwmOutput']['isOnline']={syn:'Checks if the PWM is currently reachable, without raising any error.',lib:'pwmoutput.isOnline()',pro:'function isOnline()',cmt:'

Checks if the PWM is currently reachable, without raising any error. If there is a cached value for the PWM in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the PWM.

',ret:'`true` if the PWM can be reached, and `false` otherwise'}; doc['PwmOutput']['isOnline_async']={syn:'Checks if the PWM is currently reachable, without raising any error (asynchronous version).',lib:'pwmoutput.isOnline_async()',pro:'function isOnline_async(callback, context)',cmt:'

Checks if the PWM is currently reachable, without raising any error (asynchronous version). If there is a cached value for the PWM in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the requested function.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the boolean result',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['PwmOutput']['load']={syn:'Preloads the PWM cache with a specified validity duration.',lib:'pwmoutput.load()',pro:'function load(msValidity)',cmt:'

Preloads the PWM cache with a specified validity duration. By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network traffic for instance.

',par:{msValidity:'an integer corresponding to the validity attributed to the loaded function parameters, in milliseconds'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['PwmOutput']['loadAttribute']={syn:'Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.',lib:'pwmoutput.loadAttribute()',pro:'function loadAttribute(attrName)',cmt:'

Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.

',par:{attrName:'the name of the requested attribute'},ret:'a string with the value of the the attribute',ext:'On failure, throws an exception or returns an empty string.'}; doc['PwmOutput']['load_async']={syn:'Preloads the PWM cache with a specified validity duration (asynchronous version).',lib:'pwmoutput.load_async()',pro:'function load_async(msValidity, callback, context)',cmt:'

Preloads the PWM cache with a specified validity duration (asynchronous version). By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network trafic for instance.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{msValidity:'an integer corresponding to the validity of the loaded function parameters, in milliseconds',callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the error code (or `YAPI_SUCCESS`)',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['PwmOutput']['muteValueCallbacks']={syn:'Disables the propagation of every new advertised value to the parent hub.',lib:'pwmoutput.muteValueCallbacks()',pro:'function muteValueCallbacks()',cmt:'

Disables the propagation of every new advertised value to the parent hub. You can use this function to save bandwidth and CPU on computers with limited resources, or to prevent unwanted invocations of the HTTP callback. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['PwmOutput']['nextPwmOutput']={syn:'Continues the enumeration of PWMs started using `yFirstPwmOutput()`.',lib:'pwmoutput.nextPwmOutput()',pro:'function nextPwmOutput()',cmt:'

Continues the enumeration of PWMs started using `yFirstPwmOutput()`.

',ret:'a pointer to a `YPwmOutput` object, corresponding to a PWM currently online, or a `null` pointer if there are no more PWMs to enumerate.'}; doc['PwmOutput']['pulseDurationMove']={syn:'Performs a smooth transistion of the pulse duration toward a given value.',lib:'pwmoutput.pulseDurationMove()',pro:'function pulseDurationMove(ms_target, ms_duration)',cmt:'

Performs a smooth transistion of the pulse duration toward a given value. Any period, frequency, duty cycle or pulse width change will cancel any ongoing transition process.

',par:{ms_target:'new pulse duration at the end of the transition (floating-point number, representing the pulse duration in milliseconds)',ms_duration:'total duration of the transition, in milliseconds'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['PwmOutput']['registerValueCallback']={syn:'Registers the callback function that is invoked on every change of advertised value.',lib:'pwmoutput.registerValueCallback()',pro:'function registerValueCallback(callback)',cmt:'

Registers the callback function that is invoked on every change of advertised value. The callback is invoked only during the execution of `ySleep` or `yHandleEvents`. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a null pointer as argument.

',par:{callback:'the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and the character string describing the new advertised value.'}}; doc['PwmOutput']['set_dutyCycle']={syn:'Changes the PWM duty cycle, in per cents.',lib:'pwmoutput.set_dutyCycle()',pro:'function set_dutyCycle(newval)',cmt:'

Changes the PWM duty cycle, in per cents.

',par:{newval:'a floating point number corresponding to the PWM duty cycle, in per cents'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['PwmOutput']['set_dutyCycleAtPowerOn']={syn:'Changes the PWM duty cycle at device power on.',lib:'pwmoutput.set_dutyCycleAtPowerOn()',pro:'function set_dutyCycleAtPowerOn(newval)',cmt:'

Changes the PWM duty cycle at device power on. Remember to call the matching module `saveToFlash()` method, otherwise this call will have no effect.

',par:{newval:'a floating point number corresponding to the PWM duty cycle at device power on'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['PwmOutput']['set_enabled']={syn:'Stops or starts the PWM.',lib:'pwmoutput.set_enabled()',pro:'function set_enabled(newval)',cmt:'

Stops or starts the PWM.

',par:{newval:'either `Y_ENABLED_FALSE` or `Y_ENABLED_TRUE`'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['PwmOutput']['set_enabledAtPowerOn']={syn:'Changes the state of the PWM at device power on.',lib:'pwmoutput.set_enabledAtPowerOn()',pro:'function set_enabledAtPowerOn(newval)',cmt:'

Changes the state of the PWM at device power on. Remember to call the matching module `saveToFlash()` method, otherwise this call will have no effect.

',par:{newval:'either `Y_ENABLEDATPOWERON_FALSE` or `Y_ENABLEDATPOWERON_TRUE`, according to the state of the PWM at device power on'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['PwmOutput']['set_frequency']={syn:'Changes the PWM frequency.',lib:'pwmoutput.set_frequency()',pro:'function set_frequency(newval)',cmt:'

Changes the PWM frequency. The duty cycle is kept unchanged thanks to an automatic pulse width change.

',par:{newval:'a floating point number corresponding to the PWM frequency'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['PwmOutput']['set_logicalName']={syn:'Changes the logical name of the PWM.',lib:'pwmoutput.set_logicalName()',pro:'function set_logicalName(newval)',cmt:'

Changes the logical name of the PWM. You can use `yCheckLogicalName()` prior to this call to make sure that your parameter is valid. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',par:{newval:'a string corresponding to the logical name of the PWM.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['PwmOutput']['set_period']={syn:'Changes the PWM period in milliseconds.',lib:'pwmoutput.set_period()',pro:'function set_period(newval)',cmt:'

Changes the PWM period in milliseconds.

',par:{newval:'a floating point number corresponding to the PWM period in milliseconds'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['PwmOutput']['set_pulseDuration']={syn:'Changes the PWM pulse length, in milliseconds.',lib:'pwmoutput.set_pulseDuration()',pro:'function set_pulseDuration(newval)',cmt:'

Changes the PWM pulse length, in milliseconds. A pulse length cannot be longer than period, otherwise it is truncated.

',par:{newval:'a floating point number corresponding to the PWM pulse length, in milliseconds'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['PwmOutput']['set_userData']={syn:'Stores a user context provided as argument in the userData attribute of the function.',lib:'pwmoutput.set_userData()',pro:'function set_userData(data)',cmt:'

Stores a user context provided as argument in the userData attribute of the function. This attribute is never touched by the API, and is at disposal of the caller to store a context.

',par:{data:'any kind of object to be stored'}}; doc['PwmOutput']['unmuteValueCallbacks']={syn:'Re-enables the propagation of every new advertised value to the parent hub.',lib:'pwmoutput.unmuteValueCallbacks()',pro:'function unmuteValueCallbacks()',cmt:'

Re-enables the propagation of every new advertised value to the parent hub. This function reverts the effect of a previous call to `muteValueCallbacks()`. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['PwmOutput']['wait_async']={syn:'Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function.',lib:'pwmoutput.wait_async()',pro:'function wait_async(callback, context)',cmt:'

Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function. The callback function can therefore freely issue synchronous or asynchronous commands, without risking to block the Javascript VM.

',par:{callback:'callback function that is invoked when all pending commands on the module are completed. The callback function receives two arguments: the caller-specific context object and the receiving function object.',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing.'}; //--- (end of generated code: PwmOutput) //--- (generated code: PwmPowerSource) doc['PwmPowerSource']={'':{syn:'PwmPowerSource function interface',inc:'<script type='text/javascript' src='yocto_pwmpowersource.js'></script>',cmt:'

The Yoctopuce application programming interface allows you to configure the voltage source used by all PWM on the same device.

'}}; doc['PwmPowerSource']['FindPwmPowerSource']={syn:'Retrieves a voltage source for a given identifier.',lib:'YPwmPowerSource.FindPwmPowerSource()',pro:'function FindPwmPowerSource(func)',cmt:'

Retrieves a voltage source for a given identifier. The identifier can be specified using several formats:

- FunctionLogicalName
- ModuleSerialNumber.FunctionIdentifier
- ModuleSerialNumber.FunctionLogicalName
- ModuleLogicalName.FunctionIdentifier
- ModuleLogicalName.FunctionLogicalName

This function does not require that the voltage source is online at the time it is invoked. The returned object is nevertheless valid. Use the method `YPwmPowerSource.isOnline()` to test if the voltage source is indeed online at a given time. In case of ambiguity when looking for a voltage source by logical name, no error is notified: the first instance found is returned. The search is performed first by hardware name, then by logical name.

If a call to this object\x27s is_online() method returns FALSE although you are certain that the matching device is plugged, make sure that you did call registerHub() at application initialization time.

',par:{func:'a string that uniquely characterizes the voltage source'},ret:'a `YPwmPowerSource` object allowing you to drive the voltage source.'}; doc['PwmPowerSource']['FirstPwmPowerSource']={syn:'Starts the enumeration of Voltage sources currently accessible.',lib:'YPwmPowerSource.FirstPwmPowerSource()',pro:'function FirstPwmPowerSource()',cmt:'

Starts the enumeration of Voltage sources currently accessible. Use the method `YPwmPowerSource.nextPwmPowerSource()` to iterate on next Voltage sources.

',ret:'a pointer to a `YPwmPowerSource` object, corresponding to the first source currently online, or a `null` pointer if there are none.'}; doc['PwmPowerSource']['clearCache']={syn:'Invalidates the cache.',lib:'pwmpowersource.clearCache()',pro:'function clearCache()',cmt:'

Invalidates the cache. Invalidates the cache of the voltage source attributes. Forces the next call to get_xxx() or loadxxx() to use values that come from the device.

'}; doc['PwmPowerSource']['describe']={syn:'Returns a short text that describes unambiguously the instance of the voltage source in the form `TYPE(NAME)=SERIAL.FUNCTIONID`.',lib:'pwmpowersource.describe()',pro:'function describe()',cmt:'

Returns a short text that describes unambiguously the instance of the voltage source in the form `TYPE(NAME)=SERIAL.FUNCTIONID`. More precisely, `TYPE` is the type of the function, `NAME` it the name used for the first access to the function, `SERIAL` is the serial number of the module if the module is connected or `\x22unresolved\x22`, and `FUNCTIONID` is the hardware identifier of the function if the module is connected. For example, this method returns `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1` if the module is already connected or `Relay(BadCustomeName.relay1)=unresolved` if the module has not yet been connected. This method does not trigger any USB or TCP transaction and can therefore be used in a debugger.

',ret:'a string that describes the voltage source (ex: `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1`)'}; doc['PwmPowerSource']['get_advertisedValue']={syn:'Returns the current value of the voltage source (no more than 6 characters).',lib:'pwmpowersource.get_advertisedValue()',pro:'function get_advertisedValue()',cmt:'

Returns the current value of the voltage source (no more than 6 characters).

',ret:'a string corresponding to the current value of the voltage source (no more than 6 characters).',ext:'On failure, throws an exception or returns `Y_ADVERTISEDVALUE_INVALID`.'}; doc['PwmPowerSource']['get_errorMessage']={syn:'Returns the error message of the latest error with the voltage source.',lib:'pwmpowersource.get_errorMessage()',pro:'function get_errorMessage()',cmt:'

Returns the error message of the latest error with the voltage source. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a string corresponding to the latest error message that occured while using the voltage source object'}; doc['PwmPowerSource']['get_errorType']={syn:'Returns the numerical error code of the latest error with the voltage source.',lib:'pwmpowersource.get_errorType()',pro:'function get_errorType()',cmt:'

Returns the numerical error code of the latest error with the voltage source. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a number corresponding to the code of the latest error that occurred while using the voltage source object'}; doc['PwmPowerSource']['get_friendlyName']={syn:'Returns a global identifier of the voltage source in the format `MODULE_NAME.FUNCTION_NAME`.',lib:'pwmpowersource.get_friendlyName()',pro:'function get_friendlyName()',cmt:'

Returns a global identifier of the voltage source in the format `MODULE_NAME.FUNCTION_NAME`. The returned string uses the logical names of the module and of the voltage source if they are defined, otherwise the serial number of the module and the hardware identifier of the voltage source (for example: `MyCustomName.relay1`)

',ret:'a string that uniquely identifies the voltage source using logical names (ex: `MyCustomName.relay1`)',ext:'On failure, throws an exception or returns `Y_FRIENDLYNAME_INVALID`.'}; doc['PwmPowerSource']['get_functionDescriptor']={syn:'Returns a unique identifier of type `YFUN_DESCR` corresponding to the function.',lib:'pwmpowersource.get_functionDescriptor()',pro:'function get_functionDescriptor()',cmt:'

Returns a unique identifier of type `YFUN_DESCR` corresponding to the function. This identifier can be used to test if two instances of `YFunction` reference the same physical function on the same physical device.

',ret:'an identifier of type `YFUN_DESCR`.',ext:'If the function has never been contacted, the returned value is `Y_FUNCTIONDESCRIPTOR_INVALID`.'}; doc['PwmPowerSource']['get_functionId']={syn:'Returns the hardware identifier of the voltage source, without reference to the module.',lib:'pwmpowersource.get_functionId()',pro:'function get_functionId()',cmt:'

Returns the hardware identifier of the voltage source, without reference to the module. For example `relay1`

',ret:'a string that identifies the voltage source (ex: `relay1`)',ext:'On failure, throws an exception or returns `Y_FUNCTIONID_INVALID`.'}; doc['PwmPowerSource']['get_hardwareId']={syn:'Returns the unique hardware identifier of the voltage source in the form `SERIAL.FUNCTIONID`.',lib:'pwmpowersource.get_hardwareId()',pro:'function get_hardwareId()',cmt:'

Returns the unique hardware identifier of the voltage source in the form `SERIAL.FUNCTIONID`. The unique hardware identifier is composed of the device serial number and of the hardware identifier of the voltage source (for example `RELAYLO1-123456.relay1`).

',ret:'a string that uniquely identifies the voltage source (ex: `RELAYLO1-123456.relay1`)',ext:'On failure, throws an exception or returns `Y_HARDWAREID_INVALID`.'}; doc['PwmPowerSource']['get_logicalName']={syn:'Returns the logical name of the voltage source.',lib:'pwmpowersource.get_logicalName()',pro:'function get_logicalName()',cmt:'

Returns the logical name of the voltage source.

',ret:'a string corresponding to the logical name of the voltage source.',ext:'On failure, throws an exception or returns `Y_LOGICALNAME_INVALID`.'}; doc['PwmPowerSource']['get_module']={syn:'Gets the `YModule` object for the device on which the function is located.',lib:'pwmpowersource.get_module()',pro:'function get_module()',cmt:'

Gets the `YModule` object for the device on which the function is located. If the function cannot be located on any module, the returned instance of `YModule` is not shown as on-line.

',ret:'an instance of `YModule`'}; doc['PwmPowerSource']['get_module_async']={syn:'Gets the `YModule` object for the device on which the function is located (asynchronous version).',lib:'pwmpowersource.get_module_async()',pro:'function get_module_async(callback, context)',cmt:'

Gets the `YModule` object for the device on which the function is located (asynchronous version). If the function cannot be located on any module, the returned `YModule` object does not show as on-line.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking Firefox javascript VM that does not implement context switching during blocking I/O calls. See the documentation section on asynchronous Javascript calls for more details.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the requested `YModule` object',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['PwmPowerSource']['get_powerMode']={syn:'Returns the selected power source for the PWM on the same device.',lib:'pwmpowersource.get_powerMode()',pro:'function get_powerMode()',cmt:'

Returns the selected power source for the PWM on the same device.

',ret:'a value among `Y_POWERMODE_USB_5V`, `Y_POWERMODE_USB_3V`, `Y_POWERMODE_EXT_V` and `Y_POWERMODE_OPNDRN` corresponding to the selected power source for the PWM on the same device',ext:'On failure, throws an exception or returns `Y_POWERMODE_INVALID`.'}; doc['PwmPowerSource']['get_userData']={syn:'Returns the value of the userData attribute, as previously stored using method `set_userData`.',lib:'pwmpowersource.get_userData()',pro:'function get_userData()',cmt:'

Returns the value of the userData attribute, as previously stored using method `set_userData`. This attribute is never touched directly by the API, and is at disposal of the caller to store a context.

',ret:'the object stored previously by the caller.'}; doc['PwmPowerSource']['isOnline']={syn:'Checks if the voltage source is currently reachable, without raising any error.',lib:'pwmpowersource.isOnline()',pro:'function isOnline()',cmt:'

Checks if the voltage source is currently reachable, without raising any error. If there is a cached value for the voltage source in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the voltage source.

',ret:'`true` if the voltage source can be reached, and `false` otherwise'}; doc['PwmPowerSource']['isOnline_async']={syn:'Checks if the voltage source is currently reachable, without raising any error (asynchronous version).',lib:'pwmpowersource.isOnline_async()',pro:'function isOnline_async(callback, context)',cmt:'

Checks if the voltage source is currently reachable, without raising any error (asynchronous version). If there is a cached value for the voltage source in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the requested function.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the boolean result',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['PwmPowerSource']['load']={syn:'Preloads the voltage source cache with a specified validity duration.',lib:'pwmpowersource.load()',pro:'function load(msValidity)',cmt:'

Preloads the voltage source cache with a specified validity duration. By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network traffic for instance.

',par:{msValidity:'an integer corresponding to the validity attributed to the loaded function parameters, in milliseconds'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['PwmPowerSource']['loadAttribute']={syn:'Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.',lib:'pwmpowersource.loadAttribute()',pro:'function loadAttribute(attrName)',cmt:'

Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.

',par:{attrName:'the name of the requested attribute'},ret:'a string with the value of the the attribute',ext:'On failure, throws an exception or returns an empty string.'}; doc['PwmPowerSource']['load_async']={syn:'Preloads the voltage source cache with a specified validity duration (asynchronous version).',lib:'pwmpowersource.load_async()',pro:'function load_async(msValidity, callback, context)',cmt:'

Preloads the voltage source cache with a specified validity duration (asynchronous version). By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network trafic for instance.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{msValidity:'an integer corresponding to the validity of the loaded function parameters, in milliseconds',callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the error code (or `YAPI_SUCCESS`)',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['PwmPowerSource']['muteValueCallbacks']={syn:'Disables the propagation of every new advertised value to the parent hub.',lib:'pwmpowersource.muteValueCallbacks()',pro:'function muteValueCallbacks()',cmt:'

Disables the propagation of every new advertised value to the parent hub. You can use this function to save bandwidth and CPU on computers with limited resources, or to prevent unwanted invocations of the HTTP callback. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['PwmPowerSource']['nextPwmPowerSource']={syn:'Continues the enumeration of Voltage sources started using `yFirstPwmPowerSource()`.',lib:'pwmpowersource.nextPwmPowerSource()',pro:'function nextPwmPowerSource()',cmt:'

Continues the enumeration of Voltage sources started using `yFirstPwmPowerSource()`.

',ret:'a pointer to a `YPwmPowerSource` object, corresponding to a voltage source currently online, or a `null` pointer if there are no more Voltage sources to enumerate.'}; doc['PwmPowerSource']['registerValueCallback']={syn:'Registers the callback function that is invoked on every change of advertised value.',lib:'pwmpowersource.registerValueCallback()',pro:'function registerValueCallback(callback)',cmt:'

Registers the callback function that is invoked on every change of advertised value. The callback is invoked only during the execution of `ySleep` or `yHandleEvents`. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a null pointer as argument.

',par:{callback:'the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and the character string describing the new advertised value.'}}; doc['PwmPowerSource']['set_logicalName']={syn:'Changes the logical name of the voltage source.',lib:'pwmpowersource.set_logicalName()',pro:'function set_logicalName(newval)',cmt:'

Changes the logical name of the voltage source. You can use `yCheckLogicalName()` prior to this call to make sure that your parameter is valid. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',par:{newval:'a string corresponding to the logical name of the voltage source.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['PwmPowerSource']['set_powerMode']={syn:'Changes the PWM power source.',lib:'pwmpowersource.set_powerMode()',pro:'function set_powerMode(newval)',cmt:'

Changes the PWM power source. PWM can use isolated 5V from USB, isolated 3V from USB or voltage from an external power source. The PWM can also work in open drain mode. In that mode, the PWM actively pulls the line down. Warning: this setting is common to all PWM on the same device. If you change that parameter, all PWM located on the same device are affected. If you want the change to be kept after a device reboot, make sure to call the matching module `saveToFlash()`.

',par:{newval:'a value among `Y_POWERMODE_USB_5V`, `Y_POWERMODE_USB_3V`, `Y_POWERMODE_EXT_V` and `Y_POWERMODE_OPNDRN` corresponding to the PWM power source'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['PwmPowerSource']['set_userData']={syn:'Stores a user context provided as argument in the userData attribute of the function.',lib:'pwmpowersource.set_userData()',pro:'function set_userData(data)',cmt:'

Stores a user context provided as argument in the userData attribute of the function. This attribute is never touched by the API, and is at disposal of the caller to store a context.

',par:{data:'any kind of object to be stored'}}; doc['PwmPowerSource']['unmuteValueCallbacks']={syn:'Re-enables the propagation of every new advertised value to the parent hub.',lib:'pwmpowersource.unmuteValueCallbacks()',pro:'function unmuteValueCallbacks()',cmt:'

Re-enables the propagation of every new advertised value to the parent hub. This function reverts the effect of a previous call to `muteValueCallbacks()`. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['PwmPowerSource']['wait_async']={syn:'Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function.',lib:'pwmpowersource.wait_async()',pro:'function wait_async(callback, context)',cmt:'

Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function. The callback function can therefore freely issue synchronous or asynchronous commands, without risking to block the Javascript VM.

',par:{callback:'callback function that is invoked when all pending commands on the module are completed. The callback function receives two arguments: the caller-specific context object and the receiving function object.',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing.'}; //--- (end of generated code: PwmPowerSource) //--- (generated code: Altitude) doc['Altitude']={'':{syn:'Altitude function interface',inc:'<script type='text/javascript' src='yocto_altitude.js'></script>',cmt:'

The Yoctopuce class YAltitude allows you to read and configure Yoctopuce altitude sensors. It inherits from the YSensor class the core functions to read measurements, to register callback functions, to access the autonomous datalogger. This class adds the ability to configure the barometric pressure adjusted to sea level (QNH) for barometric sensors.

'}}; doc['Altitude']['FindAltitude']={syn:'Retrieves an altimeter for a given identifier.',lib:'YAltitude.FindAltitude()',pro:'function FindAltitude(func)',cmt:'

Retrieves an altimeter for a given identifier. The identifier can be specified using several formats:

- FunctionLogicalName
- ModuleSerialNumber.FunctionIdentifier
- ModuleSerialNumber.FunctionLogicalName
- ModuleLogicalName.FunctionIdentifier
- ModuleLogicalName.FunctionLogicalName

This function does not require that the altimeter is online at the time it is invoked. The returned object is nevertheless valid. Use the method `YAltitude.isOnline()` to test if the altimeter is indeed online at a given time. In case of ambiguity when looking for an altimeter by logical name, no error is notified: the first instance found is returned. The search is performed first by hardware name, then by logical name.

If a call to this object\x27s is_online() method returns FALSE although you are certain that the matching device is plugged, make sure that you did call registerHub() at application initialization time.

',par:{func:'a string that uniquely characterizes the altimeter'},ret:'a `YAltitude` object allowing you to drive the altimeter.'}; doc['Altitude']['FirstAltitude']={syn:'Starts the enumeration of altimeters currently accessible.',lib:'YAltitude.FirstAltitude()',pro:'function FirstAltitude()',cmt:'

Starts the enumeration of altimeters currently accessible. Use the method `YAltitude.nextAltitude()` to iterate on next altimeters.

',ret:'a pointer to a `YAltitude` object, corresponding to the first altimeter currently online, or a `null` pointer if there are none.'}; doc['Altitude']['calibrateFromPoints']={syn:'Configures error correction data points, in particular to compensate for a possible perturbation of the measure caused by an enclosure.',lib:'altitude.calibrateFromPoints()',pro:'function calibrateFromPoints(rawValues, refValues)',cmt:'

Configures error correction data points, in particular to compensate for a possible perturbation of the measure caused by an enclosure. It is possible to configure up to five correction points. Correction points must be provided in ascending order, and be in the range of the sensor. The device will automatically perform a linear interpolation of the error correction between specified points. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

For more information on advanced capabilities to refine the calibration of sensors, please contact support@yoctopuce.com.

',par:{rawValues:'array of floating point numbers, corresponding to the raw values returned by the sensor for the correction points.',refValues:'array of floating point numbers, corresponding to the corrected values for the correction points.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Altitude']['clearCache']={syn:'Invalidates the cache.',lib:'altitude.clearCache()',pro:'function clearCache()',cmt:'

Invalidates the cache. Invalidates the cache of the altimeter attributes. Forces the next call to get_xxx() or loadxxx() to use values that come from the device.

'}; doc['Altitude']['describe']={syn:'Returns a short text that describes unambiguously the instance of the altimeter in the form `TYPE(NAME)=SERIAL.FUNCTIONID`.',lib:'altitude.describe()',pro:'function describe()',cmt:'

Returns a short text that describes unambiguously the instance of the altimeter in the form `TYPE(NAME)=SERIAL.FUNCTIONID`. More precisely, `TYPE` is the type of the function, `NAME` it the name used for the first access to the function, `SERIAL` is the serial number of the module if the module is connected or `\x22unresolved\x22`, and `FUNCTIONID` is the hardware identifier of the function if the module is connected. For example, this method returns `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1` if the module is already connected or `Relay(BadCustomeName.relay1)=unresolved` if the module has not yet been connected. This method does not trigger any USB or TCP transaction and can therefore be used in a debugger.

',ret:'a string that describes the altimeter (ex: `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1`)'}; doc['Altitude']['get_advMode']={syn:'Returns the measuring mode used for the advertised value pushed to the parent hub.',lib:'altitude.get_advMode()',pro:'function get_advMode()',cmt:'

Returns the measuring mode used for the advertised value pushed to the parent hub.

',ret:'a value among `Y_ADVMODE_IMMEDIATE`, `Y_ADVMODE_PERIOD_AVG`, `Y_ADVMODE_PERIOD_MIN` and `Y_ADVMODE_PERIOD_MAX` corresponding to the measuring mode used for the advertised value pushed to the parent hub',ext:'On failure, throws an exception or returns `Y_ADVMODE_INVALID`.'}; doc['Altitude']['get_advertisedValue']={syn:'Returns the current value of the altimeter (no more than 6 characters).',lib:'altitude.get_advertisedValue()',pro:'function get_advertisedValue()',cmt:'

Returns the current value of the altimeter (no more than 6 characters).

',ret:'a string corresponding to the current value of the altimeter (no more than 6 characters).',ext:'On failure, throws an exception or returns `Y_ADVERTISEDVALUE_INVALID`.'}; doc['Altitude']['get_currentRawValue']={syn:'Returns the uncalibrated, unrounded raw value returned by the sensor, in meters, as a floating point number.',lib:'altitude.get_currentRawValue()',pro:'function get_currentRawValue()',cmt:'

Returns the uncalibrated, unrounded raw value returned by the sensor, in meters, as a floating point number.

',ret:'a floating point number corresponding to the uncalibrated, unrounded raw value returned by the sensor, in meters, as a floating point number',ext:'On failure, throws an exception or returns `Y_CURRENTRAWVALUE_INVALID`.'}; doc['Altitude']['get_currentValue']={syn:'Returns the current value of the altitude, in meters, as a floating point number.',lib:'altitude.get_currentValue()',pro:'function get_currentValue()',cmt:'

Returns the current value of the altitude, in meters, as a floating point number.

',ret:'a floating point number corresponding to the current value of the altitude, in meters, as a floating point number',ext:'On failure, throws an exception or returns `Y_CURRENTVALUE_INVALID`.'}; doc['Altitude']['get_dataLogger']={syn:'Returns the YDatalogger object of the device hosting the sensor.',lib:'altitude.get_dataLogger()',pro:'function get_dataLogger()',cmt:'

Returns the YDatalogger object of the device hosting the sensor. This method returns an object of class YDatalogger that can control global parameters of the data logger. The returned object should not be freed.

',ret:'an YDataLogger object or null on error.'}; doc['Altitude']['get_errorMessage']={syn:'Returns the error message of the latest error with the altimeter.',lib:'altitude.get_errorMessage()',pro:'function get_errorMessage()',cmt:'

Returns the error message of the latest error with the altimeter. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a string corresponding to the latest error message that occured while using the altimeter object'}; doc['Altitude']['get_errorType']={syn:'Returns the numerical error code of the latest error with the altimeter.',lib:'altitude.get_errorType()',pro:'function get_errorType()',cmt:'

Returns the numerical error code of the latest error with the altimeter. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a number corresponding to the code of the latest error that occurred while using the altimeter object'}; doc['Altitude']['get_friendlyName']={syn:'Returns a global identifier of the altimeter in the format `MODULE_NAME.FUNCTION_NAME`.',lib:'altitude.get_friendlyName()',pro:'function get_friendlyName()',cmt:'

Returns a global identifier of the altimeter in the format `MODULE_NAME.FUNCTION_NAME`. The returned string uses the logical names of the module and of the altimeter if they are defined, otherwise the serial number of the module and the hardware identifier of the altimeter (for example: `MyCustomName.relay1`)

',ret:'a string that uniquely identifies the altimeter using logical names (ex: `MyCustomName.relay1`)',ext:'On failure, throws an exception or returns `Y_FRIENDLYNAME_INVALID`.'}; doc['Altitude']['get_functionDescriptor']={syn:'Returns a unique identifier of type `YFUN_DESCR` corresponding to the function.',lib:'altitude.get_functionDescriptor()',pro:'function get_functionDescriptor()',cmt:'

Returns a unique identifier of type `YFUN_DESCR` corresponding to the function. This identifier can be used to test if two instances of `YFunction` reference the same physical function on the same physical device.

',ret:'an identifier of type `YFUN_DESCR`.',ext:'If the function has never been contacted, the returned value is `Y_FUNCTIONDESCRIPTOR_INVALID`.'}; doc['Altitude']['get_functionId']={syn:'Returns the hardware identifier of the altimeter, without reference to the module.',lib:'altitude.get_functionId()',pro:'function get_functionId()',cmt:'

Returns the hardware identifier of the altimeter, without reference to the module. For example `relay1`

',ret:'a string that identifies the altimeter (ex: `relay1`)',ext:'On failure, throws an exception or returns `Y_FUNCTIONID_INVALID`.'}; doc['Altitude']['get_hardwareId']={syn:'Returns the unique hardware identifier of the altimeter in the form `SERIAL.FUNCTIONID`.',lib:'altitude.get_hardwareId()',pro:'function get_hardwareId()',cmt:'

Returns the unique hardware identifier of the altimeter in the form `SERIAL.FUNCTIONID`. The unique hardware identifier is composed of the device serial number and of the hardware identifier of the altimeter (for example `RELAYLO1-123456.relay1`).

',ret:'a string that uniquely identifies the altimeter (ex: `RELAYLO1-123456.relay1`)',ext:'On failure, throws an exception or returns `Y_HARDWAREID_INVALID`.'}; doc['Altitude']['get_highestValue']={syn:'Returns the maximal value observed for the altitude since the device was started.',lib:'altitude.get_highestValue()',pro:'function get_highestValue()',cmt:'

Returns the maximal value observed for the altitude since the device was started. Can be reset to an arbitrary value thanks to set_highestValue().

',ret:'a floating point number corresponding to the maximal value observed for the altitude since the device was started',ext:'On failure, throws an exception or returns `Y_HIGHESTVALUE_INVALID`.'}; doc['Altitude']['get_logFrequency']={syn:'Returns the datalogger recording frequency for this function, or \x22OFF\x22 when measures are not stored in the data logger flash memory.',lib:'altitude.get_logFrequency()',pro:'function get_logFrequency()',cmt:'

Returns the datalogger recording frequency for this function, or \x22OFF\x22 when measures are not stored in the data logger flash memory.

',ret:'a string corresponding to the datalogger recording frequency for this function, or \x22OFF\x22 when measures are not stored in the data logger flash memory',ext:'On failure, throws an exception or returns `Y_LOGFREQUENCY_INVALID`.'}; doc['Altitude']['get_logicalName']={syn:'Returns the logical name of the altimeter.',lib:'altitude.get_logicalName()',pro:'function get_logicalName()',cmt:'

Returns the logical name of the altimeter.

',ret:'a string corresponding to the logical name of the altimeter.',ext:'On failure, throws an exception or returns `Y_LOGICALNAME_INVALID`.'}; doc['Altitude']['get_lowestValue']={syn:'Returns the minimal value observed for the altitude since the device was started.',lib:'altitude.get_lowestValue()',pro:'function get_lowestValue()',cmt:'

Returns the minimal value observed for the altitude since the device was started. Can be reset to an arbitrary value thanks to set_lowestValue().

',ret:'a floating point number corresponding to the minimal value observed for the altitude since the device was started',ext:'On failure, throws an exception or returns `Y_LOWESTVALUE_INVALID`.'}; doc['Altitude']['get_module']={syn:'Gets the `YModule` object for the device on which the function is located.',lib:'altitude.get_module()',pro:'function get_module()',cmt:'

Gets the `YModule` object for the device on which the function is located. If the function cannot be located on any module, the returned instance of `YModule` is not shown as on-line.

',ret:'an instance of `YModule`'}; doc['Altitude']['get_module_async']={syn:'Gets the `YModule` object for the device on which the function is located (asynchronous version).',lib:'altitude.get_module_async()',pro:'function get_module_async(callback, context)',cmt:'

Gets the `YModule` object for the device on which the function is located (asynchronous version). If the function cannot be located on any module, the returned `YModule` object does not show as on-line.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking Firefox javascript VM that does not implement context switching during blocking I/O calls. See the documentation section on asynchronous Javascript calls for more details.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the requested `YModule` object',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['Altitude']['get_qnh']={syn:'Returns the barometric pressure adjusted to sea level used to compute the altitude (QNH).',lib:'altitude.get_qnh()',pro:'function get_qnh()',cmt:'

Returns the barometric pressure adjusted to sea level used to compute the altitude (QNH).

',ret:'a floating point number corresponding to the barometric pressure adjusted to sea level used to compute the altitude (QNH)',ext:'On failure, throws an exception or returns `Y_QNH_INVALID`.'}; doc['Altitude']['get_recordedData']={syn:'Retrieves a DataSet object holding historical data for this sensor, for a specified time interval.',lib:'altitude.get_recordedData()',pro:'function get_recordedData(startTime, endTime)',cmt:'

Retrieves a DataSet object holding historical data for this sensor, for a specified time interval. The measures will be retrieved from the data logger, which must have been turned on at the desired time. See the documentation of the DataSet class for information on how to get an overview of the recorded data, and how to load progressively a large set of measures from the data logger.

This function only works if the device uses a recent firmware, as DataSet objects are not supported by firmwares older than version 13000.

',par:{startTime:'the start of the desired measure time interval, as a Unix timestamp, i.e. the number of seconds since January 1, 1970 UTC. The special value 0 can be used to include any meaasure, without initial limit.',endTime:'the end of the desired measure time interval, as a Unix timestamp, i.e. the number of seconds since January 1, 1970 UTC. The special value 0 can be used to include any meaasure, without ending limit.'},ret:'an instance of YDataSet, providing access to historical data. Past measures can be loaded progressively using methods from the YDataSet object.'}; doc['Altitude']['get_reportFrequency']={syn:'Returns the timed value notification frequency, or \x22OFF\x22 if timed value notifications are disabled for this function.',lib:'altitude.get_reportFrequency()',pro:'function get_reportFrequency()',cmt:'

Returns the timed value notification frequency, or \x22OFF\x22 if timed value notifications are disabled for this function.

',ret:'a string corresponding to the timed value notification frequency, or \x22OFF\x22 if timed value notifications are disabled for this function',ext:'On failure, throws an exception or returns `Y_REPORTFREQUENCY_INVALID`.'}; doc['Altitude']['get_resolution']={syn:'Returns the resolution of the measured values.',lib:'altitude.get_resolution()',pro:'function get_resolution()',cmt:'

Returns the resolution of the measured values. The resolution corresponds to the numerical precision of the measures, which is not always the same as the actual precision of the sensor.

',ret:'a floating point number corresponding to the resolution of the measured values',ext:'On failure, throws an exception or returns `Y_RESOLUTION_INVALID`.'}; doc['Altitude']['get_sensorState']={syn:'Returns the sensor health state code, which is zero when there is an up-to-date measure available or a positive code if the sensor is not able to provide a measure right now.',lib:'altitude.get_sensorState()',pro:'function get_sensorState()',cmt:'

Returns the sensor health state code, which is zero when there is an up-to-date measure available or a positive code if the sensor is not able to provide a measure right now.

',ret:'an integer corresponding to the sensor health state code, which is zero when there is an up-to-date measure available or a positive code if the sensor is not able to provide a measure right now',ext:'On failure, throws an exception or returns `Y_SENSORSTATE_INVALID`.'}; doc['Altitude']['get_technology']={syn:'Returns the technology used by the sesnor to compute altitude.',lib:'altitude.get_technology()',pro:'function get_technology()',cmt:'

Returns the technology used by the sesnor to compute altitude. Possibles values are \x22barometric\x22 and \x22gps\x22

',ret:'a string corresponding to the technology used by the sesnor to compute altitude',ext:'On failure, throws an exception or returns `Y_TECHNOLOGY_INVALID`.'}; doc['Altitude']['get_unit']={syn:'Returns the measuring unit for the altitude.',lib:'altitude.get_unit()',pro:'function get_unit()',cmt:'

Returns the measuring unit for the altitude.

',ret:'a string corresponding to the measuring unit for the altitude',ext:'On failure, throws an exception or returns `Y_UNIT_INVALID`.'}; doc['Altitude']['get_userData']={syn:'Returns the value of the userData attribute, as previously stored using method `set_userData`.',lib:'altitude.get_userData()',pro:'function get_userData()',cmt:'

Returns the value of the userData attribute, as previously stored using method `set_userData`. This attribute is never touched directly by the API, and is at disposal of the caller to store a context.

',ret:'the object stored previously by the caller.'}; doc['Altitude']['isOnline']={syn:'Checks if the altimeter is currently reachable, without raising any error.',lib:'altitude.isOnline()',pro:'function isOnline()',cmt:'

Checks if the altimeter is currently reachable, without raising any error. If there is a cached value for the altimeter in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the altimeter.

',ret:'`true` if the altimeter can be reached, and `false` otherwise'}; doc['Altitude']['isOnline_async']={syn:'Checks if the altimeter is currently reachable, without raising any error (asynchronous version).',lib:'altitude.isOnline_async()',pro:'function isOnline_async(callback, context)',cmt:'

Checks if the altimeter is currently reachable, without raising any error (asynchronous version). If there is a cached value for the altimeter in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the requested function.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the boolean result',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['Altitude']['load']={syn:'Preloads the altimeter cache with a specified validity duration.',lib:'altitude.load()',pro:'function load(msValidity)',cmt:'

Preloads the altimeter cache with a specified validity duration. By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network traffic for instance.

',par:{msValidity:'an integer corresponding to the validity attributed to the loaded function parameters, in milliseconds'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Altitude']['loadAttribute']={syn:'Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.',lib:'altitude.loadAttribute()',pro:'function loadAttribute(attrName)',cmt:'

Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.

',par:{attrName:'the name of the requested attribute'},ret:'a string with the value of the the attribute',ext:'On failure, throws an exception or returns an empty string.'}; doc['Altitude']['loadCalibrationPoints']={syn:'Retrieves error correction data points previously entered using the method `calibrateFromPoints`.',lib:'altitude.loadCalibrationPoints()',pro:'function loadCalibrationPoints(rawValues, refValues)',cmt:'

Retrieves error correction data points previously entered using the method `calibrateFromPoints`.

',par:{rawValues:'array of floating point numbers, that will be filled by the function with the raw sensor values for the correction points.',refValues:'array of floating point numbers, that will be filled by the function with the desired values for the correction points.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Altitude']['load_async']={syn:'Preloads the altimeter cache with a specified validity duration (asynchronous version).',lib:'altitude.load_async()',pro:'function load_async(msValidity, callback, context)',cmt:'

Preloads the altimeter cache with a specified validity duration (asynchronous version). By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network trafic for instance.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{msValidity:'an integer corresponding to the validity of the loaded function parameters, in milliseconds',callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the error code (or `YAPI_SUCCESS`)',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['Altitude']['muteValueCallbacks']={syn:'Disables the propagation of every new advertised value to the parent hub.',lib:'altitude.muteValueCallbacks()',pro:'function muteValueCallbacks()',cmt:'

Disables the propagation of every new advertised value to the parent hub. You can use this function to save bandwidth and CPU on computers with limited resources, or to prevent unwanted invocations of the HTTP callback. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Altitude']['nextAltitude']={syn:'Continues the enumeration of altimeters started using `yFirstAltitude()`.',lib:'altitude.nextAltitude()',pro:'function nextAltitude()',cmt:'

Continues the enumeration of altimeters started using `yFirstAltitude()`.

',ret:'a pointer to a `YAltitude` object, corresponding to an altimeter currently online, or a `null` pointer if there are no more altimeters to enumerate.'}; doc['Altitude']['registerTimedReportCallback']={syn:'Registers the callback function that is invoked on every periodic timed notification.',lib:'altitude.registerTimedReportCallback()',pro:'function registerTimedReportCallback(callback)',cmt:'

Registers the callback function that is invoked on every periodic timed notification. The callback is invoked only during the execution of `ySleep` or `yHandleEvents`. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a null pointer as argument.

',par:{callback:'the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and an YMeasure object describing the new advertised value.'}}; doc['Altitude']['registerValueCallback']={syn:'Registers the callback function that is invoked on every change of advertised value.',lib:'altitude.registerValueCallback()',pro:'function registerValueCallback(callback)',cmt:'

Registers the callback function that is invoked on every change of advertised value. The callback is invoked only during the execution of `ySleep` or `yHandleEvents`. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a null pointer as argument.

',par:{callback:'the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and the character string describing the new advertised value.'}}; doc['Altitude']['set_advMode']={syn:'Changes the measuring mode used for the advertised value pushed to the parent hub.',lib:'altitude.set_advMode()',pro:'function set_advMode(newval)',cmt:'

Changes the measuring mode used for the advertised value pushed to the parent hub.

',par:{newval:'a value among `Y_ADVMODE_IMMEDIATE`, `Y_ADVMODE_PERIOD_AVG`, `Y_ADVMODE_PERIOD_MIN` and `Y_ADVMODE_PERIOD_MAX` corresponding to the measuring mode used for the advertised value pushed to the parent hub'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Altitude']['set_currentValue']={syn:'Changes the current estimated altitude.',lib:'altitude.set_currentValue()',pro:'function set_currentValue(newval)',cmt:'

Changes the current estimated altitude. This allows to compensate for ambient pressure variations and to work in relative mode.

',par:{newval:'a floating point number corresponding to the current estimated altitude'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Altitude']['set_highestValue']={syn:'Changes the recorded maximal value observed.',lib:'altitude.set_highestValue()',pro:'function set_highestValue(newval)',cmt:'

Changes the recorded maximal value observed. Can be used to reset the value returned by get_lowestValue().

',par:{newval:'a floating point number corresponding to the recorded maximal value observed'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Altitude']['set_logFrequency']={syn:'Changes the datalogger recording frequency for this function.',lib:'altitude.set_logFrequency()',pro:'function set_logFrequency(newval)',cmt:'

Changes the datalogger recording frequency for this function. The frequency can be specified as samples per second, as sample per minute (for instance \x2215/m\x22) or in samples per hour (eg. \x224/h\x22). To disable recording for this function, use the value \x22OFF\x22.

',par:{newval:'a string corresponding to the datalogger recording frequency for this function'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Altitude']['set_logicalName']={syn:'Changes the logical name of the altimeter.',lib:'altitude.set_logicalName()',pro:'function set_logicalName(newval)',cmt:'

Changes the logical name of the altimeter. You can use `yCheckLogicalName()` prior to this call to make sure that your parameter is valid. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',par:{newval:'a string corresponding to the logical name of the altimeter.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Altitude']['set_lowestValue']={syn:'Changes the recorded minimal value observed.',lib:'altitude.set_lowestValue()',pro:'function set_lowestValue(newval)',cmt:'

Changes the recorded minimal value observed. Can be used to reset the value returned by get_lowestValue().

',par:{newval:'a floating point number corresponding to the recorded minimal value observed'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Altitude']['set_qnh']={syn:'Changes the barometric pressure adjusted to sea level used to compute the altitude (QNH).',lib:'altitude.set_qnh()',pro:'function set_qnh(newval)',cmt:'

Changes the barometric pressure adjusted to sea level used to compute the altitude (QNH). This enables you to compensate for atmospheric pressure changes due to weather conditions.

',par:{newval:'a floating point number corresponding to the barometric pressure adjusted to sea level used to compute the altitude (QNH)'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Altitude']['set_reportFrequency']={syn:'Changes the timed value notification frequency for this function.',lib:'altitude.set_reportFrequency()',pro:'function set_reportFrequency(newval)',cmt:'

Changes the timed value notification frequency for this function. The frequency can be specified as samples per second, as sample per minute (for instance \x2215/m\x22) or in samples per hour (eg. \x224/h\x22). To disable timed value notifications for this function, use the value \x22OFF\x22.

',par:{newval:'a string corresponding to the timed value notification frequency for this function'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Altitude']['set_resolution']={syn:'Changes the resolution of the measured physical values.',lib:'altitude.set_resolution()',pro:'function set_resolution(newval)',cmt:'

Changes the resolution of the measured physical values. The resolution corresponds to the numerical precision when displaying value. It does not change the precision of the measure itself.

',par:{newval:'a floating point number corresponding to the resolution of the measured physical values'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Altitude']['set_userData']={syn:'Stores a user context provided as argument in the userData attribute of the function.',lib:'altitude.set_userData()',pro:'function set_userData(data)',cmt:'

Stores a user context provided as argument in the userData attribute of the function. This attribute is never touched by the API, and is at disposal of the caller to store a context.

',par:{data:'any kind of object to be stored'}}; doc['Altitude']['startDataLogger']={syn:'Starts the data logger on the device.',lib:'altitude.startDataLogger()',pro:'function startDataLogger()',cmt:'

Starts the data logger on the device. Note that the data logger will only save the measures on this sensor if the logFrequency is not set to \x22OFF\x22.

',ret:'`YAPI_SUCCESS` if the call succeeds.'}; doc['Altitude']['stopDataLogger']={syn:'Stops the datalogger on the device.',lib:'altitude.stopDataLogger()',pro:'function stopDataLogger()',cmt:'

Stops the datalogger on the device.

',ret:'`YAPI_SUCCESS` if the call succeeds.'}; doc['Altitude']['unmuteValueCallbacks']={syn:'Re-enables the propagation of every new advertised value to the parent hub.',lib:'altitude.unmuteValueCallbacks()',pro:'function unmuteValueCallbacks()',cmt:'

Re-enables the propagation of every new advertised value to the parent hub. This function reverts the effect of a previous call to `muteValueCallbacks()`. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Altitude']['wait_async']={syn:'Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function.',lib:'altitude.wait_async()',pro:'function wait_async(callback, context)',cmt:'

Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function. The callback function can therefore freely issue synchronous or asynchronous commands, without risking to block the Javascript VM.

',par:{callback:'callback function that is invoked when all pending commands on the module are completed. The callback function receives two arguments: the caller-specific context object and the receiving function object.',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing.'}; //--- (end of generated code: Altitude) //--- (generated code: Motor) doc['Motor']={'':{syn:'Motor function interface',inc:'<script type='text/javascript' src='yocto_motor.js'></script>',cmt:'

Yoctopuce application programming interface allows you to drive the power sent to the motor to make it turn both ways, but also to drive accelerations and decelerations. The motor will then accelerate automatically: you will not have to monitor it. The API also allows to slow down the motor by shortening its terminals: the motor will then act as an electromagnetic brake.

'}}; doc['Motor']['FindMotor']={syn:'Retrieves a motor for a given identifier.',lib:'YMotor.FindMotor()',pro:'function FindMotor(func)',cmt:'

Retrieves a motor for a given identifier. The identifier can be specified using several formats:

- FunctionLogicalName
- ModuleSerialNumber.FunctionIdentifier
- ModuleSerialNumber.FunctionLogicalName
- ModuleLogicalName.FunctionIdentifier
- ModuleLogicalName.FunctionLogicalName

This function does not require that the motor is online at the time it is invoked. The returned object is nevertheless valid. Use the method `YMotor.isOnline()` to test if the motor is indeed online at a given time. In case of ambiguity when looking for a motor by logical name, no error is notified: the first instance found is returned. The search is performed first by hardware name, then by logical name.

If a call to this object\x27s is_online() method returns FALSE although you are certain that the matching device is plugged, make sure that you did call registerHub() at application initialization time.

',par:{func:'a string that uniquely characterizes the motor'},ret:'a `YMotor` object allowing you to drive the motor.'}; doc['Motor']['FirstMotor']={syn:'Starts the enumeration of motors currently accessible.',lib:'YMotor.FirstMotor()',pro:'function FirstMotor()',cmt:'

Starts the enumeration of motors currently accessible. Use the method `YMotor.nextMotor()` to iterate on next motors.

',ret:'a pointer to a `YMotor` object, corresponding to the first motor currently online, or a `null` pointer if there are none.'}; doc['Motor']['brakingForceMove']={syn:'Changes progressively the braking force applied to the motor for a specific duration.',lib:'motor.brakingForceMove()',pro:'function brakingForceMove(targetPower, delay)',cmt:'

Changes progressively the braking force applied to the motor for a specific duration.

',par:{targetPower:'desired braking force, in percents',delay:'duration (in ms) of the transition'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Motor']['clearCache']={syn:'Invalidates the cache.',lib:'motor.clearCache()',pro:'function clearCache()',cmt:'

Invalidates the cache. Invalidates the cache of the motor attributes. Forces the next call to get_xxx() or loadxxx() to use values that come from the device.

'}; doc['Motor']['describe']={syn:'Returns a short text that describes unambiguously the instance of the motor in the form `TYPE(NAME)=SERIAL.FUNCTIONID`.',lib:'motor.describe()',pro:'function describe()',cmt:'

Returns a short text that describes unambiguously the instance of the motor in the form `TYPE(NAME)=SERIAL.FUNCTIONID`. More precisely, `TYPE` is the type of the function, `NAME` it the name used for the first access to the function, `SERIAL` is the serial number of the module if the module is connected or `\x22unresolved\x22`, and `FUNCTIONID` is the hardware identifier of the function if the module is connected. For example, this method returns `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1` if the module is already connected or `Relay(BadCustomeName.relay1)=unresolved` if the module has not yet been connected. This method does not trigger any USB or TCP transaction and can therefore be used in a debugger.

',ret:'a string that describes the motor (ex: `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1`)'}; doc['Motor']['drivingForceMove']={syn:'Changes progressively the power sent to the moteur for a specific duration.',lib:'motor.drivingForceMove()',pro:'function drivingForceMove(targetPower, delay)',cmt:'

Changes progressively the power sent to the moteur for a specific duration.

',par:{targetPower:'desired motor power, in percents (between -100% and +100%)',delay:'duration (in ms) of the transition'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Motor']['get_advertisedValue']={syn:'Returns the current value of the motor (no more than 6 characters).',lib:'motor.get_advertisedValue()',pro:'function get_advertisedValue()',cmt:'

Returns the current value of the motor (no more than 6 characters).

',ret:'a string corresponding to the current value of the motor (no more than 6 characters).',ext:'On failure, throws an exception or returns `Y_ADVERTISEDVALUE_INVALID`.'}; doc['Motor']['get_brakingForce']={syn:'Returns the braking force applied to the motor, as a percentage.',lib:'motor.get_brakingForce()',pro:'function get_brakingForce()',cmt:'

Returns the braking force applied to the motor, as a percentage. The value 0 corresponds to no braking (free wheel).

',ret:'a floating point number corresponding to the braking force applied to the motor, as a percentage',ext:'On failure, throws an exception or returns `Y_BRAKINGFORCE_INVALID`.'}; doc['Motor']['get_cutOffVoltage']={syn:'Returns the threshold voltage under which the controller automatically switches to error state and prevents further current draw.',lib:'motor.get_cutOffVoltage()',pro:'function get_cutOffVoltage()',cmt:'

Returns the threshold voltage under which the controller automatically switches to error state and prevents further current draw. This setting prevents damage to a battery that can occur when drawing current from an \x22empty\x22 battery.

',ret:'a floating point number corresponding to the threshold voltage under which the controller automatically switches to error state and prevents further current draw',ext:'On failure, throws an exception or returns `Y_CUTOFFVOLTAGE_INVALID`.'}; doc['Motor']['get_drivingForce']={syn:'Returns the power sent to the motor, as a percentage between -100% and +100%.',lib:'motor.get_drivingForce()',pro:'function get_drivingForce()',cmt:'

Returns the power sent to the motor, as a percentage between -100% and +100%.

',ret:'a floating point number corresponding to the power sent to the motor, as a percentage between -100% and +100%',ext:'On failure, throws an exception or returns `Y_DRIVINGFORCE_INVALID`.'}; doc['Motor']['get_errorMessage']={syn:'Returns the error message of the latest error with the motor.',lib:'motor.get_errorMessage()',pro:'function get_errorMessage()',cmt:'

Returns the error message of the latest error with the motor. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a string corresponding to the latest error message that occured while using the motor object'}; doc['Motor']['get_errorType']={syn:'Returns the numerical error code of the latest error with the motor.',lib:'motor.get_errorType()',pro:'function get_errorType()',cmt:'

Returns the numerical error code of the latest error with the motor. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a number corresponding to the code of the latest error that occurred while using the motor object'}; doc['Motor']['get_failSafeTimeout']={syn:'Returns the delay in milliseconds allowed for the controller to run autonomously without receiving any instruction from the control process.',lib:'motor.get_failSafeTimeout()',pro:'function get_failSafeTimeout()',cmt:'

Returns the delay in milliseconds allowed for the controller to run autonomously without receiving any instruction from the control process. When this delay has elapsed, the controller automatically stops the motor and switches to FAILSAFE error. Failsafe security is disabled when the value is zero.

',ret:'an integer corresponding to the delay in milliseconds allowed for the controller to run autonomously without receiving any instruction from the control process',ext:'On failure, throws an exception or returns `Y_FAILSAFETIMEOUT_INVALID`.'}; doc['Motor']['get_frequency']={syn:'Returns the PWM frequency used to control the motor.',lib:'motor.get_frequency()',pro:'function get_frequency()',cmt:'

Returns the PWM frequency used to control the motor.

',ret:'a floating point number corresponding to the PWM frequency used to control the motor',ext:'On failure, throws an exception or returns `Y_FREQUENCY_INVALID`.'}; doc['Motor']['get_friendlyName']={syn:'Returns a global identifier of the motor in the format `MODULE_NAME.FUNCTION_NAME`.',lib:'motor.get_friendlyName()',pro:'function get_friendlyName()',cmt:'

Returns a global identifier of the motor in the format `MODULE_NAME.FUNCTION_NAME`. The returned string uses the logical names of the module and of the motor if they are defined, otherwise the serial number of the module and the hardware identifier of the motor (for example: `MyCustomName.relay1`)

',ret:'a string that uniquely identifies the motor using logical names (ex: `MyCustomName.relay1`)',ext:'On failure, throws an exception or returns `Y_FRIENDLYNAME_INVALID`.'}; doc['Motor']['get_functionDescriptor']={syn:'Returns a unique identifier of type `YFUN_DESCR` corresponding to the function.',lib:'motor.get_functionDescriptor()',pro:'function get_functionDescriptor()',cmt:'

Returns a unique identifier of type `YFUN_DESCR` corresponding to the function. This identifier can be used to test if two instances of `YFunction` reference the same physical function on the same physical device.

',ret:'an identifier of type `YFUN_DESCR`.',ext:'If the function has never been contacted, the returned value is `Y_FUNCTIONDESCRIPTOR_INVALID`.'}; doc['Motor']['get_functionId']={syn:'Returns the hardware identifier of the motor, without reference to the module.',lib:'motor.get_functionId()',pro:'function get_functionId()',cmt:'

Returns the hardware identifier of the motor, without reference to the module. For example `relay1`

',ret:'a string that identifies the motor (ex: `relay1`)',ext:'On failure, throws an exception or returns `Y_FUNCTIONID_INVALID`.'}; doc['Motor']['get_hardwareId']={syn:'Returns the unique hardware identifier of the motor in the form `SERIAL.FUNCTIONID`.',lib:'motor.get_hardwareId()',pro:'function get_hardwareId()',cmt:'

Returns the unique hardware identifier of the motor in the form `SERIAL.FUNCTIONID`. The unique hardware identifier is composed of the device serial number and of the hardware identifier of the motor (for example `RELAYLO1-123456.relay1`).

',ret:'a string that uniquely identifies the motor (ex: `RELAYLO1-123456.relay1`)',ext:'On failure, throws an exception or returns `Y_HARDWAREID_INVALID`.'}; doc['Motor']['get_logicalName']={syn:'Returns the logical name of the motor.',lib:'motor.get_logicalName()',pro:'function get_logicalName()',cmt:'

Returns the logical name of the motor.

',ret:'a string corresponding to the logical name of the motor.',ext:'On failure, throws an exception or returns `Y_LOGICALNAME_INVALID`.'}; doc['Motor']['get_module']={syn:'Gets the `YModule` object for the device on which the function is located.',lib:'motor.get_module()',pro:'function get_module()',cmt:'

Gets the `YModule` object for the device on which the function is located. If the function cannot be located on any module, the returned instance of `YModule` is not shown as on-line.

',ret:'an instance of `YModule`'}; doc['Motor']['get_module_async']={syn:'Gets the `YModule` object for the device on which the function is located (asynchronous version).',lib:'motor.get_module_async()',pro:'function get_module_async(callback, context)',cmt:'

Gets the `YModule` object for the device on which the function is located (asynchronous version). If the function cannot be located on any module, the returned `YModule` object does not show as on-line.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking Firefox javascript VM that does not implement context switching during blocking I/O calls. See the documentation section on asynchronous Javascript calls for more details.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the requested `YModule` object',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['Motor']['get_motorStatus']={syn:'Return the controller state.',lib:'motor.get_motorStatus()',pro:'function get_motorStatus()',cmt:'

Return the controller state. Possible states are: IDLE when the motor is stopped/in free wheel, ready to start; FORWD when the controller is driving the motor forward; BACKWD when the controller is driving the motor backward; BRAKE when the controller is braking; LOVOLT when the controller has detected a low voltage condition; HICURR when the controller has detected an overcurrent condition; HIHEAT when the controller has detected an overheat condition; FAILSF when the controller switched on the failsafe security.

When an error condition occurred (LOVOLT, HICURR, HIHEAT, FAILSF), the controller status must be explicitly reset using the `resetStatus` function.

',ret:'a value among `Y_MOTORSTATUS_IDLE`, `Y_MOTORSTATUS_BRAKE`, `Y_MOTORSTATUS_FORWD`, `Y_MOTORSTATUS_BACKWD`, `Y_MOTORSTATUS_LOVOLT`, `Y_MOTORSTATUS_HICURR`, `Y_MOTORSTATUS_HIHEAT` and `Y_MOTORSTATUS_FAILSF`',ext:'On failure, throws an exception or returns `Y_MOTORSTATUS_INVALID`.'}; doc['Motor']['get_overCurrentLimit']={syn:'Returns the current threshold (in mA) above which the controller automatically switches to error state.',lib:'motor.get_overCurrentLimit()',pro:'function get_overCurrentLimit()',cmt:'

Returns the current threshold (in mA) above which the controller automatically switches to error state. A zero value means that there is no limit.

',ret:'an integer corresponding to the current threshold (in mA) above which the controller automatically switches to error state',ext:'On failure, throws an exception or returns `Y_OVERCURRENTLIMIT_INVALID`.'}; doc['Motor']['get_starterTime']={syn:'Returns the duration (in ms) during which the motor is driven at low frequency to help it start up.',lib:'motor.get_starterTime()',pro:'function get_starterTime()',cmt:'

Returns the duration (in ms) during which the motor is driven at low frequency to help it start up.

',ret:'an integer corresponding to the duration (in ms) during which the motor is driven at low frequency to help it start up',ext:'On failure, throws an exception or returns `Y_STARTERTIME_INVALID`.'}; doc['Motor']['get_userData']={syn:'Returns the value of the userData attribute, as previously stored using method `set_userData`.',lib:'motor.get_userData()',pro:'function get_userData()',cmt:'

Returns the value of the userData attribute, as previously stored using method `set_userData`. This attribute is never touched directly by the API, and is at disposal of the caller to store a context.

',ret:'the object stored previously by the caller.'}; doc['Motor']['isOnline']={syn:'Checks if the motor is currently reachable, without raising any error.',lib:'motor.isOnline()',pro:'function isOnline()',cmt:'

Checks if the motor is currently reachable, without raising any error. If there is a cached value for the motor in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the motor.

',ret:'`true` if the motor can be reached, and `false` otherwise'}; doc['Motor']['isOnline_async']={syn:'Checks if the motor is currently reachable, without raising any error (asynchronous version).',lib:'motor.isOnline_async()',pro:'function isOnline_async(callback, context)',cmt:'

Checks if the motor is currently reachable, without raising any error (asynchronous version). If there is a cached value for the motor in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the requested function.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the boolean result',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['Motor']['keepALive']={syn:'Rearms the controller failsafe timer.',lib:'motor.keepALive()',pro:'function keepALive()',cmt:'

Rearms the controller failsafe timer. When the motor is running and the failsafe feature is active, this function should be called periodically to prove that the control process is running properly. Otherwise, the motor is automatically stopped after the specified timeout. Calling a motor set function implicitely rearms the failsafe timer.

'}; doc['Motor']['load']={syn:'Preloads the motor cache with a specified validity duration.',lib:'motor.load()',pro:'function load(msValidity)',cmt:'

Preloads the motor cache with a specified validity duration. By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network traffic for instance.

',par:{msValidity:'an integer corresponding to the validity attributed to the loaded function parameters, in milliseconds'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Motor']['loadAttribute']={syn:'Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.',lib:'motor.loadAttribute()',pro:'function loadAttribute(attrName)',cmt:'

Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.

',par:{attrName:'the name of the requested attribute'},ret:'a string with the value of the the attribute',ext:'On failure, throws an exception or returns an empty string.'}; doc['Motor']['load_async']={syn:'Preloads the motor cache with a specified validity duration (asynchronous version).',lib:'motor.load_async()',pro:'function load_async(msValidity, callback, context)',cmt:'

Preloads the motor cache with a specified validity duration (asynchronous version). By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network trafic for instance.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{msValidity:'an integer corresponding to the validity of the loaded function parameters, in milliseconds',callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the error code (or `YAPI_SUCCESS`)',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['Motor']['muteValueCallbacks']={syn:'Disables the propagation of every new advertised value to the parent hub.',lib:'motor.muteValueCallbacks()',pro:'function muteValueCallbacks()',cmt:'

Disables the propagation of every new advertised value to the parent hub. You can use this function to save bandwidth and CPU on computers with limited resources, or to prevent unwanted invocations of the HTTP callback. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Motor']['nextMotor']={syn:'Continues the enumeration of motors started using `yFirstMotor()`.',lib:'motor.nextMotor()',pro:'function nextMotor()',cmt:'

Continues the enumeration of motors started using `yFirstMotor()`.

',ret:'a pointer to a `YMotor` object, corresponding to a motor currently online, or a `null` pointer if there are no more motors to enumerate.'}; doc['Motor']['registerValueCallback']={syn:'Registers the callback function that is invoked on every change of advertised value.',lib:'motor.registerValueCallback()',pro:'function registerValueCallback(callback)',cmt:'

Registers the callback function that is invoked on every change of advertised value. The callback is invoked only during the execution of `ySleep` or `yHandleEvents`. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a null pointer as argument.

',par:{callback:'the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and the character string describing the new advertised value.'}}; doc['Motor']['resetStatus']={syn:'Reset the controller state to IDLE.',lib:'motor.resetStatus()',pro:'function resetStatus()',cmt:'

Reset the controller state to IDLE. This function must be invoked explicitely after any error condition is signaled.

'}; doc['Motor']['set_brakingForce']={syn:'Changes immediately the braking force applied to the motor (in percents).',lib:'motor.set_brakingForce()',pro:'function set_brakingForce(newval)',cmt:'

Changes immediately the braking force applied to the motor (in percents). The value 0 corresponds to no braking (free wheel). When the braking force is changed, the driving power is set to zero. The value is a percentage.

',par:{newval:'a floating point number corresponding to immediately the braking force applied to the motor (in percents)'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Motor']['set_cutOffVoltage']={syn:'Changes the threshold voltage under which the controller automatically switches to error state and prevents further current draw.',lib:'motor.set_cutOffVoltage()',pro:'function set_cutOffVoltage(newval)',cmt:'

Changes the threshold voltage under which the controller automatically switches to error state and prevents further current draw. This setting prevent damage to a battery that can occur when drawing current from an \x22empty\x22 battery. Note that whatever the cutoff threshold, the controller switches to undervoltage error state if the power supply goes under 3V, even for a very brief time.

',par:{newval:'a floating point number corresponding to the threshold voltage under which the controller automatically switches to error state and prevents further current draw'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Motor']['set_drivingForce']={syn:'Changes immediately the power sent to the motor.',lib:'motor.set_drivingForce()',pro:'function set_drivingForce(newval)',cmt:'

Changes immediately the power sent to the motor. The value is a percentage between -100% to 100%. If you want go easy on your mechanics and avoid excessive current consumption, try to avoid brutal power changes. For example, immediate transition from forward full power to reverse full power is a very bad idea. Each time the driving power is modified, the braking power is set to zero.

',par:{newval:'a floating point number corresponding to immediately the power sent to the motor'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Motor']['set_failSafeTimeout']={syn:'Changes the delay in milliseconds allowed for the controller to run autonomously without receiving any instruction from the control process.',lib:'motor.set_failSafeTimeout()',pro:'function set_failSafeTimeout(newval)',cmt:'

Changes the delay in milliseconds allowed for the controller to run autonomously without receiving any instruction from the control process. When this delay has elapsed, the controller automatically stops the motor and switches to FAILSAFE error. Failsafe security is disabled when the value is zero.

',par:{newval:'an integer corresponding to the delay in milliseconds allowed for the controller to run autonomously without receiving any instruction from the control process'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Motor']['set_frequency']={syn:'Changes the PWM frequency used to control the motor.',lib:'motor.set_frequency()',pro:'function set_frequency(newval)',cmt:'

Changes the PWM frequency used to control the motor. Low frequency is usually more efficient and may help the motor to start, but an audible noise might be generated. A higher frequency reduces the noise, but more energy is converted into heat.

',par:{newval:'a floating point number corresponding to the PWM frequency used to control the motor'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Motor']['set_logicalName']={syn:'Changes the logical name of the motor.',lib:'motor.set_logicalName()',pro:'function set_logicalName(newval)',cmt:'

Changes the logical name of the motor. You can use `yCheckLogicalName()` prior to this call to make sure that your parameter is valid. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',par:{newval:'a string corresponding to the logical name of the motor.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Motor']['set_overCurrentLimit']={syn:'Changes the current threshold (in mA) above which the controller automatically switches to error state.',lib:'motor.set_overCurrentLimit()',pro:'function set_overCurrentLimit(newval)',cmt:'

Changes the current threshold (in mA) above which the controller automatically switches to error state. A zero value means that there is no limit. Note that whatever the current limit is, the controller switches to OVERCURRENT status if the current goes above 32A, even for a very brief time.

',par:{newval:'an integer corresponding to the current threshold (in mA) above which the controller automatically switches to error state'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Motor']['set_starterTime']={syn:'Changes the duration (in ms) during which the motor is driven at low frequency to help it start up.',lib:'motor.set_starterTime()',pro:'function set_starterTime(newval)',cmt:'

Changes the duration (in ms) during which the motor is driven at low frequency to help it start up.

',par:{newval:'an integer corresponding to the duration (in ms) during which the motor is driven at low frequency to help it start up'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Motor']['set_userData']={syn:'Stores a user context provided as argument in the userData attribute of the function.',lib:'motor.set_userData()',pro:'function set_userData(data)',cmt:'

Stores a user context provided as argument in the userData attribute of the function. This attribute is never touched by the API, and is at disposal of the caller to store a context.

',par:{data:'any kind of object to be stored'}}; doc['Motor']['unmuteValueCallbacks']={syn:'Re-enables the propagation of every new advertised value to the parent hub.',lib:'motor.unmuteValueCallbacks()',pro:'function unmuteValueCallbacks()',cmt:'

Re-enables the propagation of every new advertised value to the parent hub. This function reverts the effect of a previous call to `muteValueCallbacks()`. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Motor']['wait_async']={syn:'Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function.',lib:'motor.wait_async()',pro:'function wait_async(callback, context)',cmt:'

Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function. The callback function can therefore freely issue synchronous or asynchronous commands, without risking to block the Javascript VM.

',par:{callback:'callback function that is invoked when all pending commands on the module are completed. The callback function receives two arguments: the caller-specific context object and the receiving function object.',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing.'}; //--- (end of generated code: Motor) //--- (generated code: SerialPort) doc['SerialPort']={'':{syn:'SerialPort function interface',inc:'<script type='text/javascript' src='yocto_serialport.js'></script>',cmt:'

The SerialPort function interface allows you to fully drive a Yoctopuce serial port, to send and receive data, and to configure communication parameters (baud rate, bit count, parity, flow control and protocol). Note that Yoctopuce serial ports are not exposed as virtual COM ports. They are meant to be used in the same way as all Yoctopuce devices.

'}}; doc['SerialPort']['FindSerialPort']={syn:'Retrieves a serial port for a given identifier.',lib:'YSerialPort.FindSerialPort()',pro:'function FindSerialPort(func)',cmt:'

Retrieves a serial port for a given identifier. The identifier can be specified using several formats:

- FunctionLogicalName
- ModuleSerialNumber.FunctionIdentifier
- ModuleSerialNumber.FunctionLogicalName
- ModuleLogicalName.FunctionIdentifier
- ModuleLogicalName.FunctionLogicalName

This function does not require that the serial port is online at the time it is invoked. The returned object is nevertheless valid. Use the method `YSerialPort.isOnline()` to test if the serial port is indeed online at a given time. In case of ambiguity when looking for a serial port by logical name, no error is notified: the first instance found is returned. The search is performed first by hardware name, then by logical name.

If a call to this object\x27s is_online() method returns FALSE although you are certain that the matching device is plugged, make sure that you did call registerHub() at application initialization time.

',par:{func:'a string that uniquely characterizes the serial port'},ret:'a `YSerialPort` object allowing you to drive the serial port.'}; doc['SerialPort']['FirstSerialPort']={syn:'Starts the enumeration of serial ports currently accessible.',lib:'YSerialPort.FirstSerialPort()',pro:'function FirstSerialPort()',cmt:'

Starts the enumeration of serial ports currently accessible. Use the method `YSerialPort.nextSerialPort()` to iterate on next serial ports.

',ret:'a pointer to a `YSerialPort` object, corresponding to the first serial port currently online, or a `null` pointer if there are none.'}; doc['SerialPort']['clearCache']={syn:'Invalidates the cache.',lib:'serialport.clearCache()',pro:'function clearCache()',cmt:'

Invalidates the cache. Invalidates the cache of the serial port attributes. Forces the next call to get_xxx() or loadxxx() to use values that come from the device.

'}; doc['SerialPort']['describe']={syn:'Returns a short text that describes unambiguously the instance of the serial port in the form `TYPE(NAME)=SERIAL.FUNCTIONID`.',lib:'serialport.describe()',pro:'function describe()',cmt:'

Returns a short text that describes unambiguously the instance of the serial port in the form `TYPE(NAME)=SERIAL.FUNCTIONID`. More precisely, `TYPE` is the type of the function, `NAME` it the name used for the first access to the function, `SERIAL` is the serial number of the module if the module is connected or `\x22unresolved\x22`, and `FUNCTIONID` is the hardware identifier of the function if the module is connected. For example, this method returns `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1` if the module is already connected or `Relay(BadCustomeName.relay1)=unresolved` if the module has not yet been connected. This method does not trigger any USB or TCP transaction and can therefore be used in a debugger.

',ret:'a string that describes the serial port (ex: `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1`)'}; doc['SerialPort']['get_CTS']={syn:'Reads the level of the CTS line.',lib:'serialport.get_CTS()',pro:'function get_CTS()',cmt:'

Reads the level of the CTS line. The CTS line is usually driven by the RTS signal of the connected serial device.

',ret:'1 if the CTS line is high, 0 if the CTS line is low.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['SerialPort']['get_advertisedValue']={syn:'Returns the current value of the serial port (no more than 6 characters).',lib:'serialport.get_advertisedValue()',pro:'function get_advertisedValue()',cmt:'

Returns the current value of the serial port (no more than 6 characters).

',ret:'a string corresponding to the current value of the serial port (no more than 6 characters).',ext:'On failure, throws an exception or returns `Y_ADVERTISEDVALUE_INVALID`.'}; doc['SerialPort']['get_currentJob']={syn:'Returns the name of the job file currently in use.',lib:'serialport.get_currentJob()',pro:'function get_currentJob()',cmt:'

Returns the name of the job file currently in use.

',ret:'a string corresponding to the name of the job file currently in use',ext:'On failure, throws an exception or returns `Y_CURRENTJOB_INVALID`.'}; doc['SerialPort']['get_errCount']={syn:'Returns the total number of communication errors detected since last reset.',lib:'serialport.get_errCount()',pro:'function get_errCount()',cmt:'

Returns the total number of communication errors detected since last reset.

',ret:'an integer corresponding to the total number of communication errors detected since last reset',ext:'On failure, throws an exception or returns `Y_ERRCOUNT_INVALID`.'}; doc['SerialPort']['get_errorMessage']={syn:'Returns the error message of the latest error with the serial port.',lib:'serialport.get_errorMessage()',pro:'function get_errorMessage()',cmt:'

Returns the error message of the latest error with the serial port. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a string corresponding to the latest error message that occured while using the serial port object'}; doc['SerialPort']['get_errorType']={syn:'Returns the numerical error code of the latest error with the serial port.',lib:'serialport.get_errorType()',pro:'function get_errorType()',cmt:'

Returns the numerical error code of the latest error with the serial port. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a number corresponding to the code of the latest error that occurred while using the serial port object'}; doc['SerialPort']['get_friendlyName']={syn:'Returns a global identifier of the serial port in the format `MODULE_NAME.FUNCTION_NAME`.',lib:'serialport.get_friendlyName()',pro:'function get_friendlyName()',cmt:'

Returns a global identifier of the serial port in the format `MODULE_NAME.FUNCTION_NAME`. The returned string uses the logical names of the module and of the serial port if they are defined, otherwise the serial number of the module and the hardware identifier of the serial port (for example: `MyCustomName.relay1`)

',ret:'a string that uniquely identifies the serial port using logical names (ex: `MyCustomName.relay1`)',ext:'On failure, throws an exception or returns `Y_FRIENDLYNAME_INVALID`.'}; doc['SerialPort']['get_functionDescriptor']={syn:'Returns a unique identifier of type `YFUN_DESCR` corresponding to the function.',lib:'serialport.get_functionDescriptor()',pro:'function get_functionDescriptor()',cmt:'

Returns a unique identifier of type `YFUN_DESCR` corresponding to the function. This identifier can be used to test if two instances of `YFunction` reference the same physical function on the same physical device.

',ret:'an identifier of type `YFUN_DESCR`.',ext:'If the function has never been contacted, the returned value is `Y_FUNCTIONDESCRIPTOR_INVALID`.'}; doc['SerialPort']['get_functionId']={syn:'Returns the hardware identifier of the serial port, without reference to the module.',lib:'serialport.get_functionId()',pro:'function get_functionId()',cmt:'

Returns the hardware identifier of the serial port, without reference to the module. For example `relay1`

',ret:'a string that identifies the serial port (ex: `relay1`)',ext:'On failure, throws an exception or returns `Y_FUNCTIONID_INVALID`.'}; doc['SerialPort']['get_hardwareId']={syn:'Returns the unique hardware identifier of the serial port in the form `SERIAL.FUNCTIONID`.',lib:'serialport.get_hardwareId()',pro:'function get_hardwareId()',cmt:'

Returns the unique hardware identifier of the serial port in the form `SERIAL.FUNCTIONID`. The unique hardware identifier is composed of the device serial number and of the hardware identifier of the serial port (for example `RELAYLO1-123456.relay1`).

',ret:'a string that uniquely identifies the serial port (ex: `RELAYLO1-123456.relay1`)',ext:'On failure, throws an exception or returns `Y_HARDWAREID_INVALID`.'}; doc['SerialPort']['get_lastMsg']={syn:'Returns the latest message fully received (for Line, Frame and Modbus protocols).',lib:'serialport.get_lastMsg()',pro:'function get_lastMsg()',cmt:'

Returns the latest message fully received (for Line, Frame and Modbus protocols).

',ret:'a string corresponding to the latest message fully received (for Line, Frame and Modbus protocols)',ext:'On failure, throws an exception or returns `Y_LASTMSG_INVALID`.'}; doc['SerialPort']['get_logicalName']={syn:'Returns the logical name of the serial port.',lib:'serialport.get_logicalName()',pro:'function get_logicalName()',cmt:'

Returns the logical name of the serial port.

',ret:'a string corresponding to the logical name of the serial port.',ext:'On failure, throws an exception or returns `Y_LOGICALNAME_INVALID`.'}; doc['SerialPort']['get_module']={syn:'Gets the `YModule` object for the device on which the function is located.',lib:'serialport.get_module()',pro:'function get_module()',cmt:'

Gets the `YModule` object for the device on which the function is located. If the function cannot be located on any module, the returned instance of `YModule` is not shown as on-line.

',ret:'an instance of `YModule`'}; doc['SerialPort']['get_module_async']={syn:'Gets the `YModule` object for the device on which the function is located (asynchronous version).',lib:'serialport.get_module_async()',pro:'function get_module_async(callback, context)',cmt:'

Gets the `YModule` object for the device on which the function is located (asynchronous version). If the function cannot be located on any module, the returned `YModule` object does not show as on-line.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking Firefox javascript VM that does not implement context switching during blocking I/O calls. See the documentation section on asynchronous Javascript calls for more details.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the requested `YModule` object',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['SerialPort']['get_protocol']={syn:'Returns the type of protocol used over the serial line, as a string.',lib:'serialport.get_protocol()',pro:'function get_protocol()',cmt:'

Returns the type of protocol used over the serial line, as a string. Possible values are \x22Line\x22 for ASCII messages separated by CR and/or LF, \x22Frame:[timeout]ms\x22 for binary messages separated by a delay time, \x22Modbus-ASCII\x22 for MODBUS messages in ASCII mode, \x22Modbus-RTU\x22 for MODBUS messages in RTU mode, \x22Wiegand-ASCII\x22 for Wiegand messages in ASCII mode, \x22Wiegand-26\x22,\x22Wiegand-34\x22, etc for Wiegand messages in byte mode, \x22Char\x22 for a continuous ASCII stream or \x22Byte\x22 for a continuous binary stream.

',ret:'a string corresponding to the type of protocol used over the serial line, as a string',ext:'On failure, throws an exception or returns `Y_PROTOCOL_INVALID`.'}; doc['SerialPort']['get_rxCount']={syn:'Returns the total number of bytes received since last reset.',lib:'serialport.get_rxCount()',pro:'function get_rxCount()',cmt:'

Returns the total number of bytes received since last reset.

',ret:'an integer corresponding to the total number of bytes received since last reset',ext:'On failure, throws an exception or returns `Y_RXCOUNT_INVALID`.'}; doc['SerialPort']['get_rxMsgCount']={syn:'Returns the total number of messages received since last reset.',lib:'serialport.get_rxMsgCount()',pro:'function get_rxMsgCount()',cmt:'

Returns the total number of messages received since last reset.

',ret:'an integer corresponding to the total number of messages received since last reset',ext:'On failure, throws an exception or returns `Y_RXMSGCOUNT_INVALID`.'}; doc['SerialPort']['get_serialMode']={syn:'Returns the serial port communication parameters, as a string such as \x229600,8N1\x22.',lib:'serialport.get_serialMode()',pro:'function get_serialMode()',cmt:'

Returns the serial port communication parameters, as a string such as \x229600,8N1\x22. The string includes the baud rate, the number of data bits, the parity, and the number of stop bits. An optional suffix is included if flow control is active: \x22CtsRts\x22 for hardware handshake, \x22XOnXOff\x22 for logical flow control and \x22Simplex\x22 for acquiring a shared bus using the RTS line (as used by some RS485 adapters for instance).

',ret:'a string corresponding to the serial port communication parameters, as a string such as \x229600,8N1\x22',ext:'On failure, throws an exception or returns `Y_SERIALMODE_INVALID`.'}; doc['SerialPort']['get_startupJob']={syn:'Returns the job file to use when the device is powered on.',lib:'serialport.get_startupJob()',pro:'function get_startupJob()',cmt:'

Returns the job file to use when the device is powered on.

',ret:'a string corresponding to the job file to use when the device is powered on',ext:'On failure, throws an exception or returns `Y_STARTUPJOB_INVALID`.'}; doc['SerialPort']['get_txCount']={syn:'Returns the total number of bytes transmitted since last reset.',lib:'serialport.get_txCount()',pro:'function get_txCount()',cmt:'

Returns the total number of bytes transmitted since last reset.

',ret:'an integer corresponding to the total number of bytes transmitted since last reset',ext:'On failure, throws an exception or returns `Y_TXCOUNT_INVALID`.'}; doc['SerialPort']['get_txMsgCount']={syn:'Returns the total number of messages send since last reset.',lib:'serialport.get_txMsgCount()',pro:'function get_txMsgCount()',cmt:'

Returns the total number of messages send since last reset.

',ret:'an integer corresponding to the total number of messages send since last reset',ext:'On failure, throws an exception or returns `Y_TXMSGCOUNT_INVALID`.'}; doc['SerialPort']['get_userData']={syn:'Returns the value of the userData attribute, as previously stored using method `set_userData`.',lib:'serialport.get_userData()',pro:'function get_userData()',cmt:'

Returns the value of the userData attribute, as previously stored using method `set_userData`. This attribute is never touched directly by the API, and is at disposal of the caller to store a context.

',ret:'the object stored previously by the caller.'}; doc['SerialPort']['get_voltageLevel']={syn:'Returns the voltage level used on the serial line.',lib:'serialport.get_voltageLevel()',pro:'function get_voltageLevel()',cmt:'

Returns the voltage level used on the serial line.

',ret:'a value among `Y_VOLTAGELEVEL_OFF`, `Y_VOLTAGELEVEL_TTL3V`, `Y_VOLTAGELEVEL_TTL3VR`, `Y_VOLTAGELEVEL_TTL5V`, `Y_VOLTAGELEVEL_TTL5VR`, `Y_VOLTAGELEVEL_RS232` and `Y_VOLTAGELEVEL_RS485` corresponding to the voltage level used on the serial line',ext:'On failure, throws an exception or returns `Y_VOLTAGELEVEL_INVALID`.'}; doc['SerialPort']['isOnline']={syn:'Checks if the serial port is currently reachable, without raising any error.',lib:'serialport.isOnline()',pro:'function isOnline()',cmt:'

Checks if the serial port is currently reachable, without raising any error. If there is a cached value for the serial port in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the serial port.

',ret:'`true` if the serial port can be reached, and `false` otherwise'}; doc['SerialPort']['isOnline_async']={syn:'Checks if the serial port is currently reachable, without raising any error (asynchronous version).',lib:'serialport.isOnline_async()',pro:'function isOnline_async(callback, context)',cmt:'

Checks if the serial port is currently reachable, without raising any error (asynchronous version). If there is a cached value for the serial port in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the requested function.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the boolean result',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['SerialPort']['load']={syn:'Preloads the serial port cache with a specified validity duration.',lib:'serialport.load()',pro:'function load(msValidity)',cmt:'

Preloads the serial port cache with a specified validity duration. By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network traffic for instance.

',par:{msValidity:'an integer corresponding to the validity attributed to the loaded function parameters, in milliseconds'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['SerialPort']['loadAttribute']={syn:'Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.',lib:'serialport.loadAttribute()',pro:'function loadAttribute(attrName)',cmt:'

Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.

',par:{attrName:'the name of the requested attribute'},ret:'a string with the value of the the attribute',ext:'On failure, throws an exception or returns an empty string.'}; doc['SerialPort']['load_async']={syn:'Preloads the serial port cache with a specified validity duration (asynchronous version).',lib:'serialport.load_async()',pro:'function load_async(msValidity, callback, context)',cmt:'

Preloads the serial port cache with a specified validity duration (asynchronous version). By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network trafic for instance.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{msValidity:'an integer corresponding to the validity of the loaded function parameters, in milliseconds',callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the error code (or `YAPI_SUCCESS`)',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['SerialPort']['modbusReadBits']={syn:'Reads one or more contiguous internal bits (or coil status) from a MODBUS serial device.',lib:'serialport.modbusReadBits()',pro:'function modbusReadBits(slaveNo, pduAddr, nBits)',cmt:'

Reads one or more contiguous internal bits (or coil status) from a MODBUS serial device. This method uses the MODBUS function code 0x01 (Read Coils).

',par:{slaveNo:'the address of the slave MODBUS device to query',pduAddr:'the relative address of the first bit/coil to read (zero-based)',nBits:'the number of bits/coils to read'},ret:'a vector of integers, each corresponding to one bit.',ext:'On failure, throws an exception or returns an empty array.'}; doc['SerialPort']['modbusReadInputBits']={syn:'Reads one or more contiguous input bits (or discrete inputs) from a MODBUS serial device.',lib:'serialport.modbusReadInputBits()',pro:'function modbusReadInputBits(slaveNo, pduAddr, nBits)',cmt:'

Reads one or more contiguous input bits (or discrete inputs) from a MODBUS serial device. This method uses the MODBUS function code 0x02 (Read Discrete Inputs).

',par:{slaveNo:'the address of the slave MODBUS device to query',pduAddr:'the relative address of the first bit/input to read (zero-based)',nBits:'the number of bits/inputs to read'},ret:'a vector of integers, each corresponding to one bit.',ext:'On failure, throws an exception or returns an empty array.'}; doc['SerialPort']['modbusReadInputRegisters']={syn:'Reads one or more contiguous input registers (read-only registers) from a MODBUS serial device.',lib:'serialport.modbusReadInputRegisters()',pro:'function modbusReadInputRegisters(slaveNo, pduAddr, nWords)',cmt:'

Reads one or more contiguous input registers (read-only registers) from a MODBUS serial device. This method uses the MODBUS function code 0x04 (Read Input Registers).

',par:{slaveNo:'the address of the slave MODBUS device to query',pduAddr:'the relative address of the first input register to read (zero-based)',nWords:'the number of input registers to read'},ret:'a vector of integers, each corresponding to one 16-bit input value.',ext:'On failure, throws an exception or returns an empty array.'}; doc['SerialPort']['modbusReadRegisters']={syn:'Reads one or more contiguous internal registers (holding registers) from a MODBUS serial device.',lib:'serialport.modbusReadRegisters()',pro:'function modbusReadRegisters(slaveNo, pduAddr, nWords)',cmt:'

Reads one or more contiguous internal registers (holding registers) from a MODBUS serial device. This method uses the MODBUS function code 0x03 (Read Holding Registers).

',par:{slaveNo:'the address of the slave MODBUS device to query',pduAddr:'the relative address of the first holding register to read (zero-based)',nWords:'the number of holding registers to read'},ret:'a vector of integers, each corresponding to one 16-bit register value.',ext:'On failure, throws an exception or returns an empty array.'}; doc['SerialPort']['modbusWriteAndReadRegisters']={syn:'Sets several contiguous internal registers (holding registers) on a MODBUS serial device, then performs a contiguous read of a set of (possibly different) internal registers.',lib:'serialport.modbusWriteAndReadRegisters()',pro:'function modbusWriteAndReadRegisters(slaveNo, pduWriteAddr, values, pduReadAddr, nReadWords)',cmt:'

Sets several contiguous internal registers (holding registers) on a MODBUS serial device, then performs a contiguous read of a set of (possibly different) internal registers. This method uses the MODBUS function code 0x17 (Read/Write Multiple Registers).

',par:{slaveNo:'the address of the slave MODBUS device to drive',pduWriteAddr:'the relative address of the first internal register to set (zero-based)',values:'the vector of 16 bit values to set',pduReadAddr:'the relative address of the first internal register to read (zero-based)',nReadWords:'the number of 16 bit values to read'},ret:'a vector of integers, each corresponding to one 16-bit register value read.',ext:'On failure, throws an exception or returns an empty array.'}; doc['SerialPort']['modbusWriteBit']={syn:'Sets a single internal bit (or coil) on a MODBUS serial device.',lib:'serialport.modbusWriteBit()',pro:'function modbusWriteBit(slaveNo, pduAddr, value)',cmt:'

Sets a single internal bit (or coil) on a MODBUS serial device. This method uses the MODBUS function code 0x05 (Write Single Coil).

',par:{slaveNo:'the address of the slave MODBUS device to drive',pduAddr:'the relative address of the bit/coil to set (zero-based)',value:'the value to set (0 for OFF state, non-zero for ON state)'},ret:'the number of bits/coils affected on the device (1)',ext:'On failure, throws an exception or returns zero.'}; doc['SerialPort']['modbusWriteBits']={syn:'Sets several contiguous internal bits (or coils) on a MODBUS serial device.',lib:'serialport.modbusWriteBits()',pro:'function modbusWriteBits(slaveNo, pduAddr, bits)',cmt:'

Sets several contiguous internal bits (or coils) on a MODBUS serial device. This method uses the MODBUS function code 0x0f (Write Multiple Coils).

',par:{slaveNo:'the address of the slave MODBUS device to drive',pduAddr:'the relative address of the first bit/coil to set (zero-based)',bits:'the vector of bits to be set (one integer per bit)'},ret:'the number of bits/coils affected on the device',ext:'On failure, throws an exception or returns zero.'}; doc['SerialPort']['modbusWriteRegister']={syn:'Sets a single internal register (or holding register) on a MODBUS serial device.',lib:'serialport.modbusWriteRegister()',pro:'function modbusWriteRegister(slaveNo, pduAddr, value)',cmt:'

Sets a single internal register (or holding register) on a MODBUS serial device. This method uses the MODBUS function code 0x06 (Write Single Register).

',par:{slaveNo:'the address of the slave MODBUS device to drive',pduAddr:'the relative address of the register to set (zero-based)',value:'the 16 bit value to set'},ret:'the number of registers affected on the device (1)',ext:'On failure, throws an exception or returns zero.'}; doc['SerialPort']['modbusWriteRegisters']={syn:'Sets several contiguous internal registers (or holding registers) on a MODBUS serial device.',lib:'serialport.modbusWriteRegisters()',pro:'function modbusWriteRegisters(slaveNo, pduAddr, values)',cmt:'

Sets several contiguous internal registers (or holding registers) on a MODBUS serial device. This method uses the MODBUS function code 0x10 (Write Multiple Registers).

',par:{slaveNo:'the address of the slave MODBUS device to drive',pduAddr:'the relative address of the first internal register to set (zero-based)',values:'the vector of 16 bit values to set'},ret:'the number of registers affected on the device',ext:'On failure, throws an exception or returns zero.'}; doc['SerialPort']['muteValueCallbacks']={syn:'Disables the propagation of every new advertised value to the parent hub.',lib:'serialport.muteValueCallbacks()',pro:'function muteValueCallbacks()',cmt:'

Disables the propagation of every new advertised value to the parent hub. You can use this function to save bandwidth and CPU on computers with limited resources, or to prevent unwanted invocations of the HTTP callback. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['SerialPort']['nextSerialPort']={syn:'Continues the enumeration of serial ports started using `yFirstSerialPort()`.',lib:'serialport.nextSerialPort()',pro:'function nextSerialPort()',cmt:'

Continues the enumeration of serial ports started using `yFirstSerialPort()`.

',ret:'a pointer to a `YSerialPort` object, corresponding to a serial port currently online, or a `null` pointer if there are no more serial ports to enumerate.'}; doc['SerialPort']['queryLine']={syn:'Sends a text line query to the serial port, and reads the reply, if any.',lib:'serialport.queryLine()',pro:'function queryLine(query, maxWait)',cmt:'

Sends a text line query to the serial port, and reads the reply, if any. This function is intended to be used when the serial port is configured for \x27Line\x27 protocol.

',par:{query:'the line query to send (without CR/LF)',maxWait:'the maximum number of milliseconds to wait for a reply.'},ret:'the next text line received after sending the text query, as a string. Additional lines can be obtained by calling readLine or readMessages.',ext:'On failure, throws an exception or returns an empty array.'}; doc['SerialPort']['queryMODBUS']={syn:'Sends a message to a specified MODBUS slave connected to the serial port, and reads the reply, if any.',lib:'serialport.queryMODBUS()',pro:'function queryMODBUS(slaveNo, pduBytes)',cmt:'

Sends a message to a specified MODBUS slave connected to the serial port, and reads the reply, if any. The message is the PDU, provided as a vector of bytes.

',par:{slaveNo:'the address of the slave MODBUS device to query',pduBytes:'the message to send (PDU), as a vector of bytes. The first byte of the PDU is the MODBUS function code.'},ret:'the received reply, as a vector of bytes.',ext:'On failure, throws an exception or returns an empty array (or a MODBUS error reply).'}; doc['SerialPort']['readArray']={syn:'Reads data from the receive buffer as a list of bytes, starting at current stream position.',lib:'serialport.readArray()',pro:'function readArray(nChars)',cmt:'

Reads data from the receive buffer as a list of bytes, starting at current stream position. If data at current stream position is not available anymore in the receive buffer, the function performs a short read.

',par:{nChars:'the maximum number of bytes to read'},ret:'a sequence of bytes with receive buffer contents',ext:'On failure, throws an exception or returns a negative error code.'}; doc['SerialPort']['readBin']={syn:'Reads data from the receive buffer as a binary buffer, starting at current stream position.',lib:'serialport.readBin()',pro:'function readBin(nChars)',cmt:'

Reads data from the receive buffer as a binary buffer, starting at current stream position. If data at current stream position is not available anymore in the receive buffer, the function performs a short read.

',par:{nChars:'the maximum number of bytes to read'},ret:'a binary object with receive buffer contents',ext:'On failure, throws an exception or returns a negative error code.'}; doc['SerialPort']['readByte']={syn:'Reads one byte from the receive buffer, starting at current stream position.',lib:'serialport.readByte()',pro:'function readByte()',cmt:'

Reads one byte from the receive buffer, starting at current stream position. If data at current stream position is not available anymore in the receive buffer, or if there is no data available yet, the function returns YAPI_NO_MORE_DATA.

',ret:'the next byte',ext:'On failure, throws an exception or returns a negative error code.'}; doc['SerialPort']['readHex']={syn:'Reads data from the receive buffer as a hexadecimal string, starting at current stream position.',lib:'serialport.readHex()',pro:'function readHex(nBytes)',cmt:'

Reads data from the receive buffer as a hexadecimal string, starting at current stream position. If data at current stream position is not available anymore in the receive buffer, the function performs a short read.

',par:{nBytes:'the maximum number of bytes to read'},ret:'a string with receive buffer contents, encoded in hexadecimal',ext:'On failure, throws an exception or returns a negative error code.'}; doc['SerialPort']['readLine']={syn:'Reads a single line (or message) from the receive buffer, starting at current stream position.',lib:'serialport.readLine()',pro:'function readLine()',cmt:'

Reads a single line (or message) from the receive buffer, starting at current stream position. This function is intended to be used when the serial port is configured for a message protocol, such as \x27Line\x27 mode or frame protocols.

If data at current stream position is not available anymore in the receive buffer, the function returns the oldest available line and moves the stream position just after. If no new full line is received, the function returns an empty line.

',ret:'a string with a single line of text',ext:'On failure, throws an exception or returns a negative error code.'}; doc['SerialPort']['readMessages']={syn:'Searches for incoming messages in the serial port receive buffer matching a given pattern, starting at current position.',lib:'serialport.readMessages()',pro:'function readMessages(pattern, maxWait)',cmt:'

Searches for incoming messages in the serial port receive buffer matching a given pattern, starting at current position. This function will only compare and return printable characters in the message strings. Binary protocols are handled as hexadecimal strings.

The search returns all messages matching the expression provided as argument in the buffer. If no matching message is found, the search waits for one up to the specified maximum timeout (in milliseconds).

',par:{pattern:'a limited regular expression describing the expected message format, or an empty string if all messages should be returned (no filtering). When using binary protocols, the format applies to the hexadecimal representation of the message.',maxWait:'the maximum number of milliseconds to wait for a message if none is found in the receive buffer.'},ret:'an array of strings containing the messages found, if any. Binary messages are converted to hexadecimal representation.',ext:'On failure, throws an exception or returns an empty array.'}; doc['SerialPort']['readStr']={syn:'Reads data from the receive buffer as a string, starting at current stream position.',lib:'serialport.readStr()',pro:'function readStr(nChars)',cmt:'

Reads data from the receive buffer as a string, starting at current stream position. If data at current stream position is not available anymore in the receive buffer, the function performs a short read.

',par:{nChars:'the maximum number of characters to read'},ret:'a string with receive buffer contents',ext:'On failure, throws an exception or returns a negative error code.'}; doc['SerialPort']['read_avail']={syn:'Returns the number of bytes available to read in the input buffer starting from the current absolute stream position pointer of the API object.',lib:'serialport.read_avail()',pro:'function read_avail()',cmt:'

Returns the number of bytes available to read in the input buffer starting from the current absolute stream position pointer of the API object.

',ret:'the number of bytes available to read'}; doc['SerialPort']['read_seek']={syn:'Changes the current internal stream position to the specified value.',lib:'serialport.read_seek()',pro:'function read_seek(absPos)',cmt:'

Changes the current internal stream position to the specified value. This function does not affect the device, it only changes the value stored in the API object for the next read operations.

',par:{absPos:'the absolute position index for next read operations.'},ret:'nothing.'}; doc['SerialPort']['read_tell']={syn:'Returns the current absolute stream position pointer of the API object.',lib:'serialport.read_tell()',pro:'function read_tell()',cmt:'

Returns the current absolute stream position pointer of the API object.

',ret:'the absolute position index for next read operations.'}; doc['SerialPort']['registerValueCallback']={syn:'Registers the callback function that is invoked on every change of advertised value.',lib:'serialport.registerValueCallback()',pro:'function registerValueCallback(callback)',cmt:'

Registers the callback function that is invoked on every change of advertised value. The callback is invoked only during the execution of `ySleep` or `yHandleEvents`. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a null pointer as argument.

',par:{callback:'the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and the character string describing the new advertised value.'}}; doc['SerialPort']['reset']={syn:'Clears the serial port buffer and resets counters to zero.',lib:'serialport.reset()',pro:'function reset()',cmt:'

Clears the serial port buffer and resets counters to zero.

',ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['SerialPort']['selectJob']={syn:'Load and start processing the specified job file.',lib:'serialport.selectJob()',pro:'function selectJob(jobfile)',cmt:'

Load and start processing the specified job file. The file must have been previously created using the user interface or uploaded on the device filesystem using the `uploadJob()` function.

',par:{jobfile:'name of the job file (on the device filesystem)'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['SerialPort']['set_RTS']={syn:'Manually sets the state of the RTS line.',lib:'serialport.set_RTS()',pro:'function set_RTS(val)',cmt:'

Manually sets the state of the RTS line. This function has no effect when hardware handshake is enabled, as the RTS line is driven automatically.

',par:{val:'1 to turn RTS on, 0 to turn RTS off'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['SerialPort']['set_currentJob']={syn:'Changes the job to use when the device is powered on.',lib:'serialport.set_currentJob()',pro:'function set_currentJob(newval)',cmt:'

Changes the job to use when the device is powered on. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',par:{newval:'a string corresponding to the job to use when the device is powered on'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['SerialPort']['set_logicalName']={syn:'Changes the logical name of the serial port.',lib:'serialport.set_logicalName()',pro:'function set_logicalName(newval)',cmt:'

Changes the logical name of the serial port. You can use `yCheckLogicalName()` prior to this call to make sure that your parameter is valid. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',par:{newval:'a string corresponding to the logical name of the serial port.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['SerialPort']['set_protocol']={syn:'Changes the type of protocol used over the serial line.',lib:'serialport.set_protocol()',pro:'function set_protocol(newval)',cmt:'

Changes the type of protocol used over the serial line. Possible values are \x22Line\x22 for ASCII messages separated by CR and/or LF, \x22Frame:[timeout]ms\x22 for binary messages separated by a delay time, \x22Modbus-ASCII\x22 for MODBUS messages in ASCII mode, \x22Modbus-RTU\x22 for MODBUS messages in RTU mode, \x22Wiegand-ASCII\x22 for Wiegand messages in ASCII mode, \x22Wiegand-26\x22,\x22Wiegand-34\x22, etc for Wiegand messages in byte mode, \x22Char\x22 for a continuous ASCII stream or \x22Byte\x22 for a continuous binary stream. The suffix \x22/[wait]ms\x22 can be added to reduce the transmit rate so that there is always at lest the specified number of milliseconds between each bytes sent.

',par:{newval:'a string corresponding to the type of protocol used over the serial line'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['SerialPort']['set_serialMode']={syn:'Changes the serial port communication parameters, with a string such as \x229600,8N1\x22.',lib:'serialport.set_serialMode()',pro:'function set_serialMode(newval)',cmt:'

Changes the serial port communication parameters, with a string such as \x229600,8N1\x22. The string includes the baud rate, the number of data bits, the parity, and the number of stop bits. An optional suffix can be added to enable flow control: \x22CtsRts\x22 for hardware handshake, \x22XOnXOff\x22 for logical flow control and \x22Simplex\x22 for acquiring a shared bus using the RTS line (as used by some RS485 adapters for instance).

',par:{newval:'a string corresponding to the serial port communication parameters, with a string such as \x229600,8N1\x22'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['SerialPort']['set_startupJob']={syn:'Changes the job to use when the device is powered on.',lib:'serialport.set_startupJob()',pro:'function set_startupJob(newval)',cmt:'

Changes the job to use when the device is powered on. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',par:{newval:'a string corresponding to the job to use when the device is powered on'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['SerialPort']['set_userData']={syn:'Stores a user context provided as argument in the userData attribute of the function.',lib:'serialport.set_userData()',pro:'function set_userData(data)',cmt:'

Stores a user context provided as argument in the userData attribute of the function. This attribute is never touched by the API, and is at disposal of the caller to store a context.

',par:{data:'any kind of object to be stored'}}; doc['SerialPort']['set_voltageLevel']={syn:'Changes the voltage type used on the serial line.',lib:'serialport.set_voltageLevel()',pro:'function set_voltageLevel(newval)',cmt:'

Changes the voltage type used on the serial line. Valid values will depend on the Yoctopuce device model featuring the serial port feature. Check your device documentation to find out which values are valid for that specific model. \x09 Trying to set an invalid value will have no effect.

',par:{newval:'a value among `Y_VOLTAGELEVEL_OFF`, `Y_VOLTAGELEVEL_TTL3V`, `Y_VOLTAGELEVEL_TTL3VR`, `Y_VOLTAGELEVEL_TTL5V`, `Y_VOLTAGELEVEL_TTL5VR`, `Y_VOLTAGELEVEL_RS232` and `Y_VOLTAGELEVEL_RS485` corresponding to the voltage type used on the serial line'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['SerialPort']['snoopMessages']={syn:'Retrieves messages (both direction) in the serial port buffer, starting at current position.',lib:'serialport.snoopMessages()',pro:'function snoopMessages(maxWait)',cmt:'

Retrieves messages (both direction) in the serial port buffer, starting at current position. This function will only compare and return printable characters in the message strings. Binary protocols are handled as hexadecimal strings.

If no message is found, the search waits for one up to the specified maximum timeout (in milliseconds).

',par:{maxWait:'the maximum number of milliseconds to wait for a message if none is found in the receive buffer.'},ret:'an array of YSnoopingRecord objects containing the messages found, if any. Binary messages are converted to hexadecimal representation.',ext:'On failure, throws an exception or returns an empty array.'}; doc['SerialPort']['unmuteValueCallbacks']={syn:'Re-enables the propagation of every new advertised value to the parent hub.',lib:'serialport.unmuteValueCallbacks()',pro:'function unmuteValueCallbacks()',cmt:'

Re-enables the propagation of every new advertised value to the parent hub. This function reverts the effect of a previous call to `muteValueCallbacks()`. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['SerialPort']['uploadJob']={syn:'Saves the job definition string (JSON data) into a job file.',lib:'serialport.uploadJob()',pro:'function uploadJob(jobfile, jsonDef)',cmt:'

Saves the job definition string (JSON data) into a job file. The job file can be later enabled using `selectJob()`.

',par:{jobfile:'name of the job file to save on the device filesystem',jsonDef:'a string containing a JSON definition of the job'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['SerialPort']['wait_async']={syn:'Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function.',lib:'serialport.wait_async()',pro:'function wait_async(callback, context)',cmt:'

Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function. The callback function can therefore freely issue synchronous or asynchronous commands, without risking to block the Javascript VM.

',par:{callback:'callback function that is invoked when all pending commands on the module are completed. The callback function receives two arguments: the caller-specific context object and the receiving function object.',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing.'}; doc['SerialPort']['writeArray']={syn:'Sends a byte sequence (provided as a list of bytes) to the serial port.',lib:'serialport.writeArray()',pro:'function writeArray(byteList)',cmt:'

Sends a byte sequence (provided as a list of bytes) to the serial port.

',par:{byteList:'a list of byte codes'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['SerialPort']['writeBin']={syn:'Sends a binary buffer to the serial port, as is.',lib:'serialport.writeBin()',pro:'function writeBin(buff)',cmt:'

Sends a binary buffer to the serial port, as is.

',par:{buff:'the binary buffer to send'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['SerialPort']['writeByte']={syn:'Sends a single byte to the serial port.',lib:'serialport.writeByte()',pro:'function writeByte(code)',cmt:'

Sends a single byte to the serial port.

',par:{code:'the byte to send'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['SerialPort']['writeHex']={syn:'Sends a byte sequence (provided as a hexadecimal string) to the serial port.',lib:'serialport.writeHex()',pro:'function writeHex(hexString)',cmt:'

Sends a byte sequence (provided as a hexadecimal string) to the serial port.

',par:{hexString:'a string of hexadecimal byte codes'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['SerialPort']['writeLine']={syn:'Sends an ASCII string to the serial port, followed by a line break (CR LF).',lib:'serialport.writeLine()',pro:'function writeLine(text)',cmt:'

Sends an ASCII string to the serial port, followed by a line break (CR LF).

',par:{text:'the text string to send'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['SerialPort']['writeMODBUS']={syn:'Sends a MODBUS message (provided as a hexadecimal string) to the serial port.',lib:'serialport.writeMODBUS()',pro:'function writeMODBUS(hexString)',cmt:'

Sends a MODBUS message (provided as a hexadecimal string) to the serial port. The message must start with the slave address. The MODBUS CRC/LRC is automatically added by the function. This function does not wait for a reply.

',par:{hexString:'a hexadecimal message string, including device address but no CRC/LRC'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['SerialPort']['writeStr']={syn:'Sends an ASCII string to the serial port, as is.',lib:'serialport.writeStr()',pro:'function writeStr(text)',cmt:'

Sends an ASCII string to the serial port, as is.

',par:{text:'the text string to send'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; //--- (end of generated code: SerialPort) //--- (generated code: PwmInput) doc['PwmInput']={'':{syn:'PwmInput function interface',inc:'<script type='text/javascript' src='yocto_pwminput.js'></script>',cmt:'

The Yoctopuce class YPwmInput allows you to read and configure Yoctopuce PWM sensors. It inherits from YSensor class the core functions to read measurements, to register callback functions, to access the autonomous datalogger. This class adds the ability to configure the signal parameter used to transmit information: the duty cycle, the frequency or the pulse width.

'}}; doc['PwmInput']['FindPwmInput']={syn:'Retrieves a PWM input for a given identifier.',lib:'YPwmInput.FindPwmInput()',pro:'function FindPwmInput(func)',cmt:'

Retrieves a PWM input for a given identifier. The identifier can be specified using several formats:

- FunctionLogicalName
- ModuleSerialNumber.FunctionIdentifier
- ModuleSerialNumber.FunctionLogicalName
- ModuleLogicalName.FunctionIdentifier
- ModuleLogicalName.FunctionLogicalName

This function does not require that the PWM input is online at the time it is invoked. The returned object is nevertheless valid. Use the method `YPwmInput.isOnline()` to test if the PWM input is indeed online at a given time. In case of ambiguity when looking for a PWM input by logical name, no error is notified: the first instance found is returned. The search is performed first by hardware name, then by logical name.

If a call to this object\x27s is_online() method returns FALSE although you are certain that the matching device is plugged, make sure that you did call registerHub() at application initialization time.

',par:{func:'a string that uniquely characterizes the PWM input'},ret:'a `YPwmInput` object allowing you to drive the PWM input.'}; doc['PwmInput']['FirstPwmInput']={syn:'Starts the enumeration of PWM inputs currently accessible.',lib:'YPwmInput.FirstPwmInput()',pro:'function FirstPwmInput()',cmt:'

Starts the enumeration of PWM inputs currently accessible. Use the method `YPwmInput.nextPwmInput()` to iterate on next PWM inputs.

',ret:'a pointer to a `YPwmInput` object, corresponding to the first PWM input currently online, or a `null` pointer if there are none.'}; doc['PwmInput']['calibrateFromPoints']={syn:'Configures error correction data points, in particular to compensate for a possible perturbation of the measure caused by an enclosure.',lib:'pwminput.calibrateFromPoints()',pro:'function calibrateFromPoints(rawValues, refValues)',cmt:'

Configures error correction data points, in particular to compensate for a possible perturbation of the measure caused by an enclosure. It is possible to configure up to five correction points. Correction points must be provided in ascending order, and be in the range of the sensor. The device will automatically perform a linear interpolation of the error correction between specified points. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

For more information on advanced capabilities to refine the calibration of sensors, please contact support@yoctopuce.com.

',par:{rawValues:'array of floating point numbers, corresponding to the raw values returned by the sensor for the correction points.',refValues:'array of floating point numbers, corresponding to the corrected values for the correction points.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['PwmInput']['clearCache']={syn:'Invalidates the cache.',lib:'pwminput.clearCache()',pro:'function clearCache()',cmt:'

Invalidates the cache. Invalidates the cache of the PWM input attributes. Forces the next call to get_xxx() or loadxxx() to use values that come from the device.

'}; doc['PwmInput']['describe']={syn:'Returns a short text that describes unambiguously the instance of the PWM input in the form `TYPE(NAME)=SERIAL.FUNCTIONID`.',lib:'pwminput.describe()',pro:'function describe()',cmt:'

Returns a short text that describes unambiguously the instance of the PWM input in the form `TYPE(NAME)=SERIAL.FUNCTIONID`. More precisely, `TYPE` is the type of the function, `NAME` it the name used for the first access to the function, `SERIAL` is the serial number of the module if the module is connected or `\x22unresolved\x22`, and `FUNCTIONID` is the hardware identifier of the function if the module is connected. For example, this method returns `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1` if the module is already connected or `Relay(BadCustomeName.relay1)=unresolved` if the module has not yet been connected. This method does not trigger any USB or TCP transaction and can therefore be used in a debugger.

',ret:'a string that describes the PWM input (ex: `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1`)'}; doc['PwmInput']['get_advMode']={syn:'Returns the measuring mode used for the advertised value pushed to the parent hub.',lib:'pwminput.get_advMode()',pro:'function get_advMode()',cmt:'

Returns the measuring mode used for the advertised value pushed to the parent hub.

',ret:'a value among `Y_ADVMODE_IMMEDIATE`, `Y_ADVMODE_PERIOD_AVG`, `Y_ADVMODE_PERIOD_MIN` and `Y_ADVMODE_PERIOD_MAX` corresponding to the measuring mode used for the advertised value pushed to the parent hub',ext:'On failure, throws an exception or returns `Y_ADVMODE_INVALID`.'}; doc['PwmInput']['get_advertisedValue']={syn:'Returns the current value of the PWM input (no more than 6 characters).',lib:'pwminput.get_advertisedValue()',pro:'function get_advertisedValue()',cmt:'

Returns the current value of the PWM input (no more than 6 characters).

',ret:'a string corresponding to the current value of the PWM input (no more than 6 characters).',ext:'On failure, throws an exception or returns `Y_ADVERTISEDVALUE_INVALID`.'}; doc['PwmInput']['get_currentRawValue']={syn:'Returns the uncalibrated, unrounded raw value returned by the sensor, in HZ, as a floating point number.',lib:'pwminput.get_currentRawValue()',pro:'function get_currentRawValue()',cmt:'

Returns the uncalibrated, unrounded raw value returned by the sensor, in HZ, as a floating point number.

',ret:'a floating point number corresponding to the uncalibrated, unrounded raw value returned by the sensor, in HZ, as a floating point number',ext:'On failure, throws an exception or returns `Y_CURRENTRAWVALUE_INVALID`.'}; doc['PwmInput']['get_currentValue']={syn:'Returns the current value of the PwmInput feature as a floating point number.',lib:'pwminput.get_currentValue()',pro:'function get_currentValue()',cmt:'

Returns the current value of the PwmInput feature as a floating point number. Depending on the pwmReportMode setting, this can be the frequency, in Hz, the duty cycle in %, the pulse length in ms, etc.

',ret:'a floating point number corresponding to the current value of the PwmInput feature as a floating point number',ext:'On failure, throws an exception or returns `Y_CURRENTVALUE_INVALID`.'}; doc['PwmInput']['get_dataLogger']={syn:'Returns the YDatalogger object of the device hosting the sensor.',lib:'pwminput.get_dataLogger()',pro:'function get_dataLogger()',cmt:'

Returns the YDatalogger object of the device hosting the sensor. This method returns an object of class YDatalogger that can control global parameters of the data logger. The returned object should not be freed.

',ret:'an YDataLogger object or null on error.'}; doc['PwmInput']['get_debouncePeriod']={syn:'Returns the shortest expected pulse duration, in ms.',lib:'pwminput.get_debouncePeriod()',pro:'function get_debouncePeriod()',cmt:'

Returns the shortest expected pulse duration, in ms. Any shorter pulse will be automatically ignored (debounce).

',ret:'an integer corresponding to the shortest expected pulse duration, in ms',ext:'On failure, throws an exception or returns `Y_DEBOUNCEPERIOD_INVALID`.'}; doc['PwmInput']['get_dutyCycle']={syn:'Returns the PWM duty cycle, in per cents.',lib:'pwminput.get_dutyCycle()',pro:'function get_dutyCycle()',cmt:'

Returns the PWM duty cycle, in per cents.

',ret:'a floating point number corresponding to the PWM duty cycle, in per cents',ext:'On failure, throws an exception or returns `Y_DUTYCYCLE_INVALID`.'}; doc['PwmInput']['get_errorMessage']={syn:'Returns the error message of the latest error with the PWM input.',lib:'pwminput.get_errorMessage()',pro:'function get_errorMessage()',cmt:'

Returns the error message of the latest error with the PWM input. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a string corresponding to the latest error message that occured while using the PWM input object'}; doc['PwmInput']['get_errorType']={syn:'Returns the numerical error code of the latest error with the PWM input.',lib:'pwminput.get_errorType()',pro:'function get_errorType()',cmt:'

Returns the numerical error code of the latest error with the PWM input. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a number corresponding to the code of the latest error that occurred while using the PWM input object'}; doc['PwmInput']['get_frequency']={syn:'Returns the PWM frequency in Hz.',lib:'pwminput.get_frequency()',pro:'function get_frequency()',cmt:'

Returns the PWM frequency in Hz.

',ret:'a floating point number corresponding to the PWM frequency in Hz',ext:'On failure, throws an exception or returns `Y_FREQUENCY_INVALID`.'}; doc['PwmInput']['get_friendlyName']={syn:'Returns a global identifier of the PWM input in the format `MODULE_NAME.FUNCTION_NAME`.',lib:'pwminput.get_friendlyName()',pro:'function get_friendlyName()',cmt:'

Returns a global identifier of the PWM input in the format `MODULE_NAME.FUNCTION_NAME`. The returned string uses the logical names of the module and of the PWM input if they are defined, otherwise the serial number of the module and the hardware identifier of the PWM input (for example: `MyCustomName.relay1`)

',ret:'a string that uniquely identifies the PWM input using logical names (ex: `MyCustomName.relay1`)',ext:'On failure, throws an exception or returns `Y_FRIENDLYNAME_INVALID`.'}; doc['PwmInput']['get_functionDescriptor']={syn:'Returns a unique identifier of type `YFUN_DESCR` corresponding to the function.',lib:'pwminput.get_functionDescriptor()',pro:'function get_functionDescriptor()',cmt:'

Returns a unique identifier of type `YFUN_DESCR` corresponding to the function. This identifier can be used to test if two instances of `YFunction` reference the same physical function on the same physical device.

',ret:'an identifier of type `YFUN_DESCR`.',ext:'If the function has never been contacted, the returned value is `Y_FUNCTIONDESCRIPTOR_INVALID`.'}; doc['PwmInput']['get_functionId']={syn:'Returns the hardware identifier of the PWM input, without reference to the module.',lib:'pwminput.get_functionId()',pro:'function get_functionId()',cmt:'

Returns the hardware identifier of the PWM input, without reference to the module. For example `relay1`

',ret:'a string that identifies the PWM input (ex: `relay1`)',ext:'On failure, throws an exception or returns `Y_FUNCTIONID_INVALID`.'}; doc['PwmInput']['get_hardwareId']={syn:'Returns the unique hardware identifier of the PWM input in the form `SERIAL.FUNCTIONID`.',lib:'pwminput.get_hardwareId()',pro:'function get_hardwareId()',cmt:'

Returns the unique hardware identifier of the PWM input in the form `SERIAL.FUNCTIONID`. The unique hardware identifier is composed of the device serial number and of the hardware identifier of the PWM input (for example `RELAYLO1-123456.relay1`).

',ret:'a string that uniquely identifies the PWM input (ex: `RELAYLO1-123456.relay1`)',ext:'On failure, throws an exception or returns `Y_HARDWAREID_INVALID`.'}; doc['PwmInput']['get_highestValue']={syn:'Returns the maximal value observed for the PWM since the device was started.',lib:'pwminput.get_highestValue()',pro:'function get_highestValue()',cmt:'

Returns the maximal value observed for the PWM since the device was started. Can be reset to an arbitrary value thanks to set_highestValue().

',ret:'a floating point number corresponding to the maximal value observed for the PWM since the device was started',ext:'On failure, throws an exception or returns `Y_HIGHESTVALUE_INVALID`.'}; doc['PwmInput']['get_logFrequency']={syn:'Returns the datalogger recording frequency for this function, or \x22OFF\x22 when measures are not stored in the data logger flash memory.',lib:'pwminput.get_logFrequency()',pro:'function get_logFrequency()',cmt:'

Returns the datalogger recording frequency for this function, or \x22OFF\x22 when measures are not stored in the data logger flash memory.

',ret:'a string corresponding to the datalogger recording frequency for this function, or \x22OFF\x22 when measures are not stored in the data logger flash memory',ext:'On failure, throws an exception or returns `Y_LOGFREQUENCY_INVALID`.'}; doc['PwmInput']['get_logicalName']={syn:'Returns the logical name of the PWM input.',lib:'pwminput.get_logicalName()',pro:'function get_logicalName()',cmt:'

Returns the logical name of the PWM input.

',ret:'a string corresponding to the logical name of the PWM input.',ext:'On failure, throws an exception or returns `Y_LOGICALNAME_INVALID`.'}; doc['PwmInput']['get_lowestValue']={syn:'Returns the minimal value observed for the PWM since the device was started.',lib:'pwminput.get_lowestValue()',pro:'function get_lowestValue()',cmt:'

Returns the minimal value observed for the PWM since the device was started. Can be reset to an arbitrary value thanks to set_lowestValue().

',ret:'a floating point number corresponding to the minimal value observed for the PWM since the device was started',ext:'On failure, throws an exception or returns `Y_LOWESTVALUE_INVALID`.'}; doc['PwmInput']['get_module']={syn:'Gets the `YModule` object for the device on which the function is located.',lib:'pwminput.get_module()',pro:'function get_module()',cmt:'

Gets the `YModule` object for the device on which the function is located. If the function cannot be located on any module, the returned instance of `YModule` is not shown as on-line.

',ret:'an instance of `YModule`'}; doc['PwmInput']['get_module_async']={syn:'Gets the `YModule` object for the device on which the function is located (asynchronous version).',lib:'pwminput.get_module_async()',pro:'function get_module_async(callback, context)',cmt:'

Gets the `YModule` object for the device on which the function is located (asynchronous version). If the function cannot be located on any module, the returned `YModule` object does not show as on-line.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking Firefox javascript VM that does not implement context switching during blocking I/O calls. See the documentation section on asynchronous Javascript calls for more details.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the requested `YModule` object',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['PwmInput']['get_period']={syn:'Returns the PWM period in milliseconds.',lib:'pwminput.get_period()',pro:'function get_period()',cmt:'

Returns the PWM period in milliseconds.

',ret:'a floating point number corresponding to the PWM period in milliseconds',ext:'On failure, throws an exception or returns `Y_PERIOD_INVALID`.'}; doc['PwmInput']['get_pulseCounter']={syn:'Returns the pulse counter value.',lib:'pwminput.get_pulseCounter()',pro:'function get_pulseCounter()',cmt:'

Returns the pulse counter value. Actually that counter is incremented twice per period. That counter is limited to 1 billion.

',ret:'an integer corresponding to the pulse counter value',ext:'On failure, throws an exception or returns `Y_PULSECOUNTER_INVALID`.'}; doc['PwmInput']['get_pulseDuration']={syn:'Returns the PWM pulse length in milliseconds, as a floating point number.',lib:'pwminput.get_pulseDuration()',pro:'function get_pulseDuration()',cmt:'

Returns the PWM pulse length in milliseconds, as a floating point number.

',ret:'a floating point number corresponding to the PWM pulse length in milliseconds, as a floating point number',ext:'On failure, throws an exception or returns `Y_PULSEDURATION_INVALID`.'}; doc['PwmInput']['get_pulseTimer']={syn:'Returns the timer of the pulses counter (ms).',lib:'pwminput.get_pulseTimer()',pro:'function get_pulseTimer()',cmt:'

Returns the timer of the pulses counter (ms).

',ret:'an integer corresponding to the timer of the pulses counter (ms)',ext:'On failure, throws an exception or returns `Y_PULSETIMER_INVALID`.'}; doc['PwmInput']['get_pwmReportMode']={syn:'Returns the parameter (frequency/duty cycle, pulse width, edges count) returned by the get_currentValue function and callbacks.',lib:'pwminput.get_pwmReportMode()',pro:'function get_pwmReportMode()',cmt:'

Returns the parameter (frequency/duty cycle, pulse width, edges count) returned by the get_currentValue function and callbacks. Attention

',ret:'a value among `Y_PWMREPORTMODE_PWM_DUTYCYCLE`, `Y_PWMREPORTMODE_PWM_FREQUENCY`, `Y_PWMREPORTMODE_PWM_PULSEDURATION`, `Y_PWMREPORTMODE_PWM_EDGECOUNT`, `Y_PWMREPORTMODE_PWM_PULSECOUNT`, `Y_PWMREPORTMODE_PWM_CPS`, `Y_PWMREPORTMODE_PWM_CPM` and `Y_PWMREPORTMODE_PWM_STATE` corresponding to the parameter (frequency/duty cycle, pulse width, edges count) returned by the get_currentValue function and callbacks',ext:'On failure, throws an exception or returns `Y_PWMREPORTMODE_INVALID`.'}; doc['PwmInput']['get_recordedData']={syn:'Retrieves a DataSet object holding historical data for this sensor, for a specified time interval.',lib:'pwminput.get_recordedData()',pro:'function get_recordedData(startTime, endTime)',cmt:'

Retrieves a DataSet object holding historical data for this sensor, for a specified time interval. The measures will be retrieved from the data logger, which must have been turned on at the desired time. See the documentation of the DataSet class for information on how to get an overview of the recorded data, and how to load progressively a large set of measures from the data logger.

This function only works if the device uses a recent firmware, as DataSet objects are not supported by firmwares older than version 13000.

',par:{startTime:'the start of the desired measure time interval, as a Unix timestamp, i.e. the number of seconds since January 1, 1970 UTC. The special value 0 can be used to include any meaasure, without initial limit.',endTime:'the end of the desired measure time interval, as a Unix timestamp, i.e. the number of seconds since January 1, 1970 UTC. The special value 0 can be used to include any meaasure, without ending limit.'},ret:'an instance of YDataSet, providing access to historical data. Past measures can be loaded progressively using methods from the YDataSet object.'}; doc['PwmInput']['get_reportFrequency']={syn:'Returns the timed value notification frequency, or \x22OFF\x22 if timed value notifications are disabled for this function.',lib:'pwminput.get_reportFrequency()',pro:'function get_reportFrequency()',cmt:'

Returns the timed value notification frequency, or \x22OFF\x22 if timed value notifications are disabled for this function.

',ret:'a string corresponding to the timed value notification frequency, or \x22OFF\x22 if timed value notifications are disabled for this function',ext:'On failure, throws an exception or returns `Y_REPORTFREQUENCY_INVALID`.'}; doc['PwmInput']['get_resolution']={syn:'Returns the resolution of the measured values.',lib:'pwminput.get_resolution()',pro:'function get_resolution()',cmt:'

Returns the resolution of the measured values. The resolution corresponds to the numerical precision of the measures, which is not always the same as the actual precision of the sensor.

',ret:'a floating point number corresponding to the resolution of the measured values',ext:'On failure, throws an exception or returns `Y_RESOLUTION_INVALID`.'}; doc['PwmInput']['get_sensorState']={syn:'Returns the sensor health state code, which is zero when there is an up-to-date measure available or a positive code if the sensor is not able to provide a measure right now.',lib:'pwminput.get_sensorState()',pro:'function get_sensorState()',cmt:'

Returns the sensor health state code, which is zero when there is an up-to-date measure available or a positive code if the sensor is not able to provide a measure right now.

',ret:'an integer corresponding to the sensor health state code, which is zero when there is an up-to-date measure available or a positive code if the sensor is not able to provide a measure right now',ext:'On failure, throws an exception or returns `Y_SENSORSTATE_INVALID`.'}; doc['PwmInput']['get_unit']={syn:'Returns the measuring unit for the values returned by get_currentValue and callbacks.',lib:'pwminput.get_unit()',pro:'function get_unit()',cmt:'

Returns the measuring unit for the values returned by get_currentValue and callbacks. This unit changes according to the pwmReportMode settings.

',ret:'a string corresponding to the measuring unit for the values returned by get_currentValue and callbacks',ext:'On failure, throws an exception or returns `Y_UNIT_INVALID`.'}; doc['PwmInput']['get_userData']={syn:'Returns the value of the userData attribute, as previously stored using method `set_userData`.',lib:'pwminput.get_userData()',pro:'function get_userData()',cmt:'

Returns the value of the userData attribute, as previously stored using method `set_userData`. This attribute is never touched directly by the API, and is at disposal of the caller to store a context.

',ret:'the object stored previously by the caller.'}; doc['PwmInput']['isOnline']={syn:'Checks if the PWM input is currently reachable, without raising any error.',lib:'pwminput.isOnline()',pro:'function isOnline()',cmt:'

Checks if the PWM input is currently reachable, without raising any error. If there is a cached value for the PWM input in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the PWM input.

',ret:'`true` if the PWM input can be reached, and `false` otherwise'}; doc['PwmInput']['isOnline_async']={syn:'Checks if the PWM input is currently reachable, without raising any error (asynchronous version).',lib:'pwminput.isOnline_async()',pro:'function isOnline_async(callback, context)',cmt:'

Checks if the PWM input is currently reachable, without raising any error (asynchronous version). If there is a cached value for the PWM input in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the requested function.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the boolean result',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['PwmInput']['load']={syn:'Preloads the PWM input cache with a specified validity duration.',lib:'pwminput.load()',pro:'function load(msValidity)',cmt:'

Preloads the PWM input cache with a specified validity duration. By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network traffic for instance.

',par:{msValidity:'an integer corresponding to the validity attributed to the loaded function parameters, in milliseconds'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['PwmInput']['loadAttribute']={syn:'Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.',lib:'pwminput.loadAttribute()',pro:'function loadAttribute(attrName)',cmt:'

Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.

',par:{attrName:'the name of the requested attribute'},ret:'a string with the value of the the attribute',ext:'On failure, throws an exception or returns an empty string.'}; doc['PwmInput']['loadCalibrationPoints']={syn:'Retrieves error correction data points previously entered using the method `calibrateFromPoints`.',lib:'pwminput.loadCalibrationPoints()',pro:'function loadCalibrationPoints(rawValues, refValues)',cmt:'

Retrieves error correction data points previously entered using the method `calibrateFromPoints`.

',par:{rawValues:'array of floating point numbers, that will be filled by the function with the raw sensor values for the correction points.',refValues:'array of floating point numbers, that will be filled by the function with the desired values for the correction points.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['PwmInput']['load_async']={syn:'Preloads the PWM input cache with a specified validity duration (asynchronous version).',lib:'pwminput.load_async()',pro:'function load_async(msValidity, callback, context)',cmt:'

Preloads the PWM input cache with a specified validity duration (asynchronous version). By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network trafic for instance.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{msValidity:'an integer corresponding to the validity of the loaded function parameters, in milliseconds',callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the error code (or `YAPI_SUCCESS`)',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['PwmInput']['muteValueCallbacks']={syn:'Disables the propagation of every new advertised value to the parent hub.',lib:'pwminput.muteValueCallbacks()',pro:'function muteValueCallbacks()',cmt:'

Disables the propagation of every new advertised value to the parent hub. You can use this function to save bandwidth and CPU on computers with limited resources, or to prevent unwanted invocations of the HTTP callback. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['PwmInput']['nextPwmInput']={syn:'Continues the enumeration of PWM inputs started using `yFirstPwmInput()`.',lib:'pwminput.nextPwmInput()',pro:'function nextPwmInput()',cmt:'

Continues the enumeration of PWM inputs started using `yFirstPwmInput()`.

',ret:'a pointer to a `YPwmInput` object, corresponding to a PWM input currently online, or a `null` pointer if there are no more PWM inputs to enumerate.'}; doc['PwmInput']['registerTimedReportCallback']={syn:'Registers the callback function that is invoked on every periodic timed notification.',lib:'pwminput.registerTimedReportCallback()',pro:'function registerTimedReportCallback(callback)',cmt:'

Registers the callback function that is invoked on every periodic timed notification. The callback is invoked only during the execution of `ySleep` or `yHandleEvents`. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a null pointer as argument.

',par:{callback:'the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and an YMeasure object describing the new advertised value.'}}; doc['PwmInput']['registerValueCallback']={syn:'Registers the callback function that is invoked on every change of advertised value.',lib:'pwminput.registerValueCallback()',pro:'function registerValueCallback(callback)',cmt:'

Registers the callback function that is invoked on every change of advertised value. The callback is invoked only during the execution of `ySleep` or `yHandleEvents`. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a null pointer as argument.

',par:{callback:'the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and the character string describing the new advertised value.'}}; doc['PwmInput']['resetCounter']={syn:'Returns the pulse counter value as well as its timer.',lib:'pwminput.resetCounter()',pro:'function resetCounter()',cmt:'

Returns the pulse counter value as well as its timer.

',ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['PwmInput']['set_advMode']={syn:'Changes the measuring mode used for the advertised value pushed to the parent hub.',lib:'pwminput.set_advMode()',pro:'function set_advMode(newval)',cmt:'

Changes the measuring mode used for the advertised value pushed to the parent hub.

',par:{newval:'a value among `Y_ADVMODE_IMMEDIATE`, `Y_ADVMODE_PERIOD_AVG`, `Y_ADVMODE_PERIOD_MIN` and `Y_ADVMODE_PERIOD_MAX` corresponding to the measuring mode used for the advertised value pushed to the parent hub'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['PwmInput']['set_debouncePeriod']={syn:'Changes the shortest expected pulse duration, in ms.',lib:'pwminput.set_debouncePeriod()',pro:'function set_debouncePeriod(newval)',cmt:'

Changes the shortest expected pulse duration, in ms. Any shorter pulse will be automatically ignored (debounce).

',par:{newval:'an integer corresponding to the shortest expected pulse duration, in ms'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['PwmInput']['set_highestValue']={syn:'Changes the recorded maximal value observed.',lib:'pwminput.set_highestValue()',pro:'function set_highestValue(newval)',cmt:'

Changes the recorded maximal value observed. Can be used to reset the value returned by get_lowestValue().

',par:{newval:'a floating point number corresponding to the recorded maximal value observed'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['PwmInput']['set_logFrequency']={syn:'Changes the datalogger recording frequency for this function.',lib:'pwminput.set_logFrequency()',pro:'function set_logFrequency(newval)',cmt:'

Changes the datalogger recording frequency for this function. The frequency can be specified as samples per second, as sample per minute (for instance \x2215/m\x22) or in samples per hour (eg. \x224/h\x22). To disable recording for this function, use the value \x22OFF\x22.

',par:{newval:'a string corresponding to the datalogger recording frequency for this function'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['PwmInput']['set_logicalName']={syn:'Changes the logical name of the PWM input.',lib:'pwminput.set_logicalName()',pro:'function set_logicalName(newval)',cmt:'

Changes the logical name of the PWM input. You can use `yCheckLogicalName()` prior to this call to make sure that your parameter is valid. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',par:{newval:'a string corresponding to the logical name of the PWM input.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['PwmInput']['set_lowestValue']={syn:'Changes the recorded minimal value observed.',lib:'pwminput.set_lowestValue()',pro:'function set_lowestValue(newval)',cmt:'

Changes the recorded minimal value observed. Can be used to reset the value returned by get_lowestValue().

',par:{newval:'a floating point number corresponding to the recorded minimal value observed'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['PwmInput']['set_pwmReportMode']={syn:'Changes the parameter type (frequency/duty cycle, pulse width, or edge count) returned by the get_currentValue function and callbacks.',lib:'pwminput.set_pwmReportMode()',pro:'function set_pwmReportMode(newval)',cmt:'

Changes the parameter type (frequency/duty cycle, pulse width, or edge count) returned by the get_currentValue function and callbacks. The edge count value is limited to the 6 lowest digits. For values greater than one million, use get_pulseCounter().

',par:{newval:'a value among `Y_PWMREPORTMODE_PWM_DUTYCYCLE`, `Y_PWMREPORTMODE_PWM_FREQUENCY`, `Y_PWMREPORTMODE_PWM_PULSEDURATION`, `Y_PWMREPORTMODE_PWM_EDGECOUNT`, `Y_PWMREPORTMODE_PWM_PULSECOUNT`, `Y_PWMREPORTMODE_PWM_CPS`, `Y_PWMREPORTMODE_PWM_CPM` and `Y_PWMREPORTMODE_PWM_STATE` corresponding to the parameter type (frequency/duty cycle, pulse width, or edge count) returned by the get_currentValue function and callbacks'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['PwmInput']['set_reportFrequency']={syn:'Changes the timed value notification frequency for this function.',lib:'pwminput.set_reportFrequency()',pro:'function set_reportFrequency(newval)',cmt:'

Changes the timed value notification frequency for this function. The frequency can be specified as samples per second, as sample per minute (for instance \x2215/m\x22) or in samples per hour (eg. \x224/h\x22). To disable timed value notifications for this function, use the value \x22OFF\x22.

',par:{newval:'a string corresponding to the timed value notification frequency for this function'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['PwmInput']['set_resolution']={syn:'Changes the resolution of the measured physical values.',lib:'pwminput.set_resolution()',pro:'function set_resolution(newval)',cmt:'

Changes the resolution of the measured physical values. The resolution corresponds to the numerical precision when displaying value. It does not change the precision of the measure itself.

',par:{newval:'a floating point number corresponding to the resolution of the measured physical values'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['PwmInput']['set_userData']={syn:'Stores a user context provided as argument in the userData attribute of the function.',lib:'pwminput.set_userData()',pro:'function set_userData(data)',cmt:'

Stores a user context provided as argument in the userData attribute of the function. This attribute is never touched by the API, and is at disposal of the caller to store a context.

',par:{data:'any kind of object to be stored'}}; doc['PwmInput']['startDataLogger']={syn:'Starts the data logger on the device.',lib:'pwminput.startDataLogger()',pro:'function startDataLogger()',cmt:'

Starts the data logger on the device. Note that the data logger will only save the measures on this sensor if the logFrequency is not set to \x22OFF\x22.

',ret:'`YAPI_SUCCESS` if the call succeeds.'}; doc['PwmInput']['stopDataLogger']={syn:'Stops the datalogger on the device.',lib:'pwminput.stopDataLogger()',pro:'function stopDataLogger()',cmt:'

Stops the datalogger on the device.

',ret:'`YAPI_SUCCESS` if the call succeeds.'}; doc['PwmInput']['unmuteValueCallbacks']={syn:'Re-enables the propagation of every new advertised value to the parent hub.',lib:'pwminput.unmuteValueCallbacks()',pro:'function unmuteValueCallbacks()',cmt:'

Re-enables the propagation of every new advertised value to the parent hub. This function reverts the effect of a previous call to `muteValueCallbacks()`. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['PwmInput']['wait_async']={syn:'Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function.',lib:'pwminput.wait_async()',pro:'function wait_async(callback, context)',cmt:'

Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function. The callback function can therefore freely issue synchronous or asynchronous commands, without risking to block the Javascript VM.

',par:{callback:'callback function that is invoked when all pending commands on the module are completed. The callback function receives two arguments: the caller-specific context object and the receiving function object.',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing.'}; //--- (end of generated code: PwmInput) //--- (generated code: SegmentedDisplay) doc['SegmentedDisplay']={'':{syn:'SegmentedDisplay function interface',inc:'<script type='text/javascript' src='yocto_segmenteddisplay.js'></script>',cmt:'

The SegmentedDisplay class allows you to drive segmented displays.

'}}; doc['SegmentedDisplay']['FindSegmentedDisplay']={syn:'Retrieves a segmented display for a given identifier.',lib:'YSegmentedDisplay.FindSegmentedDisplay()',pro:'function FindSegmentedDisplay(func)',cmt:'

Retrieves a segmented display for a given identifier. The identifier can be specified using several formats:

- FunctionLogicalName
- ModuleSerialNumber.FunctionIdentifier
- ModuleSerialNumber.FunctionLogicalName
- ModuleLogicalName.FunctionIdentifier
- ModuleLogicalName.FunctionLogicalName

This function does not require that the segmented displays is online at the time it is invoked. The returned object is nevertheless valid. Use the method `YSegmentedDisplay.isOnline()` to test if the segmented displays is indeed online at a given time. In case of ambiguity when looking for a segmented display by logical name, no error is notified: the first instance found is returned. The search is performed first by hardware name, then by logical name.

If a call to this object\x27s is_online() method returns FALSE although you are certain that the matching device is plugged, make sure that you did call registerHub() at application initialization time.

',par:{func:'a string that uniquely characterizes the segmented displays'},ret:'a `YSegmentedDisplay` object allowing you to drive the segmented displays.'}; doc['SegmentedDisplay']['FirstSegmentedDisplay']={syn:'Starts the enumeration of segmented displays currently accessible.',lib:'YSegmentedDisplay.FirstSegmentedDisplay()',pro:'function FirstSegmentedDisplay()',cmt:'

Starts the enumeration of segmented displays currently accessible. Use the method `YSegmentedDisplay.nextSegmentedDisplay()` to iterate on next segmented displays.

',ret:'a pointer to a `YSegmentedDisplay` object, corresponding to the first segmented displays currently online, or a `null` pointer if there are none.'}; doc['SegmentedDisplay']['clearCache']={syn:'Invalidates the cache.',lib:'segmenteddisplay.clearCache()',pro:'function clearCache()',cmt:'

Invalidates the cache. Invalidates the cache of the segmented displays attributes. Forces the next call to get_xxx() or loadxxx() to use values that come from the device.

'}; doc['SegmentedDisplay']['describe']={syn:'Returns a short text that describes unambiguously the instance of the segmented displays in the form `TYPE(NAME)=SERIAL.FUNCTIONID`.',lib:'segmenteddisplay.describe()',pro:'function describe()',cmt:'

Returns a short text that describes unambiguously the instance of the segmented displays in the form `TYPE(NAME)=SERIAL.FUNCTIONID`. More precisely, `TYPE` is the type of the function, `NAME` it the name used for the first access to the function, `SERIAL` is the serial number of the module if the module is connected or `\x22unresolved\x22`, and `FUNCTIONID` is the hardware identifier of the function if the module is connected. For example, this method returns `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1` if the module is already connected or `Relay(BadCustomeName.relay1)=unresolved` if the module has not yet been connected. This method does not trigger any USB or TCP transaction and can therefore be used in a debugger.

',ret:'a string that describes the segmented displays (ex: `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1`)'}; doc['SegmentedDisplay']['get_advertisedValue']={syn:'Returns the current value of the segmented displays (no more than 6 characters).',lib:'segmenteddisplay.get_advertisedValue()',pro:'function get_advertisedValue()',cmt:'

Returns the current value of the segmented displays (no more than 6 characters).

',ret:'a string corresponding to the current value of the segmented displays (no more than 6 characters).',ext:'On failure, throws an exception or returns `Y_ADVERTISEDVALUE_INVALID`.'}; doc['SegmentedDisplay']['get_displayedText']={syn:'Returns the text currently displayed on the screen.',lib:'segmenteddisplay.get_displayedText()',pro:'function get_displayedText()',cmt:'

Returns the text currently displayed on the screen.

',ret:'a string corresponding to the text currently displayed on the screen',ext:'On failure, throws an exception or returns `Y_DISPLAYEDTEXT_INVALID`.'}; doc['SegmentedDisplay']['get_errorMessage']={syn:'Returns the error message of the latest error with the segmented displays.',lib:'segmenteddisplay.get_errorMessage()',pro:'function get_errorMessage()',cmt:'

Returns the error message of the latest error with the segmented displays. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a string corresponding to the latest error message that occured while using the segmented displays object'}; doc['SegmentedDisplay']['get_errorType']={syn:'Returns the numerical error code of the latest error with the segmented displays.',lib:'segmenteddisplay.get_errorType()',pro:'function get_errorType()',cmt:'

Returns the numerical error code of the latest error with the segmented displays. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a number corresponding to the code of the latest error that occurred while using the segmented displays object'}; doc['SegmentedDisplay']['get_friendlyName']={syn:'Returns a global identifier of the segmented displays in the format `MODULE_NAME.FUNCTION_NAME`.',lib:'segmenteddisplay.get_friendlyName()',pro:'function get_friendlyName()',cmt:'

Returns a global identifier of the segmented displays in the format `MODULE_NAME.FUNCTION_NAME`. The returned string uses the logical names of the module and of the segmented displays if they are defined, otherwise the serial number of the module and the hardware identifier of the segmented displays (for example: `MyCustomName.relay1`)

',ret:'a string that uniquely identifies the segmented displays using logical names (ex: `MyCustomName.relay1`)',ext:'On failure, throws an exception or returns `Y_FRIENDLYNAME_INVALID`.'}; doc['SegmentedDisplay']['get_functionDescriptor']={syn:'Returns a unique identifier of type `YFUN_DESCR` corresponding to the function.',lib:'segmenteddisplay.get_functionDescriptor()',pro:'function get_functionDescriptor()',cmt:'

Returns a unique identifier of type `YFUN_DESCR` corresponding to the function. This identifier can be used to test if two instances of `YFunction` reference the same physical function on the same physical device.

',ret:'an identifier of type `YFUN_DESCR`.',ext:'If the function has never been contacted, the returned value is `Y_FUNCTIONDESCRIPTOR_INVALID`.'}; doc['SegmentedDisplay']['get_functionId']={syn:'Returns the hardware identifier of the segmented displays, without reference to the module.',lib:'segmenteddisplay.get_functionId()',pro:'function get_functionId()',cmt:'

Returns the hardware identifier of the segmented displays, without reference to the module. For example `relay1`

',ret:'a string that identifies the segmented displays (ex: `relay1`)',ext:'On failure, throws an exception or returns `Y_FUNCTIONID_INVALID`.'}; doc['SegmentedDisplay']['get_hardwareId']={syn:'Returns the unique hardware identifier of the segmented displays in the form `SERIAL.FUNCTIONID`.',lib:'segmenteddisplay.get_hardwareId()',pro:'function get_hardwareId()',cmt:'

Returns the unique hardware identifier of the segmented displays in the form `SERIAL.FUNCTIONID`. The unique hardware identifier is composed of the device serial number and of the hardware identifier of the segmented displays (for example `RELAYLO1-123456.relay1`).

',ret:'a string that uniquely identifies the segmented displays (ex: `RELAYLO1-123456.relay1`)',ext:'On failure, throws an exception or returns `Y_HARDWAREID_INVALID`.'}; doc['SegmentedDisplay']['get_logicalName']={syn:'Returns the logical name of the segmented displays.',lib:'segmenteddisplay.get_logicalName()',pro:'function get_logicalName()',cmt:'

Returns the logical name of the segmented displays.

',ret:'a string corresponding to the logical name of the segmented displays.',ext:'On failure, throws an exception or returns `Y_LOGICALNAME_INVALID`.'}; doc['SegmentedDisplay']['get_module']={syn:'Gets the `YModule` object for the device on which the function is located.',lib:'segmenteddisplay.get_module()',pro:'function get_module()',cmt:'

Gets the `YModule` object for the device on which the function is located. If the function cannot be located on any module, the returned instance of `YModule` is not shown as on-line.

',ret:'an instance of `YModule`'}; doc['SegmentedDisplay']['get_module_async']={syn:'Gets the `YModule` object for the device on which the function is located (asynchronous version).',lib:'segmenteddisplay.get_module_async()',pro:'function get_module_async(callback, context)',cmt:'

Gets the `YModule` object for the device on which the function is located (asynchronous version). If the function cannot be located on any module, the returned `YModule` object does not show as on-line.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking Firefox javascript VM that does not implement context switching during blocking I/O calls. See the documentation section on asynchronous Javascript calls for more details.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the requested `YModule` object',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['SegmentedDisplay']['get_userData']={syn:'Returns the value of the userData attribute, as previously stored using method `set_userData`.',lib:'segmenteddisplay.get_userData()',pro:'function get_userData()',cmt:'

Returns the value of the userData attribute, as previously stored using method `set_userData`. This attribute is never touched directly by the API, and is at disposal of the caller to store a context.

',ret:'the object stored previously by the caller.'}; doc['SegmentedDisplay']['isOnline']={syn:'Checks if the segmented displays is currently reachable, without raising any error.',lib:'segmenteddisplay.isOnline()',pro:'function isOnline()',cmt:'

Checks if the segmented displays is currently reachable, without raising any error. If there is a cached value for the segmented displays in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the segmented displays.

',ret:'`true` if the segmented displays can be reached, and `false` otherwise'}; doc['SegmentedDisplay']['isOnline_async']={syn:'Checks if the segmented displays is currently reachable, without raising any error (asynchronous version).',lib:'segmenteddisplay.isOnline_async()',pro:'function isOnline_async(callback, context)',cmt:'

Checks if the segmented displays is currently reachable, without raising any error (asynchronous version). If there is a cached value for the segmented displays in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the requested function.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the boolean result',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['SegmentedDisplay']['load']={syn:'Preloads the segmented displays cache with a specified validity duration.',lib:'segmenteddisplay.load()',pro:'function load(msValidity)',cmt:'

Preloads the segmented displays cache with a specified validity duration. By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network traffic for instance.

',par:{msValidity:'an integer corresponding to the validity attributed to the loaded function parameters, in milliseconds'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['SegmentedDisplay']['loadAttribute']={syn:'Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.',lib:'segmenteddisplay.loadAttribute()',pro:'function loadAttribute(attrName)',cmt:'

Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.

',par:{attrName:'the name of the requested attribute'},ret:'a string with the value of the the attribute',ext:'On failure, throws an exception or returns an empty string.'}; doc['SegmentedDisplay']['load_async']={syn:'Preloads the segmented displays cache with a specified validity duration (asynchronous version).',lib:'segmenteddisplay.load_async()',pro:'function load_async(msValidity, callback, context)',cmt:'

Preloads the segmented displays cache with a specified validity duration (asynchronous version). By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network trafic for instance.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{msValidity:'an integer corresponding to the validity of the loaded function parameters, in milliseconds',callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the error code (or `YAPI_SUCCESS`)',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['SegmentedDisplay']['muteValueCallbacks']={syn:'Disables the propagation of every new advertised value to the parent hub.',lib:'segmenteddisplay.muteValueCallbacks()',pro:'function muteValueCallbacks()',cmt:'

Disables the propagation of every new advertised value to the parent hub. You can use this function to save bandwidth and CPU on computers with limited resources, or to prevent unwanted invocations of the HTTP callback. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['SegmentedDisplay']['nextSegmentedDisplay']={syn:'Continues the enumeration of segmented displays started using `yFirstSegmentedDisplay()`.',lib:'segmenteddisplay.nextSegmentedDisplay()',pro:'function nextSegmentedDisplay()',cmt:'

Continues the enumeration of segmented displays started using `yFirstSegmentedDisplay()`.

',ret:'a pointer to a `YSegmentedDisplay` object, corresponding to a segmented display currently online, or a `null` pointer if there are no more segmented displays to enumerate.'}; doc['SegmentedDisplay']['registerValueCallback']={syn:'Registers the callback function that is invoked on every change of advertised value.',lib:'segmenteddisplay.registerValueCallback()',pro:'function registerValueCallback(callback)',cmt:'

Registers the callback function that is invoked on every change of advertised value. The callback is invoked only during the execution of `ySleep` or `yHandleEvents`. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a null pointer as argument.

',par:{callback:'the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and the character string describing the new advertised value.'}}; doc['SegmentedDisplay']['set_displayedText']={syn:'Changes the text currently displayed on the screen.',lib:'segmenteddisplay.set_displayedText()',pro:'function set_displayedText(newval)',cmt:'

Changes the text currently displayed on the screen.

',par:{newval:'a string corresponding to the text currently displayed on the screen'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['SegmentedDisplay']['set_logicalName']={syn:'Changes the logical name of the segmented displays.',lib:'segmenteddisplay.set_logicalName()',pro:'function set_logicalName(newval)',cmt:'

Changes the logical name of the segmented displays. You can use `yCheckLogicalName()` prior to this call to make sure that your parameter is valid. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',par:{newval:'a string corresponding to the logical name of the segmented displays.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['SegmentedDisplay']['set_userData']={syn:'Stores a user context provided as argument in the userData attribute of the function.',lib:'segmenteddisplay.set_userData()',pro:'function set_userData(data)',cmt:'

Stores a user context provided as argument in the userData attribute of the function. This attribute is never touched by the API, and is at disposal of the caller to store a context.

',par:{data:'any kind of object to be stored'}}; doc['SegmentedDisplay']['unmuteValueCallbacks']={syn:'Re-enables the propagation of every new advertised value to the parent hub.',lib:'segmenteddisplay.unmuteValueCallbacks()',pro:'function unmuteValueCallbacks()',cmt:'

Re-enables the propagation of every new advertised value to the parent hub. This function reverts the effect of a previous call to `muteValueCallbacks()`. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['SegmentedDisplay']['wait_async']={syn:'Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function.',lib:'segmenteddisplay.wait_async()',pro:'function wait_async(callback, context)',cmt:'

Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function. The callback function can therefore freely issue synchronous or asynchronous commands, without risking to block the Javascript VM.

',par:{callback:'callback function that is invoked when all pending commands on the module are completed. The callback function receives two arguments: the caller-specific context object and the receiving function object.',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing.'}; //--- (end of generated code: SegmentedDisplay) //--- (generated code: Buzzer) doc['Buzzer']={'':{syn:'Buzzer function interface',inc:'<script type='text/javascript' src='yocto_buzzer.js'></script>',cmt:'

The Yoctopuce application programming interface allows you to choose the frequency and volume at which the buzzer must sound. You can also pre-program a play sequence.

'}}; doc['Buzzer']['FindBuzzer']={syn:'Retrieves a buzzer for a given identifier.',lib:'YBuzzer.FindBuzzer()',pro:'function FindBuzzer(func)',cmt:'

Retrieves a buzzer for a given identifier. The identifier can be specified using several formats:

- FunctionLogicalName
- ModuleSerialNumber.FunctionIdentifier
- ModuleSerialNumber.FunctionLogicalName
- ModuleLogicalName.FunctionIdentifier
- ModuleLogicalName.FunctionLogicalName

This function does not require that the buzzer is online at the time it is invoked. The returned object is nevertheless valid. Use the method `YBuzzer.isOnline()` to test if the buzzer is indeed online at a given time. In case of ambiguity when looking for a buzzer by logical name, no error is notified: the first instance found is returned. The search is performed first by hardware name, then by logical name.

If a call to this object\x27s is_online() method returns FALSE although you are certain that the matching device is plugged, make sure that you did call registerHub() at application initialization time.

',par:{func:'a string that uniquely characterizes the buzzer'},ret:'a `YBuzzer` object allowing you to drive the buzzer.'}; doc['Buzzer']['FirstBuzzer']={syn:'Starts the enumeration of buzzers currently accessible.',lib:'YBuzzer.FirstBuzzer()',pro:'function FirstBuzzer()',cmt:'

Starts the enumeration of buzzers currently accessible. Use the method `YBuzzer.nextBuzzer()` to iterate on next buzzers.

',ret:'a pointer to a `YBuzzer` object, corresponding to the first buzzer currently online, or a `null` pointer if there are none.'}; doc['Buzzer']['addFreqMoveToPlaySeq']={syn:'Adds a new frequency transition to the playing sequence.',lib:'buzzer.addFreqMoveToPlaySeq()',pro:'function addFreqMoveToPlaySeq(freq, msDelay)',cmt:'

Adds a new frequency transition to the playing sequence.

',par:{freq:'desired frequency when the transition is completed, in Hz',msDelay:'duration of the frequency transition, in milliseconds.'},ret:'`YAPI_SUCCESS` if the call succeeds. On failure, throws an exception or returns a negative error code.'}; doc['Buzzer']['addNotesToPlaySeq']={syn:'Adds notes to the playing sequence.',lib:'buzzer.addNotesToPlaySeq()',pro:'function addNotesToPlaySeq(notes)',cmt:'

Adds notes to the playing sequence. Notes are provided as text words, separated by spaces. The pitch is specified using the usual letter from A to G. The duration is specified as the divisor of a whole note: 4 for a fourth, 8 for an eight note, etc. Some modifiers are supported: `#` and `b` to alter a note pitch, `\x27` and `,` to move to the upper/lower octave, `.` to enlarge the note duration.

',par:{notes:'notes to be played, as a text string.'},ret:'`YAPI_SUCCESS` if the call succeeds. On failure, throws an exception or returns a negative error code.'}; doc['Buzzer']['addPulseToPlaySeq']={syn:'Adds a pulse to the playing sequence.',lib:'buzzer.addPulseToPlaySeq()',pro:'function addPulseToPlaySeq(freq, msDuration)',cmt:'

Adds a pulse to the playing sequence.

',par:{freq:'pulse frequency, in Hz',msDuration:'pulse duration, in milliseconds.'},ret:'`YAPI_SUCCESS` if the call succeeds. On failure, throws an exception or returns a negative error code.'}; doc['Buzzer']['addVolMoveToPlaySeq']={syn:'Adds a new volume transition to the playing sequence.',lib:'buzzer.addVolMoveToPlaySeq()',pro:'function addVolMoveToPlaySeq(volume, msDuration)',cmt:'

Adds a new volume transition to the playing sequence. Frequency stays untouched: if frequency is at zero, the transition has no effect.

',par:{volume:'desired volume when the transition is completed, as a percentage.',msDuration:'duration of the volume transition, in milliseconds.'},ret:'`YAPI_SUCCESS` if the call succeeds. On failure, throws an exception or returns a negative error code.'}; doc['Buzzer']['clearCache']={syn:'Invalidates the cache.',lib:'buzzer.clearCache()',pro:'function clearCache()',cmt:'

Invalidates the cache. Invalidates the cache of the buzzer attributes. Forces the next call to get_xxx() or loadxxx() to use values that come from the device.

'}; doc['Buzzer']['describe']={syn:'Returns a short text that describes unambiguously the instance of the buzzer in the form `TYPE(NAME)=SERIAL.FUNCTIONID`.',lib:'buzzer.describe()',pro:'function describe()',cmt:'

Returns a short text that describes unambiguously the instance of the buzzer in the form `TYPE(NAME)=SERIAL.FUNCTIONID`. More precisely, `TYPE` is the type of the function, `NAME` it the name used for the first access to the function, `SERIAL` is the serial number of the module if the module is connected or `\x22unresolved\x22`, and `FUNCTIONID` is the hardware identifier of the function if the module is connected. For example, this method returns `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1` if the module is already connected or `Relay(BadCustomeName.relay1)=unresolved` if the module has not yet been connected. This method does not trigger any USB or TCP transaction and can therefore be used in a debugger.

',ret:'a string that describes the buzzer (ex: `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1`)'}; doc['Buzzer']['freqMove']={syn:'Makes the buzzer frequency change over a period of time.',lib:'buzzer.freqMove()',pro:'function freqMove(frequency, duration)',cmt:'

Makes the buzzer frequency change over a period of time.

',par:{frequency:'frequency to reach, in hertz. A frequency under 25Hz stops the buzzer.',duration:'pulse duration in millseconds'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Buzzer']['get_advertisedValue']={syn:'Returns the current value of the buzzer (no more than 6 characters).',lib:'buzzer.get_advertisedValue()',pro:'function get_advertisedValue()',cmt:'

Returns the current value of the buzzer (no more than 6 characters).

',ret:'a string corresponding to the current value of the buzzer (no more than 6 characters).',ext:'On failure, throws an exception or returns `Y_ADVERTISEDVALUE_INVALID`.'}; doc['Buzzer']['get_errorMessage']={syn:'Returns the error message of the latest error with the buzzer.',lib:'buzzer.get_errorMessage()',pro:'function get_errorMessage()',cmt:'

Returns the error message of the latest error with the buzzer. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a string corresponding to the latest error message that occured while using the buzzer object'}; doc['Buzzer']['get_errorType']={syn:'Returns the numerical error code of the latest error with the buzzer.',lib:'buzzer.get_errorType()',pro:'function get_errorType()',cmt:'

Returns the numerical error code of the latest error with the buzzer. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a number corresponding to the code of the latest error that occurred while using the buzzer object'}; doc['Buzzer']['get_frequency']={syn:'Returns the frequency of the signal sent to the buzzer/speaker.',lib:'buzzer.get_frequency()',pro:'function get_frequency()',cmt:'

Returns the frequency of the signal sent to the buzzer/speaker.

',ret:'a floating point number corresponding to the frequency of the signal sent to the buzzer/speaker',ext:'On failure, throws an exception or returns `Y_FREQUENCY_INVALID`.'}; doc['Buzzer']['get_friendlyName']={syn:'Returns a global identifier of the buzzer in the format `MODULE_NAME.FUNCTION_NAME`.',lib:'buzzer.get_friendlyName()',pro:'function get_friendlyName()',cmt:'

Returns a global identifier of the buzzer in the format `MODULE_NAME.FUNCTION_NAME`. The returned string uses the logical names of the module and of the buzzer if they are defined, otherwise the serial number of the module and the hardware identifier of the buzzer (for example: `MyCustomName.relay1`)

',ret:'a string that uniquely identifies the buzzer using logical names (ex: `MyCustomName.relay1`)',ext:'On failure, throws an exception or returns `Y_FRIENDLYNAME_INVALID`.'}; doc['Buzzer']['get_functionDescriptor']={syn:'Returns a unique identifier of type `YFUN_DESCR` corresponding to the function.',lib:'buzzer.get_functionDescriptor()',pro:'function get_functionDescriptor()',cmt:'

Returns a unique identifier of type `YFUN_DESCR` corresponding to the function. This identifier can be used to test if two instances of `YFunction` reference the same physical function on the same physical device.

',ret:'an identifier of type `YFUN_DESCR`.',ext:'If the function has never been contacted, the returned value is `Y_FUNCTIONDESCRIPTOR_INVALID`.'}; doc['Buzzer']['get_functionId']={syn:'Returns the hardware identifier of the buzzer, without reference to the module.',lib:'buzzer.get_functionId()',pro:'function get_functionId()',cmt:'

Returns the hardware identifier of the buzzer, without reference to the module. For example `relay1`

',ret:'a string that identifies the buzzer (ex: `relay1`)',ext:'On failure, throws an exception or returns `Y_FUNCTIONID_INVALID`.'}; doc['Buzzer']['get_hardwareId']={syn:'Returns the unique hardware identifier of the buzzer in the form `SERIAL.FUNCTIONID`.',lib:'buzzer.get_hardwareId()',pro:'function get_hardwareId()',cmt:'

Returns the unique hardware identifier of the buzzer in the form `SERIAL.FUNCTIONID`. The unique hardware identifier is composed of the device serial number and of the hardware identifier of the buzzer (for example `RELAYLO1-123456.relay1`).

',ret:'a string that uniquely identifies the buzzer (ex: `RELAYLO1-123456.relay1`)',ext:'On failure, throws an exception or returns `Y_HARDWAREID_INVALID`.'}; doc['Buzzer']['get_logicalName']={syn:'Returns the logical name of the buzzer.',lib:'buzzer.get_logicalName()',pro:'function get_logicalName()',cmt:'

Returns the logical name of the buzzer.

',ret:'a string corresponding to the logical name of the buzzer.',ext:'On failure, throws an exception or returns `Y_LOGICALNAME_INVALID`.'}; doc['Buzzer']['get_module']={syn:'Gets the `YModule` object for the device on which the function is located.',lib:'buzzer.get_module()',pro:'function get_module()',cmt:'

Gets the `YModule` object for the device on which the function is located. If the function cannot be located on any module, the returned instance of `YModule` is not shown as on-line.

',ret:'an instance of `YModule`'}; doc['Buzzer']['get_module_async']={syn:'Gets the `YModule` object for the device on which the function is located (asynchronous version).',lib:'buzzer.get_module_async()',pro:'function get_module_async(callback, context)',cmt:'

Gets the `YModule` object for the device on which the function is located (asynchronous version). If the function cannot be located on any module, the returned `YModule` object does not show as on-line.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking Firefox javascript VM that does not implement context switching during blocking I/O calls. See the documentation section on asynchronous Javascript calls for more details.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the requested `YModule` object',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['Buzzer']['get_playSeqMaxSize']={syn:'Returns the maximum length of the playing sequence.',lib:'buzzer.get_playSeqMaxSize()',pro:'function get_playSeqMaxSize()',cmt:'

Returns the maximum length of the playing sequence.

',ret:'an integer corresponding to the maximum length of the playing sequence',ext:'On failure, throws an exception or returns `Y_PLAYSEQMAXSIZE_INVALID`.'}; doc['Buzzer']['get_playSeqSignature']={syn:'Returns the playing sequence signature.',lib:'buzzer.get_playSeqSignature()',pro:'function get_playSeqSignature()',cmt:'

Returns the playing sequence signature. As playing sequences cannot be read from the device, this can be used to detect if a specific playing sequence is already programmed.

',ret:'an integer corresponding to the playing sequence signature',ext:'On failure, throws an exception or returns `Y_PLAYSEQSIGNATURE_INVALID`.'}; doc['Buzzer']['get_playSeqSize']={syn:'Returns the current length of the playing sequence.',lib:'buzzer.get_playSeqSize()',pro:'function get_playSeqSize()',cmt:'

Returns the current length of the playing sequence.

',ret:'an integer corresponding to the current length of the playing sequence',ext:'On failure, throws an exception or returns `Y_PLAYSEQSIZE_INVALID`.'}; doc['Buzzer']['get_userData']={syn:'Returns the value of the userData attribute, as previously stored using method `set_userData`.',lib:'buzzer.get_userData()',pro:'function get_userData()',cmt:'

Returns the value of the userData attribute, as previously stored using method `set_userData`. This attribute is never touched directly by the API, and is at disposal of the caller to store a context.

',ret:'the object stored previously by the caller.'}; doc['Buzzer']['get_volume']={syn:'Returns the volume of the signal sent to the buzzer/speaker.',lib:'buzzer.get_volume()',pro:'function get_volume()',cmt:'

Returns the volume of the signal sent to the buzzer/speaker.

',ret:'an integer corresponding to the volume of the signal sent to the buzzer/speaker',ext:'On failure, throws an exception or returns `Y_VOLUME_INVALID`.'}; doc['Buzzer']['isOnline']={syn:'Checks if the buzzer is currently reachable, without raising any error.',lib:'buzzer.isOnline()',pro:'function isOnline()',cmt:'

Checks if the buzzer is currently reachable, without raising any error. If there is a cached value for the buzzer in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the buzzer.

',ret:'`true` if the buzzer can be reached, and `false` otherwise'}; doc['Buzzer']['isOnline_async']={syn:'Checks if the buzzer is currently reachable, without raising any error (asynchronous version).',lib:'buzzer.isOnline_async()',pro:'function isOnline_async(callback, context)',cmt:'

Checks if the buzzer is currently reachable, without raising any error (asynchronous version). If there is a cached value for the buzzer in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the requested function.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the boolean result',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['Buzzer']['load']={syn:'Preloads the buzzer cache with a specified validity duration.',lib:'buzzer.load()',pro:'function load(msValidity)',cmt:'

Preloads the buzzer cache with a specified validity duration. By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network traffic for instance.

',par:{msValidity:'an integer corresponding to the validity attributed to the loaded function parameters, in milliseconds'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Buzzer']['loadAttribute']={syn:'Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.',lib:'buzzer.loadAttribute()',pro:'function loadAttribute(attrName)',cmt:'

Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.

',par:{attrName:'the name of the requested attribute'},ret:'a string with the value of the the attribute',ext:'On failure, throws an exception or returns an empty string.'}; doc['Buzzer']['load_async']={syn:'Preloads the buzzer cache with a specified validity duration (asynchronous version).',lib:'buzzer.load_async()',pro:'function load_async(msValidity, callback, context)',cmt:'

Preloads the buzzer cache with a specified validity duration (asynchronous version). By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network trafic for instance.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{msValidity:'an integer corresponding to the validity of the loaded function parameters, in milliseconds',callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the error code (or `YAPI_SUCCESS`)',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['Buzzer']['muteValueCallbacks']={syn:'Disables the propagation of every new advertised value to the parent hub.',lib:'buzzer.muteValueCallbacks()',pro:'function muteValueCallbacks()',cmt:'

Disables the propagation of every new advertised value to the parent hub. You can use this function to save bandwidth and CPU on computers with limited resources, or to prevent unwanted invocations of the HTTP callback. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Buzzer']['nextBuzzer']={syn:'Continues the enumeration of buzzers started using `yFirstBuzzer()`.',lib:'buzzer.nextBuzzer()',pro:'function nextBuzzer()',cmt:'

Continues the enumeration of buzzers started using `yFirstBuzzer()`.

',ret:'a pointer to a `YBuzzer` object, corresponding to a buzzer currently online, or a `null` pointer if there are no more buzzers to enumerate.'}; doc['Buzzer']['oncePlaySeq']={syn:'Starts the preprogrammed playing sequence and run it once only.',lib:'buzzer.oncePlaySeq()',pro:'function oncePlaySeq()',cmt:'

Starts the preprogrammed playing sequence and run it once only.

',ret:'`YAPI_SUCCESS` if the call succeeds. On failure, throws an exception or returns a negative error code.'}; doc['Buzzer']['playNotes']={syn:'Immediately play a note sequence.',lib:'buzzer.playNotes()',pro:'function playNotes(notes)',cmt:'

Immediately play a note sequence. Notes are provided as text words, separated by spaces. The pitch is specified using the usual letter from A to G. The duration is specified as the divisor of a whole note: 4 for a fourth, 8 for an eight note, etc. Some modifiers are supported: `#` and `b` to alter a note pitch, `\x27` and `,` to move to the upper/lower octave, `.` to enlarge the note duration.

',par:{notes:'notes to be played, as a text string.'},ret:'`YAPI_SUCCESS` if the call succeeds. On failure, throws an exception or returns a negative error code.'}; doc['Buzzer']['pulse']={syn:'Activates the buzzer for a short duration.',lib:'buzzer.pulse()',pro:'function pulse(frequency, duration)',cmt:'

Activates the buzzer for a short duration.

',par:{frequency:'pulse frequency, in hertz',duration:'pulse duration in millseconds'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Buzzer']['registerValueCallback']={syn:'Registers the callback function that is invoked on every change of advertised value.',lib:'buzzer.registerValueCallback()',pro:'function registerValueCallback(callback)',cmt:'

Registers the callback function that is invoked on every change of advertised value. The callback is invoked only during the execution of `ySleep` or `yHandleEvents`. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a null pointer as argument.

',par:{callback:'the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and the character string describing the new advertised value.'}}; doc['Buzzer']['resetPlaySeq']={syn:'Resets the preprogrammed playing sequence and sets the frequency to zero.',lib:'buzzer.resetPlaySeq()',pro:'function resetPlaySeq()',cmt:'

Resets the preprogrammed playing sequence and sets the frequency to zero.

',ret:'`YAPI_SUCCESS` if the call succeeds. On failure, throws an exception or returns a negative error code.'}; doc['Buzzer']['set_frequency']={syn:'Changes the frequency of the signal sent to the buzzer.',lib:'buzzer.set_frequency()',pro:'function set_frequency(newval)',cmt:'

Changes the frequency of the signal sent to the buzzer. A zero value stops the buzzer.

',par:{newval:'a floating point number corresponding to the frequency of the signal sent to the buzzer'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Buzzer']['set_logicalName']={syn:'Changes the logical name of the buzzer.',lib:'buzzer.set_logicalName()',pro:'function set_logicalName(newval)',cmt:'

Changes the logical name of the buzzer. You can use `yCheckLogicalName()` prior to this call to make sure that your parameter is valid. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',par:{newval:'a string corresponding to the logical name of the buzzer.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Buzzer']['set_userData']={syn:'Stores a user context provided as argument in the userData attribute of the function.',lib:'buzzer.set_userData()',pro:'function set_userData(data)',cmt:'

Stores a user context provided as argument in the userData attribute of the function. This attribute is never touched by the API, and is at disposal of the caller to store a context.

',par:{data:'any kind of object to be stored'}}; doc['Buzzer']['set_volume']={syn:'Changes the volume of the signal sent to the buzzer/speaker.',lib:'buzzer.set_volume()',pro:'function set_volume(newval)',cmt:'

Changes the volume of the signal sent to the buzzer/speaker.

',par:{newval:'an integer corresponding to the volume of the signal sent to the buzzer/speaker'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Buzzer']['startPlaySeq']={syn:'Starts the preprogrammed playing sequence.',lib:'buzzer.startPlaySeq()',pro:'function startPlaySeq()',cmt:'

Starts the preprogrammed playing sequence. The sequence runs in loop until it is stopped by stopPlaySeq or an explicit change. To play the sequence only once, use `oncePlaySeq()`.

',ret:'`YAPI_SUCCESS` if the call succeeds. On failure, throws an exception or returns a negative error code.'}; doc['Buzzer']['stopPlaySeq']={syn:'Stops the preprogrammed playing sequence and sets the frequency to zero.',lib:'buzzer.stopPlaySeq()',pro:'function stopPlaySeq()',cmt:'

Stops the preprogrammed playing sequence and sets the frequency to zero.

',ret:'`YAPI_SUCCESS` if the call succeeds. On failure, throws an exception or returns a negative error code.'}; doc['Buzzer']['unmuteValueCallbacks']={syn:'Re-enables the propagation of every new advertised value to the parent hub.',lib:'buzzer.unmuteValueCallbacks()',pro:'function unmuteValueCallbacks()',cmt:'

Re-enables the propagation of every new advertised value to the parent hub. This function reverts the effect of a previous call to `muteValueCallbacks()`. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Buzzer']['volumeMove']={syn:'Makes the buzzer volume change over a period of time, frequency stays untouched.',lib:'buzzer.volumeMove()',pro:'function volumeMove(volume, duration)',cmt:'

Makes the buzzer volume change over a period of time, frequency stays untouched.

',par:{volume:'volume to reach in %',duration:'change duration in millseconds'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Buzzer']['wait_async']={syn:'Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function.',lib:'buzzer.wait_async()',pro:'function wait_async(callback, context)',cmt:'

Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function. The callback function can therefore freely issue synchronous or asynchronous commands, without risking to block the Javascript VM.

',par:{callback:'callback function that is invoked when all pending commands on the module are completed. The callback function receives two arguments: the caller-specific context object and the receiving function object.',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing.'}; //--- (end of generated code: Buzzer) //--- (generated code: FirmwareUpdate) doc['FirmwareUpdate']={'':{syn:'Control interface for the firmware update process',inc:'<script type='text/javascript' src='yocto_api.js'></script>',cmt:'

The YFirmwareUpdate class let you control the firmware update of a Yoctopuce module. This class should not be instantiate directly, instead the method `updateFirmware` should be called to get an instance of YFirmwareUpdate.

'}}; doc['FirmwareUpdate']['CheckFirmware']={syn:'Test if the byn file is valid for this module.',lib:'YFirmwareUpdate.CheckFirmware()',pro:'function CheckFirmware(serial, path, minrelease)',cmt:'

Test if the byn file is valid for this module. It is possible to pass a directory instead of a file. In that case, this method returns the path of the most recent appropriate byn file. This method will ignore any firmware older than minrelease.

',par:{serial:'the serial number of the module to update',path:'the path of a byn file or a directory that contains byn files',minrelease:'a positive integer'},ret:': the path of the byn file to use, or an empty string if no byn files matches the requirement',ext:'On failure, returns a string that starts with \x22error:\x22.'}; doc['FirmwareUpdate']['get_progress']={syn:'Returns the progress of the firmware update, on a scale from 0 to 100.',lib:'firmwareupdate.get_progress()',pro:'function get_progress()',cmt:'

Returns the progress of the firmware update, on a scale from 0 to 100. When the object is instantiated, the progress is zero. The value is updated during the firmware update process until the value of 100 is reached. The 100 value means that the firmware update was completed successfully. If an error occurs during the firmware update, a negative value is returned, and the error message can be retrieved with `get_progressMessage`.

',ret:'an integer in the range 0 to 100 (percentage of completion) or a negative error code in case of failure.'}; doc['FirmwareUpdate']['get_progressMessage']={syn:'Returns the last progress message of the firmware update process.',lib:'firmwareupdate.get_progressMessage()',pro:'function get_progressMessage()',cmt:'

Returns the last progress message of the firmware update process. If an error occurs during the firmware update process, the error message is returned

',ret:'a string with the latest progress message, or the error message.'}; doc['FirmwareUpdate']['startUpdate']={syn:'Starts the firmware update process.',lib:'firmwareupdate.startUpdate()',pro:'function startUpdate()',cmt:'

Starts the firmware update process. This method starts the firmware update process in background. This method returns immediately. You can monitor the progress of the firmware update with the `get_progress()` and `get_progressMessage()` methods.

',ret:'an integer in the range 0 to 100 (percentage of completion), or a negative error code in case of failure.',ext:'On failure returns a negative error code.'}; //--- (end of generated code: FirmwareUpdate) //--- (generated code: Gps) doc['Gps']={'':{syn:'GPS function interface',inc:'<script type='text/javascript' src='yocto_gps.js'></script>',cmt:'

The Gps function allows you to extract positionning data from the GPS device. This class can provides complete positionning information: However, if you whish to define callbacks on position changes, you should use the YLatitude et YLongitude classes.

'}}; doc['Gps']['FindGps']={syn:'Retrieves a GPS for a given identifier.',lib:'YGps.FindGps()',pro:'function FindGps(func)',cmt:'

Retrieves a GPS for a given identifier. The identifier can be specified using several formats:

- FunctionLogicalName
- ModuleSerialNumber.FunctionIdentifier
- ModuleSerialNumber.FunctionLogicalName
- ModuleLogicalName.FunctionIdentifier
- ModuleLogicalName.FunctionLogicalName

This function does not require that the GPS is online at the time it is invoked. The returned object is nevertheless valid. Use the method `YGps.isOnline()` to test if the GPS is indeed online at a given time. In case of ambiguity when looking for a GPS by logical name, no error is notified: the first instance found is returned. The search is performed first by hardware name, then by logical name.

If a call to this object\x27s is_online() method returns FALSE although you are certain that the matching device is plugged, make sure that you did call registerHub() at application initialization time.

',par:{func:'a string that uniquely characterizes the GPS'},ret:'a `YGps` object allowing you to drive the GPS.'}; doc['Gps']['FirstGps']={syn:'Starts the enumeration of GPS currently accessible.',lib:'YGps.FirstGps()',pro:'function FirstGps()',cmt:'

Starts the enumeration of GPS currently accessible. Use the method `YGps.nextGps()` to iterate on next GPS.

',ret:'a pointer to a `YGps` object, corresponding to the first GPS currently online, or a `null` pointer if there are none.'}; doc['Gps']['clearCache']={syn:'Invalidates the cache.',lib:'gps.clearCache()',pro:'function clearCache()',cmt:'

Invalidates the cache. Invalidates the cache of the GPS attributes. Forces the next call to get_xxx() or loadxxx() to use values that come from the device.

'}; doc['Gps']['describe']={syn:'Returns a short text that describes unambiguously the instance of the GPS in the form `TYPE(NAME)=SERIAL.FUNCTIONID`.',lib:'gps.describe()',pro:'function describe()',cmt:'

Returns a short text that describes unambiguously the instance of the GPS in the form `TYPE(NAME)=SERIAL.FUNCTIONID`. More precisely, `TYPE` is the type of the function, `NAME` it the name used for the first access to the function, `SERIAL` is the serial number of the module if the module is connected or `\x22unresolved\x22`, and `FUNCTIONID` is the hardware identifier of the function if the module is connected. For example, this method returns `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1` if the module is already connected or `Relay(BadCustomeName.relay1)=unresolved` if the module has not yet been connected. This method does not trigger any USB or TCP transaction and can therefore be used in a debugger.

',ret:'a string that describes the GPS (ex: `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1`)'}; doc['Gps']['get_advertisedValue']={syn:'Returns the current value of the GPS (no more than 6 characters).',lib:'gps.get_advertisedValue()',pro:'function get_advertisedValue()',cmt:'

Returns the current value of the GPS (no more than 6 characters).

',ret:'a string corresponding to the current value of the GPS (no more than 6 characters).',ext:'On failure, throws an exception or returns `Y_ADVERTISEDVALUE_INVALID`.'}; doc['Gps']['get_altitude']={syn:'Returns the current altitude.',lib:'gps.get_altitude()',pro:'function get_altitude()',cmt:'

Returns the current altitude. Beware: GPS technology is very inaccurate regarding altitude.

',ret:'a floating point number corresponding to the current altitude',ext:'On failure, throws an exception or returns `Y_ALTITUDE_INVALID`.'}; doc['Gps']['get_coordSystem']={syn:'Returns the representation system used for positioning data.',lib:'gps.get_coordSystem()',pro:'function get_coordSystem()',cmt:'

Returns the representation system used for positioning data.

',ret:'a value among `Y_COORDSYSTEM_GPS_DMS`, `Y_COORDSYSTEM_GPS_DM` and `Y_COORDSYSTEM_GPS_D` corresponding to the representation system used for positioning data',ext:'On failure, throws an exception or returns `Y_COORDSYSTEM_INVALID`.'}; doc['Gps']['get_dateTime']={syn:'Returns the current time in the form \x22YYYY/MM/DD hh:mm:ss\x22.',lib:'gps.get_dateTime()',pro:'function get_dateTime()',cmt:'

Returns the current time in the form \x22YYYY/MM/DD hh:mm:ss\x22.

',ret:'a string corresponding to the current time in the form \x22YYYY/MM/DD hh:mm:ss\x22',ext:'On failure, throws an exception or returns `Y_DATETIME_INVALID`.'}; doc['Gps']['get_dilution']={syn:'Returns the current horizontal dilution of precision, the smaller that number is, the better .',lib:'gps.get_dilution()',pro:'function get_dilution()',cmt:'

Returns the current horizontal dilution of precision, the smaller that number is, the better .

',ret:'a floating point number corresponding to the current horizontal dilution of precision, the smaller that number is, the better',ext:'On failure, throws an exception or returns `Y_DILUTION_INVALID`.'}; doc['Gps']['get_direction']={syn:'Returns the current move bearing in degrees, zero is the true (geographic) north.',lib:'gps.get_direction()',pro:'function get_direction()',cmt:'

Returns the current move bearing in degrees, zero is the true (geographic) north.

',ret:'a floating point number corresponding to the current move bearing in degrees, zero is the true (geographic) north',ext:'On failure, throws an exception or returns `Y_DIRECTION_INVALID`.'}; doc['Gps']['get_errorMessage']={syn:'Returns the error message of the latest error with the GPS.',lib:'gps.get_errorMessage()',pro:'function get_errorMessage()',cmt:'

Returns the error message of the latest error with the GPS. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a string corresponding to the latest error message that occured while using the GPS object'}; doc['Gps']['get_errorType']={syn:'Returns the numerical error code of the latest error with the GPS.',lib:'gps.get_errorType()',pro:'function get_errorType()',cmt:'

Returns the numerical error code of the latest error with the GPS. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a number corresponding to the code of the latest error that occurred while using the GPS object'}; doc['Gps']['get_friendlyName']={syn:'Returns a global identifier of the GPS in the format `MODULE_NAME.FUNCTION_NAME`.',lib:'gps.get_friendlyName()',pro:'function get_friendlyName()',cmt:'

Returns a global identifier of the GPS in the format `MODULE_NAME.FUNCTION_NAME`. The returned string uses the logical names of the module and of the GPS if they are defined, otherwise the serial number of the module and the hardware identifier of the GPS (for example: `MyCustomName.relay1`)

',ret:'a string that uniquely identifies the GPS using logical names (ex: `MyCustomName.relay1`)',ext:'On failure, throws an exception or returns `Y_FRIENDLYNAME_INVALID`.'}; doc['Gps']['get_functionDescriptor']={syn:'Returns a unique identifier of type `YFUN_DESCR` corresponding to the function.',lib:'gps.get_functionDescriptor()',pro:'function get_functionDescriptor()',cmt:'

Returns a unique identifier of type `YFUN_DESCR` corresponding to the function. This identifier can be used to test if two instances of `YFunction` reference the same physical function on the same physical device.

',ret:'an identifier of type `YFUN_DESCR`.',ext:'If the function has never been contacted, the returned value is `Y_FUNCTIONDESCRIPTOR_INVALID`.'}; doc['Gps']['get_functionId']={syn:'Returns the hardware identifier of the GPS, without reference to the module.',lib:'gps.get_functionId()',pro:'function get_functionId()',cmt:'

Returns the hardware identifier of the GPS, without reference to the module. For example `relay1`

',ret:'a string that identifies the GPS (ex: `relay1`)',ext:'On failure, throws an exception or returns `Y_FUNCTIONID_INVALID`.'}; doc['Gps']['get_groundSpeed']={syn:'Returns the current ground speed in Km/h.',lib:'gps.get_groundSpeed()',pro:'function get_groundSpeed()',cmt:'

Returns the current ground speed in Km/h.

',ret:'a floating point number corresponding to the current ground speed in Km/h',ext:'On failure, throws an exception or returns `Y_GROUNDSPEED_INVALID`.'}; doc['Gps']['get_hardwareId']={syn:'Returns the unique hardware identifier of the GPS in the form `SERIAL.FUNCTIONID`.',lib:'gps.get_hardwareId()',pro:'function get_hardwareId()',cmt:'

Returns the unique hardware identifier of the GPS in the form `SERIAL.FUNCTIONID`. The unique hardware identifier is composed of the device serial number and of the hardware identifier of the GPS (for example `RELAYLO1-123456.relay1`).

',ret:'a string that uniquely identifies the GPS (ex: `RELAYLO1-123456.relay1`)',ext:'On failure, throws an exception or returns `Y_HARDWAREID_INVALID`.'}; doc['Gps']['get_isFixed']={syn:'Returns TRUE if the receiver has found enough satellites to work.',lib:'gps.get_isFixed()',pro:'function get_isFixed()',cmt:'

Returns TRUE if the receiver has found enough satellites to work.

',ret:'either `Y_ISFIXED_FALSE` or `Y_ISFIXED_TRUE`, according to TRUE if the receiver has found enough satellites to work',ext:'On failure, throws an exception or returns `Y_ISFIXED_INVALID`.'}; doc['Gps']['get_latitude']={syn:'Returns the current latitude.',lib:'gps.get_latitude()',pro:'function get_latitude()',cmt:'

Returns the current latitude.

',ret:'a string corresponding to the current latitude',ext:'On failure, throws an exception or returns `Y_LATITUDE_INVALID`.'}; doc['Gps']['get_logicalName']={syn:'Returns the logical name of the GPS.',lib:'gps.get_logicalName()',pro:'function get_logicalName()',cmt:'

Returns the logical name of the GPS.

',ret:'a string corresponding to the logical name of the GPS.',ext:'On failure, throws an exception or returns `Y_LOGICALNAME_INVALID`.'}; doc['Gps']['get_longitude']={syn:'Returns the current longitude.',lib:'gps.get_longitude()',pro:'function get_longitude()',cmt:'

Returns the current longitude.

',ret:'a string corresponding to the current longitude',ext:'On failure, throws an exception or returns `Y_LONGITUDE_INVALID`.'}; doc['Gps']['get_module']={syn:'Gets the `YModule` object for the device on which the function is located.',lib:'gps.get_module()',pro:'function get_module()',cmt:'

Gets the `YModule` object for the device on which the function is located. If the function cannot be located on any module, the returned instance of `YModule` is not shown as on-line.

',ret:'an instance of `YModule`'}; doc['Gps']['get_module_async']={syn:'Gets the `YModule` object for the device on which the function is located (asynchronous version).',lib:'gps.get_module_async()',pro:'function get_module_async(callback, context)',cmt:'

Gets the `YModule` object for the device on which the function is located (asynchronous version). If the function cannot be located on any module, the returned `YModule` object does not show as on-line.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking Firefox javascript VM that does not implement context switching during blocking I/O calls. See the documentation section on asynchronous Javascript calls for more details.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the requested `YModule` object',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['Gps']['get_satCount']={syn:'Returns the count of visible satellites.',lib:'gps.get_satCount()',pro:'function get_satCount()',cmt:'

Returns the count of visible satellites.

',ret:'an integer corresponding to the count of visible satellites',ext:'On failure, throws an exception or returns `Y_SATCOUNT_INVALID`.'}; doc['Gps']['get_unixTime']={syn:'Returns the current time in Unix format (number of seconds elapsed since Jan 1st, 1970).',lib:'gps.get_unixTime()',pro:'function get_unixTime()',cmt:'

Returns the current time in Unix format (number of seconds elapsed since Jan 1st, 1970).

',ret:'an integer corresponding to the current time in Unix format (number of seconds elapsed since Jan 1st, 1970)',ext:'On failure, throws an exception or returns `Y_UNIXTIME_INVALID`.'}; doc['Gps']['get_userData']={syn:'Returns the value of the userData attribute, as previously stored using method `set_userData`.',lib:'gps.get_userData()',pro:'function get_userData()',cmt:'

Returns the value of the userData attribute, as previously stored using method `set_userData`. This attribute is never touched directly by the API, and is at disposal of the caller to store a context.

',ret:'the object stored previously by the caller.'}; doc['Gps']['get_utcOffset']={syn:'Returns the number of seconds between current time and UTC time (time zone).',lib:'gps.get_utcOffset()',pro:'function get_utcOffset()',cmt:'

Returns the number of seconds between current time and UTC time (time zone).

',ret:'an integer corresponding to the number of seconds between current time and UTC time (time zone)',ext:'On failure, throws an exception or returns `Y_UTCOFFSET_INVALID`.'}; doc['Gps']['isOnline']={syn:'Checks if the GPS is currently reachable, without raising any error.',lib:'gps.isOnline()',pro:'function isOnline()',cmt:'

Checks if the GPS is currently reachable, without raising any error. If there is a cached value for the GPS in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the GPS.

',ret:'`true` if the GPS can be reached, and `false` otherwise'}; doc['Gps']['isOnline_async']={syn:'Checks if the GPS is currently reachable, without raising any error (asynchronous version).',lib:'gps.isOnline_async()',pro:'function isOnline_async(callback, context)',cmt:'

Checks if the GPS is currently reachable, without raising any error (asynchronous version). If there is a cached value for the GPS in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the requested function.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the boolean result',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['Gps']['load']={syn:'Preloads the GPS cache with a specified validity duration.',lib:'gps.load()',pro:'function load(msValidity)',cmt:'

Preloads the GPS cache with a specified validity duration. By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network traffic for instance.

',par:{msValidity:'an integer corresponding to the validity attributed to the loaded function parameters, in milliseconds'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Gps']['loadAttribute']={syn:'Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.',lib:'gps.loadAttribute()',pro:'function loadAttribute(attrName)',cmt:'

Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.

',par:{attrName:'the name of the requested attribute'},ret:'a string with the value of the the attribute',ext:'On failure, throws an exception or returns an empty string.'}; doc['Gps']['load_async']={syn:'Preloads the GPS cache with a specified validity duration (asynchronous version).',lib:'gps.load_async()',pro:'function load_async(msValidity, callback, context)',cmt:'

Preloads the GPS cache with a specified validity duration (asynchronous version). By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network trafic for instance.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{msValidity:'an integer corresponding to the validity of the loaded function parameters, in milliseconds',callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the error code (or `YAPI_SUCCESS`)',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['Gps']['muteValueCallbacks']={syn:'Disables the propagation of every new advertised value to the parent hub.',lib:'gps.muteValueCallbacks()',pro:'function muteValueCallbacks()',cmt:'

Disables the propagation of every new advertised value to the parent hub. You can use this function to save bandwidth and CPU on computers with limited resources, or to prevent unwanted invocations of the HTTP callback. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Gps']['nextGps']={syn:'Continues the enumeration of GPS started using `yFirstGps()`.',lib:'gps.nextGps()',pro:'function nextGps()',cmt:'

Continues the enumeration of GPS started using `yFirstGps()`.

',ret:'a pointer to a `YGps` object, corresponding to a GPS currently online, or a `null` pointer if there are no more GPS to enumerate.'}; doc['Gps']['registerValueCallback']={syn:'Registers the callback function that is invoked on every change of advertised value.',lib:'gps.registerValueCallback()',pro:'function registerValueCallback(callback)',cmt:'

Registers the callback function that is invoked on every change of advertised value. The callback is invoked only during the execution of `ySleep` or `yHandleEvents`. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a null pointer as argument.

',par:{callback:'the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and the character string describing the new advertised value.'}}; doc['Gps']['set_coordSystem']={syn:'Changes the representation system used for positioning data.',lib:'gps.set_coordSystem()',pro:'function set_coordSystem(newval)',cmt:'

Changes the representation system used for positioning data.

',par:{newval:'a value among `Y_COORDSYSTEM_GPS_DMS`, `Y_COORDSYSTEM_GPS_DM` and `Y_COORDSYSTEM_GPS_D` corresponding to the representation system used for positioning data'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Gps']['set_logicalName']={syn:'Changes the logical name of the GPS.',lib:'gps.set_logicalName()',pro:'function set_logicalName(newval)',cmt:'

Changes the logical name of the GPS. You can use `yCheckLogicalName()` prior to this call to make sure that your parameter is valid. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',par:{newval:'a string corresponding to the logical name of the GPS.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Gps']['set_userData']={syn:'Stores a user context provided as argument in the userData attribute of the function.',lib:'gps.set_userData()',pro:'function set_userData(data)',cmt:'

Stores a user context provided as argument in the userData attribute of the function. This attribute is never touched by the API, and is at disposal of the caller to store a context.

',par:{data:'any kind of object to be stored'}}; doc['Gps']['set_utcOffset']={syn:'Changes the number of seconds between current time and UTC time (time zone).',lib:'gps.set_utcOffset()',pro:'function set_utcOffset(newval)',cmt:'

Changes the number of seconds between current time and UTC time (time zone). The timezone is automatically rounded to the nearest multiple of 15 minutes. If current UTC time is known, the current time is automatically be updated according to the selected time zone.

',par:{newval:'an integer corresponding to the number of seconds between current time and UTC time (time zone)'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Gps']['unmuteValueCallbacks']={syn:'Re-enables the propagation of every new advertised value to the parent hub.',lib:'gps.unmuteValueCallbacks()',pro:'function unmuteValueCallbacks()',cmt:'

Re-enables the propagation of every new advertised value to the parent hub. This function reverts the effect of a previous call to `muteValueCallbacks()`. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Gps']['wait_async']={syn:'Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function.',lib:'gps.wait_async()',pro:'function wait_async(callback, context)',cmt:'

Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function. The callback function can therefore freely issue synchronous or asynchronous commands, without risking to block the Javascript VM.

',par:{callback:'callback function that is invoked when all pending commands on the module are completed. The callback function receives two arguments: the caller-specific context object and the receiving function object.',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing.'}; //--- (end of generated code: Gps) //--- (generated code: Latitude) doc['Latitude']={'':{syn:'Latitude function interface',inc:'<script type='text/javascript' src='yocto_latitude.js'></script>',cmt:'

The Yoctopuce class YLatitude allows you to read the latitude from Yoctopuce geolocalization sensors. It inherits from the YSensor class the core functions to read measurements, to register callback functions, to access the autonomous datalogger.

'}}; doc['Latitude']['FindLatitude']={syn:'Retrieves a latitude sensor for a given identifier.',lib:'YLatitude.FindLatitude()',pro:'function FindLatitude(func)',cmt:'

Retrieves a latitude sensor for a given identifier. The identifier can be specified using several formats:

- FunctionLogicalName
- ModuleSerialNumber.FunctionIdentifier
- ModuleSerialNumber.FunctionLogicalName
- ModuleLogicalName.FunctionIdentifier
- ModuleLogicalName.FunctionLogicalName

This function does not require that the latitude sensor is online at the time it is invoked. The returned object is nevertheless valid. Use the method `YLatitude.isOnline()` to test if the latitude sensor is indeed online at a given time. In case of ambiguity when looking for a latitude sensor by logical name, no error is notified: the first instance found is returned. The search is performed first by hardware name, then by logical name.

If a call to this object\x27s is_online() method returns FALSE although you are certain that the matching device is plugged, make sure that you did call registerHub() at application initialization time.

',par:{func:'a string that uniquely characterizes the latitude sensor'},ret:'a `YLatitude` object allowing you to drive the latitude sensor.'}; doc['Latitude']['FirstLatitude']={syn:'Starts the enumeration of latitude sensors currently accessible.',lib:'YLatitude.FirstLatitude()',pro:'function FirstLatitude()',cmt:'

Starts the enumeration of latitude sensors currently accessible. Use the method `YLatitude.nextLatitude()` to iterate on next latitude sensors.

',ret:'a pointer to a `YLatitude` object, corresponding to the first latitude sensor currently online, or a `null` pointer if there are none.'}; doc['Latitude']['calibrateFromPoints']={syn:'Configures error correction data points, in particular to compensate for a possible perturbation of the measure caused by an enclosure.',lib:'latitude.calibrateFromPoints()',pro:'function calibrateFromPoints(rawValues, refValues)',cmt:'

Configures error correction data points, in particular to compensate for a possible perturbation of the measure caused by an enclosure. It is possible to configure up to five correction points. Correction points must be provided in ascending order, and be in the range of the sensor. The device will automatically perform a linear interpolation of the error correction between specified points. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

For more information on advanced capabilities to refine the calibration of sensors, please contact support@yoctopuce.com.

',par:{rawValues:'array of floating point numbers, corresponding to the raw values returned by the sensor for the correction points.',refValues:'array of floating point numbers, corresponding to the corrected values for the correction points.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Latitude']['clearCache']={syn:'Invalidates the cache.',lib:'latitude.clearCache()',pro:'function clearCache()',cmt:'

Invalidates the cache. Invalidates the cache of the latitude sensor attributes. Forces the next call to get_xxx() or loadxxx() to use values that come from the device.

'}; doc['Latitude']['describe']={syn:'Returns a short text that describes unambiguously the instance of the latitude sensor in the form `TYPE(NAME)=SERIAL.FUNCTIONID`.',lib:'latitude.describe()',pro:'function describe()',cmt:'

Returns a short text that describes unambiguously the instance of the latitude sensor in the form `TYPE(NAME)=SERIAL.FUNCTIONID`. More precisely, `TYPE` is the type of the function, `NAME` it the name used for the first access to the function, `SERIAL` is the serial number of the module if the module is connected or `\x22unresolved\x22`, and `FUNCTIONID` is the hardware identifier of the function if the module is connected. For example, this method returns `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1` if the module is already connected or `Relay(BadCustomeName.relay1)=unresolved` if the module has not yet been connected. This method does not trigger any USB or TCP transaction and can therefore be used in a debugger.

',ret:'a string that describes the latitude sensor (ex: `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1`)'}; doc['Latitude']['get_advMode']={syn:'Returns the measuring mode used for the advertised value pushed to the parent hub.',lib:'latitude.get_advMode()',pro:'function get_advMode()',cmt:'

Returns the measuring mode used for the advertised value pushed to the parent hub.

',ret:'a value among `Y_ADVMODE_IMMEDIATE`, `Y_ADVMODE_PERIOD_AVG`, `Y_ADVMODE_PERIOD_MIN` and `Y_ADVMODE_PERIOD_MAX` corresponding to the measuring mode used for the advertised value pushed to the parent hub',ext:'On failure, throws an exception or returns `Y_ADVMODE_INVALID`.'}; doc['Latitude']['get_advertisedValue']={syn:'Returns the current value of the latitude sensor (no more than 6 characters).',lib:'latitude.get_advertisedValue()',pro:'function get_advertisedValue()',cmt:'

Returns the current value of the latitude sensor (no more than 6 characters).

',ret:'a string corresponding to the current value of the latitude sensor (no more than 6 characters).',ext:'On failure, throws an exception or returns `Y_ADVERTISEDVALUE_INVALID`.'}; doc['Latitude']['get_currentRawValue']={syn:'Returns the uncalibrated, unrounded raw value returned by the sensor, in deg/1000, as a floating point number.',lib:'latitude.get_currentRawValue()',pro:'function get_currentRawValue()',cmt:'

Returns the uncalibrated, unrounded raw value returned by the sensor, in deg/1000, as a floating point number.

',ret:'a floating point number corresponding to the uncalibrated, unrounded raw value returned by the sensor, in deg/1000, as a floating point number',ext:'On failure, throws an exception or returns `Y_CURRENTRAWVALUE_INVALID`.'}; doc['Latitude']['get_currentValue']={syn:'Returns the current value of the latitude, in deg/1000, as a floating point number.',lib:'latitude.get_currentValue()',pro:'function get_currentValue()',cmt:'

Returns the current value of the latitude, in deg/1000, as a floating point number.

',ret:'a floating point number corresponding to the current value of the latitude, in deg/1000, as a floating point number',ext:'On failure, throws an exception or returns `Y_CURRENTVALUE_INVALID`.'}; doc['Latitude']['get_dataLogger']={syn:'Returns the YDatalogger object of the device hosting the sensor.',lib:'latitude.get_dataLogger()',pro:'function get_dataLogger()',cmt:'

Returns the YDatalogger object of the device hosting the sensor. This method returns an object of class YDatalogger that can control global parameters of the data logger. The returned object should not be freed.

',ret:'an YDataLogger object or null on error.'}; doc['Latitude']['get_errorMessage']={syn:'Returns the error message of the latest error with the latitude sensor.',lib:'latitude.get_errorMessage()',pro:'function get_errorMessage()',cmt:'

Returns the error message of the latest error with the latitude sensor. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a string corresponding to the latest error message that occured while using the latitude sensor object'}; doc['Latitude']['get_errorType']={syn:'Returns the numerical error code of the latest error with the latitude sensor.',lib:'latitude.get_errorType()',pro:'function get_errorType()',cmt:'

Returns the numerical error code of the latest error with the latitude sensor. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a number corresponding to the code of the latest error that occurred while using the latitude sensor object'}; doc['Latitude']['get_friendlyName']={syn:'Returns a global identifier of the latitude sensor in the format `MODULE_NAME.FUNCTION_NAME`.',lib:'latitude.get_friendlyName()',pro:'function get_friendlyName()',cmt:'

Returns a global identifier of the latitude sensor in the format `MODULE_NAME.FUNCTION_NAME`. The returned string uses the logical names of the module and of the latitude sensor if they are defined, otherwise the serial number of the module and the hardware identifier of the latitude sensor (for example: `MyCustomName.relay1`)

',ret:'a string that uniquely identifies the latitude sensor using logical names (ex: `MyCustomName.relay1`)',ext:'On failure, throws an exception or returns `Y_FRIENDLYNAME_INVALID`.'}; doc['Latitude']['get_functionDescriptor']={syn:'Returns a unique identifier of type `YFUN_DESCR` corresponding to the function.',lib:'latitude.get_functionDescriptor()',pro:'function get_functionDescriptor()',cmt:'

Returns a unique identifier of type `YFUN_DESCR` corresponding to the function. This identifier can be used to test if two instances of `YFunction` reference the same physical function on the same physical device.

',ret:'an identifier of type `YFUN_DESCR`.',ext:'If the function has never been contacted, the returned value is `Y_FUNCTIONDESCRIPTOR_INVALID`.'}; doc['Latitude']['get_functionId']={syn:'Returns the hardware identifier of the latitude sensor, without reference to the module.',lib:'latitude.get_functionId()',pro:'function get_functionId()',cmt:'

Returns the hardware identifier of the latitude sensor, without reference to the module. For example `relay1`

',ret:'a string that identifies the latitude sensor (ex: `relay1`)',ext:'On failure, throws an exception or returns `Y_FUNCTIONID_INVALID`.'}; doc['Latitude']['get_hardwareId']={syn:'Returns the unique hardware identifier of the latitude sensor in the form `SERIAL.FUNCTIONID`.',lib:'latitude.get_hardwareId()',pro:'function get_hardwareId()',cmt:'

Returns the unique hardware identifier of the latitude sensor in the form `SERIAL.FUNCTIONID`. The unique hardware identifier is composed of the device serial number and of the hardware identifier of the latitude sensor (for example `RELAYLO1-123456.relay1`).

',ret:'a string that uniquely identifies the latitude sensor (ex: `RELAYLO1-123456.relay1`)',ext:'On failure, throws an exception or returns `Y_HARDWAREID_INVALID`.'}; doc['Latitude']['get_highestValue']={syn:'Returns the maximal value observed for the latitude since the device was started.',lib:'latitude.get_highestValue()',pro:'function get_highestValue()',cmt:'

Returns the maximal value observed for the latitude since the device was started. Can be reset to an arbitrary value thanks to set_highestValue().

',ret:'a floating point number corresponding to the maximal value observed for the latitude since the device was started',ext:'On failure, throws an exception or returns `Y_HIGHESTVALUE_INVALID`.'}; doc['Latitude']['get_logFrequency']={syn:'Returns the datalogger recording frequency for this function, or \x22OFF\x22 when measures are not stored in the data logger flash memory.',lib:'latitude.get_logFrequency()',pro:'function get_logFrequency()',cmt:'

Returns the datalogger recording frequency for this function, or \x22OFF\x22 when measures are not stored in the data logger flash memory.

',ret:'a string corresponding to the datalogger recording frequency for this function, or \x22OFF\x22 when measures are not stored in the data logger flash memory',ext:'On failure, throws an exception or returns `Y_LOGFREQUENCY_INVALID`.'}; doc['Latitude']['get_logicalName']={syn:'Returns the logical name of the latitude sensor.',lib:'latitude.get_logicalName()',pro:'function get_logicalName()',cmt:'

Returns the logical name of the latitude sensor.

',ret:'a string corresponding to the logical name of the latitude sensor.',ext:'On failure, throws an exception or returns `Y_LOGICALNAME_INVALID`.'}; doc['Latitude']['get_lowestValue']={syn:'Returns the minimal value observed for the latitude since the device was started.',lib:'latitude.get_lowestValue()',pro:'function get_lowestValue()',cmt:'

Returns the minimal value observed for the latitude since the device was started. Can be reset to an arbitrary value thanks to set_lowestValue().

',ret:'a floating point number corresponding to the minimal value observed for the latitude since the device was started',ext:'On failure, throws an exception or returns `Y_LOWESTVALUE_INVALID`.'}; doc['Latitude']['get_module']={syn:'Gets the `YModule` object for the device on which the function is located.',lib:'latitude.get_module()',pro:'function get_module()',cmt:'

Gets the `YModule` object for the device on which the function is located. If the function cannot be located on any module, the returned instance of `YModule` is not shown as on-line.

',ret:'an instance of `YModule`'}; doc['Latitude']['get_module_async']={syn:'Gets the `YModule` object for the device on which the function is located (asynchronous version).',lib:'latitude.get_module_async()',pro:'function get_module_async(callback, context)',cmt:'

Gets the `YModule` object for the device on which the function is located (asynchronous version). If the function cannot be located on any module, the returned `YModule` object does not show as on-line.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking Firefox javascript VM that does not implement context switching during blocking I/O calls. See the documentation section on asynchronous Javascript calls for more details.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the requested `YModule` object',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['Latitude']['get_recordedData']={syn:'Retrieves a DataSet object holding historical data for this sensor, for a specified time interval.',lib:'latitude.get_recordedData()',pro:'function get_recordedData(startTime, endTime)',cmt:'

Retrieves a DataSet object holding historical data for this sensor, for a specified time interval. The measures will be retrieved from the data logger, which must have been turned on at the desired time. See the documentation of the DataSet class for information on how to get an overview of the recorded data, and how to load progressively a large set of measures from the data logger.

This function only works if the device uses a recent firmware, as DataSet objects are not supported by firmwares older than version 13000.

',par:{startTime:'the start of the desired measure time interval, as a Unix timestamp, i.e. the number of seconds since January 1, 1970 UTC. The special value 0 can be used to include any meaasure, without initial limit.',endTime:'the end of the desired measure time interval, as a Unix timestamp, i.e. the number of seconds since January 1, 1970 UTC. The special value 0 can be used to include any meaasure, without ending limit.'},ret:'an instance of YDataSet, providing access to historical data. Past measures can be loaded progressively using methods from the YDataSet object.'}; doc['Latitude']['get_reportFrequency']={syn:'Returns the timed value notification frequency, or \x22OFF\x22 if timed value notifications are disabled for this function.',lib:'latitude.get_reportFrequency()',pro:'function get_reportFrequency()',cmt:'

Returns the timed value notification frequency, or \x22OFF\x22 if timed value notifications are disabled for this function.

',ret:'a string corresponding to the timed value notification frequency, or \x22OFF\x22 if timed value notifications are disabled for this function',ext:'On failure, throws an exception or returns `Y_REPORTFREQUENCY_INVALID`.'}; doc['Latitude']['get_resolution']={syn:'Returns the resolution of the measured values.',lib:'latitude.get_resolution()',pro:'function get_resolution()',cmt:'

Returns the resolution of the measured values. The resolution corresponds to the numerical precision of the measures, which is not always the same as the actual precision of the sensor.

',ret:'a floating point number corresponding to the resolution of the measured values',ext:'On failure, throws an exception or returns `Y_RESOLUTION_INVALID`.'}; doc['Latitude']['get_sensorState']={syn:'Returns the sensor health state code, which is zero when there is an up-to-date measure available or a positive code if the sensor is not able to provide a measure right now.',lib:'latitude.get_sensorState()',pro:'function get_sensorState()',cmt:'

Returns the sensor health state code, which is zero when there is an up-to-date measure available or a positive code if the sensor is not able to provide a measure right now.

',ret:'an integer corresponding to the sensor health state code, which is zero when there is an up-to-date measure available or a positive code if the sensor is not able to provide a measure right now',ext:'On failure, throws an exception or returns `Y_SENSORSTATE_INVALID`.'}; doc['Latitude']['get_unit']={syn:'Returns the measuring unit for the latitude.',lib:'latitude.get_unit()',pro:'function get_unit()',cmt:'

Returns the measuring unit for the latitude.

',ret:'a string corresponding to the measuring unit for the latitude',ext:'On failure, throws an exception or returns `Y_UNIT_INVALID`.'}; doc['Latitude']['get_userData']={syn:'Returns the value of the userData attribute, as previously stored using method `set_userData`.',lib:'latitude.get_userData()',pro:'function get_userData()',cmt:'

Returns the value of the userData attribute, as previously stored using method `set_userData`. This attribute is never touched directly by the API, and is at disposal of the caller to store a context.

',ret:'the object stored previously by the caller.'}; doc['Latitude']['isOnline']={syn:'Checks if the latitude sensor is currently reachable, without raising any error.',lib:'latitude.isOnline()',pro:'function isOnline()',cmt:'

Checks if the latitude sensor is currently reachable, without raising any error. If there is a cached value for the latitude sensor in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the latitude sensor.

',ret:'`true` if the latitude sensor can be reached, and `false` otherwise'}; doc['Latitude']['isOnline_async']={syn:'Checks if the latitude sensor is currently reachable, without raising any error (asynchronous version).',lib:'latitude.isOnline_async()',pro:'function isOnline_async(callback, context)',cmt:'

Checks if the latitude sensor is currently reachable, without raising any error (asynchronous version). If there is a cached value for the latitude sensor in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the requested function.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the boolean result',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['Latitude']['load']={syn:'Preloads the latitude sensor cache with a specified validity duration.',lib:'latitude.load()',pro:'function load(msValidity)',cmt:'

Preloads the latitude sensor cache with a specified validity duration. By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network traffic for instance.

',par:{msValidity:'an integer corresponding to the validity attributed to the loaded function parameters, in milliseconds'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Latitude']['loadAttribute']={syn:'Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.',lib:'latitude.loadAttribute()',pro:'function loadAttribute(attrName)',cmt:'

Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.

',par:{attrName:'the name of the requested attribute'},ret:'a string with the value of the the attribute',ext:'On failure, throws an exception or returns an empty string.'}; doc['Latitude']['loadCalibrationPoints']={syn:'Retrieves error correction data points previously entered using the method `calibrateFromPoints`.',lib:'latitude.loadCalibrationPoints()',pro:'function loadCalibrationPoints(rawValues, refValues)',cmt:'

Retrieves error correction data points previously entered using the method `calibrateFromPoints`.

',par:{rawValues:'array of floating point numbers, that will be filled by the function with the raw sensor values for the correction points.',refValues:'array of floating point numbers, that will be filled by the function with the desired values for the correction points.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Latitude']['load_async']={syn:'Preloads the latitude sensor cache with a specified validity duration (asynchronous version).',lib:'latitude.load_async()',pro:'function load_async(msValidity, callback, context)',cmt:'

Preloads the latitude sensor cache with a specified validity duration (asynchronous version). By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network trafic for instance.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{msValidity:'an integer corresponding to the validity of the loaded function parameters, in milliseconds',callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the error code (or `YAPI_SUCCESS`)',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['Latitude']['muteValueCallbacks']={syn:'Disables the propagation of every new advertised value to the parent hub.',lib:'latitude.muteValueCallbacks()',pro:'function muteValueCallbacks()',cmt:'

Disables the propagation of every new advertised value to the parent hub. You can use this function to save bandwidth and CPU on computers with limited resources, or to prevent unwanted invocations of the HTTP callback. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Latitude']['nextLatitude']={syn:'Continues the enumeration of latitude sensors started using `yFirstLatitude()`.',lib:'latitude.nextLatitude()',pro:'function nextLatitude()',cmt:'

Continues the enumeration of latitude sensors started using `yFirstLatitude()`.

',ret:'a pointer to a `YLatitude` object, corresponding to a latitude sensor currently online, or a `null` pointer if there are no more latitude sensors to enumerate.'}; doc['Latitude']['registerTimedReportCallback']={syn:'Registers the callback function that is invoked on every periodic timed notification.',lib:'latitude.registerTimedReportCallback()',pro:'function registerTimedReportCallback(callback)',cmt:'

Registers the callback function that is invoked on every periodic timed notification. The callback is invoked only during the execution of `ySleep` or `yHandleEvents`. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a null pointer as argument.

',par:{callback:'the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and an YMeasure object describing the new advertised value.'}}; doc['Latitude']['registerValueCallback']={syn:'Registers the callback function that is invoked on every change of advertised value.',lib:'latitude.registerValueCallback()',pro:'function registerValueCallback(callback)',cmt:'

Registers the callback function that is invoked on every change of advertised value. The callback is invoked only during the execution of `ySleep` or `yHandleEvents`. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a null pointer as argument.

',par:{callback:'the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and the character string describing the new advertised value.'}}; doc['Latitude']['set_advMode']={syn:'Changes the measuring mode used for the advertised value pushed to the parent hub.',lib:'latitude.set_advMode()',pro:'function set_advMode(newval)',cmt:'

Changes the measuring mode used for the advertised value pushed to the parent hub.

',par:{newval:'a value among `Y_ADVMODE_IMMEDIATE`, `Y_ADVMODE_PERIOD_AVG`, `Y_ADVMODE_PERIOD_MIN` and `Y_ADVMODE_PERIOD_MAX` corresponding to the measuring mode used for the advertised value pushed to the parent hub'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Latitude']['set_highestValue']={syn:'Changes the recorded maximal value observed.',lib:'latitude.set_highestValue()',pro:'function set_highestValue(newval)',cmt:'

Changes the recorded maximal value observed. Can be used to reset the value returned by get_lowestValue().

',par:{newval:'a floating point number corresponding to the recorded maximal value observed'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Latitude']['set_logFrequency']={syn:'Changes the datalogger recording frequency for this function.',lib:'latitude.set_logFrequency()',pro:'function set_logFrequency(newval)',cmt:'

Changes the datalogger recording frequency for this function. The frequency can be specified as samples per second, as sample per minute (for instance \x2215/m\x22) or in samples per hour (eg. \x224/h\x22). To disable recording for this function, use the value \x22OFF\x22.

',par:{newval:'a string corresponding to the datalogger recording frequency for this function'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Latitude']['set_logicalName']={syn:'Changes the logical name of the latitude sensor.',lib:'latitude.set_logicalName()',pro:'function set_logicalName(newval)',cmt:'

Changes the logical name of the latitude sensor. You can use `yCheckLogicalName()` prior to this call to make sure that your parameter is valid. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',par:{newval:'a string corresponding to the logical name of the latitude sensor.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Latitude']['set_lowestValue']={syn:'Changes the recorded minimal value observed.',lib:'latitude.set_lowestValue()',pro:'function set_lowestValue(newval)',cmt:'

Changes the recorded minimal value observed. Can be used to reset the value returned by get_lowestValue().

',par:{newval:'a floating point number corresponding to the recorded minimal value observed'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Latitude']['set_reportFrequency']={syn:'Changes the timed value notification frequency for this function.',lib:'latitude.set_reportFrequency()',pro:'function set_reportFrequency(newval)',cmt:'

Changes the timed value notification frequency for this function. The frequency can be specified as samples per second, as sample per minute (for instance \x2215/m\x22) or in samples per hour (eg. \x224/h\x22). To disable timed value notifications for this function, use the value \x22OFF\x22.

',par:{newval:'a string corresponding to the timed value notification frequency for this function'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Latitude']['set_resolution']={syn:'Changes the resolution of the measured physical values.',lib:'latitude.set_resolution()',pro:'function set_resolution(newval)',cmt:'

Changes the resolution of the measured physical values. The resolution corresponds to the numerical precision when displaying value. It does not change the precision of the measure itself.

',par:{newval:'a floating point number corresponding to the resolution of the measured physical values'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Latitude']['set_userData']={syn:'Stores a user context provided as argument in the userData attribute of the function.',lib:'latitude.set_userData()',pro:'function set_userData(data)',cmt:'

Stores a user context provided as argument in the userData attribute of the function. This attribute is never touched by the API, and is at disposal of the caller to store a context.

',par:{data:'any kind of object to be stored'}}; doc['Latitude']['startDataLogger']={syn:'Starts the data logger on the device.',lib:'latitude.startDataLogger()',pro:'function startDataLogger()',cmt:'

Starts the data logger on the device. Note that the data logger will only save the measures on this sensor if the logFrequency is not set to \x22OFF\x22.

',ret:'`YAPI_SUCCESS` if the call succeeds.'}; doc['Latitude']['stopDataLogger']={syn:'Stops the datalogger on the device.',lib:'latitude.stopDataLogger()',pro:'function stopDataLogger()',cmt:'

Stops the datalogger on the device.

',ret:'`YAPI_SUCCESS` if the call succeeds.'}; doc['Latitude']['unmuteValueCallbacks']={syn:'Re-enables the propagation of every new advertised value to the parent hub.',lib:'latitude.unmuteValueCallbacks()',pro:'function unmuteValueCallbacks()',cmt:'

Re-enables the propagation of every new advertised value to the parent hub. This function reverts the effect of a previous call to `muteValueCallbacks()`. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Latitude']['wait_async']={syn:'Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function.',lib:'latitude.wait_async()',pro:'function wait_async(callback, context)',cmt:'

Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function. The callback function can therefore freely issue synchronous or asynchronous commands, without risking to block the Javascript VM.

',par:{callback:'callback function that is invoked when all pending commands on the module are completed. The callback function receives two arguments: the caller-specific context object and the receiving function object.',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing.'}; //--- (end of generated code: Latitude) //--- (generated code: Longitude) doc['Longitude']={'':{syn:'Longitude function interface',inc:'<script type='text/javascript' src='yocto_longitude.js'></script>',cmt:'

The Yoctopuce class YLongitude allows you to read the longitude from Yoctopuce geolocalization sensors. It inherits from the YSensor class the core functions to read measurements, register callback functions, access the autonomous datalogger.

'}}; doc['Longitude']['FindLongitude']={syn:'Retrieves a longitude sensor for a given identifier.',lib:'YLongitude.FindLongitude()',pro:'function FindLongitude(func)',cmt:'

Retrieves a longitude sensor for a given identifier. The identifier can be specified using several formats:

- FunctionLogicalName
- ModuleSerialNumber.FunctionIdentifier
- ModuleSerialNumber.FunctionLogicalName
- ModuleLogicalName.FunctionIdentifier
- ModuleLogicalName.FunctionLogicalName

This function does not require that the longitude sensor is online at the time it is invoked. The returned object is nevertheless valid. Use the method `YLongitude.isOnline()` to test if the longitude sensor is indeed online at a given time. In case of ambiguity when looking for a longitude sensor by logical name, no error is notified: the first instance found is returned. The search is performed first by hardware name, then by logical name.

If a call to this object\x27s is_online() method returns FALSE although you are certain that the matching device is plugged, make sure that you did call registerHub() at application initialization time.

',par:{func:'a string that uniquely characterizes the longitude sensor'},ret:'a `YLongitude` object allowing you to drive the longitude sensor.'}; doc['Longitude']['FirstLongitude']={syn:'Starts the enumeration of longitude sensors currently accessible.',lib:'YLongitude.FirstLongitude()',pro:'function FirstLongitude()',cmt:'

Starts the enumeration of longitude sensors currently accessible. Use the method `YLongitude.nextLongitude()` to iterate on next longitude sensors.

',ret:'a pointer to a `YLongitude` object, corresponding to the first longitude sensor currently online, or a `null` pointer if there are none.'}; doc['Longitude']['calibrateFromPoints']={syn:'Configures error correction data points, in particular to compensate for a possible perturbation of the measure caused by an enclosure.',lib:'longitude.calibrateFromPoints()',pro:'function calibrateFromPoints(rawValues, refValues)',cmt:'

Configures error correction data points, in particular to compensate for a possible perturbation of the measure caused by an enclosure. It is possible to configure up to five correction points. Correction points must be provided in ascending order, and be in the range of the sensor. The device will automatically perform a linear interpolation of the error correction between specified points. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

For more information on advanced capabilities to refine the calibration of sensors, please contact support@yoctopuce.com.

',par:{rawValues:'array of floating point numbers, corresponding to the raw values returned by the sensor for the correction points.',refValues:'array of floating point numbers, corresponding to the corrected values for the correction points.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Longitude']['clearCache']={syn:'Invalidates the cache.',lib:'longitude.clearCache()',pro:'function clearCache()',cmt:'

Invalidates the cache. Invalidates the cache of the longitude sensor attributes. Forces the next call to get_xxx() or loadxxx() to use values that come from the device.

'}; doc['Longitude']['describe']={syn:'Returns a short text that describes unambiguously the instance of the longitude sensor in the form `TYPE(NAME)=SERIAL.FUNCTIONID`.',lib:'longitude.describe()',pro:'function describe()',cmt:'

Returns a short text that describes unambiguously the instance of the longitude sensor in the form `TYPE(NAME)=SERIAL.FUNCTIONID`. More precisely, `TYPE` is the type of the function, `NAME` it the name used for the first access to the function, `SERIAL` is the serial number of the module if the module is connected or `\x22unresolved\x22`, and `FUNCTIONID` is the hardware identifier of the function if the module is connected. For example, this method returns `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1` if the module is already connected or `Relay(BadCustomeName.relay1)=unresolved` if the module has not yet been connected. This method does not trigger any USB or TCP transaction and can therefore be used in a debugger.

',ret:'a string that describes the longitude sensor (ex: `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1`)'}; doc['Longitude']['get_advMode']={syn:'Returns the measuring mode used for the advertised value pushed to the parent hub.',lib:'longitude.get_advMode()',pro:'function get_advMode()',cmt:'

Returns the measuring mode used for the advertised value pushed to the parent hub.

',ret:'a value among `Y_ADVMODE_IMMEDIATE`, `Y_ADVMODE_PERIOD_AVG`, `Y_ADVMODE_PERIOD_MIN` and `Y_ADVMODE_PERIOD_MAX` corresponding to the measuring mode used for the advertised value pushed to the parent hub',ext:'On failure, throws an exception or returns `Y_ADVMODE_INVALID`.'}; doc['Longitude']['get_advertisedValue']={syn:'Returns the current value of the longitude sensor (no more than 6 characters).',lib:'longitude.get_advertisedValue()',pro:'function get_advertisedValue()',cmt:'

Returns the current value of the longitude sensor (no more than 6 characters).

',ret:'a string corresponding to the current value of the longitude sensor (no more than 6 characters).',ext:'On failure, throws an exception or returns `Y_ADVERTISEDVALUE_INVALID`.'}; doc['Longitude']['get_currentRawValue']={syn:'Returns the uncalibrated, unrounded raw value returned by the sensor, in deg/1000, as a floating point number.',lib:'longitude.get_currentRawValue()',pro:'function get_currentRawValue()',cmt:'

Returns the uncalibrated, unrounded raw value returned by the sensor, in deg/1000, as a floating point number.

',ret:'a floating point number corresponding to the uncalibrated, unrounded raw value returned by the sensor, in deg/1000, as a floating point number',ext:'On failure, throws an exception or returns `Y_CURRENTRAWVALUE_INVALID`.'}; doc['Longitude']['get_currentValue']={syn:'Returns the current value of the longitude, in deg/1000, as a floating point number.',lib:'longitude.get_currentValue()',pro:'function get_currentValue()',cmt:'

Returns the current value of the longitude, in deg/1000, as a floating point number.

',ret:'a floating point number corresponding to the current value of the longitude, in deg/1000, as a floating point number',ext:'On failure, throws an exception or returns `Y_CURRENTVALUE_INVALID`.'}; doc['Longitude']['get_dataLogger']={syn:'Returns the YDatalogger object of the device hosting the sensor.',lib:'longitude.get_dataLogger()',pro:'function get_dataLogger()',cmt:'

Returns the YDatalogger object of the device hosting the sensor. This method returns an object of class YDatalogger that can control global parameters of the data logger. The returned object should not be freed.

',ret:'an YDataLogger object or null on error.'}; doc['Longitude']['get_errorMessage']={syn:'Returns the error message of the latest error with the longitude sensor.',lib:'longitude.get_errorMessage()',pro:'function get_errorMessage()',cmt:'

Returns the error message of the latest error with the longitude sensor. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a string corresponding to the latest error message that occured while using the longitude sensor object'}; doc['Longitude']['get_errorType']={syn:'Returns the numerical error code of the latest error with the longitude sensor.',lib:'longitude.get_errorType()',pro:'function get_errorType()',cmt:'

Returns the numerical error code of the latest error with the longitude sensor. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a number corresponding to the code of the latest error that occurred while using the longitude sensor object'}; doc['Longitude']['get_friendlyName']={syn:'Returns a global identifier of the longitude sensor in the format `MODULE_NAME.FUNCTION_NAME`.',lib:'longitude.get_friendlyName()',pro:'function get_friendlyName()',cmt:'

Returns a global identifier of the longitude sensor in the format `MODULE_NAME.FUNCTION_NAME`. The returned string uses the logical names of the module and of the longitude sensor if they are defined, otherwise the serial number of the module and the hardware identifier of the longitude sensor (for example: `MyCustomName.relay1`)

',ret:'a string that uniquely identifies the longitude sensor using logical names (ex: `MyCustomName.relay1`)',ext:'On failure, throws an exception or returns `Y_FRIENDLYNAME_INVALID`.'}; doc['Longitude']['get_functionDescriptor']={syn:'Returns a unique identifier of type `YFUN_DESCR` corresponding to the function.',lib:'longitude.get_functionDescriptor()',pro:'function get_functionDescriptor()',cmt:'

Returns a unique identifier of type `YFUN_DESCR` corresponding to the function. This identifier can be used to test if two instances of `YFunction` reference the same physical function on the same physical device.

',ret:'an identifier of type `YFUN_DESCR`.',ext:'If the function has never been contacted, the returned value is `Y_FUNCTIONDESCRIPTOR_INVALID`.'}; doc['Longitude']['get_functionId']={syn:'Returns the hardware identifier of the longitude sensor, without reference to the module.',lib:'longitude.get_functionId()',pro:'function get_functionId()',cmt:'

Returns the hardware identifier of the longitude sensor, without reference to the module. For example `relay1`

',ret:'a string that identifies the longitude sensor (ex: `relay1`)',ext:'On failure, throws an exception or returns `Y_FUNCTIONID_INVALID`.'}; doc['Longitude']['get_hardwareId']={syn:'Returns the unique hardware identifier of the longitude sensor in the form `SERIAL.FUNCTIONID`.',lib:'longitude.get_hardwareId()',pro:'function get_hardwareId()',cmt:'

Returns the unique hardware identifier of the longitude sensor in the form `SERIAL.FUNCTIONID`. The unique hardware identifier is composed of the device serial number and of the hardware identifier of the longitude sensor (for example `RELAYLO1-123456.relay1`).

',ret:'a string that uniquely identifies the longitude sensor (ex: `RELAYLO1-123456.relay1`)',ext:'On failure, throws an exception or returns `Y_HARDWAREID_INVALID`.'}; doc['Longitude']['get_highestValue']={syn:'Returns the maximal value observed for the longitude since the device was started.',lib:'longitude.get_highestValue()',pro:'function get_highestValue()',cmt:'

Returns the maximal value observed for the longitude since the device was started. Can be reset to an arbitrary value thanks to set_highestValue().

',ret:'a floating point number corresponding to the maximal value observed for the longitude since the device was started',ext:'On failure, throws an exception or returns `Y_HIGHESTVALUE_INVALID`.'}; doc['Longitude']['get_logFrequency']={syn:'Returns the datalogger recording frequency for this function, or \x22OFF\x22 when measures are not stored in the data logger flash memory.',lib:'longitude.get_logFrequency()',pro:'function get_logFrequency()',cmt:'

Returns the datalogger recording frequency for this function, or \x22OFF\x22 when measures are not stored in the data logger flash memory.

',ret:'a string corresponding to the datalogger recording frequency for this function, or \x22OFF\x22 when measures are not stored in the data logger flash memory',ext:'On failure, throws an exception or returns `Y_LOGFREQUENCY_INVALID`.'}; doc['Longitude']['get_logicalName']={syn:'Returns the logical name of the longitude sensor.',lib:'longitude.get_logicalName()',pro:'function get_logicalName()',cmt:'

Returns the logical name of the longitude sensor.

',ret:'a string corresponding to the logical name of the longitude sensor.',ext:'On failure, throws an exception or returns `Y_LOGICALNAME_INVALID`.'}; doc['Longitude']['get_lowestValue']={syn:'Returns the minimal value observed for the longitude since the device was started.',lib:'longitude.get_lowestValue()',pro:'function get_lowestValue()',cmt:'

Returns the minimal value observed for the longitude since the device was started. Can be reset to an arbitrary value thanks to set_lowestValue().

',ret:'a floating point number corresponding to the minimal value observed for the longitude since the device was started',ext:'On failure, throws an exception or returns `Y_LOWESTVALUE_INVALID`.'}; doc['Longitude']['get_module']={syn:'Gets the `YModule` object for the device on which the function is located.',lib:'longitude.get_module()',pro:'function get_module()',cmt:'

Gets the `YModule` object for the device on which the function is located. If the function cannot be located on any module, the returned instance of `YModule` is not shown as on-line.

',ret:'an instance of `YModule`'}; doc['Longitude']['get_module_async']={syn:'Gets the `YModule` object for the device on which the function is located (asynchronous version).',lib:'longitude.get_module_async()',pro:'function get_module_async(callback, context)',cmt:'

Gets the `YModule` object for the device on which the function is located (asynchronous version). If the function cannot be located on any module, the returned `YModule` object does not show as on-line.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking Firefox javascript VM that does not implement context switching during blocking I/O calls. See the documentation section on asynchronous Javascript calls for more details.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the requested `YModule` object',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['Longitude']['get_recordedData']={syn:'Retrieves a DataSet object holding historical data for this sensor, for a specified time interval.',lib:'longitude.get_recordedData()',pro:'function get_recordedData(startTime, endTime)',cmt:'

Retrieves a DataSet object holding historical data for this sensor, for a specified time interval. The measures will be retrieved from the data logger, which must have been turned on at the desired time. See the documentation of the DataSet class for information on how to get an overview of the recorded data, and how to load progressively a large set of measures from the data logger.

This function only works if the device uses a recent firmware, as DataSet objects are not supported by firmwares older than version 13000.

',par:{startTime:'the start of the desired measure time interval, as a Unix timestamp, i.e. the number of seconds since January 1, 1970 UTC. The special value 0 can be used to include any meaasure, without initial limit.',endTime:'the end of the desired measure time interval, as a Unix timestamp, i.e. the number of seconds since January 1, 1970 UTC. The special value 0 can be used to include any meaasure, without ending limit.'},ret:'an instance of YDataSet, providing access to historical data. Past measures can be loaded progressively using methods from the YDataSet object.'}; doc['Longitude']['get_reportFrequency']={syn:'Returns the timed value notification frequency, or \x22OFF\x22 if timed value notifications are disabled for this function.',lib:'longitude.get_reportFrequency()',pro:'function get_reportFrequency()',cmt:'

Returns the timed value notification frequency, or \x22OFF\x22 if timed value notifications are disabled for this function.

',ret:'a string corresponding to the timed value notification frequency, or \x22OFF\x22 if timed value notifications are disabled for this function',ext:'On failure, throws an exception or returns `Y_REPORTFREQUENCY_INVALID`.'}; doc['Longitude']['get_resolution']={syn:'Returns the resolution of the measured values.',lib:'longitude.get_resolution()',pro:'function get_resolution()',cmt:'

Returns the resolution of the measured values. The resolution corresponds to the numerical precision of the measures, which is not always the same as the actual precision of the sensor.

',ret:'a floating point number corresponding to the resolution of the measured values',ext:'On failure, throws an exception or returns `Y_RESOLUTION_INVALID`.'}; doc['Longitude']['get_sensorState']={syn:'Returns the sensor health state code, which is zero when there is an up-to-date measure available or a positive code if the sensor is not able to provide a measure right now.',lib:'longitude.get_sensorState()',pro:'function get_sensorState()',cmt:'

Returns the sensor health state code, which is zero when there is an up-to-date measure available or a positive code if the sensor is not able to provide a measure right now.

',ret:'an integer corresponding to the sensor health state code, which is zero when there is an up-to-date measure available or a positive code if the sensor is not able to provide a measure right now',ext:'On failure, throws an exception or returns `Y_SENSORSTATE_INVALID`.'}; doc['Longitude']['get_unit']={syn:'Returns the measuring unit for the longitude.',lib:'longitude.get_unit()',pro:'function get_unit()',cmt:'

Returns the measuring unit for the longitude.

',ret:'a string corresponding to the measuring unit for the longitude',ext:'On failure, throws an exception or returns `Y_UNIT_INVALID`.'}; doc['Longitude']['get_userData']={syn:'Returns the value of the userData attribute, as previously stored using method `set_userData`.',lib:'longitude.get_userData()',pro:'function get_userData()',cmt:'

Returns the value of the userData attribute, as previously stored using method `set_userData`. This attribute is never touched directly by the API, and is at disposal of the caller to store a context.

',ret:'the object stored previously by the caller.'}; doc['Longitude']['isOnline']={syn:'Checks if the longitude sensor is currently reachable, without raising any error.',lib:'longitude.isOnline()',pro:'function isOnline()',cmt:'

Checks if the longitude sensor is currently reachable, without raising any error. If there is a cached value for the longitude sensor in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the longitude sensor.

',ret:'`true` if the longitude sensor can be reached, and `false` otherwise'}; doc['Longitude']['isOnline_async']={syn:'Checks if the longitude sensor is currently reachable, without raising any error (asynchronous version).',lib:'longitude.isOnline_async()',pro:'function isOnline_async(callback, context)',cmt:'

Checks if the longitude sensor is currently reachable, without raising any error (asynchronous version). If there is a cached value for the longitude sensor in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the requested function.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the boolean result',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['Longitude']['load']={syn:'Preloads the longitude sensor cache with a specified validity duration.',lib:'longitude.load()',pro:'function load(msValidity)',cmt:'

Preloads the longitude sensor cache with a specified validity duration. By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network traffic for instance.

',par:{msValidity:'an integer corresponding to the validity attributed to the loaded function parameters, in milliseconds'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Longitude']['loadAttribute']={syn:'Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.',lib:'longitude.loadAttribute()',pro:'function loadAttribute(attrName)',cmt:'

Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.

',par:{attrName:'the name of the requested attribute'},ret:'a string with the value of the the attribute',ext:'On failure, throws an exception or returns an empty string.'}; doc['Longitude']['loadCalibrationPoints']={syn:'Retrieves error correction data points previously entered using the method `calibrateFromPoints`.',lib:'longitude.loadCalibrationPoints()',pro:'function loadCalibrationPoints(rawValues, refValues)',cmt:'

Retrieves error correction data points previously entered using the method `calibrateFromPoints`.

',par:{rawValues:'array of floating point numbers, that will be filled by the function with the raw sensor values for the correction points.',refValues:'array of floating point numbers, that will be filled by the function with the desired values for the correction points.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Longitude']['load_async']={syn:'Preloads the longitude sensor cache with a specified validity duration (asynchronous version).',lib:'longitude.load_async()',pro:'function load_async(msValidity, callback, context)',cmt:'

Preloads the longitude sensor cache with a specified validity duration (asynchronous version). By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network trafic for instance.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{msValidity:'an integer corresponding to the validity of the loaded function parameters, in milliseconds',callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the error code (or `YAPI_SUCCESS`)',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['Longitude']['muteValueCallbacks']={syn:'Disables the propagation of every new advertised value to the parent hub.',lib:'longitude.muteValueCallbacks()',pro:'function muteValueCallbacks()',cmt:'

Disables the propagation of every new advertised value to the parent hub. You can use this function to save bandwidth and CPU on computers with limited resources, or to prevent unwanted invocations of the HTTP callback. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Longitude']['nextLongitude']={syn:'Continues the enumeration of longitude sensors started using `yFirstLongitude()`.',lib:'longitude.nextLongitude()',pro:'function nextLongitude()',cmt:'

Continues the enumeration of longitude sensors started using `yFirstLongitude()`.

',ret:'a pointer to a `YLongitude` object, corresponding to a longitude sensor currently online, or a `null` pointer if there are no more longitude sensors to enumerate.'}; doc['Longitude']['registerTimedReportCallback']={syn:'Registers the callback function that is invoked on every periodic timed notification.',lib:'longitude.registerTimedReportCallback()',pro:'function registerTimedReportCallback(callback)',cmt:'

Registers the callback function that is invoked on every periodic timed notification. The callback is invoked only during the execution of `ySleep` or `yHandleEvents`. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a null pointer as argument.

',par:{callback:'the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and an YMeasure object describing the new advertised value.'}}; doc['Longitude']['registerValueCallback']={syn:'Registers the callback function that is invoked on every change of advertised value.',lib:'longitude.registerValueCallback()',pro:'function registerValueCallback(callback)',cmt:'

Registers the callback function that is invoked on every change of advertised value. The callback is invoked only during the execution of `ySleep` or `yHandleEvents`. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a null pointer as argument.

',par:{callback:'the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and the character string describing the new advertised value.'}}; doc['Longitude']['set_advMode']={syn:'Changes the measuring mode used for the advertised value pushed to the parent hub.',lib:'longitude.set_advMode()',pro:'function set_advMode(newval)',cmt:'

Changes the measuring mode used for the advertised value pushed to the parent hub.

',par:{newval:'a value among `Y_ADVMODE_IMMEDIATE`, `Y_ADVMODE_PERIOD_AVG`, `Y_ADVMODE_PERIOD_MIN` and `Y_ADVMODE_PERIOD_MAX` corresponding to the measuring mode used for the advertised value pushed to the parent hub'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Longitude']['set_highestValue']={syn:'Changes the recorded maximal value observed.',lib:'longitude.set_highestValue()',pro:'function set_highestValue(newval)',cmt:'

Changes the recorded maximal value observed. Can be used to reset the value returned by get_lowestValue().

',par:{newval:'a floating point number corresponding to the recorded maximal value observed'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Longitude']['set_logFrequency']={syn:'Changes the datalogger recording frequency for this function.',lib:'longitude.set_logFrequency()',pro:'function set_logFrequency(newval)',cmt:'

Changes the datalogger recording frequency for this function. The frequency can be specified as samples per second, as sample per minute (for instance \x2215/m\x22) or in samples per hour (eg. \x224/h\x22). To disable recording for this function, use the value \x22OFF\x22.

',par:{newval:'a string corresponding to the datalogger recording frequency for this function'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Longitude']['set_logicalName']={syn:'Changes the logical name of the longitude sensor.',lib:'longitude.set_logicalName()',pro:'function set_logicalName(newval)',cmt:'

Changes the logical name of the longitude sensor. You can use `yCheckLogicalName()` prior to this call to make sure that your parameter is valid. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',par:{newval:'a string corresponding to the logical name of the longitude sensor.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Longitude']['set_lowestValue']={syn:'Changes the recorded minimal value observed.',lib:'longitude.set_lowestValue()',pro:'function set_lowestValue(newval)',cmt:'

Changes the recorded minimal value observed. Can be used to reset the value returned by get_lowestValue().

',par:{newval:'a floating point number corresponding to the recorded minimal value observed'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Longitude']['set_reportFrequency']={syn:'Changes the timed value notification frequency for this function.',lib:'longitude.set_reportFrequency()',pro:'function set_reportFrequency(newval)',cmt:'

Changes the timed value notification frequency for this function. The frequency can be specified as samples per second, as sample per minute (for instance \x2215/m\x22) or in samples per hour (eg. \x224/h\x22). To disable timed value notifications for this function, use the value \x22OFF\x22.

',par:{newval:'a string corresponding to the timed value notification frequency for this function'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Longitude']['set_resolution']={syn:'Changes the resolution of the measured physical values.',lib:'longitude.set_resolution()',pro:'function set_resolution(newval)',cmt:'

Changes the resolution of the measured physical values. The resolution corresponds to the numerical precision when displaying value. It does not change the precision of the measure itself.

',par:{newval:'a floating point number corresponding to the resolution of the measured physical values'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Longitude']['set_userData']={syn:'Stores a user context provided as argument in the userData attribute of the function.',lib:'longitude.set_userData()',pro:'function set_userData(data)',cmt:'

Stores a user context provided as argument in the userData attribute of the function. This attribute is never touched by the API, and is at disposal of the caller to store a context.

',par:{data:'any kind of object to be stored'}}; doc['Longitude']['startDataLogger']={syn:'Starts the data logger on the device.',lib:'longitude.startDataLogger()',pro:'function startDataLogger()',cmt:'

Starts the data logger on the device. Note that the data logger will only save the measures on this sensor if the logFrequency is not set to \x22OFF\x22.

',ret:'`YAPI_SUCCESS` if the call succeeds.'}; doc['Longitude']['stopDataLogger']={syn:'Stops the datalogger on the device.',lib:'longitude.stopDataLogger()',pro:'function stopDataLogger()',cmt:'

Stops the datalogger on the device.

',ret:'`YAPI_SUCCESS` if the call succeeds.'}; doc['Longitude']['unmuteValueCallbacks']={syn:'Re-enables the propagation of every new advertised value to the parent hub.',lib:'longitude.unmuteValueCallbacks()',pro:'function unmuteValueCallbacks()',cmt:'

Re-enables the propagation of every new advertised value to the parent hub. This function reverts the effect of a previous call to `muteValueCallbacks()`. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Longitude']['wait_async']={syn:'Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function.',lib:'longitude.wait_async()',pro:'function wait_async(callback, context)',cmt:'

Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function. The callback function can therefore freely issue synchronous or asynchronous commands, without risking to block the Javascript VM.

',par:{callback:'callback function that is invoked when all pending commands on the module are completed. The callback function receives two arguments: the caller-specific context object and the receiving function object.',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing.'}; //--- (end of generated code: Longitude) //--- (generated code: GroundSpeed) doc['GroundSpeed']={'':{syn:'GroundSpeed function interface',inc:'<script type='text/javascript' src='yocto_groundspeed.js'></script>',cmt:'

The Yoctopuce class YGroundSpeed allows you to read the ground speed from Yoctopuce geolocalization sensors. It inherits from the YSensor class the core functions to read measurements, register callback functions, access the autonomous datalogger.

'}}; doc['GroundSpeed']['FindGroundSpeed']={syn:'Retrieves a ground speed sensor for a given identifier.',lib:'YGroundSpeed.FindGroundSpeed()',pro:'function FindGroundSpeed(func)',cmt:'

Retrieves a ground speed sensor for a given identifier. The identifier can be specified using several formats:

- FunctionLogicalName
- ModuleSerialNumber.FunctionIdentifier
- ModuleSerialNumber.FunctionLogicalName
- ModuleLogicalName.FunctionIdentifier
- ModuleLogicalName.FunctionLogicalName

This function does not require that the ground speed sensor is online at the time it is invoked. The returned object is nevertheless valid. Use the method `YGroundSpeed.isOnline()` to test if the ground speed sensor is indeed online at a given time. In case of ambiguity when looking for a ground speed sensor by logical name, no error is notified: the first instance found is returned. The search is performed first by hardware name, then by logical name.

If a call to this object\x27s is_online() method returns FALSE although you are certain that the matching device is plugged, make sure that you did call registerHub() at application initialization time.

',par:{func:'a string that uniquely characterizes the ground speed sensor'},ret:'a `YGroundSpeed` object allowing you to drive the ground speed sensor.'}; doc['GroundSpeed']['FirstGroundSpeed']={syn:'Starts the enumeration of ground speed sensors currently accessible.',lib:'YGroundSpeed.FirstGroundSpeed()',pro:'function FirstGroundSpeed()',cmt:'

Starts the enumeration of ground speed sensors currently accessible. Use the method `YGroundSpeed.nextGroundSpeed()` to iterate on next ground speed sensors.

',ret:'a pointer to a `YGroundSpeed` object, corresponding to the first ground speed sensor currently online, or a `null` pointer if there are none.'}; doc['GroundSpeed']['calibrateFromPoints']={syn:'Configures error correction data points, in particular to compensate for a possible perturbation of the measure caused by an enclosure.',lib:'groundspeed.calibrateFromPoints()',pro:'function calibrateFromPoints(rawValues, refValues)',cmt:'

Configures error correction data points, in particular to compensate for a possible perturbation of the measure caused by an enclosure. It is possible to configure up to five correction points. Correction points must be provided in ascending order, and be in the range of the sensor. The device will automatically perform a linear interpolation of the error correction between specified points. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

For more information on advanced capabilities to refine the calibration of sensors, please contact support@yoctopuce.com.

',par:{rawValues:'array of floating point numbers, corresponding to the raw values returned by the sensor for the correction points.',refValues:'array of floating point numbers, corresponding to the corrected values for the correction points.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['GroundSpeed']['clearCache']={syn:'Invalidates the cache.',lib:'groundspeed.clearCache()',pro:'function clearCache()',cmt:'

Invalidates the cache. Invalidates the cache of the ground speed sensor attributes. Forces the next call to get_xxx() or loadxxx() to use values that come from the device.

'}; doc['GroundSpeed']['describe']={syn:'Returns a short text that describes unambiguously the instance of the ground speed sensor in the form `TYPE(NAME)=SERIAL.FUNCTIONID`.',lib:'groundspeed.describe()',pro:'function describe()',cmt:'

Returns a short text that describes unambiguously the instance of the ground speed sensor in the form `TYPE(NAME)=SERIAL.FUNCTIONID`. More precisely, `TYPE` is the type of the function, `NAME` it the name used for the first access to the function, `SERIAL` is the serial number of the module if the module is connected or `\x22unresolved\x22`, and `FUNCTIONID` is the hardware identifier of the function if the module is connected. For example, this method returns `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1` if the module is already connected or `Relay(BadCustomeName.relay1)=unresolved` if the module has not yet been connected. This method does not trigger any USB or TCP transaction and can therefore be used in a debugger.

',ret:'a string that describes the ground speed sensor (ex: `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1`)'}; doc['GroundSpeed']['get_advMode']={syn:'Returns the measuring mode used for the advertised value pushed to the parent hub.',lib:'groundspeed.get_advMode()',pro:'function get_advMode()',cmt:'

Returns the measuring mode used for the advertised value pushed to the parent hub.

',ret:'a value among `Y_ADVMODE_IMMEDIATE`, `Y_ADVMODE_PERIOD_AVG`, `Y_ADVMODE_PERIOD_MIN` and `Y_ADVMODE_PERIOD_MAX` corresponding to the measuring mode used for the advertised value pushed to the parent hub',ext:'On failure, throws an exception or returns `Y_ADVMODE_INVALID`.'}; doc['GroundSpeed']['get_advertisedValue']={syn:'Returns the current value of the ground speed sensor (no more than 6 characters).',lib:'groundspeed.get_advertisedValue()',pro:'function get_advertisedValue()',cmt:'

Returns the current value of the ground speed sensor (no more than 6 characters).

',ret:'a string corresponding to the current value of the ground speed sensor (no more than 6 characters).',ext:'On failure, throws an exception or returns `Y_ADVERTISEDVALUE_INVALID`.'}; doc['GroundSpeed']['get_currentRawValue']={syn:'Returns the uncalibrated, unrounded raw value returned by the sensor, in km/h, as a floating point number.',lib:'groundspeed.get_currentRawValue()',pro:'function get_currentRawValue()',cmt:'

Returns the uncalibrated, unrounded raw value returned by the sensor, in km/h, as a floating point number.

',ret:'a floating point number corresponding to the uncalibrated, unrounded raw value returned by the sensor, in km/h, as a floating point number',ext:'On failure, throws an exception or returns `Y_CURRENTRAWVALUE_INVALID`.'}; doc['GroundSpeed']['get_currentValue']={syn:'Returns the current value of the ground speed, in km/h, as a floating point number.',lib:'groundspeed.get_currentValue()',pro:'function get_currentValue()',cmt:'

Returns the current value of the ground speed, in km/h, as a floating point number.

',ret:'a floating point number corresponding to the current value of the ground speed, in km/h, as a floating point number',ext:'On failure, throws an exception or returns `Y_CURRENTVALUE_INVALID`.'}; doc['GroundSpeed']['get_dataLogger']={syn:'Returns the YDatalogger object of the device hosting the sensor.',lib:'groundspeed.get_dataLogger()',pro:'function get_dataLogger()',cmt:'

Returns the YDatalogger object of the device hosting the sensor. This method returns an object of class YDatalogger that can control global parameters of the data logger. The returned object should not be freed.

',ret:'an YDataLogger object or null on error.'}; doc['GroundSpeed']['get_errorMessage']={syn:'Returns the error message of the latest error with the ground speed sensor.',lib:'groundspeed.get_errorMessage()',pro:'function get_errorMessage()',cmt:'

Returns the error message of the latest error with the ground speed sensor. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a string corresponding to the latest error message that occured while using the ground speed sensor object'}; doc['GroundSpeed']['get_errorType']={syn:'Returns the numerical error code of the latest error with the ground speed sensor.',lib:'groundspeed.get_errorType()',pro:'function get_errorType()',cmt:'

Returns the numerical error code of the latest error with the ground speed sensor. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a number corresponding to the code of the latest error that occurred while using the ground speed sensor object'}; doc['GroundSpeed']['get_friendlyName']={syn:'Returns a global identifier of the ground speed sensor in the format `MODULE_NAME.FUNCTION_NAME`.',lib:'groundspeed.get_friendlyName()',pro:'function get_friendlyName()',cmt:'

Returns a global identifier of the ground speed sensor in the format `MODULE_NAME.FUNCTION_NAME`. The returned string uses the logical names of the module and of the ground speed sensor if they are defined, otherwise the serial number of the module and the hardware identifier of the ground speed sensor (for example: `MyCustomName.relay1`)

',ret:'a string that uniquely identifies the ground speed sensor using logical names (ex: `MyCustomName.relay1`)',ext:'On failure, throws an exception or returns `Y_FRIENDLYNAME_INVALID`.'}; doc['GroundSpeed']['get_functionDescriptor']={syn:'Returns a unique identifier of type `YFUN_DESCR` corresponding to the function.',lib:'groundspeed.get_functionDescriptor()',pro:'function get_functionDescriptor()',cmt:'

Returns a unique identifier of type `YFUN_DESCR` corresponding to the function. This identifier can be used to test if two instances of `YFunction` reference the same physical function on the same physical device.

',ret:'an identifier of type `YFUN_DESCR`.',ext:'If the function has never been contacted, the returned value is `Y_FUNCTIONDESCRIPTOR_INVALID`.'}; doc['GroundSpeed']['get_functionId']={syn:'Returns the hardware identifier of the ground speed sensor, without reference to the module.',lib:'groundspeed.get_functionId()',pro:'function get_functionId()',cmt:'

Returns the hardware identifier of the ground speed sensor, without reference to the module. For example `relay1`

',ret:'a string that identifies the ground speed sensor (ex: `relay1`)',ext:'On failure, throws an exception or returns `Y_FUNCTIONID_INVALID`.'}; doc['GroundSpeed']['get_hardwareId']={syn:'Returns the unique hardware identifier of the ground speed sensor in the form `SERIAL.FUNCTIONID`.',lib:'groundspeed.get_hardwareId()',pro:'function get_hardwareId()',cmt:'

Returns the unique hardware identifier of the ground speed sensor in the form `SERIAL.FUNCTIONID`. The unique hardware identifier is composed of the device serial number and of the hardware identifier of the ground speed sensor (for example `RELAYLO1-123456.relay1`).

',ret:'a string that uniquely identifies the ground speed sensor (ex: `RELAYLO1-123456.relay1`)',ext:'On failure, throws an exception or returns `Y_HARDWAREID_INVALID`.'}; doc['GroundSpeed']['get_highestValue']={syn:'Returns the maximal value observed for the ground speed since the device was started.',lib:'groundspeed.get_highestValue()',pro:'function get_highestValue()',cmt:'

Returns the maximal value observed for the ground speed since the device was started. Can be reset to an arbitrary value thanks to set_highestValue().

',ret:'a floating point number corresponding to the maximal value observed for the ground speed since the device was started',ext:'On failure, throws an exception or returns `Y_HIGHESTVALUE_INVALID`.'}; doc['GroundSpeed']['get_logFrequency']={syn:'Returns the datalogger recording frequency for this function, or \x22OFF\x22 when measures are not stored in the data logger flash memory.',lib:'groundspeed.get_logFrequency()',pro:'function get_logFrequency()',cmt:'

Returns the datalogger recording frequency for this function, or \x22OFF\x22 when measures are not stored in the data logger flash memory.

',ret:'a string corresponding to the datalogger recording frequency for this function, or \x22OFF\x22 when measures are not stored in the data logger flash memory',ext:'On failure, throws an exception or returns `Y_LOGFREQUENCY_INVALID`.'}; doc['GroundSpeed']['get_logicalName']={syn:'Returns the logical name of the ground speed sensor.',lib:'groundspeed.get_logicalName()',pro:'function get_logicalName()',cmt:'

Returns the logical name of the ground speed sensor.

',ret:'a string corresponding to the logical name of the ground speed sensor.',ext:'On failure, throws an exception or returns `Y_LOGICALNAME_INVALID`.'}; doc['GroundSpeed']['get_lowestValue']={syn:'Returns the minimal value observed for the ground speed since the device was started.',lib:'groundspeed.get_lowestValue()',pro:'function get_lowestValue()',cmt:'

Returns the minimal value observed for the ground speed since the device was started. Can be reset to an arbitrary value thanks to set_lowestValue().

',ret:'a floating point number corresponding to the minimal value observed for the ground speed since the device was started',ext:'On failure, throws an exception or returns `Y_LOWESTVALUE_INVALID`.'}; doc['GroundSpeed']['get_module']={syn:'Gets the `YModule` object for the device on which the function is located.',lib:'groundspeed.get_module()',pro:'function get_module()',cmt:'

Gets the `YModule` object for the device on which the function is located. If the function cannot be located on any module, the returned instance of `YModule` is not shown as on-line.

',ret:'an instance of `YModule`'}; doc['GroundSpeed']['get_module_async']={syn:'Gets the `YModule` object for the device on which the function is located (asynchronous version).',lib:'groundspeed.get_module_async()',pro:'function get_module_async(callback, context)',cmt:'

Gets the `YModule` object for the device on which the function is located (asynchronous version). If the function cannot be located on any module, the returned `YModule` object does not show as on-line.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking Firefox javascript VM that does not implement context switching during blocking I/O calls. See the documentation section on asynchronous Javascript calls for more details.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the requested `YModule` object',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['GroundSpeed']['get_recordedData']={syn:'Retrieves a DataSet object holding historical data for this sensor, for a specified time interval.',lib:'groundspeed.get_recordedData()',pro:'function get_recordedData(startTime, endTime)',cmt:'

Retrieves a DataSet object holding historical data for this sensor, for a specified time interval. The measures will be retrieved from the data logger, which must have been turned on at the desired time. See the documentation of the DataSet class for information on how to get an overview of the recorded data, and how to load progressively a large set of measures from the data logger.

This function only works if the device uses a recent firmware, as DataSet objects are not supported by firmwares older than version 13000.

',par:{startTime:'the start of the desired measure time interval, as a Unix timestamp, i.e. the number of seconds since January 1, 1970 UTC. The special value 0 can be used to include any meaasure, without initial limit.',endTime:'the end of the desired measure time interval, as a Unix timestamp, i.e. the number of seconds since January 1, 1970 UTC. The special value 0 can be used to include any meaasure, without ending limit.'},ret:'an instance of YDataSet, providing access to historical data. Past measures can be loaded progressively using methods from the YDataSet object.'}; doc['GroundSpeed']['get_reportFrequency']={syn:'Returns the timed value notification frequency, or \x22OFF\x22 if timed value notifications are disabled for this function.',lib:'groundspeed.get_reportFrequency()',pro:'function get_reportFrequency()',cmt:'

Returns the timed value notification frequency, or \x22OFF\x22 if timed value notifications are disabled for this function.

',ret:'a string corresponding to the timed value notification frequency, or \x22OFF\x22 if timed value notifications are disabled for this function',ext:'On failure, throws an exception or returns `Y_REPORTFREQUENCY_INVALID`.'}; doc['GroundSpeed']['get_resolution']={syn:'Returns the resolution of the measured values.',lib:'groundspeed.get_resolution()',pro:'function get_resolution()',cmt:'

Returns the resolution of the measured values. The resolution corresponds to the numerical precision of the measures, which is not always the same as the actual precision of the sensor.

',ret:'a floating point number corresponding to the resolution of the measured values',ext:'On failure, throws an exception or returns `Y_RESOLUTION_INVALID`.'}; doc['GroundSpeed']['get_sensorState']={syn:'Returns the sensor health state code, which is zero when there is an up-to-date measure available or a positive code if the sensor is not able to provide a measure right now.',lib:'groundspeed.get_sensorState()',pro:'function get_sensorState()',cmt:'

Returns the sensor health state code, which is zero when there is an up-to-date measure available or a positive code if the sensor is not able to provide a measure right now.

',ret:'an integer corresponding to the sensor health state code, which is zero when there is an up-to-date measure available or a positive code if the sensor is not able to provide a measure right now',ext:'On failure, throws an exception or returns `Y_SENSORSTATE_INVALID`.'}; doc['GroundSpeed']['get_unit']={syn:'Returns the measuring unit for the ground speed.',lib:'groundspeed.get_unit()',pro:'function get_unit()',cmt:'

Returns the measuring unit for the ground speed.

',ret:'a string corresponding to the measuring unit for the ground speed',ext:'On failure, throws an exception or returns `Y_UNIT_INVALID`.'}; doc['GroundSpeed']['get_userData']={syn:'Returns the value of the userData attribute, as previously stored using method `set_userData`.',lib:'groundspeed.get_userData()',pro:'function get_userData()',cmt:'

Returns the value of the userData attribute, as previously stored using method `set_userData`. This attribute is never touched directly by the API, and is at disposal of the caller to store a context.

',ret:'the object stored previously by the caller.'}; doc['GroundSpeed']['isOnline']={syn:'Checks if the ground speed sensor is currently reachable, without raising any error.',lib:'groundspeed.isOnline()',pro:'function isOnline()',cmt:'

Checks if the ground speed sensor is currently reachable, without raising any error. If there is a cached value for the ground speed sensor in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the ground speed sensor.

',ret:'`true` if the ground speed sensor can be reached, and `false` otherwise'}; doc['GroundSpeed']['isOnline_async']={syn:'Checks if the ground speed sensor is currently reachable, without raising any error (asynchronous version).',lib:'groundspeed.isOnline_async()',pro:'function isOnline_async(callback, context)',cmt:'

Checks if the ground speed sensor is currently reachable, without raising any error (asynchronous version). If there is a cached value for the ground speed sensor in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the requested function.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the boolean result',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['GroundSpeed']['load']={syn:'Preloads the ground speed sensor cache with a specified validity duration.',lib:'groundspeed.load()',pro:'function load(msValidity)',cmt:'

Preloads the ground speed sensor cache with a specified validity duration. By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network traffic for instance.

',par:{msValidity:'an integer corresponding to the validity attributed to the loaded function parameters, in milliseconds'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['GroundSpeed']['loadAttribute']={syn:'Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.',lib:'groundspeed.loadAttribute()',pro:'function loadAttribute(attrName)',cmt:'

Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.

',par:{attrName:'the name of the requested attribute'},ret:'a string with the value of the the attribute',ext:'On failure, throws an exception or returns an empty string.'}; doc['GroundSpeed']['loadCalibrationPoints']={syn:'Retrieves error correction data points previously entered using the method `calibrateFromPoints`.',lib:'groundspeed.loadCalibrationPoints()',pro:'function loadCalibrationPoints(rawValues, refValues)',cmt:'

Retrieves error correction data points previously entered using the method `calibrateFromPoints`.

',par:{rawValues:'array of floating point numbers, that will be filled by the function with the raw sensor values for the correction points.',refValues:'array of floating point numbers, that will be filled by the function with the desired values for the correction points.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['GroundSpeed']['load_async']={syn:'Preloads the ground speed sensor cache with a specified validity duration (asynchronous version).',lib:'groundspeed.load_async()',pro:'function load_async(msValidity, callback, context)',cmt:'

Preloads the ground speed sensor cache with a specified validity duration (asynchronous version). By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network trafic for instance.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{msValidity:'an integer corresponding to the validity of the loaded function parameters, in milliseconds',callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the error code (or `YAPI_SUCCESS`)',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['GroundSpeed']['muteValueCallbacks']={syn:'Disables the propagation of every new advertised value to the parent hub.',lib:'groundspeed.muteValueCallbacks()',pro:'function muteValueCallbacks()',cmt:'

Disables the propagation of every new advertised value to the parent hub. You can use this function to save bandwidth and CPU on computers with limited resources, or to prevent unwanted invocations of the HTTP callback. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['GroundSpeed']['nextGroundSpeed']={syn:'Continues the enumeration of ground speed sensors started using `yFirstGroundSpeed()`.',lib:'groundspeed.nextGroundSpeed()',pro:'function nextGroundSpeed()',cmt:'

Continues the enumeration of ground speed sensors started using `yFirstGroundSpeed()`.

',ret:'a pointer to a `YGroundSpeed` object, corresponding to a ground speed sensor currently online, or a `null` pointer if there are no more ground speed sensors to enumerate.'}; doc['GroundSpeed']['registerTimedReportCallback']={syn:'Registers the callback function that is invoked on every periodic timed notification.',lib:'groundspeed.registerTimedReportCallback()',pro:'function registerTimedReportCallback(callback)',cmt:'

Registers the callback function that is invoked on every periodic timed notification. The callback is invoked only during the execution of `ySleep` or `yHandleEvents`. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a null pointer as argument.

',par:{callback:'the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and an YMeasure object describing the new advertised value.'}}; doc['GroundSpeed']['registerValueCallback']={syn:'Registers the callback function that is invoked on every change of advertised value.',lib:'groundspeed.registerValueCallback()',pro:'function registerValueCallback(callback)',cmt:'

Registers the callback function that is invoked on every change of advertised value. The callback is invoked only during the execution of `ySleep` or `yHandleEvents`. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a null pointer as argument.

',par:{callback:'the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and the character string describing the new advertised value.'}}; doc['GroundSpeed']['set_advMode']={syn:'Changes the measuring mode used for the advertised value pushed to the parent hub.',lib:'groundspeed.set_advMode()',pro:'function set_advMode(newval)',cmt:'

Changes the measuring mode used for the advertised value pushed to the parent hub.

',par:{newval:'a value among `Y_ADVMODE_IMMEDIATE`, `Y_ADVMODE_PERIOD_AVG`, `Y_ADVMODE_PERIOD_MIN` and `Y_ADVMODE_PERIOD_MAX` corresponding to the measuring mode used for the advertised value pushed to the parent hub'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['GroundSpeed']['set_highestValue']={syn:'Changes the recorded maximal value observed.',lib:'groundspeed.set_highestValue()',pro:'function set_highestValue(newval)',cmt:'

Changes the recorded maximal value observed. Can be used to reset the value returned by get_lowestValue().

',par:{newval:'a floating point number corresponding to the recorded maximal value observed'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['GroundSpeed']['set_logFrequency']={syn:'Changes the datalogger recording frequency for this function.',lib:'groundspeed.set_logFrequency()',pro:'function set_logFrequency(newval)',cmt:'

Changes the datalogger recording frequency for this function. The frequency can be specified as samples per second, as sample per minute (for instance \x2215/m\x22) or in samples per hour (eg. \x224/h\x22). To disable recording for this function, use the value \x22OFF\x22.

',par:{newval:'a string corresponding to the datalogger recording frequency for this function'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['GroundSpeed']['set_logicalName']={syn:'Changes the logical name of the ground speed sensor.',lib:'groundspeed.set_logicalName()',pro:'function set_logicalName(newval)',cmt:'

Changes the logical name of the ground speed sensor. You can use `yCheckLogicalName()` prior to this call to make sure that your parameter is valid. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',par:{newval:'a string corresponding to the logical name of the ground speed sensor.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['GroundSpeed']['set_lowestValue']={syn:'Changes the recorded minimal value observed.',lib:'groundspeed.set_lowestValue()',pro:'function set_lowestValue(newval)',cmt:'

Changes the recorded minimal value observed. Can be used to reset the value returned by get_lowestValue().

',par:{newval:'a floating point number corresponding to the recorded minimal value observed'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['GroundSpeed']['set_reportFrequency']={syn:'Changes the timed value notification frequency for this function.',lib:'groundspeed.set_reportFrequency()',pro:'function set_reportFrequency(newval)',cmt:'

Changes the timed value notification frequency for this function. The frequency can be specified as samples per second, as sample per minute (for instance \x2215/m\x22) or in samples per hour (eg. \x224/h\x22). To disable timed value notifications for this function, use the value \x22OFF\x22.

',par:{newval:'a string corresponding to the timed value notification frequency for this function'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['GroundSpeed']['set_resolution']={syn:'Changes the resolution of the measured physical values.',lib:'groundspeed.set_resolution()',pro:'function set_resolution(newval)',cmt:'

Changes the resolution of the measured physical values. The resolution corresponds to the numerical precision when displaying value. It does not change the precision of the measure itself.

',par:{newval:'a floating point number corresponding to the resolution of the measured physical values'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['GroundSpeed']['set_userData']={syn:'Stores a user context provided as argument in the userData attribute of the function.',lib:'groundspeed.set_userData()',pro:'function set_userData(data)',cmt:'

Stores a user context provided as argument in the userData attribute of the function. This attribute is never touched by the API, and is at disposal of the caller to store a context.

',par:{data:'any kind of object to be stored'}}; doc['GroundSpeed']['startDataLogger']={syn:'Starts the data logger on the device.',lib:'groundspeed.startDataLogger()',pro:'function startDataLogger()',cmt:'

Starts the data logger on the device. Note that the data logger will only save the measures on this sensor if the logFrequency is not set to \x22OFF\x22.

',ret:'`YAPI_SUCCESS` if the call succeeds.'}; doc['GroundSpeed']['stopDataLogger']={syn:'Stops the datalogger on the device.',lib:'groundspeed.stopDataLogger()',pro:'function stopDataLogger()',cmt:'

Stops the datalogger on the device.

',ret:'`YAPI_SUCCESS` if the call succeeds.'}; doc['GroundSpeed']['unmuteValueCallbacks']={syn:'Re-enables the propagation of every new advertised value to the parent hub.',lib:'groundspeed.unmuteValueCallbacks()',pro:'function unmuteValueCallbacks()',cmt:'

Re-enables the propagation of every new advertised value to the parent hub. This function reverts the effect of a previous call to `muteValueCallbacks()`. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['GroundSpeed']['wait_async']={syn:'Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function.',lib:'groundspeed.wait_async()',pro:'function wait_async(callback, context)',cmt:'

Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function. The callback function can therefore freely issue synchronous or asynchronous commands, without risking to block the Javascript VM.

',par:{callback:'callback function that is invoked when all pending commands on the module are completed. The callback function receives two arguments: the caller-specific context object and the receiving function object.',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing.'}; //--- (end of generated code: GroundSpeed) //--- (generated code: PowerOutput) doc['PowerOutput']={'':{syn:'External power supply control interface',inc:'<script type='text/javascript' src='yocto_poweroutput.js'></script>',cmt:'

Yoctopuce application programming interface allows you to control the power ouput featured on some devices such as the Yocto-Serial.

'}}; doc['PowerOutput']['FindPowerOutput']={syn:'Retrieves a dual power ouput control for a given identifier.',lib:'YPowerOutput.FindPowerOutput()',pro:'function FindPowerOutput(func)',cmt:'

Retrieves a dual power ouput control for a given identifier. The identifier can be specified using several formats:

- FunctionLogicalName
- ModuleSerialNumber.FunctionIdentifier
- ModuleSerialNumber.FunctionLogicalName
- ModuleLogicalName.FunctionIdentifier
- ModuleLogicalName.FunctionLogicalName

This function does not require that the power ouput control is online at the time it is invoked. The returned object is nevertheless valid. Use the method `YPowerOutput.isOnline()` to test if the power ouput control is indeed online at a given time. In case of ambiguity when looking for a dual power ouput control by logical name, no error is notified: the first instance found is returned. The search is performed first by hardware name, then by logical name.

If a call to this object\x27s is_online() method returns FALSE although you are certain that the matching device is plugged, make sure that you did call registerHub() at application initialization time.

',par:{func:'a string that uniquely characterizes the power ouput control'},ret:'a `YPowerOutput` object allowing you to drive the power ouput control.'}; doc['PowerOutput']['FirstPowerOutput']={syn:'Starts the enumeration of dual power ouput controls currently accessible.',lib:'YPowerOutput.FirstPowerOutput()',pro:'function FirstPowerOutput()',cmt:'

Starts the enumeration of dual power ouput controls currently accessible. Use the method `YPowerOutput.nextPowerOutput()` to iterate on next dual power ouput controls.

',ret:'a pointer to a `YPowerOutput` object, corresponding to the first dual power ouput control currently online, or a `null` pointer if there are none.'}; doc['PowerOutput']['clearCache']={syn:'Invalidates the cache.',lib:'poweroutput.clearCache()',pro:'function clearCache()',cmt:'

Invalidates the cache. Invalidates the cache of the power ouput control attributes. Forces the next call to get_xxx() or loadxxx() to use values that come from the device.

'}; doc['PowerOutput']['describe']={syn:'Returns a short text that describes unambiguously the instance of the power ouput control in the form `TYPE(NAME)=SERIAL.FUNCTIONID`.',lib:'poweroutput.describe()',pro:'function describe()',cmt:'

Returns a short text that describes unambiguously the instance of the power ouput control in the form `TYPE(NAME)=SERIAL.FUNCTIONID`. More precisely, `TYPE` is the type of the function, `NAME` it the name used for the first access to the function, `SERIAL` is the serial number of the module if the module is connected or `\x22unresolved\x22`, and `FUNCTIONID` is the hardware identifier of the function if the module is connected. For example, this method returns `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1` if the module is already connected or `Relay(BadCustomeName.relay1)=unresolved` if the module has not yet been connected. This method does not trigger any USB or TCP transaction and can therefore be used in a debugger.

',ret:'a string that describes the power ouput control (ex: `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1`)'}; doc['PowerOutput']['get_advertisedValue']={syn:'Returns the current value of the power ouput control (no more than 6 characters).',lib:'poweroutput.get_advertisedValue()',pro:'function get_advertisedValue()',cmt:'

Returns the current value of the power ouput control (no more than 6 characters).

',ret:'a string corresponding to the current value of the power ouput control (no more than 6 characters).',ext:'On failure, throws an exception or returns `Y_ADVERTISEDVALUE_INVALID`.'}; doc['PowerOutput']['get_errorMessage']={syn:'Returns the error message of the latest error with the power ouput control.',lib:'poweroutput.get_errorMessage()',pro:'function get_errorMessage()',cmt:'

Returns the error message of the latest error with the power ouput control. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a string corresponding to the latest error message that occured while using the power ouput control object'}; doc['PowerOutput']['get_errorType']={syn:'Returns the numerical error code of the latest error with the power ouput control.',lib:'poweroutput.get_errorType()',pro:'function get_errorType()',cmt:'

Returns the numerical error code of the latest error with the power ouput control. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a number corresponding to the code of the latest error that occurred while using the power ouput control object'}; doc['PowerOutput']['get_friendlyName']={syn:'Returns a global identifier of the power ouput control in the format `MODULE_NAME.FUNCTION_NAME`.',lib:'poweroutput.get_friendlyName()',pro:'function get_friendlyName()',cmt:'

Returns a global identifier of the power ouput control in the format `MODULE_NAME.FUNCTION_NAME`. The returned string uses the logical names of the module and of the power ouput control if they are defined, otherwise the serial number of the module and the hardware identifier of the power ouput control (for example: `MyCustomName.relay1`)

',ret:'a string that uniquely identifies the power ouput control using logical names (ex: `MyCustomName.relay1`)',ext:'On failure, throws an exception or returns `Y_FRIENDLYNAME_INVALID`.'}; doc['PowerOutput']['get_functionDescriptor']={syn:'Returns a unique identifier of type `YFUN_DESCR` corresponding to the function.',lib:'poweroutput.get_functionDescriptor()',pro:'function get_functionDescriptor()',cmt:'

Returns a unique identifier of type `YFUN_DESCR` corresponding to the function. This identifier can be used to test if two instances of `YFunction` reference the same physical function on the same physical device.

',ret:'an identifier of type `YFUN_DESCR`.',ext:'If the function has never been contacted, the returned value is `Y_FUNCTIONDESCRIPTOR_INVALID`.'}; doc['PowerOutput']['get_functionId']={syn:'Returns the hardware identifier of the power ouput control, without reference to the module.',lib:'poweroutput.get_functionId()',pro:'function get_functionId()',cmt:'

Returns the hardware identifier of the power ouput control, without reference to the module. For example `relay1`

',ret:'a string that identifies the power ouput control (ex: `relay1`)',ext:'On failure, throws an exception or returns `Y_FUNCTIONID_INVALID`.'}; doc['PowerOutput']['get_hardwareId']={syn:'Returns the unique hardware identifier of the power ouput control in the form `SERIAL.FUNCTIONID`.',lib:'poweroutput.get_hardwareId()',pro:'function get_hardwareId()',cmt:'

Returns the unique hardware identifier of the power ouput control in the form `SERIAL.FUNCTIONID`. The unique hardware identifier is composed of the device serial number and of the hardware identifier of the power ouput control (for example `RELAYLO1-123456.relay1`).

',ret:'a string that uniquely identifies the power ouput control (ex: `RELAYLO1-123456.relay1`)',ext:'On failure, throws an exception or returns `Y_HARDWAREID_INVALID`.'}; doc['PowerOutput']['get_logicalName']={syn:'Returns the logical name of the power ouput control.',lib:'poweroutput.get_logicalName()',pro:'function get_logicalName()',cmt:'

Returns the logical name of the power ouput control.

',ret:'a string corresponding to the logical name of the power ouput control.',ext:'On failure, throws an exception or returns `Y_LOGICALNAME_INVALID`.'}; doc['PowerOutput']['get_module']={syn:'Gets the `YModule` object for the device on which the function is located.',lib:'poweroutput.get_module()',pro:'function get_module()',cmt:'

Gets the `YModule` object for the device on which the function is located. If the function cannot be located on any module, the returned instance of `YModule` is not shown as on-line.

',ret:'an instance of `YModule`'}; doc['PowerOutput']['get_module_async']={syn:'Gets the `YModule` object for the device on which the function is located (asynchronous version).',lib:'poweroutput.get_module_async()',pro:'function get_module_async(callback, context)',cmt:'

Gets the `YModule` object for the device on which the function is located (asynchronous version). If the function cannot be located on any module, the returned `YModule` object does not show as on-line.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking Firefox javascript VM that does not implement context switching during blocking I/O calls. See the documentation section on asynchronous Javascript calls for more details.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the requested `YModule` object',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['PowerOutput']['get_userData']={syn:'Returns the value of the userData attribute, as previously stored using method `set_userData`.',lib:'poweroutput.get_userData()',pro:'function get_userData()',cmt:'

Returns the value of the userData attribute, as previously stored using method `set_userData`. This attribute is never touched directly by the API, and is at disposal of the caller to store a context.

',ret:'the object stored previously by the caller.'}; doc['PowerOutput']['get_voltage']={syn:'Returns the voltage on the power output featured by the module.',lib:'poweroutput.get_voltage()',pro:'function get_voltage()',cmt:'

Returns the voltage on the power output featured by the module.

',ret:'a value among `Y_VOLTAGE_OFF`, `Y_VOLTAGE_OUT3V3` and `Y_VOLTAGE_OUT5V` corresponding to the voltage on the power output featured by the module',ext:'On failure, throws an exception or returns `Y_VOLTAGE_INVALID`.'}; doc['PowerOutput']['isOnline']={syn:'Checks if the power ouput control is currently reachable, without raising any error.',lib:'poweroutput.isOnline()',pro:'function isOnline()',cmt:'

Checks if the power ouput control is currently reachable, without raising any error. If there is a cached value for the power ouput control in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the power ouput control.

',ret:'`true` if the power ouput control can be reached, and `false` otherwise'}; doc['PowerOutput']['isOnline_async']={syn:'Checks if the power ouput control is currently reachable, without raising any error (asynchronous version).',lib:'poweroutput.isOnline_async()',pro:'function isOnline_async(callback, context)',cmt:'

Checks if the power ouput control is currently reachable, without raising any error (asynchronous version). If there is a cached value for the power ouput control in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the requested function.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the boolean result',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['PowerOutput']['load']={syn:'Preloads the power ouput control cache with a specified validity duration.',lib:'poweroutput.load()',pro:'function load(msValidity)',cmt:'

Preloads the power ouput control cache with a specified validity duration. By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network traffic for instance.

',par:{msValidity:'an integer corresponding to the validity attributed to the loaded function parameters, in milliseconds'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['PowerOutput']['loadAttribute']={syn:'Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.',lib:'poweroutput.loadAttribute()',pro:'function loadAttribute(attrName)',cmt:'

Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.

',par:{attrName:'the name of the requested attribute'},ret:'a string with the value of the the attribute',ext:'On failure, throws an exception or returns an empty string.'}; doc['PowerOutput']['load_async']={syn:'Preloads the power ouput control cache with a specified validity duration (asynchronous version).',lib:'poweroutput.load_async()',pro:'function load_async(msValidity, callback, context)',cmt:'

Preloads the power ouput control cache with a specified validity duration (asynchronous version). By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network trafic for instance.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{msValidity:'an integer corresponding to the validity of the loaded function parameters, in milliseconds',callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the error code (or `YAPI_SUCCESS`)',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['PowerOutput']['muteValueCallbacks']={syn:'Disables the propagation of every new advertised value to the parent hub.',lib:'poweroutput.muteValueCallbacks()',pro:'function muteValueCallbacks()',cmt:'

Disables the propagation of every new advertised value to the parent hub. You can use this function to save bandwidth and CPU on computers with limited resources, or to prevent unwanted invocations of the HTTP callback. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['PowerOutput']['nextPowerOutput']={syn:'Continues the enumeration of dual power ouput controls started using `yFirstPowerOutput()`.',lib:'poweroutput.nextPowerOutput()',pro:'function nextPowerOutput()',cmt:'

Continues the enumeration of dual power ouput controls started using `yFirstPowerOutput()`.

',ret:'a pointer to a `YPowerOutput` object, corresponding to a dual power ouput control currently online, or a `null` pointer if there are no more dual power ouput controls to enumerate.'}; doc['PowerOutput']['registerValueCallback']={syn:'Registers the callback function that is invoked on every change of advertised value.',lib:'poweroutput.registerValueCallback()',pro:'function registerValueCallback(callback)',cmt:'

Registers the callback function that is invoked on every change of advertised value. The callback is invoked only during the execution of `ySleep` or `yHandleEvents`. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a null pointer as argument.

',par:{callback:'the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and the character string describing the new advertised value.'}}; doc['PowerOutput']['set_logicalName']={syn:'Changes the logical name of the power ouput control.',lib:'poweroutput.set_logicalName()',pro:'function set_logicalName(newval)',cmt:'

Changes the logical name of the power ouput control. You can use `yCheckLogicalName()` prior to this call to make sure that your parameter is valid. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',par:{newval:'a string corresponding to the logical name of the power ouput control.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['PowerOutput']['set_userData']={syn:'Stores a user context provided as argument in the userData attribute of the function.',lib:'poweroutput.set_userData()',pro:'function set_userData(data)',cmt:'

Stores a user context provided as argument in the userData attribute of the function. This attribute is never touched by the API, and is at disposal of the caller to store a context.

',par:{data:'any kind of object to be stored'}}; doc['PowerOutput']['set_voltage']={syn:'Changes the voltage on the power output provided by the module.',lib:'poweroutput.set_voltage()',pro:'function set_voltage(newval)',cmt:'

Changes the voltage on the power output provided by the module. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',par:{newval:'a value among `Y_VOLTAGE_OFF`, `Y_VOLTAGE_OUT3V3` and `Y_VOLTAGE_OUT5V` corresponding to the voltage on the power output provided by the module'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['PowerOutput']['unmuteValueCallbacks']={syn:'Re-enables the propagation of every new advertised value to the parent hub.',lib:'poweroutput.unmuteValueCallbacks()',pro:'function unmuteValueCallbacks()',cmt:'

Re-enables the propagation of every new advertised value to the parent hub. This function reverts the effect of a previous call to `muteValueCallbacks()`. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['PowerOutput']['wait_async']={syn:'Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function.',lib:'poweroutput.wait_async()',pro:'function wait_async(callback, context)',cmt:'

Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function. The callback function can therefore freely issue synchronous or asynchronous commands, without risking to block the Javascript VM.

',par:{callback:'callback function that is invoked when all pending commands on the module are completed. The callback function receives two arguments: the caller-specific context object and the receiving function object.',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing.'}; //--- (end of generated code: PowerOutput) //--- (generated code: Cellular) doc['Cellular']={'':{syn:'Cellular function interface',inc:'<script type='text/javascript' src='yocto_cellular.js'></script>',cmt:'

YCellular functions provides control over cellular network parameters and status for devices that are GSM-enabled.

'}}; doc['Cellular']['FindCellular']={syn:'Retrieves a cellular interface for a given identifier.',lib:'YCellular.FindCellular()',pro:'function FindCellular(func)',cmt:'

Retrieves a cellular interface for a given identifier. The identifier can be specified using several formats:

- FunctionLogicalName
- ModuleSerialNumber.FunctionIdentifier
- ModuleSerialNumber.FunctionLogicalName
- ModuleLogicalName.FunctionIdentifier
- ModuleLogicalName.FunctionLogicalName

This function does not require that the cellular interface is online at the time it is invoked. The returned object is nevertheless valid. Use the method `YCellular.isOnline()` to test if the cellular interface is indeed online at a given time. In case of ambiguity when looking for a cellular interface by logical name, no error is notified: the first instance found is returned. The search is performed first by hardware name, then by logical name.

If a call to this object\x27s is_online() method returns FALSE although you are certain that the matching device is plugged, make sure that you did call registerHub() at application initialization time.

',par:{func:'a string that uniquely characterizes the cellular interface'},ret:'a `YCellular` object allowing you to drive the cellular interface.'}; doc['Cellular']['FirstCellular']={syn:'Starts the enumeration of cellular interfaces currently accessible.',lib:'YCellular.FirstCellular()',pro:'function FirstCellular()',cmt:'

Starts the enumeration of cellular interfaces currently accessible. Use the method `YCellular.nextCellular()` to iterate on next cellular interfaces.

',ret:'a pointer to a `YCellular` object, corresponding to the first cellular interface currently online, or a `null` pointer if there are none.'}; doc['Cellular']['clearCache']={syn:'Invalidates the cache.',lib:'cellular.clearCache()',pro:'function clearCache()',cmt:'

Invalidates the cache. Invalidates the cache of the cellular interface attributes. Forces the next call to get_xxx() or loadxxx() to use values that come from the device.

'}; doc['Cellular']['clearDataCounters']={syn:'Clear the transmitted data counters.',lib:'cellular.clearDataCounters()',pro:'function clearDataCounters()',cmt:'

Clear the transmitted data counters.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Cellular']['describe']={syn:'Returns a short text that describes unambiguously the instance of the cellular interface in the form `TYPE(NAME)=SERIAL.FUNCTIONID`.',lib:'cellular.describe()',pro:'function describe()',cmt:'

Returns a short text that describes unambiguously the instance of the cellular interface in the form `TYPE(NAME)=SERIAL.FUNCTIONID`. More precisely, `TYPE` is the type of the function, `NAME` it the name used for the first access to the function, `SERIAL` is the serial number of the module if the module is connected or `\x22unresolved\x22`, and `FUNCTIONID` is the hardware identifier of the function if the module is connected. For example, this method returns `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1` if the module is already connected or `Relay(BadCustomeName.relay1)=unresolved` if the module has not yet been connected. This method does not trigger any USB or TCP transaction and can therefore be used in a debugger.

',ret:'a string that describes the cellular interface (ex: `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1`)'}; doc['Cellular']['get_advertisedValue']={syn:'Returns the current value of the cellular interface (no more than 6 characters).',lib:'cellular.get_advertisedValue()',pro:'function get_advertisedValue()',cmt:'

Returns the current value of the cellular interface (no more than 6 characters).

',ret:'a string corresponding to the current value of the cellular interface (no more than 6 characters).',ext:'On failure, throws an exception or returns `Y_ADVERTISEDVALUE_INVALID`.'}; doc['Cellular']['get_airplaneMode']={syn:'Returns true if the airplane mode is active (radio turned off).',lib:'cellular.get_airplaneMode()',pro:'function get_airplaneMode()',cmt:'

Returns true if the airplane mode is active (radio turned off).

',ret:'either `Y_AIRPLANEMODE_OFF` or `Y_AIRPLANEMODE_ON`, according to true if the airplane mode is active (radio turned off)',ext:'On failure, throws an exception or returns `Y_AIRPLANEMODE_INVALID`.'}; doc['Cellular']['get_apn']={syn:'Returns the Access Point Name (APN) to be used, if needed.',lib:'cellular.get_apn()',pro:'function get_apn()',cmt:'

Returns the Access Point Name (APN) to be used, if needed. When left blank, the APN suggested by the cell operator will be used.

',ret:'a string corresponding to the Access Point Name (APN) to be used, if needed',ext:'On failure, throws an exception or returns `Y_APN_INVALID`.'}; doc['Cellular']['get_apnSecret']={syn:'Returns an opaque string if APN authentication parameters have been configured in the device, or an empty string otherwise.',lib:'cellular.get_apnSecret()',pro:'function get_apnSecret()',cmt:'

Returns an opaque string if APN authentication parameters have been configured in the device, or an empty string otherwise. To configure these parameters, use `set_apnAuth()`.

',ret:'a string corresponding to an opaque string if APN authentication parameters have been configured in the device, or an empty string otherwise',ext:'On failure, throws an exception or returns `Y_APNSECRET_INVALID`.'}; doc['Cellular']['get_availableOperators']={syn:'Returns the list detected cell operators in the neighborhood.',lib:'cellular.get_availableOperators()',pro:'function get_availableOperators()',cmt:'

Returns the list detected cell operators in the neighborhood. This function will typically take between 30 seconds to 1 minute to return. Note that any SIM card can usually only connect to specific operators. All networks returned by this function might therefore not be available for connection.

',ret:'a list of string (cell operator names).'}; doc['Cellular']['get_cellIdentifier']={syn:'Returns the unique identifier of the cellular antenna in use: MCC, MNC, LAC and Cell ID.',lib:'cellular.get_cellIdentifier()',pro:'function get_cellIdentifier()',cmt:'

Returns the unique identifier of the cellular antenna in use: MCC, MNC, LAC and Cell ID.

',ret:'a string corresponding to the unique identifier of the cellular antenna in use: MCC, MNC, LAC and Cell ID',ext:'On failure, throws an exception or returns `Y_CELLIDENTIFIER_INVALID`.'}; doc['Cellular']['get_cellOperator']={syn:'Returns the name of the cell operator currently in use.',lib:'cellular.get_cellOperator()',pro:'function get_cellOperator()',cmt:'

Returns the name of the cell operator currently in use.

',ret:'a string corresponding to the name of the cell operator currently in use',ext:'On failure, throws an exception or returns `Y_CELLOPERATOR_INVALID`.'}; doc['Cellular']['get_cellType']={syn:'Active cellular connection type.',lib:'cellular.get_cellType()',pro:'function get_cellType()',cmt:'

Active cellular connection type.

',ret:'a value among `Y_CELLTYPE_GPRS`, `Y_CELLTYPE_EGPRS`, `Y_CELLTYPE_WCDMA`, `Y_CELLTYPE_HSDPA`, `Y_CELLTYPE_NONE` and `Y_CELLTYPE_CDMA`',ext:'On failure, throws an exception or returns `Y_CELLTYPE_INVALID`.'}; doc['Cellular']['get_dataReceived']={syn:'Returns the number of bytes received so far.',lib:'cellular.get_dataReceived()',pro:'function get_dataReceived()',cmt:'

Returns the number of bytes received so far.

',ret:'an integer corresponding to the number of bytes received so far',ext:'On failure, throws an exception or returns `Y_DATARECEIVED_INVALID`.'}; doc['Cellular']['get_dataSent']={syn:'Returns the number of bytes sent so far.',lib:'cellular.get_dataSent()',pro:'function get_dataSent()',cmt:'

Returns the number of bytes sent so far.

',ret:'an integer corresponding to the number of bytes sent so far',ext:'On failure, throws an exception or returns `Y_DATASENT_INVALID`.'}; doc['Cellular']['get_enableData']={syn:'Returns the condition for enabling IP data services (GPRS).',lib:'cellular.get_enableData()',pro:'function get_enableData()',cmt:'

Returns the condition for enabling IP data services (GPRS). When data services are disabled, SMS are the only mean of communication.

',ret:'a value among `Y_ENABLEDATA_HOMENETWORK`, `Y_ENABLEDATA_ROAMING`, `Y_ENABLEDATA_NEVER` and `Y_ENABLEDATA_NEUTRALITY` corresponding to the condition for enabling IP data services (GPRS)',ext:'On failure, throws an exception or returns `Y_ENABLEDATA_INVALID`.'}; doc['Cellular']['get_errorMessage']={syn:'Returns the error message of the latest error with the cellular interface.',lib:'cellular.get_errorMessage()',pro:'function get_errorMessage()',cmt:'

Returns the error message of the latest error with the cellular interface. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a string corresponding to the latest error message that occured while using the cellular interface object'}; doc['Cellular']['get_errorType']={syn:'Returns the numerical error code of the latest error with the cellular interface.',lib:'cellular.get_errorType()',pro:'function get_errorType()',cmt:'

Returns the numerical error code of the latest error with the cellular interface. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a number corresponding to the code of the latest error that occurred while using the cellular interface object'}; doc['Cellular']['get_friendlyName']={syn:'Returns a global identifier of the cellular interface in the format `MODULE_NAME.FUNCTION_NAME`.',lib:'cellular.get_friendlyName()',pro:'function get_friendlyName()',cmt:'

Returns a global identifier of the cellular interface in the format `MODULE_NAME.FUNCTION_NAME`. The returned string uses the logical names of the module and of the cellular interface if they are defined, otherwise the serial number of the module and the hardware identifier of the cellular interface (for example: `MyCustomName.relay1`)

',ret:'a string that uniquely identifies the cellular interface using logical names (ex: `MyCustomName.relay1`)',ext:'On failure, throws an exception or returns `Y_FRIENDLYNAME_INVALID`.'}; doc['Cellular']['get_functionDescriptor']={syn:'Returns a unique identifier of type `YFUN_DESCR` corresponding to the function.',lib:'cellular.get_functionDescriptor()',pro:'function get_functionDescriptor()',cmt:'

Returns a unique identifier of type `YFUN_DESCR` corresponding to the function. This identifier can be used to test if two instances of `YFunction` reference the same physical function on the same physical device.

',ret:'an identifier of type `YFUN_DESCR`.',ext:'If the function has never been contacted, the returned value is `Y_FUNCTIONDESCRIPTOR_INVALID`.'}; doc['Cellular']['get_functionId']={syn:'Returns the hardware identifier of the cellular interface, without reference to the module.',lib:'cellular.get_functionId()',pro:'function get_functionId()',cmt:'

Returns the hardware identifier of the cellular interface, without reference to the module. For example `relay1`

',ret:'a string that identifies the cellular interface (ex: `relay1`)',ext:'On failure, throws an exception or returns `Y_FUNCTIONID_INVALID`.'}; doc['Cellular']['get_hardwareId']={syn:'Returns the unique hardware identifier of the cellular interface in the form `SERIAL.FUNCTIONID`.',lib:'cellular.get_hardwareId()',pro:'function get_hardwareId()',cmt:'

Returns the unique hardware identifier of the cellular interface in the form `SERIAL.FUNCTIONID`. The unique hardware identifier is composed of the device serial number and of the hardware identifier of the cellular interface (for example `RELAYLO1-123456.relay1`).

',ret:'a string that uniquely identifies the cellular interface (ex: `RELAYLO1-123456.relay1`)',ext:'On failure, throws an exception or returns `Y_HARDWAREID_INVALID`.'}; doc['Cellular']['get_imsi']={syn:'Returns an opaque string if a PIN code has been configured in the device to access the SIM card, or an empty string if none has been configured or if the code provided was rejected by the SIM card.',lib:'cellular.get_imsi()',pro:'function get_imsi()',cmt:'

Returns an opaque string if a PIN code has been configured in the device to access the SIM card, or an empty string if none has been configured or if the code provided was rejected by the SIM card.

',ret:'a string corresponding to an opaque string if a PIN code has been configured in the device to access the SIM card, or an empty string if none has been configured or if the code provided was rejected by the SIM card',ext:'On failure, throws an exception or returns `Y_IMSI_INVALID`.'}; doc['Cellular']['get_linkQuality']={syn:'Returns the link quality, expressed in percent.',lib:'cellular.get_linkQuality()',pro:'function get_linkQuality()',cmt:'

Returns the link quality, expressed in percent.

',ret:'an integer corresponding to the link quality, expressed in percent',ext:'On failure, throws an exception or returns `Y_LINKQUALITY_INVALID`.'}; doc['Cellular']['get_lockedOperator']={syn:'Returns the name of the only cell operator to use if automatic choice is disabled, or an empty string if the SIM card will automatically choose among available cell operators.',lib:'cellular.get_lockedOperator()',pro:'function get_lockedOperator()',cmt:'

Returns the name of the only cell operator to use if automatic choice is disabled, or an empty string if the SIM card will automatically choose among available cell operators.

',ret:'a string corresponding to the name of the only cell operator to use if automatic choice is disabled, or an empty string if the SIM card will automatically choose among available cell operators',ext:'On failure, throws an exception or returns `Y_LOCKEDOPERATOR_INVALID`.'}; doc['Cellular']['get_logicalName']={syn:'Returns the logical name of the cellular interface.',lib:'cellular.get_logicalName()',pro:'function get_logicalName()',cmt:'

Returns the logical name of the cellular interface.

',ret:'a string corresponding to the logical name of the cellular interface.',ext:'On failure, throws an exception or returns `Y_LOGICALNAME_INVALID`.'}; doc['Cellular']['get_message']={syn:'Returns the latest status message from the wireless interface.',lib:'cellular.get_message()',pro:'function get_message()',cmt:'

Returns the latest status message from the wireless interface.

',ret:'a string corresponding to the latest status message from the wireless interface',ext:'On failure, throws an exception or returns `Y_MESSAGE_INVALID`.'}; doc['Cellular']['get_module']={syn:'Gets the `YModule` object for the device on which the function is located.',lib:'cellular.get_module()',pro:'function get_module()',cmt:'

Gets the `YModule` object for the device on which the function is located. If the function cannot be located on any module, the returned instance of `YModule` is not shown as on-line.

',ret:'an instance of `YModule`'}; doc['Cellular']['get_module_async']={syn:'Gets the `YModule` object for the device on which the function is located (asynchronous version).',lib:'cellular.get_module_async()',pro:'function get_module_async(callback, context)',cmt:'

Gets the `YModule` object for the device on which the function is located (asynchronous version). If the function cannot be located on any module, the returned `YModule` object does not show as on-line.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking Firefox javascript VM that does not implement context switching during blocking I/O calls. See the documentation section on asynchronous Javascript calls for more details.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the requested `YModule` object',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['Cellular']['get_pin']={syn:'Returns an opaque string if a PIN code has been configured in the device to access the SIM card, or an empty string if none has been configured or if the code provided was rejected by the SIM card.',lib:'cellular.get_pin()',pro:'function get_pin()',cmt:'

Returns an opaque string if a PIN code has been configured in the device to access the SIM card, or an empty string if none has been configured or if the code provided was rejected by the SIM card.

',ret:'a string corresponding to an opaque string if a PIN code has been configured in the device to access the SIM card, or an empty string if none has been configured or if the code provided was rejected by the SIM card',ext:'On failure, throws an exception or returns `Y_PIN_INVALID`.'}; doc['Cellular']['get_pingInterval']={syn:'Returns the automated connectivity check interval, in seconds.',lib:'cellular.get_pingInterval()',pro:'function get_pingInterval()',cmt:'

Returns the automated connectivity check interval, in seconds.

',ret:'an integer corresponding to the automated connectivity check interval, in seconds',ext:'On failure, throws an exception or returns `Y_PINGINTERVAL_INVALID`.'}; doc['Cellular']['get_userData']={syn:'Returns the value of the userData attribute, as previously stored using method `set_userData`.',lib:'cellular.get_userData()',pro:'function get_userData()',cmt:'

Returns the value of the userData attribute, as previously stored using method `set_userData`. This attribute is never touched directly by the API, and is at disposal of the caller to store a context.

',ret:'the object stored previously by the caller.'}; doc['Cellular']['isOnline']={syn:'Checks if the cellular interface is currently reachable, without raising any error.',lib:'cellular.isOnline()',pro:'function isOnline()',cmt:'

Checks if the cellular interface is currently reachable, without raising any error. If there is a cached value for the cellular interface in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the cellular interface.

',ret:'`true` if the cellular interface can be reached, and `false` otherwise'}; doc['Cellular']['isOnline_async']={syn:'Checks if the cellular interface is currently reachable, without raising any error (asynchronous version).',lib:'cellular.isOnline_async()',pro:'function isOnline_async(callback, context)',cmt:'

Checks if the cellular interface is currently reachable, without raising any error (asynchronous version). If there is a cached value for the cellular interface in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the requested function.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the boolean result',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['Cellular']['load']={syn:'Preloads the cellular interface cache with a specified validity duration.',lib:'cellular.load()',pro:'function load(msValidity)',cmt:'

Preloads the cellular interface cache with a specified validity duration. By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network traffic for instance.

',par:{msValidity:'an integer corresponding to the validity attributed to the loaded function parameters, in milliseconds'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Cellular']['loadAttribute']={syn:'Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.',lib:'cellular.loadAttribute()',pro:'function loadAttribute(attrName)',cmt:'

Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.

',par:{attrName:'the name of the requested attribute'},ret:'a string with the value of the the attribute',ext:'On failure, throws an exception or returns an empty string.'}; doc['Cellular']['load_async']={syn:'Preloads the cellular interface cache with a specified validity duration (asynchronous version).',lib:'cellular.load_async()',pro:'function load_async(msValidity, callback, context)',cmt:'

Preloads the cellular interface cache with a specified validity duration (asynchronous version). By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network trafic for instance.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{msValidity:'an integer corresponding to the validity of the loaded function parameters, in milliseconds',callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the error code (or `YAPI_SUCCESS`)',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['Cellular']['muteValueCallbacks']={syn:'Disables the propagation of every new advertised value to the parent hub.',lib:'cellular.muteValueCallbacks()',pro:'function muteValueCallbacks()',cmt:'

Disables the propagation of every new advertised value to the parent hub. You can use this function to save bandwidth and CPU on computers with limited resources, or to prevent unwanted invocations of the HTTP callback. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Cellular']['nextCellular']={syn:'Continues the enumeration of cellular interfaces started using `yFirstCellular()`.',lib:'cellular.nextCellular()',pro:'function nextCellular()',cmt:'

Continues the enumeration of cellular interfaces started using `yFirstCellular()`.

',ret:'a pointer to a `YCellular` object, corresponding to a cellular interface currently online, or a `null` pointer if there are no more cellular interfaces to enumerate.'}; doc['Cellular']['quickCellSurvey']={syn:'Returns a list of nearby cellular antennas, as required for quick geolocation of the device.',lib:'cellular.quickCellSurvey()',pro:'function quickCellSurvey()',cmt:'

Returns a list of nearby cellular antennas, as required for quick geolocation of the device. The first cell listed is the serving cell, and the next ones are the neighboor cells reported by the serving cell.

',ret:'a list of YCellRecords.'}; doc['Cellular']['registerValueCallback']={syn:'Registers the callback function that is invoked on every change of advertised value.',lib:'cellular.registerValueCallback()',pro:'function registerValueCallback(callback)',cmt:'

Registers the callback function that is invoked on every change of advertised value. The callback is invoked only during the execution of `ySleep` or `yHandleEvents`. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a null pointer as argument.

',par:{callback:'the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and the character string describing the new advertised value.'}}; doc['Cellular']['sendPUK']={syn:'Sends a PUK code to unlock the SIM card after three failed PIN code attempts, and setup a new PIN into the SIM card.',lib:'cellular.sendPUK()',pro:'function sendPUK(puk, newPin)',cmt:'

Sends a PUK code to unlock the SIM card after three failed PIN code attempts, and setup a new PIN into the SIM card. Only ten consecutives tentatives are permitted: after that, the SIM card will be blocked permanently without any mean of recovery to use it again. Note that after calling this method, you have usually to invoke method `set_pin()` to tell the YoctoHub which PIN to use in the future.

',par:{puk:'the SIM PUK code',newPin:'new PIN code to configure into the SIM card'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Cellular']['set_airplaneMode']={syn:'Changes the activation state of airplane mode (radio turned off).',lib:'cellular.set_airplaneMode()',pro:'function set_airplaneMode(newval)',cmt:'

Changes the activation state of airplane mode (radio turned off).

',par:{newval:'either `Y_AIRPLANEMODE_OFF` or `Y_AIRPLANEMODE_ON`, according to the activation state of airplane mode (radio turned off)'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Cellular']['set_apn']={syn:'Returns the Access Point Name (APN) to be used, if needed.',lib:'cellular.set_apn()',pro:'function set_apn(newval)',cmt:'

Returns the Access Point Name (APN) to be used, if needed. When left blank, the APN suggested by the cell operator will be used.

',par:{newval:'a string'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Cellular']['set_apnAuth']={syn:'Configure authentication parameters to connect to the APN.',lib:'cellular.set_apnAuth()',pro:'function set_apnAuth(username, password)',cmt:'

Configure authentication parameters to connect to the APN. Both PAP and CHAP authentication are supported.

',par:{username:'APN username',password:'APN password'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Cellular']['set_dataReceived']={syn:'Changes the value of the incoming data counter.',lib:'cellular.set_dataReceived()',pro:'function set_dataReceived(newval)',cmt:'

Changes the value of the incoming data counter.

',par:{newval:'an integer corresponding to the value of the incoming data counter'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Cellular']['set_dataSent']={syn:'Changes the value of the outgoing data counter.',lib:'cellular.set_dataSent()',pro:'function set_dataSent(newval)',cmt:'

Changes the value of the outgoing data counter.

',par:{newval:'an integer corresponding to the value of the outgoing data counter'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Cellular']['set_enableData']={syn:'Changes the condition for enabling IP data services (GPRS).',lib:'cellular.set_enableData()',pro:'function set_enableData(newval)',cmt:'

Changes the condition for enabling IP data services (GPRS). The service can be either fully deactivated, or limited to the SIM home network, or enabled for all partner networks (roaming). Caution: enabling data services on roaming networks may cause prohibitive communication costs !

When data services are disabled, SMS are the only mean of communication.

',par:{newval:'a value among `Y_ENABLEDATA_HOMENETWORK`, `Y_ENABLEDATA_ROAMING`, `Y_ENABLEDATA_NEVER` and `Y_ENABLEDATA_NEUTRALITY` corresponding to the condition for enabling IP data services (GPRS)'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Cellular']['set_lockedOperator']={syn:'Changes the name of the cell operator to be used.',lib:'cellular.set_lockedOperator()',pro:'function set_lockedOperator(newval)',cmt:'

Changes the name of the cell operator to be used. If the name is an empty string, the choice will be made automatically based on the SIM card. Otherwise, the selected operator is the only one that will be used.

',par:{newval:'a string corresponding to the name of the cell operator to be used'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Cellular']['set_logicalName']={syn:'Changes the logical name of the cellular interface.',lib:'cellular.set_logicalName()',pro:'function set_logicalName(newval)',cmt:'

Changes the logical name of the cellular interface. You can use `yCheckLogicalName()` prior to this call to make sure that your parameter is valid. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',par:{newval:'a string corresponding to the logical name of the cellular interface.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Cellular']['set_pin']={syn:'Changes the PIN code used by the module to access the SIM card.',lib:'cellular.set_pin()',pro:'function set_pin(newval)',cmt:'

Changes the PIN code used by the module to access the SIM card. This function does not change the code on the SIM card itself, but only changes the parameter used by the device to try to get access to it. If the SIM code does not work immediately on first try, it will be automatically forgotten and the message will be set to \x22Enter SIM PIN\x22. The method should then be invoked again with right correct PIN code. After three failed attempts in a row, the message is changed to \x22Enter SIM PUK\x22 and the SIM card PUK code must be provided using method `sendPUK`.

Remember to call the `saveToFlash()` method of the module to save the new value in the device flash.

',par:{newval:'a string corresponding to the PIN code used by the module to access the SIM card'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Cellular']['set_pingInterval']={syn:'Changes the automated connectivity check interval, in seconds.',lib:'cellular.set_pingInterval()',pro:'function set_pingInterval(newval)',cmt:'

Changes the automated connectivity check interval, in seconds.

',par:{newval:'an integer corresponding to the automated connectivity check interval, in seconds'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Cellular']['set_userData']={syn:'Stores a user context provided as argument in the userData attribute of the function.',lib:'cellular.set_userData()',pro:'function set_userData(data)',cmt:'

Stores a user context provided as argument in the userData attribute of the function. This attribute is never touched by the API, and is at disposal of the caller to store a context.

',par:{data:'any kind of object to be stored'}}; doc['Cellular']['unmuteValueCallbacks']={syn:'Re-enables the propagation of every new advertised value to the parent hub.',lib:'cellular.unmuteValueCallbacks()',pro:'function unmuteValueCallbacks()',cmt:'

Re-enables the propagation of every new advertised value to the parent hub. This function reverts the effect of a previous call to `muteValueCallbacks()`. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Cellular']['wait_async']={syn:'Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function.',lib:'cellular.wait_async()',pro:'function wait_async(callback, context)',cmt:'

Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function. The callback function can therefore freely issue synchronous or asynchronous commands, without risking to block the Javascript VM.

',par:{callback:'callback function that is invoked when all pending commands on the module are completed. The callback function receives two arguments: the caller-specific context object and the receiving function object.',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing.'}; //--- (end of generated code: Cellular) //--- (generated code: AudioOut) doc['AudioOut']={'':{syn:'AudioOut function interface',inc:'<script type='text/javascript' src='yocto_audioout.js'></script>',cmt:'

The Yoctopuce application programming interface allows you to configure the volume of the outout.

'}}; doc['AudioOut']['FindAudioOut']={syn:'Retrieves an audio output for a given identifier.',lib:'YAudioOut.FindAudioOut()',pro:'function FindAudioOut(func)',cmt:'

Retrieves an audio output for a given identifier. The identifier can be specified using several formats:

- FunctionLogicalName
- ModuleSerialNumber.FunctionIdentifier
- ModuleSerialNumber.FunctionLogicalName
- ModuleLogicalName.FunctionIdentifier
- ModuleLogicalName.FunctionLogicalName

This function does not require that the audio output is online at the time it is invoked. The returned object is nevertheless valid. Use the method `YAudioOut.isOnline()` to test if the audio output is indeed online at a given time. In case of ambiguity when looking for an audio output by logical name, no error is notified: the first instance found is returned. The search is performed first by hardware name, then by logical name.

If a call to this object\x27s is_online() method returns FALSE although you are certain that the matching device is plugged, make sure that you did call registerHub() at application initialization time.

',par:{func:'a string that uniquely characterizes the audio output'},ret:'a `YAudioOut` object allowing you to drive the audio output.'}; doc['AudioOut']['FirstAudioOut']={syn:'Starts the enumeration of audio outputs currently accessible.',lib:'YAudioOut.FirstAudioOut()',pro:'function FirstAudioOut()',cmt:'

Starts the enumeration of audio outputs currently accessible. Use the method `YAudioOut.nextAudioOut()` to iterate on next audio outputs.

',ret:'a pointer to a `YAudioOut` object, corresponding to the first audio output currently online, or a `null` pointer if there are none.'}; doc['AudioOut']['clearCache']={syn:'Invalidates the cache.',lib:'audioout.clearCache()',pro:'function clearCache()',cmt:'

Invalidates the cache. Invalidates the cache of the audio output attributes. Forces the next call to get_xxx() or loadxxx() to use values that come from the device.

'}; doc['AudioOut']['describe']={syn:'Returns a short text that describes unambiguously the instance of the audio output in the form `TYPE(NAME)=SERIAL.FUNCTIONID`.',lib:'audioout.describe()',pro:'function describe()',cmt:'

Returns a short text that describes unambiguously the instance of the audio output in the form `TYPE(NAME)=SERIAL.FUNCTIONID`. More precisely, `TYPE` is the type of the function, `NAME` it the name used for the first access to the function, `SERIAL` is the serial number of the module if the module is connected or `\x22unresolved\x22`, and `FUNCTIONID` is the hardware identifier of the function if the module is connected. For example, this method returns `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1` if the module is already connected or `Relay(BadCustomeName.relay1)=unresolved` if the module has not yet been connected. This method does not trigger any USB or TCP transaction and can therefore be used in a debugger.

',ret:'a string that describes the audio output (ex: `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1`)'}; doc['AudioOut']['get_advertisedValue']={syn:'Returns the current value of the audio output (no more than 6 characters).',lib:'audioout.get_advertisedValue()',pro:'function get_advertisedValue()',cmt:'

Returns the current value of the audio output (no more than 6 characters).

',ret:'a string corresponding to the current value of the audio output (no more than 6 characters).',ext:'On failure, throws an exception or returns `Y_ADVERTISEDVALUE_INVALID`.'}; doc['AudioOut']['get_errorMessage']={syn:'Returns the error message of the latest error with the audio output.',lib:'audioout.get_errorMessage()',pro:'function get_errorMessage()',cmt:'

Returns the error message of the latest error with the audio output. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a string corresponding to the latest error message that occured while using the audio output object'}; doc['AudioOut']['get_errorType']={syn:'Returns the numerical error code of the latest error with the audio output.',lib:'audioout.get_errorType()',pro:'function get_errorType()',cmt:'

Returns the numerical error code of the latest error with the audio output. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a number corresponding to the code of the latest error that occurred while using the audio output object'}; doc['AudioOut']['get_friendlyName']={syn:'Returns a global identifier of the audio output in the format `MODULE_NAME.FUNCTION_NAME`.',lib:'audioout.get_friendlyName()',pro:'function get_friendlyName()',cmt:'

Returns a global identifier of the audio output in the format `MODULE_NAME.FUNCTION_NAME`. The returned string uses the logical names of the module and of the audio output if they are defined, otherwise the serial number of the module and the hardware identifier of the audio output (for example: `MyCustomName.relay1`)

',ret:'a string that uniquely identifies the audio output using logical names (ex: `MyCustomName.relay1`)',ext:'On failure, throws an exception or returns `Y_FRIENDLYNAME_INVALID`.'}; doc['AudioOut']['get_functionDescriptor']={syn:'Returns a unique identifier of type `YFUN_DESCR` corresponding to the function.',lib:'audioout.get_functionDescriptor()',pro:'function get_functionDescriptor()',cmt:'

Returns a unique identifier of type `YFUN_DESCR` corresponding to the function. This identifier can be used to test if two instances of `YFunction` reference the same physical function on the same physical device.

',ret:'an identifier of type `YFUN_DESCR`.',ext:'If the function has never been contacted, the returned value is `Y_FUNCTIONDESCRIPTOR_INVALID`.'}; doc['AudioOut']['get_functionId']={syn:'Returns the hardware identifier of the audio output, without reference to the module.',lib:'audioout.get_functionId()',pro:'function get_functionId()',cmt:'

Returns the hardware identifier of the audio output, without reference to the module. For example `relay1`

',ret:'a string that identifies the audio output (ex: `relay1`)',ext:'On failure, throws an exception or returns `Y_FUNCTIONID_INVALID`.'}; doc['AudioOut']['get_hardwareId']={syn:'Returns the unique hardware identifier of the audio output in the form `SERIAL.FUNCTIONID`.',lib:'audioout.get_hardwareId()',pro:'function get_hardwareId()',cmt:'

Returns the unique hardware identifier of the audio output in the form `SERIAL.FUNCTIONID`. The unique hardware identifier is composed of the device serial number and of the hardware identifier of the audio output (for example `RELAYLO1-123456.relay1`).

',ret:'a string that uniquely identifies the audio output (ex: `RELAYLO1-123456.relay1`)',ext:'On failure, throws an exception or returns `Y_HARDWAREID_INVALID`.'}; doc['AudioOut']['get_logicalName']={syn:'Returns the logical name of the audio output.',lib:'audioout.get_logicalName()',pro:'function get_logicalName()',cmt:'

Returns the logical name of the audio output.

',ret:'a string corresponding to the logical name of the audio output.',ext:'On failure, throws an exception or returns `Y_LOGICALNAME_INVALID`.'}; doc['AudioOut']['get_module']={syn:'Gets the `YModule` object for the device on which the function is located.',lib:'audioout.get_module()',pro:'function get_module()',cmt:'

Gets the `YModule` object for the device on which the function is located. If the function cannot be located on any module, the returned instance of `YModule` is not shown as on-line.

',ret:'an instance of `YModule`'}; doc['AudioOut']['get_module_async']={syn:'Gets the `YModule` object for the device on which the function is located (asynchronous version).',lib:'audioout.get_module_async()',pro:'function get_module_async(callback, context)',cmt:'

Gets the `YModule` object for the device on which the function is located (asynchronous version). If the function cannot be located on any module, the returned `YModule` object does not show as on-line.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking Firefox javascript VM that does not implement context switching during blocking I/O calls. See the documentation section on asynchronous Javascript calls for more details.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the requested `YModule` object',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['AudioOut']['get_mute']={syn:'Returns the state of the mute function.',lib:'audioout.get_mute()',pro:'function get_mute()',cmt:'

Returns the state of the mute function.

',ret:'either `Y_MUTE_FALSE` or `Y_MUTE_TRUE`, according to the state of the mute function',ext:'On failure, throws an exception or returns `Y_MUTE_INVALID`.'}; doc['AudioOut']['get_noSignalFor']={syn:'Returns the number of seconds elapsed without detecting a signal.',lib:'audioout.get_noSignalFor()',pro:'function get_noSignalFor()',cmt:'

Returns the number of seconds elapsed without detecting a signal.

',ret:'an integer corresponding to the number of seconds elapsed without detecting a signal',ext:'On failure, throws an exception or returns `Y_NOSIGNALFOR_INVALID`.'}; doc['AudioOut']['get_signal']={syn:'Returns the detected output current level.',lib:'audioout.get_signal()',pro:'function get_signal()',cmt:'

Returns the detected output current level.

',ret:'an integer corresponding to the detected output current level',ext:'On failure, throws an exception or returns `Y_SIGNAL_INVALID`.'}; doc['AudioOut']['get_userData']={syn:'Returns the value of the userData attribute, as previously stored using method `set_userData`.',lib:'audioout.get_userData()',pro:'function get_userData()',cmt:'

Returns the value of the userData attribute, as previously stored using method `set_userData`. This attribute is never touched directly by the API, and is at disposal of the caller to store a context.

',ret:'the object stored previously by the caller.'}; doc['AudioOut']['get_volume']={syn:'Returns audio output volume, in per cents.',lib:'audioout.get_volume()',pro:'function get_volume()',cmt:'

Returns audio output volume, in per cents.

',ret:'an integer corresponding to audio output volume, in per cents',ext:'On failure, throws an exception or returns `Y_VOLUME_INVALID`.'}; doc['AudioOut']['get_volumeRange']={syn:'Returns the supported volume range.',lib:'audioout.get_volumeRange()',pro:'function get_volumeRange()',cmt:'

Returns the supported volume range. The low value of the range corresponds to the minimal audible value. To completely mute the sound, use `set_mute()` instead of the `set_volume()`.

',ret:'a string corresponding to the supported volume range',ext:'On failure, throws an exception or returns `Y_VOLUMERANGE_INVALID`.'}; doc['AudioOut']['isOnline']={syn:'Checks if the audio output is currently reachable, without raising any error.',lib:'audioout.isOnline()',pro:'function isOnline()',cmt:'

Checks if the audio output is currently reachable, without raising any error. If there is a cached value for the audio output in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the audio output.

',ret:'`true` if the audio output can be reached, and `false` otherwise'}; doc['AudioOut']['isOnline_async']={syn:'Checks if the audio output is currently reachable, without raising any error (asynchronous version).',lib:'audioout.isOnline_async()',pro:'function isOnline_async(callback, context)',cmt:'

Checks if the audio output is currently reachable, without raising any error (asynchronous version). If there is a cached value for the audio output in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the requested function.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the boolean result',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['AudioOut']['load']={syn:'Preloads the audio output cache with a specified validity duration.',lib:'audioout.load()',pro:'function load(msValidity)',cmt:'

Preloads the audio output cache with a specified validity duration. By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network traffic for instance.

',par:{msValidity:'an integer corresponding to the validity attributed to the loaded function parameters, in milliseconds'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['AudioOut']['loadAttribute']={syn:'Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.',lib:'audioout.loadAttribute()',pro:'function loadAttribute(attrName)',cmt:'

Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.

',par:{attrName:'the name of the requested attribute'},ret:'a string with the value of the the attribute',ext:'On failure, throws an exception or returns an empty string.'}; doc['AudioOut']['load_async']={syn:'Preloads the audio output cache with a specified validity duration (asynchronous version).',lib:'audioout.load_async()',pro:'function load_async(msValidity, callback, context)',cmt:'

Preloads the audio output cache with a specified validity duration (asynchronous version). By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network trafic for instance.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{msValidity:'an integer corresponding to the validity of the loaded function parameters, in milliseconds',callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the error code (or `YAPI_SUCCESS`)',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['AudioOut']['muteValueCallbacks']={syn:'Disables the propagation of every new advertised value to the parent hub.',lib:'audioout.muteValueCallbacks()',pro:'function muteValueCallbacks()',cmt:'

Disables the propagation of every new advertised value to the parent hub. You can use this function to save bandwidth and CPU on computers with limited resources, or to prevent unwanted invocations of the HTTP callback. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['AudioOut']['nextAudioOut']={syn:'Continues the enumeration of audio outputs started using `yFirstAudioOut()`.',lib:'audioout.nextAudioOut()',pro:'function nextAudioOut()',cmt:'

Continues the enumeration of audio outputs started using `yFirstAudioOut()`.

',ret:'a pointer to a `YAudioOut` object, corresponding to an audio output currently online, or a `null` pointer if there are no more audio outputs to enumerate.'}; doc['AudioOut']['registerValueCallback']={syn:'Registers the callback function that is invoked on every change of advertised value.',lib:'audioout.registerValueCallback()',pro:'function registerValueCallback(callback)',cmt:'

Registers the callback function that is invoked on every change of advertised value. The callback is invoked only during the execution of `ySleep` or `yHandleEvents`. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a null pointer as argument.

',par:{callback:'the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and the character string describing the new advertised value.'}}; doc['AudioOut']['set_logicalName']={syn:'Changes the logical name of the audio output.',lib:'audioout.set_logicalName()',pro:'function set_logicalName(newval)',cmt:'

Changes the logical name of the audio output. You can use `yCheckLogicalName()` prior to this call to make sure that your parameter is valid. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',par:{newval:'a string corresponding to the logical name of the audio output.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['AudioOut']['set_mute']={syn:'Changes the state of the mute function.',lib:'audioout.set_mute()',pro:'function set_mute(newval)',cmt:'

Changes the state of the mute function. Remember to call the matching module `saveToFlash()` method to save the setting permanently.

',par:{newval:'either `Y_MUTE_FALSE` or `Y_MUTE_TRUE`, according to the state of the mute function'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['AudioOut']['set_userData']={syn:'Stores a user context provided as argument in the userData attribute of the function.',lib:'audioout.set_userData()',pro:'function set_userData(data)',cmt:'

Stores a user context provided as argument in the userData attribute of the function. This attribute is never touched by the API, and is at disposal of the caller to store a context.

',par:{data:'any kind of object to be stored'}}; doc['AudioOut']['set_volume']={syn:'Changes audio output volume, in per cents.',lib:'audioout.set_volume()',pro:'function set_volume(newval)',cmt:'

Changes audio output volume, in per cents.

',par:{newval:'an integer corresponding to audio output volume, in per cents'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['AudioOut']['unmuteValueCallbacks']={syn:'Re-enables the propagation of every new advertised value to the parent hub.',lib:'audioout.unmuteValueCallbacks()',pro:'function unmuteValueCallbacks()',cmt:'

Re-enables the propagation of every new advertised value to the parent hub. This function reverts the effect of a previous call to `muteValueCallbacks()`. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['AudioOut']['wait_async']={syn:'Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function.',lib:'audioout.wait_async()',pro:'function wait_async(callback, context)',cmt:'

Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function. The callback function can therefore freely issue synchronous or asynchronous commands, without risking to block the Javascript VM.

',par:{callback:'callback function that is invoked when all pending commands on the module are completed. The callback function receives two arguments: the caller-specific context object and the receiving function object.',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing.'}; //--- (end of generated code: AudioOut) //--- (generated code: BluetoothLink) doc['BluetoothLink']={'':{syn:'BluetoothLink function interface',inc:'<script type='text/javascript' src='yocto_bluetoothlink.js'></script>',cmt:'

BluetoothLink function provides control over bluetooth link and status for devices that are bluetooth-enabled.

'}}; doc['BluetoothLink']['FindBluetoothLink']={syn:'Retrieves a cellular interface for a given identifier.',lib:'YBluetoothLink.FindBluetoothLink()',pro:'function FindBluetoothLink(func)',cmt:'

Retrieves a cellular interface for a given identifier. The identifier can be specified using several formats:

- FunctionLogicalName
- ModuleSerialNumber.FunctionIdentifier
- ModuleSerialNumber.FunctionLogicalName
- ModuleLogicalName.FunctionIdentifier
- ModuleLogicalName.FunctionLogicalName

This function does not require that the cellular interface is online at the time it is invoked. The returned object is nevertheless valid. Use the method `YBluetoothLink.isOnline()` to test if the cellular interface is indeed online at a given time. In case of ambiguity when looking for a cellular interface by logical name, no error is notified: the first instance found is returned. The search is performed first by hardware name, then by logical name.

If a call to this object\x27s is_online() method returns FALSE although you are certain that the matching device is plugged, make sure that you did call registerHub() at application initialization time.

',par:{func:'a string that uniquely characterizes the cellular interface'},ret:'a `YBluetoothLink` object allowing you to drive the cellular interface.'}; doc['BluetoothLink']['FirstBluetoothLink']={syn:'Starts the enumeration of cellular interfaces currently accessible.',lib:'YBluetoothLink.FirstBluetoothLink()',pro:'function FirstBluetoothLink()',cmt:'

Starts the enumeration of cellular interfaces currently accessible. Use the method `YBluetoothLink.nextBluetoothLink()` to iterate on next cellular interfaces.

',ret:'a pointer to a `YBluetoothLink` object, corresponding to the first cellular interface currently online, or a `null` pointer if there are none.'}; doc['BluetoothLink']['clearCache']={syn:'Invalidates the cache.',lib:'bluetoothlink.clearCache()',pro:'function clearCache()',cmt:'

Invalidates the cache. Invalidates the cache of the cellular interface attributes. Forces the next call to get_xxx() or loadxxx() to use values that come from the device.

'}; doc['BluetoothLink']['connect']={syn:'Attempt to connect to the previously selected remote device.',lib:'bluetoothlink.connect()',pro:'function connect()',cmt:'

Attempt to connect to the previously selected remote device.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['BluetoothLink']['describe']={syn:'Returns a short text that describes unambiguously the instance of the cellular interface in the form `TYPE(NAME)=SERIAL.FUNCTIONID`.',lib:'bluetoothlink.describe()',pro:'function describe()',cmt:'

Returns a short text that describes unambiguously the instance of the cellular interface in the form `TYPE(NAME)=SERIAL.FUNCTIONID`. More precisely, `TYPE` is the type of the function, `NAME` it the name used for the first access to the function, `SERIAL` is the serial number of the module if the module is connected or `\x22unresolved\x22`, and `FUNCTIONID` is the hardware identifier of the function if the module is connected. For example, this method returns `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1` if the module is already connected or `Relay(BadCustomeName.relay1)=unresolved` if the module has not yet been connected. This method does not trigger any USB or TCP transaction and can therefore be used in a debugger.

',ret:'a string that describes the cellular interface (ex: `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1`)'}; doc['BluetoothLink']['disconnect']={syn:'Disconnect from the previously selected remote device.',lib:'bluetoothlink.disconnect()',pro:'function disconnect()',cmt:'

Disconnect from the previously selected remote device.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['BluetoothLink']['get_advertisedValue']={syn:'Returns the current value of the cellular interface (no more than 6 characters).',lib:'bluetoothlink.get_advertisedValue()',pro:'function get_advertisedValue()',cmt:'

Returns the current value of the cellular interface (no more than 6 characters).

',ret:'a string corresponding to the current value of the cellular interface (no more than 6 characters).',ext:'On failure, throws an exception or returns `Y_ADVERTISEDVALUE_INVALID`.'}; doc['BluetoothLink']['get_errorMessage']={syn:'Returns the error message of the latest error with the cellular interface.',lib:'bluetoothlink.get_errorMessage()',pro:'function get_errorMessage()',cmt:'

Returns the error message of the latest error with the cellular interface. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a string corresponding to the latest error message that occured while using the cellular interface object'}; doc['BluetoothLink']['get_errorType']={syn:'Returns the numerical error code of the latest error with the cellular interface.',lib:'bluetoothlink.get_errorType()',pro:'function get_errorType()',cmt:'

Returns the numerical error code of the latest error with the cellular interface. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a number corresponding to the code of the latest error that occurred while using the cellular interface object'}; doc['BluetoothLink']['get_friendlyName']={syn:'Returns a global identifier of the cellular interface in the format `MODULE_NAME.FUNCTION_NAME`.',lib:'bluetoothlink.get_friendlyName()',pro:'function get_friendlyName()',cmt:'

Returns a global identifier of the cellular interface in the format `MODULE_NAME.FUNCTION_NAME`. The returned string uses the logical names of the module and of the cellular interface if they are defined, otherwise the serial number of the module and the hardware identifier of the cellular interface (for example: `MyCustomName.relay1`)

',ret:'a string that uniquely identifies the cellular interface using logical names (ex: `MyCustomName.relay1`)',ext:'On failure, throws an exception or returns `Y_FRIENDLYNAME_INVALID`.'}; doc['BluetoothLink']['get_functionDescriptor']={syn:'Returns a unique identifier of type `YFUN_DESCR` corresponding to the function.',lib:'bluetoothlink.get_functionDescriptor()',pro:'function get_functionDescriptor()',cmt:'

Returns a unique identifier of type `YFUN_DESCR` corresponding to the function. This identifier can be used to test if two instances of `YFunction` reference the same physical function on the same physical device.

',ret:'an identifier of type `YFUN_DESCR`.',ext:'If the function has never been contacted, the returned value is `Y_FUNCTIONDESCRIPTOR_INVALID`.'}; doc['BluetoothLink']['get_functionId']={syn:'Returns the hardware identifier of the cellular interface, without reference to the module.',lib:'bluetoothlink.get_functionId()',pro:'function get_functionId()',cmt:'

Returns the hardware identifier of the cellular interface, without reference to the module. For example `relay1`

',ret:'a string that identifies the cellular interface (ex: `relay1`)',ext:'On failure, throws an exception or returns `Y_FUNCTIONID_INVALID`.'}; doc['BluetoothLink']['get_hardwareId']={syn:'Returns the unique hardware identifier of the cellular interface in the form `SERIAL.FUNCTIONID`.',lib:'bluetoothlink.get_hardwareId()',pro:'function get_hardwareId()',cmt:'

Returns the unique hardware identifier of the cellular interface in the form `SERIAL.FUNCTIONID`. The unique hardware identifier is composed of the device serial number and of the hardware identifier of the cellular interface (for example `RELAYLO1-123456.relay1`).

',ret:'a string that uniquely identifies the cellular interface (ex: `RELAYLO1-123456.relay1`)',ext:'On failure, throws an exception or returns `Y_HARDWAREID_INVALID`.'}; doc['BluetoothLink']['get_linkQuality']={syn:'Returns the bluetooth receiver signal strength, in pourcents, or 0 if no connection is established.',lib:'bluetoothlink.get_linkQuality()',pro:'function get_linkQuality()',cmt:'

Returns the bluetooth receiver signal strength, in pourcents, or 0 if no connection is established.

',ret:'an integer corresponding to the bluetooth receiver signal strength, in pourcents, or 0 if no connection is established',ext:'On failure, throws an exception or returns `Y_LINKQUALITY_INVALID`.'}; doc['BluetoothLink']['get_linkState']={syn:'Returns the bluetooth link state.',lib:'bluetoothlink.get_linkState()',pro:'function get_linkState()',cmt:'

Returns the bluetooth link state.

',ret:'a value among `Y_LINKSTATE_DOWN`, `Y_LINKSTATE_FREE`, `Y_LINKSTATE_SEARCH`, `Y_LINKSTATE_EXISTS`, `Y_LINKSTATE_LINKED` and `Y_LINKSTATE_PLAY` corresponding to the bluetooth link state',ext:'On failure, throws an exception or returns `Y_LINKSTATE_INVALID`.'}; doc['BluetoothLink']['get_logicalName']={syn:'Returns the logical name of the cellular interface.',lib:'bluetoothlink.get_logicalName()',pro:'function get_logicalName()',cmt:'

Returns the logical name of the cellular interface.

',ret:'a string corresponding to the logical name of the cellular interface.',ext:'On failure, throws an exception or returns `Y_LOGICALNAME_INVALID`.'}; doc['BluetoothLink']['get_module']={syn:'Gets the `YModule` object for the device on which the function is located.',lib:'bluetoothlink.get_module()',pro:'function get_module()',cmt:'

Gets the `YModule` object for the device on which the function is located. If the function cannot be located on any module, the returned instance of `YModule` is not shown as on-line.

',ret:'an instance of `YModule`'}; doc['BluetoothLink']['get_module_async']={syn:'Gets the `YModule` object for the device on which the function is located (asynchronous version).',lib:'bluetoothlink.get_module_async()',pro:'function get_module_async(callback, context)',cmt:'

Gets the `YModule` object for the device on which the function is located (asynchronous version). If the function cannot be located on any module, the returned `YModule` object does not show as on-line.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking Firefox javascript VM that does not implement context switching during blocking I/O calls. See the documentation section on asynchronous Javascript calls for more details.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the requested `YModule` object',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['BluetoothLink']['get_mute']={syn:'Returns the state of the mute function.',lib:'bluetoothlink.get_mute()',pro:'function get_mute()',cmt:'

Returns the state of the mute function.

',ret:'either `Y_MUTE_FALSE` or `Y_MUTE_TRUE`, according to the state of the mute function',ext:'On failure, throws an exception or returns `Y_MUTE_INVALID`.'}; doc['BluetoothLink']['get_ownAddress']={syn:'Returns the MAC-48 address of the bluetooth interface, which is unique on the bluetooth network.',lib:'bluetoothlink.get_ownAddress()',pro:'function get_ownAddress()',cmt:'

Returns the MAC-48 address of the bluetooth interface, which is unique on the bluetooth network.

',ret:'a string corresponding to the MAC-48 address of the bluetooth interface, which is unique on the bluetooth network',ext:'On failure, throws an exception or returns `Y_OWNADDRESS_INVALID`.'}; doc['BluetoothLink']['get_pairingPin']={syn:'Returns an opaque string if a PIN code has been configured in the device to access the SIM card, or an empty string if none has been configured or if the code provided was rejected by the SIM card.',lib:'bluetoothlink.get_pairingPin()',pro:'function get_pairingPin()',cmt:'

Returns an opaque string if a PIN code has been configured in the device to access the SIM card, or an empty string if none has been configured or if the code provided was rejected by the SIM card.

',ret:'a string corresponding to an opaque string if a PIN code has been configured in the device to access the SIM card, or an empty string if none has been configured or if the code provided was rejected by the SIM card',ext:'On failure, throws an exception or returns `Y_PAIRINGPIN_INVALID`.'}; doc['BluetoothLink']['get_preAmplifier']={syn:'Returns the audio pre-amplifier volume, in per cents.',lib:'bluetoothlink.get_preAmplifier()',pro:'function get_preAmplifier()',cmt:'

Returns the audio pre-amplifier volume, in per cents.

',ret:'an integer corresponding to the audio pre-amplifier volume, in per cents',ext:'On failure, throws an exception or returns `Y_PREAMPLIFIER_INVALID`.'}; doc['BluetoothLink']['get_remoteAddress']={syn:'Returns the MAC-48 address of the remote device to connect to.',lib:'bluetoothlink.get_remoteAddress()',pro:'function get_remoteAddress()',cmt:'

Returns the MAC-48 address of the remote device to connect to.

',ret:'a string corresponding to the MAC-48 address of the remote device to connect to',ext:'On failure, throws an exception or returns `Y_REMOTEADDRESS_INVALID`.'}; doc['BluetoothLink']['get_remoteName']={syn:'Returns the bluetooth name the remote device, if found on the bluetooth network.',lib:'bluetoothlink.get_remoteName()',pro:'function get_remoteName()',cmt:'

Returns the bluetooth name the remote device, if found on the bluetooth network.

',ret:'a string corresponding to the bluetooth name the remote device, if found on the bluetooth network',ext:'On failure, throws an exception or returns `Y_REMOTENAME_INVALID`.'}; doc['BluetoothLink']['get_userData']={syn:'Returns the value of the userData attribute, as previously stored using method `set_userData`.',lib:'bluetoothlink.get_userData()',pro:'function get_userData()',cmt:'

Returns the value of the userData attribute, as previously stored using method `set_userData`. This attribute is never touched directly by the API, and is at disposal of the caller to store a context.

',ret:'the object stored previously by the caller.'}; doc['BluetoothLink']['get_volume']={syn:'Returns the connected headset volume, in per cents.',lib:'bluetoothlink.get_volume()',pro:'function get_volume()',cmt:'

Returns the connected headset volume, in per cents.

',ret:'an integer corresponding to the connected headset volume, in per cents',ext:'On failure, throws an exception or returns `Y_VOLUME_INVALID`.'}; doc['BluetoothLink']['isOnline']={syn:'Checks if the cellular interface is currently reachable, without raising any error.',lib:'bluetoothlink.isOnline()',pro:'function isOnline()',cmt:'

Checks if the cellular interface is currently reachable, without raising any error. If there is a cached value for the cellular interface in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the cellular interface.

',ret:'`true` if the cellular interface can be reached, and `false` otherwise'}; doc['BluetoothLink']['isOnline_async']={syn:'Checks if the cellular interface is currently reachable, without raising any error (asynchronous version).',lib:'bluetoothlink.isOnline_async()',pro:'function isOnline_async(callback, context)',cmt:'

Checks if the cellular interface is currently reachable, without raising any error (asynchronous version). If there is a cached value for the cellular interface in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the requested function.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the boolean result',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['BluetoothLink']['load']={syn:'Preloads the cellular interface cache with a specified validity duration.',lib:'bluetoothlink.load()',pro:'function load(msValidity)',cmt:'

Preloads the cellular interface cache with a specified validity duration. By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network traffic for instance.

',par:{msValidity:'an integer corresponding to the validity attributed to the loaded function parameters, in milliseconds'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['BluetoothLink']['loadAttribute']={syn:'Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.',lib:'bluetoothlink.loadAttribute()',pro:'function loadAttribute(attrName)',cmt:'

Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.

',par:{attrName:'the name of the requested attribute'},ret:'a string with the value of the the attribute',ext:'On failure, throws an exception or returns an empty string.'}; doc['BluetoothLink']['load_async']={syn:'Preloads the cellular interface cache with a specified validity duration (asynchronous version).',lib:'bluetoothlink.load_async()',pro:'function load_async(msValidity, callback, context)',cmt:'

Preloads the cellular interface cache with a specified validity duration (asynchronous version). By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network trafic for instance.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{msValidity:'an integer corresponding to the validity of the loaded function parameters, in milliseconds',callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the error code (or `YAPI_SUCCESS`)',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['BluetoothLink']['muteValueCallbacks']={syn:'Disables the propagation of every new advertised value to the parent hub.',lib:'bluetoothlink.muteValueCallbacks()',pro:'function muteValueCallbacks()',cmt:'

Disables the propagation of every new advertised value to the parent hub. You can use this function to save bandwidth and CPU on computers with limited resources, or to prevent unwanted invocations of the HTTP callback. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['BluetoothLink']['nextBluetoothLink']={syn:'Continues the enumeration of cellular interfaces started using `yFirstBluetoothLink()`.',lib:'bluetoothlink.nextBluetoothLink()',pro:'function nextBluetoothLink()',cmt:'

Continues the enumeration of cellular interfaces started using `yFirstBluetoothLink()`.

',ret:'a pointer to a `YBluetoothLink` object, corresponding to a cellular interface currently online, or a `null` pointer if there are no more cellular interfaces to enumerate.'}; doc['BluetoothLink']['registerValueCallback']={syn:'Registers the callback function that is invoked on every change of advertised value.',lib:'bluetoothlink.registerValueCallback()',pro:'function registerValueCallback(callback)',cmt:'

Registers the callback function that is invoked on every change of advertised value. The callback is invoked only during the execution of `ySleep` or `yHandleEvents`. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a null pointer as argument.

',par:{callback:'the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and the character string describing the new advertised value.'}}; doc['BluetoothLink']['set_logicalName']={syn:'Changes the logical name of the cellular interface.',lib:'bluetoothlink.set_logicalName()',pro:'function set_logicalName(newval)',cmt:'

Changes the logical name of the cellular interface. You can use `yCheckLogicalName()` prior to this call to make sure that your parameter is valid. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',par:{newval:'a string corresponding to the logical name of the cellular interface.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['BluetoothLink']['set_mute']={syn:'Changes the state of the mute function.',lib:'bluetoothlink.set_mute()',pro:'function set_mute(newval)',cmt:'

Changes the state of the mute function. Remember to call the matching module `saveToFlash()` method to save the setting permanently.

',par:{newval:'either `Y_MUTE_FALSE` or `Y_MUTE_TRUE`, according to the state of the mute function'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['BluetoothLink']['set_pairingPin']={syn:'Changes the PIN code used by the module for bluetooth pairing.',lib:'bluetoothlink.set_pairingPin()',pro:'function set_pairingPin(newval)',cmt:'

Changes the PIN code used by the module for bluetooth pairing. Remember to call the `saveToFlash()` method of the module to save the new value in the device flash.

',par:{newval:'a string corresponding to the PIN code used by the module for bluetooth pairing'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['BluetoothLink']['set_preAmplifier']={syn:'Changes the audio pre-amplifier volume, in per cents.',lib:'bluetoothlink.set_preAmplifier()',pro:'function set_preAmplifier(newval)',cmt:'

Changes the audio pre-amplifier volume, in per cents.

',par:{newval:'an integer corresponding to the audio pre-amplifier volume, in per cents'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['BluetoothLink']['set_remoteAddress']={syn:'Changes the MAC-48 address defining which remote device to connect to.',lib:'bluetoothlink.set_remoteAddress()',pro:'function set_remoteAddress(newval)',cmt:'

Changes the MAC-48 address defining which remote device to connect to.

',par:{newval:'a string corresponding to the MAC-48 address defining which remote device to connect to'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['BluetoothLink']['set_userData']={syn:'Stores a user context provided as argument in the userData attribute of the function.',lib:'bluetoothlink.set_userData()',pro:'function set_userData(data)',cmt:'

Stores a user context provided as argument in the userData attribute of the function. This attribute is never touched by the API, and is at disposal of the caller to store a context.

',par:{data:'any kind of object to be stored'}}; doc['BluetoothLink']['set_volume']={syn:'Changes the connected headset volume, in per cents.',lib:'bluetoothlink.set_volume()',pro:'function set_volume(newval)',cmt:'

Changes the connected headset volume, in per cents.

',par:{newval:'an integer corresponding to the connected headset volume, in per cents'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['BluetoothLink']['unmuteValueCallbacks']={syn:'Re-enables the propagation of every new advertised value to the parent hub.',lib:'bluetoothlink.unmuteValueCallbacks()',pro:'function unmuteValueCallbacks()',cmt:'

Re-enables the propagation of every new advertised value to the parent hub. This function reverts the effect of a previous call to `muteValueCallbacks()`. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['BluetoothLink']['wait_async']={syn:'Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function.',lib:'bluetoothlink.wait_async()',pro:'function wait_async(callback, context)',cmt:'

Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function. The callback function can therefore freely issue synchronous or asynchronous commands, without risking to block the Javascript VM.

',par:{callback:'callback function that is invoked when all pending commands on the module are completed. The callback function receives two arguments: the caller-specific context object and the receiving function object.',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing.'}; //--- (end of generated code: BluetoothLink) //--- (generated code: AudioIn) doc['AudioIn']={'':{syn:'AudioIn function interface',inc:'<script type='text/javascript' src='yocto_audioin.js'></script>',cmt:'

The Yoctopuce application programming interface allows you to configure the volume of the input channel.

'}}; doc['AudioIn']['FindAudioIn']={syn:'Retrieves an audio input for a given identifier.',lib:'YAudioIn.FindAudioIn()',pro:'function FindAudioIn(func)',cmt:'

Retrieves an audio input for a given identifier. The identifier can be specified using several formats:

- FunctionLogicalName
- ModuleSerialNumber.FunctionIdentifier
- ModuleSerialNumber.FunctionLogicalName
- ModuleLogicalName.FunctionIdentifier
- ModuleLogicalName.FunctionLogicalName

This function does not require that the audio input is online at the time it is invoked. The returned object is nevertheless valid. Use the method `YAudioIn.isOnline()` to test if the audio input is indeed online at a given time. In case of ambiguity when looking for an audio input by logical name, no error is notified: the first instance found is returned. The search is performed first by hardware name, then by logical name.

If a call to this object\x27s is_online() method returns FALSE although you are certain that the matching device is plugged, make sure that you did call registerHub() at application initialization time.

',par:{func:'a string that uniquely characterizes the audio input'},ret:'a `YAudioIn` object allowing you to drive the audio input.'}; doc['AudioIn']['FirstAudioIn']={syn:'Starts the enumeration of audio inputs currently accessible.',lib:'YAudioIn.FirstAudioIn()',pro:'function FirstAudioIn()',cmt:'

Starts the enumeration of audio inputs currently accessible. Use the method `YAudioIn.nextAudioIn()` to iterate on next audio inputs.

',ret:'a pointer to a `YAudioIn` object, corresponding to the first audio input currently online, or a `null` pointer if there are none.'}; doc['AudioIn']['clearCache']={syn:'Invalidates the cache.',lib:'audioin.clearCache()',pro:'function clearCache()',cmt:'

Invalidates the cache. Invalidates the cache of the audio input attributes. Forces the next call to get_xxx() or loadxxx() to use values that come from the device.

'}; doc['AudioIn']['describe']={syn:'Returns a short text that describes unambiguously the instance of the audio input in the form `TYPE(NAME)=SERIAL.FUNCTIONID`.',lib:'audioin.describe()',pro:'function describe()',cmt:'

Returns a short text that describes unambiguously the instance of the audio input in the form `TYPE(NAME)=SERIAL.FUNCTIONID`. More precisely, `TYPE` is the type of the function, `NAME` it the name used for the first access to the function, `SERIAL` is the serial number of the module if the module is connected or `\x22unresolved\x22`, and `FUNCTIONID` is the hardware identifier of the function if the module is connected. For example, this method returns `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1` if the module is already connected or `Relay(BadCustomeName.relay1)=unresolved` if the module has not yet been connected. This method does not trigger any USB or TCP transaction and can therefore be used in a debugger.

',ret:'a string that describes the audio input (ex: `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1`)'}; doc['AudioIn']['get_advertisedValue']={syn:'Returns the current value of the audio input (no more than 6 characters).',lib:'audioin.get_advertisedValue()',pro:'function get_advertisedValue()',cmt:'

Returns the current value of the audio input (no more than 6 characters).

',ret:'a string corresponding to the current value of the audio input (no more than 6 characters).',ext:'On failure, throws an exception or returns `Y_ADVERTISEDVALUE_INVALID`.'}; doc['AudioIn']['get_errorMessage']={syn:'Returns the error message of the latest error with the audio input.',lib:'audioin.get_errorMessage()',pro:'function get_errorMessage()',cmt:'

Returns the error message of the latest error with the audio input. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a string corresponding to the latest error message that occured while using the audio input object'}; doc['AudioIn']['get_errorType']={syn:'Returns the numerical error code of the latest error with the audio input.',lib:'audioin.get_errorType()',pro:'function get_errorType()',cmt:'

Returns the numerical error code of the latest error with the audio input. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a number corresponding to the code of the latest error that occurred while using the audio input object'}; doc['AudioIn']['get_friendlyName']={syn:'Returns a global identifier of the audio input in the format `MODULE_NAME.FUNCTION_NAME`.',lib:'audioin.get_friendlyName()',pro:'function get_friendlyName()',cmt:'

Returns a global identifier of the audio input in the format `MODULE_NAME.FUNCTION_NAME`. The returned string uses the logical names of the module and of the audio input if they are defined, otherwise the serial number of the module and the hardware identifier of the audio input (for example: `MyCustomName.relay1`)

',ret:'a string that uniquely identifies the audio input using logical names (ex: `MyCustomName.relay1`)',ext:'On failure, throws an exception or returns `Y_FRIENDLYNAME_INVALID`.'}; doc['AudioIn']['get_functionDescriptor']={syn:'Returns a unique identifier of type `YFUN_DESCR` corresponding to the function.',lib:'audioin.get_functionDescriptor()',pro:'function get_functionDescriptor()',cmt:'

Returns a unique identifier of type `YFUN_DESCR` corresponding to the function. This identifier can be used to test if two instances of `YFunction` reference the same physical function on the same physical device.

',ret:'an identifier of type `YFUN_DESCR`.',ext:'If the function has never been contacted, the returned value is `Y_FUNCTIONDESCRIPTOR_INVALID`.'}; doc['AudioIn']['get_functionId']={syn:'Returns the hardware identifier of the audio input, without reference to the module.',lib:'audioin.get_functionId()',pro:'function get_functionId()',cmt:'

Returns the hardware identifier of the audio input, without reference to the module. For example `relay1`

',ret:'a string that identifies the audio input (ex: `relay1`)',ext:'On failure, throws an exception or returns `Y_FUNCTIONID_INVALID`.'}; doc['AudioIn']['get_hardwareId']={syn:'Returns the unique hardware identifier of the audio input in the form `SERIAL.FUNCTIONID`.',lib:'audioin.get_hardwareId()',pro:'function get_hardwareId()',cmt:'

Returns the unique hardware identifier of the audio input in the form `SERIAL.FUNCTIONID`. The unique hardware identifier is composed of the device serial number and of the hardware identifier of the audio input (for example `RELAYLO1-123456.relay1`).

',ret:'a string that uniquely identifies the audio input (ex: `RELAYLO1-123456.relay1`)',ext:'On failure, throws an exception or returns `Y_HARDWAREID_INVALID`.'}; doc['AudioIn']['get_logicalName']={syn:'Returns the logical name of the audio input.',lib:'audioin.get_logicalName()',pro:'function get_logicalName()',cmt:'

Returns the logical name of the audio input.

',ret:'a string corresponding to the logical name of the audio input.',ext:'On failure, throws an exception or returns `Y_LOGICALNAME_INVALID`.'}; doc['AudioIn']['get_module']={syn:'Gets the `YModule` object for the device on which the function is located.',lib:'audioin.get_module()',pro:'function get_module()',cmt:'

Gets the `YModule` object for the device on which the function is located. If the function cannot be located on any module, the returned instance of `YModule` is not shown as on-line.

',ret:'an instance of `YModule`'}; doc['AudioIn']['get_module_async']={syn:'Gets the `YModule` object for the device on which the function is located (asynchronous version).',lib:'audioin.get_module_async()',pro:'function get_module_async(callback, context)',cmt:'

Gets the `YModule` object for the device on which the function is located (asynchronous version). If the function cannot be located on any module, the returned `YModule` object does not show as on-line.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking Firefox javascript VM that does not implement context switching during blocking I/O calls. See the documentation section on asynchronous Javascript calls for more details.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the requested `YModule` object',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['AudioIn']['get_mute']={syn:'Returns the state of the mute function.',lib:'audioin.get_mute()',pro:'function get_mute()',cmt:'

Returns the state of the mute function.

',ret:'either `Y_MUTE_FALSE` or `Y_MUTE_TRUE`, according to the state of the mute function',ext:'On failure, throws an exception or returns `Y_MUTE_INVALID`.'}; doc['AudioIn']['get_noSignalFor']={syn:'Returns the number of seconds elapsed without detecting a signal.',lib:'audioin.get_noSignalFor()',pro:'function get_noSignalFor()',cmt:'

Returns the number of seconds elapsed without detecting a signal.

',ret:'an integer corresponding to the number of seconds elapsed without detecting a signal',ext:'On failure, throws an exception or returns `Y_NOSIGNALFOR_INVALID`.'}; doc['AudioIn']['get_signal']={syn:'Returns the detected input signal level.',lib:'audioin.get_signal()',pro:'function get_signal()',cmt:'

Returns the detected input signal level.

',ret:'an integer corresponding to the detected input signal level',ext:'On failure, throws an exception or returns `Y_SIGNAL_INVALID`.'}; doc['AudioIn']['get_userData']={syn:'Returns the value of the userData attribute, as previously stored using method `set_userData`.',lib:'audioin.get_userData()',pro:'function get_userData()',cmt:'

Returns the value of the userData attribute, as previously stored using method `set_userData`. This attribute is never touched directly by the API, and is at disposal of the caller to store a context.

',ret:'the object stored previously by the caller.'}; doc['AudioIn']['get_volume']={syn:'Returns audio input gain, in per cents.',lib:'audioin.get_volume()',pro:'function get_volume()',cmt:'

Returns audio input gain, in per cents.

',ret:'an integer corresponding to audio input gain, in per cents',ext:'On failure, throws an exception or returns `Y_VOLUME_INVALID`.'}; doc['AudioIn']['get_volumeRange']={syn:'Returns the supported volume range.',lib:'audioin.get_volumeRange()',pro:'function get_volumeRange()',cmt:'

Returns the supported volume range. The low value of the range corresponds to the minimal audible value. To completely mute the sound, use `set_mute()` instead of the `set_volume()`.

',ret:'a string corresponding to the supported volume range',ext:'On failure, throws an exception or returns `Y_VOLUMERANGE_INVALID`.'}; doc['AudioIn']['isOnline']={syn:'Checks if the audio input is currently reachable, without raising any error.',lib:'audioin.isOnline()',pro:'function isOnline()',cmt:'

Checks if the audio input is currently reachable, without raising any error. If there is a cached value for the audio input in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the audio input.

',ret:'`true` if the audio input can be reached, and `false` otherwise'}; doc['AudioIn']['isOnline_async']={syn:'Checks if the audio input is currently reachable, without raising any error (asynchronous version).',lib:'audioin.isOnline_async()',pro:'function isOnline_async(callback, context)',cmt:'

Checks if the audio input is currently reachable, without raising any error (asynchronous version). If there is a cached value for the audio input in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the requested function.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the boolean result',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['AudioIn']['load']={syn:'Preloads the audio input cache with a specified validity duration.',lib:'audioin.load()',pro:'function load(msValidity)',cmt:'

Preloads the audio input cache with a specified validity duration. By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network traffic for instance.

',par:{msValidity:'an integer corresponding to the validity attributed to the loaded function parameters, in milliseconds'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['AudioIn']['loadAttribute']={syn:'Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.',lib:'audioin.loadAttribute()',pro:'function loadAttribute(attrName)',cmt:'

Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.

',par:{attrName:'the name of the requested attribute'},ret:'a string with the value of the the attribute',ext:'On failure, throws an exception or returns an empty string.'}; doc['AudioIn']['load_async']={syn:'Preloads the audio input cache with a specified validity duration (asynchronous version).',lib:'audioin.load_async()',pro:'function load_async(msValidity, callback, context)',cmt:'

Preloads the audio input cache with a specified validity duration (asynchronous version). By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network trafic for instance.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{msValidity:'an integer corresponding to the validity of the loaded function parameters, in milliseconds',callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the error code (or `YAPI_SUCCESS`)',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['AudioIn']['muteValueCallbacks']={syn:'Disables the propagation of every new advertised value to the parent hub.',lib:'audioin.muteValueCallbacks()',pro:'function muteValueCallbacks()',cmt:'

Disables the propagation of every new advertised value to the parent hub. You can use this function to save bandwidth and CPU on computers with limited resources, or to prevent unwanted invocations of the HTTP callback. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['AudioIn']['nextAudioIn']={syn:'Continues the enumeration of audio inputs started using `yFirstAudioIn()`.',lib:'audioin.nextAudioIn()',pro:'function nextAudioIn()',cmt:'

Continues the enumeration of audio inputs started using `yFirstAudioIn()`.

',ret:'a pointer to a `YAudioIn` object, corresponding to an audio input currently online, or a `null` pointer if there are no more audio inputs to enumerate.'}; doc['AudioIn']['registerValueCallback']={syn:'Registers the callback function that is invoked on every change of advertised value.',lib:'audioin.registerValueCallback()',pro:'function registerValueCallback(callback)',cmt:'

Registers the callback function that is invoked on every change of advertised value. The callback is invoked only during the execution of `ySleep` or `yHandleEvents`. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a null pointer as argument.

',par:{callback:'the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and the character string describing the new advertised value.'}}; doc['AudioIn']['set_logicalName']={syn:'Changes the logical name of the audio input.',lib:'audioin.set_logicalName()',pro:'function set_logicalName(newval)',cmt:'

Changes the logical name of the audio input. You can use `yCheckLogicalName()` prior to this call to make sure that your parameter is valid. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',par:{newval:'a string corresponding to the logical name of the audio input.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['AudioIn']['set_mute']={syn:'Changes the state of the mute function.',lib:'audioin.set_mute()',pro:'function set_mute(newval)',cmt:'

Changes the state of the mute function. Remember to call the matching module `saveToFlash()` method to save the setting permanently.

',par:{newval:'either `Y_MUTE_FALSE` or `Y_MUTE_TRUE`, according to the state of the mute function'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['AudioIn']['set_userData']={syn:'Stores a user context provided as argument in the userData attribute of the function.',lib:'audioin.set_userData()',pro:'function set_userData(data)',cmt:'

Stores a user context provided as argument in the userData attribute of the function. This attribute is never touched by the API, and is at disposal of the caller to store a context.

',par:{data:'any kind of object to be stored'}}; doc['AudioIn']['set_volume']={syn:'Changes audio input gain, in per cents.',lib:'audioin.set_volume()',pro:'function set_volume(newval)',cmt:'

Changes audio input gain, in per cents.

',par:{newval:'an integer corresponding to audio input gain, in per cents'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['AudioIn']['unmuteValueCallbacks']={syn:'Re-enables the propagation of every new advertised value to the parent hub.',lib:'audioin.unmuteValueCallbacks()',pro:'function unmuteValueCallbacks()',cmt:'

Re-enables the propagation of every new advertised value to the parent hub. This function reverts the effect of a previous call to `muteValueCallbacks()`. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['AudioIn']['wait_async']={syn:'Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function.',lib:'audioin.wait_async()',pro:'function wait_async(callback, context)',cmt:'

Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function. The callback function can therefore freely issue synchronous or asynchronous commands, without risking to block the Javascript VM.

',par:{callback:'callback function that is invoked when all pending commands on the module are completed. The callback function receives two arguments: the caller-specific context object and the receiving function object.',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing.'}; //--- (end of generated code: AudioIn) //--- (generated code: QuadratureDecoder) doc['QuadratureDecoder']={'':{syn:'QuadratureDecoder function interface',inc:'<script type='text/javascript' src='yocto_quadraturedecoder.js'></script>',cmt:'

The class YQuadratureDecoder allows you to decode a two-wire signal produced by a quadrature encoder. It inherits from YSensor class the core functions to read measurements, to register callback functions, to access the autonomous datalogger.

'}}; doc['QuadratureDecoder']['FindQuadratureDecoder']={syn:'Retrieves a quadrature decoder for a given identifier.',lib:'YQuadratureDecoder.FindQuadratureDecoder()',pro:'function FindQuadratureDecoder(func)',cmt:'

Retrieves a quadrature decoder for a given identifier. The identifier can be specified using several formats:

- FunctionLogicalName
- ModuleSerialNumber.FunctionIdentifier
- ModuleSerialNumber.FunctionLogicalName
- ModuleLogicalName.FunctionIdentifier
- ModuleLogicalName.FunctionLogicalName

This function does not require that the quadrature decoder is online at the time it is invoked. The returned object is nevertheless valid. Use the method `YQuadratureDecoder.isOnline()` to test if the quadrature decoder is indeed online at a given time. In case of ambiguity when looking for a quadrature decoder by logical name, no error is notified: the first instance found is returned. The search is performed first by hardware name, then by logical name.

If a call to this object\x27s is_online() method returns FALSE although you are certain that the matching device is plugged, make sure that you did call registerHub() at application initialization time.

',par:{func:'a string that uniquely characterizes the quadrature decoder'},ret:'a `YQuadratureDecoder` object allowing you to drive the quadrature decoder.'}; doc['QuadratureDecoder']['FirstQuadratureDecoder']={syn:'Starts the enumeration of quadrature decoders currently accessible.',lib:'YQuadratureDecoder.FirstQuadratureDecoder()',pro:'function FirstQuadratureDecoder()',cmt:'

Starts the enumeration of quadrature decoders currently accessible. Use the method `YQuadratureDecoder.nextQuadratureDecoder()` to iterate on next quadrature decoders.

',ret:'a pointer to a `YQuadratureDecoder` object, corresponding to the first quadrature decoder currently online, or a `null` pointer if there are none.'}; doc['QuadratureDecoder']['calibrateFromPoints']={syn:'Configures error correction data points, in particular to compensate for a possible perturbation of the measure caused by an enclosure.',lib:'quadraturedecoder.calibrateFromPoints()',pro:'function calibrateFromPoints(rawValues, refValues)',cmt:'

Configures error correction data points, in particular to compensate for a possible perturbation of the measure caused by an enclosure. It is possible to configure up to five correction points. Correction points must be provided in ascending order, and be in the range of the sensor. The device will automatically perform a linear interpolation of the error correction between specified points. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

For more information on advanced capabilities to refine the calibration of sensors, please contact support@yoctopuce.com.

',par:{rawValues:'array of floating point numbers, corresponding to the raw values returned by the sensor for the correction points.',refValues:'array of floating point numbers, corresponding to the corrected values for the correction points.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['QuadratureDecoder']['clearCache']={syn:'Invalidates the cache.',lib:'quadraturedecoder.clearCache()',pro:'function clearCache()',cmt:'

Invalidates the cache. Invalidates the cache of the quadrature decoder attributes. Forces the next call to get_xxx() or loadxxx() to use values that come from the device.

'}; doc['QuadratureDecoder']['describe']={syn:'Returns a short text that describes unambiguously the instance of the quadrature decoder in the form `TYPE(NAME)=SERIAL.FUNCTIONID`.',lib:'quadraturedecoder.describe()',pro:'function describe()',cmt:'

Returns a short text that describes unambiguously the instance of the quadrature decoder in the form `TYPE(NAME)=SERIAL.FUNCTIONID`. More precisely, `TYPE` is the type of the function, `NAME` it the name used for the first access to the function, `SERIAL` is the serial number of the module if the module is connected or `\x22unresolved\x22`, and `FUNCTIONID` is the hardware identifier of the function if the module is connected. For example, this method returns `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1` if the module is already connected or `Relay(BadCustomeName.relay1)=unresolved` if the module has not yet been connected. This method does not trigger any USB or TCP transaction and can therefore be used in a debugger.

',ret:'a string that describes the quadrature decoder (ex: `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1`)'}; doc['QuadratureDecoder']['get_advMode']={syn:'Returns the measuring mode used for the advertised value pushed to the parent hub.',lib:'quadraturedecoder.get_advMode()',pro:'function get_advMode()',cmt:'

Returns the measuring mode used for the advertised value pushed to the parent hub.

',ret:'a value among `Y_ADVMODE_IMMEDIATE`, `Y_ADVMODE_PERIOD_AVG`, `Y_ADVMODE_PERIOD_MIN` and `Y_ADVMODE_PERIOD_MAX` corresponding to the measuring mode used for the advertised value pushed to the parent hub',ext:'On failure, throws an exception or returns `Y_ADVMODE_INVALID`.'}; doc['QuadratureDecoder']['get_advertisedValue']={syn:'Returns the current value of the quadrature decoder (no more than 6 characters).',lib:'quadraturedecoder.get_advertisedValue()',pro:'function get_advertisedValue()',cmt:'

Returns the current value of the quadrature decoder (no more than 6 characters).

',ret:'a string corresponding to the current value of the quadrature decoder (no more than 6 characters).',ext:'On failure, throws an exception or returns `Y_ADVERTISEDVALUE_INVALID`.'}; doc['QuadratureDecoder']['get_currentRawValue']={syn:'Returns the uncalibrated, unrounded raw value returned by the sensor, in pas, as a floating point number.',lib:'quadraturedecoder.get_currentRawValue()',pro:'function get_currentRawValue()',cmt:'

Returns the uncalibrated, unrounded raw value returned by the sensor, in pas, as a floating point number.

',ret:'a floating point number corresponding to the uncalibrated, unrounded raw value returned by the sensor, in pas, as a floating point number',ext:'On failure, throws an exception or returns `Y_CURRENTRAWVALUE_INVALID`.'}; doc['QuadratureDecoder']['get_currentValue']={syn:'Returns the current value of the position, in pas, as a floating point number.',lib:'quadraturedecoder.get_currentValue()',pro:'function get_currentValue()',cmt:'

Returns the current value of the position, in pas, as a floating point number.

',ret:'a floating point number corresponding to the current value of the position, in pas, as a floating point number',ext:'On failure, throws an exception or returns `Y_CURRENTVALUE_INVALID`.'}; doc['QuadratureDecoder']['get_dataLogger']={syn:'Returns the YDatalogger object of the device hosting the sensor.',lib:'quadraturedecoder.get_dataLogger()',pro:'function get_dataLogger()',cmt:'

Returns the YDatalogger object of the device hosting the sensor. This method returns an object of class YDatalogger that can control global parameters of the data logger. The returned object should not be freed.

',ret:'an YDataLogger object or null on error.'}; doc['QuadratureDecoder']['get_decoding']={syn:'Returns the current activation state of the quadrature decoder.',lib:'quadraturedecoder.get_decoding()',pro:'function get_decoding()',cmt:'

Returns the current activation state of the quadrature decoder.

',ret:'either `Y_DECODING_OFF` or `Y_DECODING_ON`, according to the current activation state of the quadrature decoder',ext:'On failure, throws an exception or returns `Y_DECODING_INVALID`.'}; doc['QuadratureDecoder']['get_errorMessage']={syn:'Returns the error message of the latest error with the quadrature decoder.',lib:'quadraturedecoder.get_errorMessage()',pro:'function get_errorMessage()',cmt:'

Returns the error message of the latest error with the quadrature decoder. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a string corresponding to the latest error message that occured while using the quadrature decoder object'}; doc['QuadratureDecoder']['get_errorType']={syn:'Returns the numerical error code of the latest error with the quadrature decoder.',lib:'quadraturedecoder.get_errorType()',pro:'function get_errorType()',cmt:'

Returns the numerical error code of the latest error with the quadrature decoder. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a number corresponding to the code of the latest error that occurred while using the quadrature decoder object'}; doc['QuadratureDecoder']['get_friendlyName']={syn:'Returns a global identifier of the quadrature decoder in the format `MODULE_NAME.FUNCTION_NAME`.',lib:'quadraturedecoder.get_friendlyName()',pro:'function get_friendlyName()',cmt:'

Returns a global identifier of the quadrature decoder in the format `MODULE_NAME.FUNCTION_NAME`. The returned string uses the logical names of the module and of the quadrature decoder if they are defined, otherwise the serial number of the module and the hardware identifier of the quadrature decoder (for example: `MyCustomName.relay1`)

',ret:'a string that uniquely identifies the quadrature decoder using logical names (ex: `MyCustomName.relay1`)',ext:'On failure, throws an exception or returns `Y_FRIENDLYNAME_INVALID`.'}; doc['QuadratureDecoder']['get_functionDescriptor']={syn:'Returns a unique identifier of type `YFUN_DESCR` corresponding to the function.',lib:'quadraturedecoder.get_functionDescriptor()',pro:'function get_functionDescriptor()',cmt:'

Returns a unique identifier of type `YFUN_DESCR` corresponding to the function. This identifier can be used to test if two instances of `YFunction` reference the same physical function on the same physical device.

',ret:'an identifier of type `YFUN_DESCR`.',ext:'If the function has never been contacted, the returned value is `Y_FUNCTIONDESCRIPTOR_INVALID`.'}; doc['QuadratureDecoder']['get_functionId']={syn:'Returns the hardware identifier of the quadrature decoder, without reference to the module.',lib:'quadraturedecoder.get_functionId()',pro:'function get_functionId()',cmt:'

Returns the hardware identifier of the quadrature decoder, without reference to the module. For example `relay1`

',ret:'a string that identifies the quadrature decoder (ex: `relay1`)',ext:'On failure, throws an exception or returns `Y_FUNCTIONID_INVALID`.'}; doc['QuadratureDecoder']['get_hardwareId']={syn:'Returns the unique hardware identifier of the quadrature decoder in the form `SERIAL.FUNCTIONID`.',lib:'quadraturedecoder.get_hardwareId()',pro:'function get_hardwareId()',cmt:'

Returns the unique hardware identifier of the quadrature decoder in the form `SERIAL.FUNCTIONID`. The unique hardware identifier is composed of the device serial number and of the hardware identifier of the quadrature decoder (for example `RELAYLO1-123456.relay1`).

',ret:'a string that uniquely identifies the quadrature decoder (ex: `RELAYLO1-123456.relay1`)',ext:'On failure, throws an exception or returns `Y_HARDWAREID_INVALID`.'}; doc['QuadratureDecoder']['get_highestValue']={syn:'Returns the maximal value observed for the position since the device was started.',lib:'quadraturedecoder.get_highestValue()',pro:'function get_highestValue()',cmt:'

Returns the maximal value observed for the position since the device was started. Can be reset to an arbitrary value thanks to set_highestValue().

',ret:'a floating point number corresponding to the maximal value observed for the position since the device was started',ext:'On failure, throws an exception or returns `Y_HIGHESTVALUE_INVALID`.'}; doc['QuadratureDecoder']['get_logFrequency']={syn:'Returns the datalogger recording frequency for this function, or \x22OFF\x22 when measures are not stored in the data logger flash memory.',lib:'quadraturedecoder.get_logFrequency()',pro:'function get_logFrequency()',cmt:'

Returns the datalogger recording frequency for this function, or \x22OFF\x22 when measures are not stored in the data logger flash memory.

',ret:'a string corresponding to the datalogger recording frequency for this function, or \x22OFF\x22 when measures are not stored in the data logger flash memory',ext:'On failure, throws an exception or returns `Y_LOGFREQUENCY_INVALID`.'}; doc['QuadratureDecoder']['get_logicalName']={syn:'Returns the logical name of the quadrature decoder.',lib:'quadraturedecoder.get_logicalName()',pro:'function get_logicalName()',cmt:'

Returns the logical name of the quadrature decoder.

',ret:'a string corresponding to the logical name of the quadrature decoder.',ext:'On failure, throws an exception or returns `Y_LOGICALNAME_INVALID`.'}; doc['QuadratureDecoder']['get_lowestValue']={syn:'Returns the minimal value observed for the position since the device was started.',lib:'quadraturedecoder.get_lowestValue()',pro:'function get_lowestValue()',cmt:'

Returns the minimal value observed for the position since the device was started. Can be reset to an arbitrary value thanks to set_lowestValue().

',ret:'a floating point number corresponding to the minimal value observed for the position since the device was started',ext:'On failure, throws an exception or returns `Y_LOWESTVALUE_INVALID`.'}; doc['QuadratureDecoder']['get_module']={syn:'Gets the `YModule` object for the device on which the function is located.',lib:'quadraturedecoder.get_module()',pro:'function get_module()',cmt:'

Gets the `YModule` object for the device on which the function is located. If the function cannot be located on any module, the returned instance of `YModule` is not shown as on-line.

',ret:'an instance of `YModule`'}; doc['QuadratureDecoder']['get_module_async']={syn:'Gets the `YModule` object for the device on which the function is located (asynchronous version).',lib:'quadraturedecoder.get_module_async()',pro:'function get_module_async(callback, context)',cmt:'

Gets the `YModule` object for the device on which the function is located (asynchronous version). If the function cannot be located on any module, the returned `YModule` object does not show as on-line.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking Firefox javascript VM that does not implement context switching during blocking I/O calls. See the documentation section on asynchronous Javascript calls for more details.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the requested `YModule` object',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['QuadratureDecoder']['get_recordedData']={syn:'Retrieves a DataSet object holding historical data for this sensor, for a specified time interval.',lib:'quadraturedecoder.get_recordedData()',pro:'function get_recordedData(startTime, endTime)',cmt:'

Retrieves a DataSet object holding historical data for this sensor, for a specified time interval. The measures will be retrieved from the data logger, which must have been turned on at the desired time. See the documentation of the DataSet class for information on how to get an overview of the recorded data, and how to load progressively a large set of measures from the data logger.

This function only works if the device uses a recent firmware, as DataSet objects are not supported by firmwares older than version 13000.

',par:{startTime:'the start of the desired measure time interval, as a Unix timestamp, i.e. the number of seconds since January 1, 1970 UTC. The special value 0 can be used to include any meaasure, without initial limit.',endTime:'the end of the desired measure time interval, as a Unix timestamp, i.e. the number of seconds since January 1, 1970 UTC. The special value 0 can be used to include any meaasure, without ending limit.'},ret:'an instance of YDataSet, providing access to historical data. Past measures can be loaded progressively using methods from the YDataSet object.'}; doc['QuadratureDecoder']['get_reportFrequency']={syn:'Returns the timed value notification frequency, or \x22OFF\x22 if timed value notifications are disabled for this function.',lib:'quadraturedecoder.get_reportFrequency()',pro:'function get_reportFrequency()',cmt:'

Returns the timed value notification frequency, or \x22OFF\x22 if timed value notifications are disabled for this function.

',ret:'a string corresponding to the timed value notification frequency, or \x22OFF\x22 if timed value notifications are disabled for this function',ext:'On failure, throws an exception or returns `Y_REPORTFREQUENCY_INVALID`.'}; doc['QuadratureDecoder']['get_resolution']={syn:'Returns the resolution of the measured values.',lib:'quadraturedecoder.get_resolution()',pro:'function get_resolution()',cmt:'

Returns the resolution of the measured values. The resolution corresponds to the numerical precision of the measures, which is not always the same as the actual precision of the sensor.

',ret:'a floating point number corresponding to the resolution of the measured values',ext:'On failure, throws an exception or returns `Y_RESOLUTION_INVALID`.'}; doc['QuadratureDecoder']['get_sensorState']={syn:'Returns the sensor health state code, which is zero when there is an up-to-date measure available or a positive code if the sensor is not able to provide a measure right now.',lib:'quadraturedecoder.get_sensorState()',pro:'function get_sensorState()',cmt:'

Returns the sensor health state code, which is zero when there is an up-to-date measure available or a positive code if the sensor is not able to provide a measure right now.

',ret:'an integer corresponding to the sensor health state code, which is zero when there is an up-to-date measure available or a positive code if the sensor is not able to provide a measure right now',ext:'On failure, throws an exception or returns `Y_SENSORSTATE_INVALID`.'}; doc['QuadratureDecoder']['get_speed']={syn:'Returns the increments frequency, in Hz.',lib:'quadraturedecoder.get_speed()',pro:'function get_speed()',cmt:'

Returns the increments frequency, in Hz.

',ret:'a floating point number corresponding to the increments frequency, in Hz',ext:'On failure, throws an exception or returns `Y_SPEED_INVALID`.'}; doc['QuadratureDecoder']['get_unit']={syn:'Returns the measuring unit for the position.',lib:'quadraturedecoder.get_unit()',pro:'function get_unit()',cmt:'

Returns the measuring unit for the position.

',ret:'a string corresponding to the measuring unit for the position',ext:'On failure, throws an exception or returns `Y_UNIT_INVALID`.'}; doc['QuadratureDecoder']['get_userData']={syn:'Returns the value of the userData attribute, as previously stored using method `set_userData`.',lib:'quadraturedecoder.get_userData()',pro:'function get_userData()',cmt:'

Returns the value of the userData attribute, as previously stored using method `set_userData`. This attribute is never touched directly by the API, and is at disposal of the caller to store a context.

',ret:'the object stored previously by the caller.'}; doc['QuadratureDecoder']['isOnline']={syn:'Checks if the quadrature decoder is currently reachable, without raising any error.',lib:'quadraturedecoder.isOnline()',pro:'function isOnline()',cmt:'

Checks if the quadrature decoder is currently reachable, without raising any error. If there is a cached value for the quadrature decoder in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the quadrature decoder.

',ret:'`true` if the quadrature decoder can be reached, and `false` otherwise'}; doc['QuadratureDecoder']['isOnline_async']={syn:'Checks if the quadrature decoder is currently reachable, without raising any error (asynchronous version).',lib:'quadraturedecoder.isOnline_async()',pro:'function isOnline_async(callback, context)',cmt:'

Checks if the quadrature decoder is currently reachable, without raising any error (asynchronous version). If there is a cached value for the quadrature decoder in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the requested function.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the boolean result',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['QuadratureDecoder']['load']={syn:'Preloads the quadrature decoder cache with a specified validity duration.',lib:'quadraturedecoder.load()',pro:'function load(msValidity)',cmt:'

Preloads the quadrature decoder cache with a specified validity duration. By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network traffic for instance.

',par:{msValidity:'an integer corresponding to the validity attributed to the loaded function parameters, in milliseconds'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['QuadratureDecoder']['loadAttribute']={syn:'Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.',lib:'quadraturedecoder.loadAttribute()',pro:'function loadAttribute(attrName)',cmt:'

Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.

',par:{attrName:'the name of the requested attribute'},ret:'a string with the value of the the attribute',ext:'On failure, throws an exception or returns an empty string.'}; doc['QuadratureDecoder']['loadCalibrationPoints']={syn:'Retrieves error correction data points previously entered using the method `calibrateFromPoints`.',lib:'quadraturedecoder.loadCalibrationPoints()',pro:'function loadCalibrationPoints(rawValues, refValues)',cmt:'

Retrieves error correction data points previously entered using the method `calibrateFromPoints`.

',par:{rawValues:'array of floating point numbers, that will be filled by the function with the raw sensor values for the correction points.',refValues:'array of floating point numbers, that will be filled by the function with the desired values for the correction points.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['QuadratureDecoder']['load_async']={syn:'Preloads the quadrature decoder cache with a specified validity duration (asynchronous version).',lib:'quadraturedecoder.load_async()',pro:'function load_async(msValidity, callback, context)',cmt:'

Preloads the quadrature decoder cache with a specified validity duration (asynchronous version). By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network trafic for instance.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{msValidity:'an integer corresponding to the validity of the loaded function parameters, in milliseconds',callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the error code (or `YAPI_SUCCESS`)',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['QuadratureDecoder']['muteValueCallbacks']={syn:'Disables the propagation of every new advertised value to the parent hub.',lib:'quadraturedecoder.muteValueCallbacks()',pro:'function muteValueCallbacks()',cmt:'

Disables the propagation of every new advertised value to the parent hub. You can use this function to save bandwidth and CPU on computers with limited resources, or to prevent unwanted invocations of the HTTP callback. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['QuadratureDecoder']['nextQuadratureDecoder']={syn:'Continues the enumeration of quadrature decoders started using `yFirstQuadratureDecoder()`.',lib:'quadraturedecoder.nextQuadratureDecoder()',pro:'function nextQuadratureDecoder()',cmt:'

Continues the enumeration of quadrature decoders started using `yFirstQuadratureDecoder()`.

',ret:'a pointer to a `YQuadratureDecoder` object, corresponding to a quadrature decoder currently online, or a `null` pointer if there are no more quadrature decoders to enumerate.'}; doc['QuadratureDecoder']['registerTimedReportCallback']={syn:'Registers the callback function that is invoked on every periodic timed notification.',lib:'quadraturedecoder.registerTimedReportCallback()',pro:'function registerTimedReportCallback(callback)',cmt:'

Registers the callback function that is invoked on every periodic timed notification. The callback is invoked only during the execution of `ySleep` or `yHandleEvents`. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a null pointer as argument.

',par:{callback:'the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and an YMeasure object describing the new advertised value.'}}; doc['QuadratureDecoder']['registerValueCallback']={syn:'Registers the callback function that is invoked on every change of advertised value.',lib:'quadraturedecoder.registerValueCallback()',pro:'function registerValueCallback(callback)',cmt:'

Registers the callback function that is invoked on every change of advertised value. The callback is invoked only during the execution of `ySleep` or `yHandleEvents`. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a null pointer as argument.

',par:{callback:'the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and the character string describing the new advertised value.'}}; doc['QuadratureDecoder']['set_advMode']={syn:'Changes the measuring mode used for the advertised value pushed to the parent hub.',lib:'quadraturedecoder.set_advMode()',pro:'function set_advMode(newval)',cmt:'

Changes the measuring mode used for the advertised value pushed to the parent hub.

',par:{newval:'a value among `Y_ADVMODE_IMMEDIATE`, `Y_ADVMODE_PERIOD_AVG`, `Y_ADVMODE_PERIOD_MIN` and `Y_ADVMODE_PERIOD_MAX` corresponding to the measuring mode used for the advertised value pushed to the parent hub'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['QuadratureDecoder']['set_currentValue']={syn:'Changes the current expected position of the quadrature decoder.',lib:'quadraturedecoder.set_currentValue()',pro:'function set_currentValue(newval)',cmt:'

Changes the current expected position of the quadrature decoder. Invoking this function implicitely activates the quadrature decoder.

',par:{newval:'a floating point number corresponding to the current expected position of the quadrature decoder'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['QuadratureDecoder']['set_decoding']={syn:'Changes the activation state of the quadrature decoder.',lib:'quadraturedecoder.set_decoding()',pro:'function set_decoding(newval)',cmt:'

Changes the activation state of the quadrature decoder.

',par:{newval:'either `Y_DECODING_OFF` or `Y_DECODING_ON`, according to the activation state of the quadrature decoder'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['QuadratureDecoder']['set_highestValue']={syn:'Changes the recorded maximal value observed.',lib:'quadraturedecoder.set_highestValue()',pro:'function set_highestValue(newval)',cmt:'

Changes the recorded maximal value observed. Can be used to reset the value returned by get_lowestValue().

',par:{newval:'a floating point number corresponding to the recorded maximal value observed'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['QuadratureDecoder']['set_logFrequency']={syn:'Changes the datalogger recording frequency for this function.',lib:'quadraturedecoder.set_logFrequency()',pro:'function set_logFrequency(newval)',cmt:'

Changes the datalogger recording frequency for this function. The frequency can be specified as samples per second, as sample per minute (for instance \x2215/m\x22) or in samples per hour (eg. \x224/h\x22). To disable recording for this function, use the value \x22OFF\x22.

',par:{newval:'a string corresponding to the datalogger recording frequency for this function'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['QuadratureDecoder']['set_logicalName']={syn:'Changes the logical name of the quadrature decoder.',lib:'quadraturedecoder.set_logicalName()',pro:'function set_logicalName(newval)',cmt:'

Changes the logical name of the quadrature decoder. You can use `yCheckLogicalName()` prior to this call to make sure that your parameter is valid. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',par:{newval:'a string corresponding to the logical name of the quadrature decoder.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['QuadratureDecoder']['set_lowestValue']={syn:'Changes the recorded minimal value observed.',lib:'quadraturedecoder.set_lowestValue()',pro:'function set_lowestValue(newval)',cmt:'

Changes the recorded minimal value observed. Can be used to reset the value returned by get_lowestValue().

',par:{newval:'a floating point number corresponding to the recorded minimal value observed'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['QuadratureDecoder']['set_reportFrequency']={syn:'Changes the timed value notification frequency for this function.',lib:'quadraturedecoder.set_reportFrequency()',pro:'function set_reportFrequency(newval)',cmt:'

Changes the timed value notification frequency for this function. The frequency can be specified as samples per second, as sample per minute (for instance \x2215/m\x22) or in samples per hour (eg. \x224/h\x22). To disable timed value notifications for this function, use the value \x22OFF\x22.

',par:{newval:'a string corresponding to the timed value notification frequency for this function'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['QuadratureDecoder']['set_resolution']={syn:'Changes the resolution of the measured physical values.',lib:'quadraturedecoder.set_resolution()',pro:'function set_resolution(newval)',cmt:'

Changes the resolution of the measured physical values. The resolution corresponds to the numerical precision when displaying value. It does not change the precision of the measure itself.

',par:{newval:'a floating point number corresponding to the resolution of the measured physical values'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['QuadratureDecoder']['set_userData']={syn:'Stores a user context provided as argument in the userData attribute of the function.',lib:'quadraturedecoder.set_userData()',pro:'function set_userData(data)',cmt:'

Stores a user context provided as argument in the userData attribute of the function. This attribute is never touched by the API, and is at disposal of the caller to store a context.

',par:{data:'any kind of object to be stored'}}; doc['QuadratureDecoder']['startDataLogger']={syn:'Starts the data logger on the device.',lib:'quadraturedecoder.startDataLogger()',pro:'function startDataLogger()',cmt:'

Starts the data logger on the device. Note that the data logger will only save the measures on this sensor if the logFrequency is not set to \x22OFF\x22.

',ret:'`YAPI_SUCCESS` if the call succeeds.'}; doc['QuadratureDecoder']['stopDataLogger']={syn:'Stops the datalogger on the device.',lib:'quadraturedecoder.stopDataLogger()',pro:'function stopDataLogger()',cmt:'

Stops the datalogger on the device.

',ret:'`YAPI_SUCCESS` if the call succeeds.'}; doc['QuadratureDecoder']['unmuteValueCallbacks']={syn:'Re-enables the propagation of every new advertised value to the parent hub.',lib:'quadraturedecoder.unmuteValueCallbacks()',pro:'function unmuteValueCallbacks()',cmt:'

Re-enables the propagation of every new advertised value to the parent hub. This function reverts the effect of a previous call to `muteValueCallbacks()`. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['QuadratureDecoder']['wait_async']={syn:'Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function.',lib:'quadraturedecoder.wait_async()',pro:'function wait_async(callback, context)',cmt:'

Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function. The callback function can therefore freely issue synchronous or asynchronous commands, without risking to block the Javascript VM.

',par:{callback:'callback function that is invoked when all pending commands on the module are completed. The callback function receives two arguments: the caller-specific context object and the receiving function object.',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing.'}; //--- (end of generated code: QuadratureDecoder) //--- (generated code: CurrentLoopOutput) doc['CurrentLoopOutput']={'':{syn:'CurrentLoopOutput function interface',inc:'<script type='text/javascript' src='yocto_currentloopoutput.js'></script>',cmt:'

The Yoctopuce application programming interface allows you to change the value of the 4-20mA \x09 output as well as to know the current loop state.

'}}; doc['CurrentLoopOutput']['FindCurrentLoopOutput']={syn:'Retrieves a 4-20mA output for a given identifier.',lib:'YCurrentLoopOutput.FindCurrentLoopOutput()',pro:'function FindCurrentLoopOutput(func)',cmt:'

Retrieves a 4-20mA output for a given identifier. The identifier can be specified using several formats:

- FunctionLogicalName
- ModuleSerialNumber.FunctionIdentifier
- ModuleSerialNumber.FunctionLogicalName
- ModuleLogicalName.FunctionIdentifier
- ModuleLogicalName.FunctionLogicalName

This function does not require that the 4-20mA output is online at the time it is invoked. The returned object is nevertheless valid. Use the method `YCurrentLoopOutput.isOnline()` to test if the 4-20mA output is indeed online at a given time. In case of ambiguity when looking for a 4-20mA output by logical name, no error is notified: the first instance found is returned. The search is performed first by hardware name, then by logical name.

If a call to this object\x27s is_online() method returns FALSE although you are certain that the matching device is plugged, make sure that you did call registerHub() at application initialization time.

',par:{func:'a string that uniquely characterizes the 4-20mA output'},ret:'a `YCurrentLoopOutput` object allowing you to drive the 4-20mA output.'}; doc['CurrentLoopOutput']['FirstCurrentLoopOutput']={syn:'Starts the enumeration of 4-20mA outputs currently accessible.',lib:'YCurrentLoopOutput.FirstCurrentLoopOutput()',pro:'function FirstCurrentLoopOutput()',cmt:'

Starts the enumeration of 4-20mA outputs currently accessible. Use the method `YCurrentLoopOutput.nextCurrentLoopOutput()` to iterate on next 4-20mA outputs.

',ret:'a pointer to a `YCurrentLoopOutput` object, corresponding to the first 4-20mA output currently online, or a `null` pointer if there are none.'}; doc['CurrentLoopOutput']['clearCache']={syn:'Invalidates the cache.',lib:'currentloopoutput.clearCache()',pro:'function clearCache()',cmt:'

Invalidates the cache. Invalidates the cache of the 4-20mA output attributes. Forces the next call to get_xxx() or loadxxx() to use values that come from the device.

'}; doc['CurrentLoopOutput']['currentMove']={syn:'Performs a smooth transistion of current flowing in the loop.',lib:'currentloopoutput.currentMove()',pro:'function currentMove(mA_target, ms_duration)',cmt:'

Performs a smooth transistion of current flowing in the loop. Any current explicit change cancels any ongoing transition process.

',par:{mA_target:'new current value at the end of the transition (floating-point number, representing the end current in mA)',ms_duration:'total duration of the transition, in milliseconds'},ret:'`YAPI_SUCCESS` when the call succeeds.'}; doc['CurrentLoopOutput']['describe']={syn:'Returns a short text that describes unambiguously the instance of the 4-20mA output in the form `TYPE(NAME)=SERIAL.FUNCTIONID`.',lib:'currentloopoutput.describe()',pro:'function describe()',cmt:'

Returns a short text that describes unambiguously the instance of the 4-20mA output in the form `TYPE(NAME)=SERIAL.FUNCTIONID`. More precisely, `TYPE` is the type of the function, `NAME` it the name used for the first access to the function, `SERIAL` is the serial number of the module if the module is connected or `\x22unresolved\x22`, and `FUNCTIONID` is the hardware identifier of the function if the module is connected. For example, this method returns `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1` if the module is already connected or `Relay(BadCustomeName.relay1)=unresolved` if the module has not yet been connected. This method does not trigger any USB or TCP transaction and can therefore be used in a debugger.

',ret:'a string that describes the 4-20mA output (ex: `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1`)'}; doc['CurrentLoopOutput']['get_advertisedValue']={syn:'Returns the current value of the 4-20mA output (no more than 6 characters).',lib:'currentloopoutput.get_advertisedValue()',pro:'function get_advertisedValue()',cmt:'

Returns the current value of the 4-20mA output (no more than 6 characters).

',ret:'a string corresponding to the current value of the 4-20mA output (no more than 6 characters).',ext:'On failure, throws an exception or returns `Y_ADVERTISEDVALUE_INVALID`.'}; doc['CurrentLoopOutput']['get_current']={syn:'Returns the loop current set point in mA.',lib:'currentloopoutput.get_current()',pro:'function get_current()',cmt:'

Returns the loop current set point in mA.

',ret:'a floating point number corresponding to the loop current set point in mA',ext:'On failure, throws an exception or returns `Y_CURRENT_INVALID`.'}; doc['CurrentLoopOutput']['get_currentAtStartUp']={syn:'Returns the current in the loop at device startup, in mA.',lib:'currentloopoutput.get_currentAtStartUp()',pro:'function get_currentAtStartUp()',cmt:'

Returns the current in the loop at device startup, in mA.

',ret:'a floating point number corresponding to the current in the loop at device startup, in mA',ext:'On failure, throws an exception or returns `Y_CURRENTATSTARTUP_INVALID`.'}; doc['CurrentLoopOutput']['get_errorMessage']={syn:'Returns the error message of the latest error with the 4-20mA output.',lib:'currentloopoutput.get_errorMessage()',pro:'function get_errorMessage()',cmt:'

Returns the error message of the latest error with the 4-20mA output. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a string corresponding to the latest error message that occured while using the 4-20mA output object'}; doc['CurrentLoopOutput']['get_errorType']={syn:'Returns the numerical error code of the latest error with the 4-20mA output.',lib:'currentloopoutput.get_errorType()',pro:'function get_errorType()',cmt:'

Returns the numerical error code of the latest error with the 4-20mA output. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a number corresponding to the code of the latest error that occurred while using the 4-20mA output object'}; doc['CurrentLoopOutput']['get_friendlyName']={syn:'Returns a global identifier of the 4-20mA output in the format `MODULE_NAME.FUNCTION_NAME`.',lib:'currentloopoutput.get_friendlyName()',pro:'function get_friendlyName()',cmt:'

Returns a global identifier of the 4-20mA output in the format `MODULE_NAME.FUNCTION_NAME`. The returned string uses the logical names of the module and of the 4-20mA output if they are defined, otherwise the serial number of the module and the hardware identifier of the 4-20mA output (for example: `MyCustomName.relay1`)

',ret:'a string that uniquely identifies the 4-20mA output using logical names (ex: `MyCustomName.relay1`)',ext:'On failure, throws an exception or returns `Y_FRIENDLYNAME_INVALID`.'}; doc['CurrentLoopOutput']['get_functionDescriptor']={syn:'Returns a unique identifier of type `YFUN_DESCR` corresponding to the function.',lib:'currentloopoutput.get_functionDescriptor()',pro:'function get_functionDescriptor()',cmt:'

Returns a unique identifier of type `YFUN_DESCR` corresponding to the function. This identifier can be used to test if two instances of `YFunction` reference the same physical function on the same physical device.

',ret:'an identifier of type `YFUN_DESCR`.',ext:'If the function has never been contacted, the returned value is `Y_FUNCTIONDESCRIPTOR_INVALID`.'}; doc['CurrentLoopOutput']['get_functionId']={syn:'Returns the hardware identifier of the 4-20mA output, without reference to the module.',lib:'currentloopoutput.get_functionId()',pro:'function get_functionId()',cmt:'

Returns the hardware identifier of the 4-20mA output, without reference to the module. For example `relay1`

',ret:'a string that identifies the 4-20mA output (ex: `relay1`)',ext:'On failure, throws an exception or returns `Y_FUNCTIONID_INVALID`.'}; doc['CurrentLoopOutput']['get_hardwareId']={syn:'Returns the unique hardware identifier of the 4-20mA output in the form `SERIAL.FUNCTIONID`.',lib:'currentloopoutput.get_hardwareId()',pro:'function get_hardwareId()',cmt:'

Returns the unique hardware identifier of the 4-20mA output in the form `SERIAL.FUNCTIONID`. The unique hardware identifier is composed of the device serial number and of the hardware identifier of the 4-20mA output (for example `RELAYLO1-123456.relay1`).

',ret:'a string that uniquely identifies the 4-20mA output (ex: `RELAYLO1-123456.relay1`)',ext:'On failure, throws an exception or returns `Y_HARDWAREID_INVALID`.'}; doc['CurrentLoopOutput']['get_logicalName']={syn:'Returns the logical name of the 4-20mA output.',lib:'currentloopoutput.get_logicalName()',pro:'function get_logicalName()',cmt:'

Returns the logical name of the 4-20mA output.

',ret:'a string corresponding to the logical name of the 4-20mA output.',ext:'On failure, throws an exception or returns `Y_LOGICALNAME_INVALID`.'}; doc['CurrentLoopOutput']['get_loopPower']={syn:'Returns the loop powerstate.',lib:'currentloopoutput.get_loopPower()',pro:'function get_loopPower()',cmt:'

Returns the loop powerstate. POWEROK: the loop \x09 is powered. NOPWR: the loop in not powered. LOWPWR: the loop is not powered enough to maintain the current required (insufficient voltage).

',ret:'a value among `Y_LOOPPOWER_NOPWR`, `Y_LOOPPOWER_LOWPWR` and `Y_LOOPPOWER_POWEROK` corresponding to the loop powerstate',ext:'On failure, throws an exception or returns `Y_LOOPPOWER_INVALID`.'}; doc['CurrentLoopOutput']['get_module']={syn:'Gets the `YModule` object for the device on which the function is located.',lib:'currentloopoutput.get_module()',pro:'function get_module()',cmt:'

Gets the `YModule` object for the device on which the function is located. If the function cannot be located on any module, the returned instance of `YModule` is not shown as on-line.

',ret:'an instance of `YModule`'}; doc['CurrentLoopOutput']['get_module_async']={syn:'Gets the `YModule` object for the device on which the function is located (asynchronous version).',lib:'currentloopoutput.get_module_async()',pro:'function get_module_async(callback, context)',cmt:'

Gets the `YModule` object for the device on which the function is located (asynchronous version). If the function cannot be located on any module, the returned `YModule` object does not show as on-line.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking Firefox javascript VM that does not implement context switching during blocking I/O calls. See the documentation section on asynchronous Javascript calls for more details.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the requested `YModule` object',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['CurrentLoopOutput']['get_userData']={syn:'Returns the value of the userData attribute, as previously stored using method `set_userData`.',lib:'currentloopoutput.get_userData()',pro:'function get_userData()',cmt:'

Returns the value of the userData attribute, as previously stored using method `set_userData`. This attribute is never touched directly by the API, and is at disposal of the caller to store a context.

',ret:'the object stored previously by the caller.'}; doc['CurrentLoopOutput']['isOnline']={syn:'Checks if the 4-20mA output is currently reachable, without raising any error.',lib:'currentloopoutput.isOnline()',pro:'function isOnline()',cmt:'

Checks if the 4-20mA output is currently reachable, without raising any error. If there is a cached value for the 4-20mA output in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the 4-20mA output.

',ret:'`true` if the 4-20mA output can be reached, and `false` otherwise'}; doc['CurrentLoopOutput']['isOnline_async']={syn:'Checks if the 4-20mA output is currently reachable, without raising any error (asynchronous version).',lib:'currentloopoutput.isOnline_async()',pro:'function isOnline_async(callback, context)',cmt:'

Checks if the 4-20mA output is currently reachable, without raising any error (asynchronous version). If there is a cached value for the 4-20mA output in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the requested function.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the boolean result',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['CurrentLoopOutput']['load']={syn:'Preloads the 4-20mA output cache with a specified validity duration.',lib:'currentloopoutput.load()',pro:'function load(msValidity)',cmt:'

Preloads the 4-20mA output cache with a specified validity duration. By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network traffic for instance.

',par:{msValidity:'an integer corresponding to the validity attributed to the loaded function parameters, in milliseconds'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['CurrentLoopOutput']['loadAttribute']={syn:'Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.',lib:'currentloopoutput.loadAttribute()',pro:'function loadAttribute(attrName)',cmt:'

Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.

',par:{attrName:'the name of the requested attribute'},ret:'a string with the value of the the attribute',ext:'On failure, throws an exception or returns an empty string.'}; doc['CurrentLoopOutput']['load_async']={syn:'Preloads the 4-20mA output cache with a specified validity duration (asynchronous version).',lib:'currentloopoutput.load_async()',pro:'function load_async(msValidity, callback, context)',cmt:'

Preloads the 4-20mA output cache with a specified validity duration (asynchronous version). By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network trafic for instance.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{msValidity:'an integer corresponding to the validity of the loaded function parameters, in milliseconds',callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the error code (or `YAPI_SUCCESS`)',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['CurrentLoopOutput']['muteValueCallbacks']={syn:'Disables the propagation of every new advertised value to the parent hub.',lib:'currentloopoutput.muteValueCallbacks()',pro:'function muteValueCallbacks()',cmt:'

Disables the propagation of every new advertised value to the parent hub. You can use this function to save bandwidth and CPU on computers with limited resources, or to prevent unwanted invocations of the HTTP callback. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['CurrentLoopOutput']['nextCurrentLoopOutput']={syn:'Continues the enumeration of 4-20mA outputs started using `yFirstCurrentLoopOutput()`.',lib:'currentloopoutput.nextCurrentLoopOutput()',pro:'function nextCurrentLoopOutput()',cmt:'

Continues the enumeration of 4-20mA outputs started using `yFirstCurrentLoopOutput()`.

',ret:'a pointer to a `YCurrentLoopOutput` object, corresponding to a 4-20mA output currently online, or a `null` pointer if there are no more 4-20mA outputs to enumerate.'}; doc['CurrentLoopOutput']['registerValueCallback']={syn:'Registers the callback function that is invoked on every change of advertised value.',lib:'currentloopoutput.registerValueCallback()',pro:'function registerValueCallback(callback)',cmt:'

Registers the callback function that is invoked on every change of advertised value. The callback is invoked only during the execution of `ySleep` or `yHandleEvents`. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a null pointer as argument.

',par:{callback:'the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and the character string describing the new advertised value.'}}; doc['CurrentLoopOutput']['set_current']={syn:'Changes the current loop, the valid range is from 3 to 21mA.',lib:'currentloopoutput.set_current()',pro:'function set_current(newval)',cmt:'

Changes the current loop, the valid range is from 3 to 21mA. If the loop is \x09 not propely powered, the target current is not reached and \x09\x09loopPower is set to LOWPWR.

',par:{newval:'a floating point number corresponding to the current loop, the valid range is from 3 to 21mA'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['CurrentLoopOutput']['set_currentAtStartUp']={syn:'Changes the loop current at device start up.',lib:'currentloopoutput.set_currentAtStartUp()',pro:'function set_currentAtStartUp(newval)',cmt:'

Changes the loop current at device start up. Remember to call the matching module `saveToFlash()` method, otherwise this call has no effect.

',par:{newval:'a floating point number corresponding to the loop current at device start up'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['CurrentLoopOutput']['set_logicalName']={syn:'Changes the logical name of the 4-20mA output.',lib:'currentloopoutput.set_logicalName()',pro:'function set_logicalName(newval)',cmt:'

Changes the logical name of the 4-20mA output. You can use `yCheckLogicalName()` prior to this call to make sure that your parameter is valid. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',par:{newval:'a string corresponding to the logical name of the 4-20mA output.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['CurrentLoopOutput']['set_userData']={syn:'Stores a user context provided as argument in the userData attribute of the function.',lib:'currentloopoutput.set_userData()',pro:'function set_userData(data)',cmt:'

Stores a user context provided as argument in the userData attribute of the function. This attribute is never touched by the API, and is at disposal of the caller to store a context.

',par:{data:'any kind of object to be stored'}}; doc['CurrentLoopOutput']['unmuteValueCallbacks']={syn:'Re-enables the propagation of every new advertised value to the parent hub.',lib:'currentloopoutput.unmuteValueCallbacks()',pro:'function unmuteValueCallbacks()',cmt:'

Re-enables the propagation of every new advertised value to the parent hub. This function reverts the effect of a previous call to `muteValueCallbacks()`. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['CurrentLoopOutput']['wait_async']={syn:'Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function.',lib:'currentloopoutput.wait_async()',pro:'function wait_async(callback, context)',cmt:'

Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function. The callback function can therefore freely issue synchronous or asynchronous commands, without risking to block the Javascript VM.

',par:{callback:'callback function that is invoked when all pending commands on the module are completed. The callback function receives two arguments: the caller-specific context object and the receiving function object.',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing.'}; //--- (end of generated code: CurrentLoopOutput) //--- (generated code: ColorLedCluster) doc['ColorLedCluster']={'':{syn:'ColorLedCluster function interface',inc:'<script type='text/javascript' src='yocto_colorledcluster.js'></script>',cmt:'

The Yoctopuce application programming interface allows you to drive a color LED cluster. Unlike the ColorLed class, the ColorLedCluster allows to handle several LEDs at one. Color changes can be done using RGB coordinates as well as HSL coordinates. The module performs all conversions form RGB to HSL automatically. It is then self-evident to turn on a LED with a given hue and to progressively vary its saturation or lightness. If needed, you can find more information on the difference between RGB and HSL in the section following this one.

'}}; doc['ColorLedCluster']['FindColorLedCluster']={syn:'Retrieves a RGB LED cluster for a given identifier.',lib:'YColorLedCluster.FindColorLedCluster()',pro:'function FindColorLedCluster(func)',cmt:'

Retrieves a RGB LED cluster for a given identifier. The identifier can be specified using several formats:

- FunctionLogicalName
- ModuleSerialNumber.FunctionIdentifier
- ModuleSerialNumber.FunctionLogicalName
- ModuleLogicalName.FunctionIdentifier
- ModuleLogicalName.FunctionLogicalName

This function does not require that the RGB LED cluster is online at the time it is invoked. The returned object is nevertheless valid. Use the method `YColorLedCluster.isOnline()` to test if the RGB LED cluster is indeed online at a given time. In case of ambiguity when looking for a RGB LED cluster by logical name, no error is notified: the first instance found is returned. The search is performed first by hardware name, then by logical name.

If a call to this object\x27s is_online() method returns FALSE although you are certain that the matching device is plugged, make sure that you did call registerHub() at application initialization time.

',par:{func:'a string that uniquely characterizes the RGB LED cluster'},ret:'a `YColorLedCluster` object allowing you to drive the RGB LED cluster.'}; doc['ColorLedCluster']['FirstColorLedCluster']={syn:'Starts the enumeration of RGB LED clusters currently accessible.',lib:'YColorLedCluster.FirstColorLedCluster()',pro:'function FirstColorLedCluster()',cmt:'

Starts the enumeration of RGB LED clusters currently accessible. Use the method `YColorLedCluster.nextColorLedCluster()` to iterate on next RGB LED clusters.

',ret:'a pointer to a `YColorLedCluster` object, corresponding to the first RGB LED cluster currently online, or a `null` pointer if there are none.'}; doc['ColorLedCluster']['addHslMoveToBlinkSeq']={syn:'Adds an HSL transition to a sequence.',lib:'colorledcluster.addHslMoveToBlinkSeq()',pro:'function addHslMoveToBlinkSeq(seqIndex, hslValue, delay)',cmt:'

Adds an HSL transition to a sequence. A sequence is a transition list, which can be executed in loop by an group of LEDs. Sequences are persistant and are saved in the device flash memory as soon as the `saveBlinkSeq()` method is called.

',par:{seqIndex:'sequence index.',hslValue:'target color (0xHHSSLL)',delay:'transition duration in ms'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['ColorLedCluster']['addJumpToBlinkSeq']={syn:'Adds to a sequence a jump to another sequence.',lib:'colorledcluster.addJumpToBlinkSeq()',pro:'function addJumpToBlinkSeq(seqIndex, linkSeqIndex)',cmt:'

Adds to a sequence a jump to another sequence. When a pixel will reach this jump, it will be automatically relinked to the new sequence, and will run it starting from the beginning.

',par:{seqIndex:'sequence index.',linkSeqIndex:'index of the sequence to chain.'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['ColorLedCluster']['addMirrorToBlinkSeq']={syn:'Adds a mirror ending to a sequence.',lib:'colorledcluster.addMirrorToBlinkSeq()',pro:'function addMirrorToBlinkSeq(seqIndex)',cmt:'

Adds a mirror ending to a sequence. When the sequence will reach the end of the last transition, its running speed will automatically be reversed so that the sequence plays in the reverse direction, like in a mirror. After the first transition of the sequence is played at the end of the reverse execution, the sequence starts again in the initial direction.

',par:{seqIndex:'sequence index.'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['ColorLedCluster']['addRgbMoveToBlinkSeq']={syn:'Adds an RGB transition to a sequence.',lib:'colorledcluster.addRgbMoveToBlinkSeq()',pro:'function addRgbMoveToBlinkSeq(seqIndex, rgbValue, delay)',cmt:'

Adds an RGB transition to a sequence. A sequence is a transition list, which can be executed in loop by a group of LEDs. Sequences are persistent and are saved in the device flash memory as soon as the `saveBlinkSeq()` method is called.

',par:{seqIndex:'sequence index.',rgbValue:'target color (0xRRGGBB)',delay:'transition duration in ms'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['ColorLedCluster']['addUnlinkToBlinkSeq']={syn:'Adds a to a sequence a hard stop code.',lib:'colorledcluster.addUnlinkToBlinkSeq()',pro:'function addUnlinkToBlinkSeq(seqIndex)',cmt:'

Adds a to a sequence a hard stop code. When a pixel will reach this stop code, instead of restarting the sequence in a loop it will automatically be unlinked from the sequence.

',par:{seqIndex:'sequence index.'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['ColorLedCluster']['clearCache']={syn:'Invalidates the cache.',lib:'colorledcluster.clearCache()',pro:'function clearCache()',cmt:'

Invalidates the cache. Invalidates the cache of the RGB LED cluster attributes. Forces the next call to get_xxx() or loadxxx() to use values that come from the device.

'}; doc['ColorLedCluster']['describe']={syn:'Returns a short text that describes unambiguously the instance of the RGB LED cluster in the form `TYPE(NAME)=SERIAL.FUNCTIONID`.',lib:'colorledcluster.describe()',pro:'function describe()',cmt:'

Returns a short text that describes unambiguously the instance of the RGB LED cluster in the form `TYPE(NAME)=SERIAL.FUNCTIONID`. More precisely, `TYPE` is the type of the function, `NAME` it the name used for the first access to the function, `SERIAL` is the serial number of the module if the module is connected or `\x22unresolved\x22`, and `FUNCTIONID` is the hardware identifier of the function if the module is connected. For example, this method returns `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1` if the module is already connected or `Relay(BadCustomeName.relay1)=unresolved` if the module has not yet been connected. This method does not trigger any USB or TCP transaction and can therefore be used in a debugger.

',ret:'a string that describes the RGB LED cluster (ex: `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1`)'}; doc['ColorLedCluster']['get_activeLedCount']={syn:'Returns the number of LEDs currently handled by the device.',lib:'colorledcluster.get_activeLedCount()',pro:'function get_activeLedCount()',cmt:'

Returns the number of LEDs currently handled by the device.

',ret:'an integer corresponding to the number of LEDs currently handled by the device',ext:'On failure, throws an exception or returns `Y_ACTIVELEDCOUNT_INVALID`.'}; doc['ColorLedCluster']['get_advertisedValue']={syn:'Returns the current value of the RGB LED cluster (no more than 6 characters).',lib:'colorledcluster.get_advertisedValue()',pro:'function get_advertisedValue()',cmt:'

Returns the current value of the RGB LED cluster (no more than 6 characters).

',ret:'a string corresponding to the current value of the RGB LED cluster (no more than 6 characters).',ext:'On failure, throws an exception or returns `Y_ADVERTISEDVALUE_INVALID`.'}; doc['ColorLedCluster']['get_blinkSeqMaxCount']={syn:'Returns the maximum number of sequences that the device can handle.',lib:'colorledcluster.get_blinkSeqMaxCount()',pro:'function get_blinkSeqMaxCount()',cmt:'

Returns the maximum number of sequences that the device can handle.

',ret:'an integer corresponding to the maximum number of sequences that the device can handle',ext:'On failure, throws an exception or returns `Y_BLINKSEQMAXCOUNT_INVALID`.'}; doc['ColorLedCluster']['get_blinkSeqMaxSize']={syn:'Returns the maximum length of sequences.',lib:'colorledcluster.get_blinkSeqMaxSize()',pro:'function get_blinkSeqMaxSize()',cmt:'

Returns the maximum length of sequences.

',ret:'an integer corresponding to the maximum length of sequences',ext:'On failure, throws an exception or returns `Y_BLINKSEQMAXSIZE_INVALID`.'}; doc['ColorLedCluster']['get_blinkSeqSignatures']={syn:'Returns a list on 32 bit signatures for specified blinking sequences.',lib:'colorledcluster.get_blinkSeqSignatures()',pro:'function get_blinkSeqSignatures(seqIndex, count)',cmt:'

Returns a list on 32 bit signatures for specified blinking sequences. Since blinking sequences cannot be read from the device, this can be used to detect if a specific blinking sequence is already programmed.

',par:{seqIndex:'index of the first blinking sequence which should be returned',count:'number of blinking sequences which should be returned'},ret:'a list of 32 bit integer signatures',ext:'On failure, throws an exception or returns an empty array.'}; doc['ColorLedCluster']['get_blinkSeqState']={syn:'Returns a list of integers with the started state for specified blinking sequences.',lib:'colorledcluster.get_blinkSeqState()',pro:'function get_blinkSeqState(seqIndex, count)',cmt:'

Returns a list of integers with the started state for specified blinking sequences.

',par:{seqIndex:'index of the first blinking sequence which should be returned',count:'number of blinking sequences which should be returned'},ret:'a list of integers, 0 for sequences turned off and 1 for sequences running',ext:'On failure, throws an exception or returns an empty array.'}; doc['ColorLedCluster']['get_blinkSeqStateAtPowerOn']={syn:'Returns a list of integers with the \x22auto-start at power on\x22 flag state for specified blinking sequences.',lib:'colorledcluster.get_blinkSeqStateAtPowerOn()',pro:'function get_blinkSeqStateAtPowerOn(seqIndex, count)',cmt:'

Returns a list of integers with the \x22auto-start at power on\x22 flag state for specified blinking sequences.

',par:{seqIndex:'index of the first blinking sequence which should be returned',count:'number of blinking sequences which should be returned'},ret:'a list of integers, 0 for sequences turned off and 1 for sequences running',ext:'On failure, throws an exception or returns an empty array.'}; doc['ColorLedCluster']['get_blinkSeqStateSpeed']={syn:'Returns a list of integers with the current speed for specified blinking sequences.',lib:'colorledcluster.get_blinkSeqStateSpeed()',pro:'function get_blinkSeqStateSpeed(seqIndex, count)',cmt:'

Returns a list of integers with the current speed for specified blinking sequences.

',par:{seqIndex:'index of the first sequence speed which should be returned',count:'number of sequence speeds which should be returned'},ret:'a list of integers, 0 for sequences turned off and 1 for sequences running',ext:'On failure, throws an exception or returns an empty array.'}; doc['ColorLedCluster']['get_errorMessage']={syn:'Returns the error message of the latest error with the RGB LED cluster.',lib:'colorledcluster.get_errorMessage()',pro:'function get_errorMessage()',cmt:'

Returns the error message of the latest error with the RGB LED cluster. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a string corresponding to the latest error message that occured while using the RGB LED cluster object'}; doc['ColorLedCluster']['get_errorType']={syn:'Returns the numerical error code of the latest error with the RGB LED cluster.',lib:'colorledcluster.get_errorType()',pro:'function get_errorType()',cmt:'

Returns the numerical error code of the latest error with the RGB LED cluster. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a number corresponding to the code of the latest error that occurred while using the RGB LED cluster object'}; doc['ColorLedCluster']['get_friendlyName']={syn:'Returns a global identifier of the RGB LED cluster in the format `MODULE_NAME.FUNCTION_NAME`.',lib:'colorledcluster.get_friendlyName()',pro:'function get_friendlyName()',cmt:'

Returns a global identifier of the RGB LED cluster in the format `MODULE_NAME.FUNCTION_NAME`. The returned string uses the logical names of the module and of the RGB LED cluster if they are defined, otherwise the serial number of the module and the hardware identifier of the RGB LED cluster (for example: `MyCustomName.relay1`)

',ret:'a string that uniquely identifies the RGB LED cluster using logical names (ex: `MyCustomName.relay1`)',ext:'On failure, throws an exception or returns `Y_FRIENDLYNAME_INVALID`.'}; doc['ColorLedCluster']['get_functionDescriptor']={syn:'Returns a unique identifier of type `YFUN_DESCR` corresponding to the function.',lib:'colorledcluster.get_functionDescriptor()',pro:'function get_functionDescriptor()',cmt:'

Returns a unique identifier of type `YFUN_DESCR` corresponding to the function. This identifier can be used to test if two instances of `YFunction` reference the same physical function on the same physical device.

',ret:'an identifier of type `YFUN_DESCR`.',ext:'If the function has never been contacted, the returned value is `Y_FUNCTIONDESCRIPTOR_INVALID`.'}; doc['ColorLedCluster']['get_functionId']={syn:'Returns the hardware identifier of the RGB LED cluster, without reference to the module.',lib:'colorledcluster.get_functionId()',pro:'function get_functionId()',cmt:'

Returns the hardware identifier of the RGB LED cluster, without reference to the module. For example `relay1`

',ret:'a string that identifies the RGB LED cluster (ex: `relay1`)',ext:'On failure, throws an exception or returns `Y_FUNCTIONID_INVALID`.'}; doc['ColorLedCluster']['get_hardwareId']={syn:'Returns the unique hardware identifier of the RGB LED cluster in the form `SERIAL.FUNCTIONID`.',lib:'colorledcluster.get_hardwareId()',pro:'function get_hardwareId()',cmt:'

Returns the unique hardware identifier of the RGB LED cluster in the form `SERIAL.FUNCTIONID`. The unique hardware identifier is composed of the device serial number and of the hardware identifier of the RGB LED cluster (for example `RELAYLO1-123456.relay1`).

',ret:'a string that uniquely identifies the RGB LED cluster (ex: `RELAYLO1-123456.relay1`)',ext:'On failure, throws an exception or returns `Y_HARDWAREID_INVALID`.'}; doc['ColorLedCluster']['get_linkedSeqArray']={syn:'Returns a list on sequence index for each RGB LED.',lib:'colorledcluster.get_linkedSeqArray()',pro:'function get_linkedSeqArray(ledIndex, count)',cmt:'

Returns a list on sequence index for each RGB LED. The first number represents the sequence index for the the first LED, the second number represents the sequence index for the second LED, etc.

',par:{ledIndex:'index of the first LED which should be returned',count:'number of LEDs which should be returned'},ret:'a list of integers with sequence index',ext:'On failure, throws an exception or returns an empty array.'}; doc['ColorLedCluster']['get_logicalName']={syn:'Returns the logical name of the RGB LED cluster.',lib:'colorledcluster.get_logicalName()',pro:'function get_logicalName()',cmt:'

Returns the logical name of the RGB LED cluster.

',ret:'a string corresponding to the logical name of the RGB LED cluster.',ext:'On failure, throws an exception or returns `Y_LOGICALNAME_INVALID`.'}; doc['ColorLedCluster']['get_maxLedCount']={syn:'Returns the maximum number of LEDs that the device can handle.',lib:'colorledcluster.get_maxLedCount()',pro:'function get_maxLedCount()',cmt:'

Returns the maximum number of LEDs that the device can handle.

',ret:'an integer corresponding to the maximum number of LEDs that the device can handle',ext:'On failure, throws an exception or returns `Y_MAXLEDCOUNT_INVALID`.'}; doc['ColorLedCluster']['get_module']={syn:'Gets the `YModule` object for the device on which the function is located.',lib:'colorledcluster.get_module()',pro:'function get_module()',cmt:'

Gets the `YModule` object for the device on which the function is located. If the function cannot be located on any module, the returned instance of `YModule` is not shown as on-line.

',ret:'an instance of `YModule`'}; doc['ColorLedCluster']['get_module_async']={syn:'Gets the `YModule` object for the device on which the function is located (asynchronous version).',lib:'colorledcluster.get_module_async()',pro:'function get_module_async(callback, context)',cmt:'

Gets the `YModule` object for the device on which the function is located (asynchronous version). If the function cannot be located on any module, the returned `YModule` object does not show as on-line.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking Firefox javascript VM that does not implement context switching during blocking I/O calls. See the documentation section on asynchronous Javascript calls for more details.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the requested `YModule` object',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['ColorLedCluster']['get_rgbColorArray']={syn:'Returns a list on 24bit RGB color values with the current colors displayed on the RGB leds.',lib:'colorledcluster.get_rgbColorArray()',pro:'function get_rgbColorArray(ledIndex, count)',cmt:'

Returns a list on 24bit RGB color values with the current colors displayed on the RGB leds. The first number represents the RGB value of the first LED, the second number represents the RGB value of the second LED, etc.

',par:{ledIndex:'index of the first LED which should be returned',count:'number of LEDs which should be returned'},ret:'a list of 24bit color codes with RGB components of selected LEDs, as 0xRRGGBB.',ext:'On failure, throws an exception or returns an empty array.'}; doc['ColorLedCluster']['get_rgbColorArrayAtPowerOn']={syn:'Returns a list on 24bit RGB color values with the RGB LEDs startup colors.',lib:'colorledcluster.get_rgbColorArrayAtPowerOn()',pro:'function get_rgbColorArrayAtPowerOn(ledIndex, count)',cmt:'

Returns a list on 24bit RGB color values with the RGB LEDs startup colors. The first number represents the startup RGB value of the first LED, the second number represents the RGB value of the second LED, etc.

',par:{ledIndex:'index of the first LED which should be returned',count:'number of LEDs which should be returned'},ret:'a list of 24bit color codes with RGB components of selected LEDs, as 0xRRGGBB.',ext:'On failure, throws an exception or returns an empty array.'}; doc['ColorLedCluster']['get_rgbColorBuffer']={syn:'Returns a binary buffer with content from the LED RGB buffer, as is.',lib:'colorledcluster.get_rgbColorBuffer()',pro:'function get_rgbColorBuffer(ledIndex, count)',cmt:'

Returns a binary buffer with content from the LED RGB buffer, as is. First three bytes are RGB components for the first LED in the interval, the next three bytes for the second LED in the interval, etc.

',par:{ledIndex:'index of the first LED which should be returned',count:'number of LEDs which should be returned'},ret:'a binary buffer with RGB components of selected LEDs.',ext:'On failure, throws an exception or returns an empty binary buffer.'}; doc['ColorLedCluster']['get_userData']={syn:'Returns the value of the userData attribute, as previously stored using method `set_userData`.',lib:'colorledcluster.get_userData()',pro:'function get_userData()',cmt:'

Returns the value of the userData attribute, as previously stored using method `set_userData`. This attribute is never touched directly by the API, and is at disposal of the caller to store a context.

',ret:'the object stored previously by the caller.'}; doc['ColorLedCluster']['hslArrayOfs_move']={syn:'Sets up a smooth HSL color transition to the specified pixel-by-pixel list of HSL color codes.',lib:'colorledcluster.hslArrayOfs_move()',pro:'function hslArrayOfs_move(ledIndex, hslList, delay)',cmt:'

Sets up a smooth HSL color transition to the specified pixel-by-pixel list of HSL color codes. The first color code represents the target HSL value of the first LED, the second color code represents the target value of the second LED, etc.

',par:{ledIndex:'index of the first LED which should be updated',hslList:'a list of target 24bit HSL codes, in the form 0xHHSSLL',delay:'transition duration in ms'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['ColorLedCluster']['hslArray_move']={syn:'Sets up a smooth HSL color transition to the specified pixel-by-pixel list of HSL color codes.',lib:'colorledcluster.hslArray_move()',pro:'function hslArray_move(hslList, delay)',cmt:'

Sets up a smooth HSL color transition to the specified pixel-by-pixel list of HSL color codes. The first color code represents the target HSL value of the first LED, the second color code represents the target value of the second LED, etc.

',par:{hslList:'a list of target 24bit HSL codes, in the form 0xHHSSLL',delay:'transition duration in ms'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['ColorLedCluster']['hsl_move']={syn:'Allows you to modify the current color of a group of adjacent LEDs to another color, in a seamless and autonomous manner.',lib:'colorledcluster.hsl_move()',pro:'function hsl_move(ledIndex, count, hslValue, delay)',cmt:'

Allows you to modify the current color of a group of adjacent LEDs to another color, in a seamless and autonomous manner. The transition is performed in the HSL space. In HSL, hue is a circular value (0..360\xB0). There are always two paths to perform the transition: by increasing or by decreasing the hue. The module selects the shortest transition. If the difference is exactly 180\xB0, the module selects the transition which increases the hue.

',par:{ledIndex:'index of the fisrt affected LED.',count:'affected LED count.',hslValue:'new color (0xHHSSLL).',delay:'transition duration in ms'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['ColorLedCluster']['isOnline']={syn:'Checks if the RGB LED cluster is currently reachable, without raising any error.',lib:'colorledcluster.isOnline()',pro:'function isOnline()',cmt:'

Checks if the RGB LED cluster is currently reachable, without raising any error. If there is a cached value for the RGB LED cluster in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the RGB LED cluster.

',ret:'`true` if the RGB LED cluster can be reached, and `false` otherwise'}; doc['ColorLedCluster']['isOnline_async']={syn:'Checks if the RGB LED cluster is currently reachable, without raising any error (asynchronous version).',lib:'colorledcluster.isOnline_async()',pro:'function isOnline_async(callback, context)',cmt:'

Checks if the RGB LED cluster is currently reachable, without raising any error (asynchronous version). If there is a cached value for the RGB LED cluster in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the requested function.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the boolean result',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['ColorLedCluster']['linkLedToBlinkSeq']={syn:'Links adjacent LEDs to a specific sequence.',lib:'colorledcluster.linkLedToBlinkSeq()',pro:'function linkLedToBlinkSeq(ledIndex, count, seqIndex, offset)',cmt:'

Links adjacent LEDs to a specific sequence. These LEDs start to execute the sequence as soon as startBlinkSeq is called. It is possible to add an offset in the execution: that way we can have several groups of LED executing the same sequence, with a temporal offset. A LED cannot be linked to more than one sequence.

',par:{ledIndex:'index of the first affected LED.',count:'affected LED count.',seqIndex:'sequence index.',offset:'execution offset in ms.'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['ColorLedCluster']['linkLedToBlinkSeqAtPowerOn']={syn:'Links adjacent LEDs to a specific sequence at device poweron.',lib:'colorledcluster.linkLedToBlinkSeqAtPowerOn()',pro:'function linkLedToBlinkSeqAtPowerOn(ledIndex, count, seqIndex, offset)',cmt:'

Links adjacent LEDs to a specific sequence at device poweron. Don\x27t forget to configure the sequence auto start flag as well and call `saveLedsConfigAtPowerOn()`. It is possible to add an offset in the execution: that way we can have several groups of LEDs executing the same sequence, with a temporal offset. A LED cannot be linked to more than one sequence.

',par:{ledIndex:'index of the first affected LED.',count:'affected LED count.',seqIndex:'sequence index.',offset:'execution offset in ms.'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['ColorLedCluster']['linkLedToPeriodicBlinkSeq']={syn:'Links adjacent LEDs to a specific sequence.',lib:'colorledcluster.linkLedToPeriodicBlinkSeq()',pro:'function linkLedToPeriodicBlinkSeq(ledIndex, count, seqIndex, periods)',cmt:'

Links adjacent LEDs to a specific sequence. These LED start to execute the sequence as soon as startBlinkSeq is called. This function automatically introduces a shift between LEDs so that the specified number of sequence periods appears on the group of LEDs (wave effect).

',par:{ledIndex:'index of the first affected LED.',count:'affected LED count.',seqIndex:'sequence index.',periods:'number of periods to show on LEDs.'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['ColorLedCluster']['load']={syn:'Preloads the RGB LED cluster cache with a specified validity duration.',lib:'colorledcluster.load()',pro:'function load(msValidity)',cmt:'

Preloads the RGB LED cluster cache with a specified validity duration. By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network traffic for instance.

',par:{msValidity:'an integer corresponding to the validity attributed to the loaded function parameters, in milliseconds'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['ColorLedCluster']['loadAttribute']={syn:'Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.',lib:'colorledcluster.loadAttribute()',pro:'function loadAttribute(attrName)',cmt:'

Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.

',par:{attrName:'the name of the requested attribute'},ret:'a string with the value of the the attribute',ext:'On failure, throws an exception or returns an empty string.'}; doc['ColorLedCluster']['load_async']={syn:'Preloads the RGB LED cluster cache with a specified validity duration (asynchronous version).',lib:'colorledcluster.load_async()',pro:'function load_async(msValidity, callback, context)',cmt:'

Preloads the RGB LED cluster cache with a specified validity duration (asynchronous version). By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network trafic for instance.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{msValidity:'an integer corresponding to the validity of the loaded function parameters, in milliseconds',callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the error code (or `YAPI_SUCCESS`)',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['ColorLedCluster']['muteValueCallbacks']={syn:'Disables the propagation of every new advertised value to the parent hub.',lib:'colorledcluster.muteValueCallbacks()',pro:'function muteValueCallbacks()',cmt:'

Disables the propagation of every new advertised value to the parent hub. You can use this function to save bandwidth and CPU on computers with limited resources, or to prevent unwanted invocations of the HTTP callback. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['ColorLedCluster']['nextColorLedCluster']={syn:'Continues the enumeration of RGB LED clusters started using `yFirstColorLedCluster()`.',lib:'colorledcluster.nextColorLedCluster()',pro:'function nextColorLedCluster()',cmt:'

Continues the enumeration of RGB LED clusters started using `yFirstColorLedCluster()`.

',ret:'a pointer to a `YColorLedCluster` object, corresponding to a RGB LED cluster currently online, or a `null` pointer if there are no more RGB LED clusters to enumerate.'}; doc['ColorLedCluster']['registerValueCallback']={syn:'Registers the callback function that is invoked on every change of advertised value.',lib:'colorledcluster.registerValueCallback()',pro:'function registerValueCallback(callback)',cmt:'

Registers the callback function that is invoked on every change of advertised value. The callback is invoked only during the execution of `ySleep` or `yHandleEvents`. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a null pointer as argument.

',par:{callback:'the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and the character string describing the new advertised value.'}}; doc['ColorLedCluster']['resetBlinkSeq']={syn:'Stops a sequence execution and resets its contents.',lib:'colorledcluster.resetBlinkSeq()',pro:'function resetBlinkSeq(seqIndex)',cmt:'

Stops a sequence execution and resets its contents. Leds linked to this sequence are not automatically updated anymore.

',par:{seqIndex:'index of the sequence to reset'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['ColorLedCluster']['rgbArrayOfs_move']={syn:'Sets up a smooth RGB color transition to the specified pixel-by-pixel list of RGB color codes.',lib:'colorledcluster.rgbArrayOfs_move()',pro:'function rgbArrayOfs_move(ledIndex, rgbList, delay)',cmt:'

Sets up a smooth RGB color transition to the specified pixel-by-pixel list of RGB color codes. The first color code represents the target RGB value of the first LED, the next color code represents the target value of the next LED, etc.

',par:{ledIndex:'index of the first LED which should be updated',rgbList:'a list of target 24bit RGB codes, in the form 0xRRGGBB',delay:'transition duration in ms'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['ColorLedCluster']['rgbArray_move']={syn:'Sets up a smooth RGB color transition to the specified pixel-by-pixel list of RGB color codes.',lib:'colorledcluster.rgbArray_move()',pro:'function rgbArray_move(rgbList, delay)',cmt:'

Sets up a smooth RGB color transition to the specified pixel-by-pixel list of RGB color codes. The first color code represents the target RGB value of the first LED, the next color code represents the target value of the next LED, etc.

',par:{rgbList:'a list of target 24bit RGB codes, in the form 0xRRGGBB',delay:'transition duration in ms'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['ColorLedCluster']['rgb_move']={syn:'Allows you to modify the current color of a group of adjacent LEDs to another color, in a seamless and autonomous manner.',lib:'colorledcluster.rgb_move()',pro:'function rgb_move(ledIndex, count, rgbValue, delay)',cmt:'

Allows you to modify the current color of a group of adjacent LEDs to another color, in a seamless and autonomous manner. The transition is performed in the RGB space.

',par:{ledIndex:'index of the first affected LED.',count:'affected LED count.',rgbValue:'new color (0xRRGGBB).',delay:'transition duration in ms'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['ColorLedCluster']['saveBlinkSeq']={syn:'Saves the definition of a sequence.',lib:'colorledcluster.saveBlinkSeq()',pro:'function saveBlinkSeq(seqIndex)',cmt:'

Saves the definition of a sequence. Warning: only sequence steps and flags are saved. to save the LEDs startup bindings, the method `saveLedsConfigAtPowerOn()` must be called.

',par:{seqIndex:'index of the sequence to start.'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['ColorLedCluster']['saveLedsConfigAtPowerOn']={syn:'Saves the LEDs power-on configuration.',lib:'colorledcluster.saveLedsConfigAtPowerOn()',pro:'function saveLedsConfigAtPowerOn()',cmt:'

Saves the LEDs power-on configuration. This includes the start-up color or sequence binding for all LEDs. Warning: if some LEDs are linked to a sequence, the method `saveBlinkSeq()` must also be called to save the sequence definition.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['ColorLedCluster']['set_activeLedCount']={syn:'Changes the number of LEDs currently handled by the device.',lib:'colorledcluster.set_activeLedCount()',pro:'function set_activeLedCount(newval)',cmt:'

Changes the number of LEDs currently handled by the device.

',par:{newval:'an integer corresponding to the number of LEDs currently handled by the device'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['ColorLedCluster']['set_blinkSeqSpeed']={syn:'Changes the execution speed of a sequence.',lib:'colorledcluster.set_blinkSeqSpeed()',pro:'function set_blinkSeqSpeed(seqIndex, speed)',cmt:'

Changes the execution speed of a sequence. The natural execution speed is 1000 per thousand. If you configure a slower speed, you can play the sequence in slow-motion. If you set a negative speed, you can play the sequence in reverse direction.

',par:{seqIndex:'index of the sequence to start.',speed:'sequence running speed (-1000...1000).'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['ColorLedCluster']['set_blinkSeqStateAtPowerOn']={syn:'Configures a sequence to make it start automatically at device startup.',lib:'colorledcluster.set_blinkSeqStateAtPowerOn()',pro:'function set_blinkSeqStateAtPowerOn(seqIndex, autostart)',cmt:'

Configures a sequence to make it start automatically at device startup. Note that a sequence with a zero duration can\x27t be started. Don\x27t forget to call `saveBlinkSeq()` to make sure the modification is saved in the device flash memory.

',par:{seqIndex:'index of the sequence to reset.',autostart:'0 to keep the sequence turned off and 1 to start it automatically.'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['ColorLedCluster']['set_hslColor']={syn:'Changes the current color of consecutive LEDs in the cluster, using a HSL color.',lib:'colorledcluster.set_hslColor()',pro:'function set_hslColor(ledIndex, count, hslValue)',cmt:'

Changes the current color of consecutive LEDs in the cluster, using a HSL color. Encoding is done as follows: 0xHHSSLL.

',par:{ledIndex:'index of the first affected LED.',count:'affected LED count.',hslValue:'new color.'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['ColorLedCluster']['set_hslColorArray']={syn:'Sends 24bit HSL colors (provided as a list of integers) to the LED HSL buffer, as is.',lib:'colorledcluster.set_hslColorArray()',pro:'function set_hslColorArray(ledIndex, hslList)',cmt:'

Sends 24bit HSL colors (provided as a list of integers) to the LED HSL buffer, as is. The first number represents the HSL value of the LED specified as parameter, the second number represents the HSL value of the second LED, etc.

',par:{ledIndex:'index of the first LED which should be updated',hslList:'a list of 24bit HSL codes, in the form 0xHHSSLL'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['ColorLedCluster']['set_hslColorBuffer']={syn:'Sends a binary buffer to the LED HSL buffer, as is.',lib:'colorledcluster.set_hslColorBuffer()',pro:'function set_hslColorBuffer(ledIndex, buff)',cmt:'

Sends a binary buffer to the LED HSL buffer, as is. First three bytes are HSL components for the LED specified as parameter, the next three bytes for the second LED, etc.

',par:{ledIndex:'index of the first LED which should be updated',buff:'the binary buffer to send'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['ColorLedCluster']['set_logicalName']={syn:'Changes the logical name of the RGB LED cluster.',lib:'colorledcluster.set_logicalName()',pro:'function set_logicalName(newval)',cmt:'

Changes the logical name of the RGB LED cluster. You can use `yCheckLogicalName()` prior to this call to make sure that your parameter is valid. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',par:{newval:'a string corresponding to the logical name of the RGB LED cluster.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['ColorLedCluster']['set_rgbColor']={syn:'Changes the current color of consecutve LEDs in the cluster, using a RGB color.',lib:'colorledcluster.set_rgbColor()',pro:'function set_rgbColor(ledIndex, count, rgbValue)',cmt:'

Changes the current color of consecutve LEDs in the cluster, using a RGB color. Encoding is done as follows: 0xRRGGBB.

',par:{ledIndex:'index of the first affected LED.',count:'affected LED count.',rgbValue:'new color.'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['ColorLedCluster']['set_rgbColorArray']={syn:'Sends 24bit RGB colors (provided as a list of integers) to the LED RGB buffer, as is.',lib:'colorledcluster.set_rgbColorArray()',pro:'function set_rgbColorArray(ledIndex, rgbList)',cmt:'

Sends 24bit RGB colors (provided as a list of integers) to the LED RGB buffer, as is. The first number represents the RGB value of the LED specified as parameter, the second number represents the RGB value of the next LED, etc.

',par:{ledIndex:'index of the first LED which should be updated',rgbList:'a list of 24bit RGB codes, in the form 0xRRGGBB'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['ColorLedCluster']['set_rgbColorAtPowerOn']={syn:'Changes the color at device startup of consecutve LEDs in the cluster, using a RGB color.',lib:'colorledcluster.set_rgbColorAtPowerOn()',pro:'function set_rgbColorAtPowerOn(ledIndex, count, rgbValue)',cmt:'

Changes the color at device startup of consecutve LEDs in the cluster, using a RGB color. Encoding is done as follows: 0xRRGGBB. Don\x27t forget to call `saveLedsConfigAtPowerOn()` to make sure the modification is saved in the device flash memory.

',par:{ledIndex:'index of the first affected LED.',count:'affected LED count.',rgbValue:'new color.'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['ColorLedCluster']['set_rgbColorBuffer']={syn:'Sends a binary buffer to the LED RGB buffer, as is.',lib:'colorledcluster.set_rgbColorBuffer()',pro:'function set_rgbColorBuffer(ledIndex, buff)',cmt:'

Sends a binary buffer to the LED RGB buffer, as is. First three bytes are RGB components for LED specified as parameter, the next three bytes for the next LED, etc.

',par:{ledIndex:'index of the first LED which should be updated',buff:'the binary buffer to send'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['ColorLedCluster']['set_userData']={syn:'Stores a user context provided as argument in the userData attribute of the function.',lib:'colorledcluster.set_userData()',pro:'function set_userData(data)',cmt:'

Stores a user context provided as argument in the userData attribute of the function. This attribute is never touched by the API, and is at disposal of the caller to store a context.

',par:{data:'any kind of object to be stored'}}; doc['ColorLedCluster']['startBlinkSeq']={syn:'Starts a sequence execution: every LED linked to that sequence starts to run it in a loop.',lib:'colorledcluster.startBlinkSeq()',pro:'function startBlinkSeq(seqIndex)',cmt:'

Starts a sequence execution: every LED linked to that sequence starts to run it in a loop. Note that a sequence with a zero duration can\x27t be started.

',par:{seqIndex:'index of the sequence to start.'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['ColorLedCluster']['stopBlinkSeq']={syn:'Stops a sequence execution.',lib:'colorledcluster.stopBlinkSeq()',pro:'function stopBlinkSeq(seqIndex)',cmt:'

Stops a sequence execution. If started again, the execution restarts from the beginning.

',par:{seqIndex:'index of the sequence to stop.'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['ColorLedCluster']['unlinkLedFromBlinkSeq']={syn:'Unlinks adjacent LEDs from a sequence.',lib:'colorledcluster.unlinkLedFromBlinkSeq()',pro:'function unlinkLedFromBlinkSeq(ledIndex, count)',cmt:'

Unlinks adjacent LEDs from a sequence.

',par:{ledIndex:'index of the first affected LED.',count:'affected LED count.'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['ColorLedCluster']['unmuteValueCallbacks']={syn:'Re-enables the propagation of every new advertised value to the parent hub.',lib:'colorledcluster.unmuteValueCallbacks()',pro:'function unmuteValueCallbacks()',cmt:'

Re-enables the propagation of every new advertised value to the parent hub. This function reverts the effect of a previous call to `muteValueCallbacks()`. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['ColorLedCluster']['wait_async']={syn:'Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function.',lib:'colorledcluster.wait_async()',pro:'function wait_async(callback, context)',cmt:'

Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function. The callback function can therefore freely issue synchronous or asynchronous commands, without risking to block the Javascript VM.

',par:{callback:'callback function that is invoked when all pending commands on the module are completed. The callback function receives two arguments: the caller-specific context object and the receiving function object.',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing.'}; //--- (end of generated code: ColorLedCluster) //--- (generated code: SpiPort) doc['SpiPort']={'':{syn:'SPI Port function interface',inc:'<script type='text/javascript' src='yocto_spiport.js'></script>',cmt:'

The SpiPort function interface allows you to fully drive a Yoctopuce SPI port, to send and receive data, and to configure communication parameters (baud rate, bit count, parity, flow control and protocol). Note that Yoctopuce SPI ports are not exposed as virtual COM ports. They are meant to be used in the same way as all Yoctopuce devices.

'}}; doc['SpiPort']['FindSpiPort']={syn:'Retrieves a SPI port for a given identifier.',lib:'YSpiPort.FindSpiPort()',pro:'function FindSpiPort(func)',cmt:'

Retrieves a SPI port for a given identifier. The identifier can be specified using several formats:

- FunctionLogicalName
- ModuleSerialNumber.FunctionIdentifier
- ModuleSerialNumber.FunctionLogicalName
- ModuleLogicalName.FunctionIdentifier
- ModuleLogicalName.FunctionLogicalName

This function does not require that the SPI port is online at the time it is invoked. The returned object is nevertheless valid. Use the method `YSpiPort.isOnline()` to test if the SPI port is indeed online at a given time. In case of ambiguity when looking for a SPI port by logical name, no error is notified: the first instance found is returned. The search is performed first by hardware name, then by logical name.

If a call to this object\x27s is_online() method returns FALSE although you are certain that the matching device is plugged, make sure that you did call registerHub() at application initialization time.

',par:{func:'a string that uniquely characterizes the SPI port'},ret:'a `YSpiPort` object allowing you to drive the SPI port.'}; doc['SpiPort']['FirstSpiPort']={syn:'Starts the enumeration of SPI ports currently accessible.',lib:'YSpiPort.FirstSpiPort()',pro:'function FirstSpiPort()',cmt:'

Starts the enumeration of SPI ports currently accessible. Use the method `YSpiPort.nextSpiPort()` to iterate on next SPI ports.

',ret:'a pointer to a `YSpiPort` object, corresponding to the first SPI port currently online, or a `null` pointer if there are none.'}; doc['SpiPort']['clearCache']={syn:'Invalidates the cache.',lib:'spiport.clearCache()',pro:'function clearCache()',cmt:'

Invalidates the cache. Invalidates the cache of the SPI port attributes. Forces the next call to get_xxx() or loadxxx() to use values that come from the device.

'}; doc['SpiPort']['describe']={syn:'Returns a short text that describes unambiguously the instance of the SPI port in the form `TYPE(NAME)=SERIAL.FUNCTIONID`.',lib:'spiport.describe()',pro:'function describe()',cmt:'

Returns a short text that describes unambiguously the instance of the SPI port in the form `TYPE(NAME)=SERIAL.FUNCTIONID`. More precisely, `TYPE` is the type of the function, `NAME` it the name used for the first access to the function, `SERIAL` is the serial number of the module if the module is connected or `\x22unresolved\x22`, and `FUNCTIONID` is the hardware identifier of the function if the module is connected. For example, this method returns `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1` if the module is already connected or `Relay(BadCustomeName.relay1)=unresolved` if the module has not yet been connected. This method does not trigger any USB or TCP transaction and can therefore be used in a debugger.

',ret:'a string that describes the SPI port (ex: `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1`)'}; doc['SpiPort']['get_advertisedValue']={syn:'Returns the current value of the SPI port (no more than 6 characters).',lib:'spiport.get_advertisedValue()',pro:'function get_advertisedValue()',cmt:'

Returns the current value of the SPI port (no more than 6 characters).

',ret:'a string corresponding to the current value of the SPI port (no more than 6 characters).',ext:'On failure, throws an exception or returns `Y_ADVERTISEDVALUE_INVALID`.'}; doc['SpiPort']['get_currentJob']={syn:'Returns the name of the job file currently in use.',lib:'spiport.get_currentJob()',pro:'function get_currentJob()',cmt:'

Returns the name of the job file currently in use.

',ret:'a string corresponding to the name of the job file currently in use',ext:'On failure, throws an exception or returns `Y_CURRENTJOB_INVALID`.'}; doc['SpiPort']['get_errCount']={syn:'Returns the total number of communication errors detected since last reset.',lib:'spiport.get_errCount()',pro:'function get_errCount()',cmt:'

Returns the total number of communication errors detected since last reset.

',ret:'an integer corresponding to the total number of communication errors detected since last reset',ext:'On failure, throws an exception or returns `Y_ERRCOUNT_INVALID`.'}; doc['SpiPort']['get_errorMessage']={syn:'Returns the error message of the latest error with the SPI port.',lib:'spiport.get_errorMessage()',pro:'function get_errorMessage()',cmt:'

Returns the error message of the latest error with the SPI port. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a string corresponding to the latest error message that occured while using the SPI port object'}; doc['SpiPort']['get_errorType']={syn:'Returns the numerical error code of the latest error with the SPI port.',lib:'spiport.get_errorType()',pro:'function get_errorType()',cmt:'

Returns the numerical error code of the latest error with the SPI port. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a number corresponding to the code of the latest error that occurred while using the SPI port object'}; doc['SpiPort']['get_friendlyName']={syn:'Returns a global identifier of the SPI port in the format `MODULE_NAME.FUNCTION_NAME`.',lib:'spiport.get_friendlyName()',pro:'function get_friendlyName()',cmt:'

Returns a global identifier of the SPI port in the format `MODULE_NAME.FUNCTION_NAME`. The returned string uses the logical names of the module and of the SPI port if they are defined, otherwise the serial number of the module and the hardware identifier of the SPI port (for example: `MyCustomName.relay1`)

',ret:'a string that uniquely identifies the SPI port using logical names (ex: `MyCustomName.relay1`)',ext:'On failure, throws an exception or returns `Y_FRIENDLYNAME_INVALID`.'}; doc['SpiPort']['get_functionDescriptor']={syn:'Returns a unique identifier of type `YFUN_DESCR` corresponding to the function.',lib:'spiport.get_functionDescriptor()',pro:'function get_functionDescriptor()',cmt:'

Returns a unique identifier of type `YFUN_DESCR` corresponding to the function. This identifier can be used to test if two instances of `YFunction` reference the same physical function on the same physical device.

',ret:'an identifier of type `YFUN_DESCR`.',ext:'If the function has never been contacted, the returned value is `Y_FUNCTIONDESCRIPTOR_INVALID`.'}; doc['SpiPort']['get_functionId']={syn:'Returns the hardware identifier of the SPI port, without reference to the module.',lib:'spiport.get_functionId()',pro:'function get_functionId()',cmt:'

Returns the hardware identifier of the SPI port, without reference to the module. For example `relay1`

',ret:'a string that identifies the SPI port (ex: `relay1`)',ext:'On failure, throws an exception or returns `Y_FUNCTIONID_INVALID`.'}; doc['SpiPort']['get_hardwareId']={syn:'Returns the unique hardware identifier of the SPI port in the form `SERIAL.FUNCTIONID`.',lib:'spiport.get_hardwareId()',pro:'function get_hardwareId()',cmt:'

Returns the unique hardware identifier of the SPI port in the form `SERIAL.FUNCTIONID`. The unique hardware identifier is composed of the device serial number and of the hardware identifier of the SPI port (for example `RELAYLO1-123456.relay1`).

',ret:'a string that uniquely identifies the SPI port (ex: `RELAYLO1-123456.relay1`)',ext:'On failure, throws an exception or returns `Y_HARDWAREID_INVALID`.'}; doc['SpiPort']['get_lastMsg']={syn:'Returns the latest message fully received (for Line and Frame protocols).',lib:'spiport.get_lastMsg()',pro:'function get_lastMsg()',cmt:'

Returns the latest message fully received (for Line and Frame protocols).

',ret:'a string corresponding to the latest message fully received (for Line and Frame protocols)',ext:'On failure, throws an exception or returns `Y_LASTMSG_INVALID`.'}; doc['SpiPort']['get_logicalName']={syn:'Returns the logical name of the SPI port.',lib:'spiport.get_logicalName()',pro:'function get_logicalName()',cmt:'

Returns the logical name of the SPI port.

',ret:'a string corresponding to the logical name of the SPI port.',ext:'On failure, throws an exception or returns `Y_LOGICALNAME_INVALID`.'}; doc['SpiPort']['get_module']={syn:'Gets the `YModule` object for the device on which the function is located.',lib:'spiport.get_module()',pro:'function get_module()',cmt:'

Gets the `YModule` object for the device on which the function is located. If the function cannot be located on any module, the returned instance of `YModule` is not shown as on-line.

',ret:'an instance of `YModule`'}; doc['SpiPort']['get_module_async']={syn:'Gets the `YModule` object for the device on which the function is located (asynchronous version).',lib:'spiport.get_module_async()',pro:'function get_module_async(callback, context)',cmt:'

Gets the `YModule` object for the device on which the function is located (asynchronous version). If the function cannot be located on any module, the returned `YModule` object does not show as on-line.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking Firefox javascript VM that does not implement context switching during blocking I/O calls. See the documentation section on asynchronous Javascript calls for more details.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the requested `YModule` object',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['SpiPort']['get_protocol']={syn:'Returns the type of protocol used over the serial line, as a string.',lib:'spiport.get_protocol()',pro:'function get_protocol()',cmt:'

Returns the type of protocol used over the serial line, as a string. Possible values are \x22Line\x22 for ASCII messages separated by CR and/or LF, \x22Frame:[timeout]ms\x22 for binary messages separated by a delay time, \x22Char\x22 for a continuous ASCII stream or \x22Byte\x22 for a continuous binary stream.

',ret:'a string corresponding to the type of protocol used over the serial line, as a string',ext:'On failure, throws an exception or returns `Y_PROTOCOL_INVALID`.'}; doc['SpiPort']['get_rxCount']={syn:'Returns the total number of bytes received since last reset.',lib:'spiport.get_rxCount()',pro:'function get_rxCount()',cmt:'

Returns the total number of bytes received since last reset.

',ret:'an integer corresponding to the total number of bytes received since last reset',ext:'On failure, throws an exception or returns `Y_RXCOUNT_INVALID`.'}; doc['SpiPort']['get_rxMsgCount']={syn:'Returns the total number of messages received since last reset.',lib:'spiport.get_rxMsgCount()',pro:'function get_rxMsgCount()',cmt:'

Returns the total number of messages received since last reset.

',ret:'an integer corresponding to the total number of messages received since last reset',ext:'On failure, throws an exception or returns `Y_RXMSGCOUNT_INVALID`.'}; doc['SpiPort']['get_shitftSampling']={syn:'Returns true when the SDI line phase is shifted with regards to the SDO line.',lib:'spiport.get_shitftSampling()',pro:'function get_shitftSampling()',cmt:'

Returns true when the SDI line phase is shifted with regards to the SDO line.

',ret:'either `Y_SHITFTSAMPLING_OFF` or `Y_SHITFTSAMPLING_ON`, according to true when the SDI line phase is shifted with regards to the SDO line',ext:'On failure, throws an exception or returns `Y_SHITFTSAMPLING_INVALID`.'}; doc['SpiPort']['get_spiMode']={syn:'Returns the SPI port communication parameters, as a string such as \x22125000,0,msb\x22.',lib:'spiport.get_spiMode()',pro:'function get_spiMode()',cmt:'

Returns the SPI port communication parameters, as a string such as \x22125000,0,msb\x22. The string includes the baud rate, the SPI mode (between 0 and 3) and the bit order.

',ret:'a string corresponding to the SPI port communication parameters, as a string such as \x22125000,0,msb\x22',ext:'On failure, throws an exception or returns `Y_SPIMODE_INVALID`.'}; doc['SpiPort']['get_ssPolarity']={syn:'Returns the SS line polarity.',lib:'spiport.get_ssPolarity()',pro:'function get_ssPolarity()',cmt:'

Returns the SS line polarity.

',ret:'either `Y_SSPOLARITY_ACTIVE_LOW` or `Y_SSPOLARITY_ACTIVE_HIGH`, according to the SS line polarity',ext:'On failure, throws an exception or returns `Y_SSPOLARITY_INVALID`.'}; doc['SpiPort']['get_startupJob']={syn:'Returns the job file to use when the device is powered on.',lib:'spiport.get_startupJob()',pro:'function get_startupJob()',cmt:'

Returns the job file to use when the device is powered on.

',ret:'a string corresponding to the job file to use when the device is powered on',ext:'On failure, throws an exception or returns `Y_STARTUPJOB_INVALID`.'}; doc['SpiPort']['get_txCount']={syn:'Returns the total number of bytes transmitted since last reset.',lib:'spiport.get_txCount()',pro:'function get_txCount()',cmt:'

Returns the total number of bytes transmitted since last reset.

',ret:'an integer corresponding to the total number of bytes transmitted since last reset',ext:'On failure, throws an exception or returns `Y_TXCOUNT_INVALID`.'}; doc['SpiPort']['get_txMsgCount']={syn:'Returns the total number of messages send since last reset.',lib:'spiport.get_txMsgCount()',pro:'function get_txMsgCount()',cmt:'

Returns the total number of messages send since last reset.

',ret:'an integer corresponding to the total number of messages send since last reset',ext:'On failure, throws an exception or returns `Y_TXMSGCOUNT_INVALID`.'}; doc['SpiPort']['get_userData']={syn:'Returns the value of the userData attribute, as previously stored using method `set_userData`.',lib:'spiport.get_userData()',pro:'function get_userData()',cmt:'

Returns the value of the userData attribute, as previously stored using method `set_userData`. This attribute is never touched directly by the API, and is at disposal of the caller to store a context.

',ret:'the object stored previously by the caller.'}; doc['SpiPort']['get_voltageLevel']={syn:'Returns the voltage level used on the serial line.',lib:'spiport.get_voltageLevel()',pro:'function get_voltageLevel()',cmt:'

Returns the voltage level used on the serial line.

',ret:'a value among `Y_VOLTAGELEVEL_OFF`, `Y_VOLTAGELEVEL_TTL3V`, `Y_VOLTAGELEVEL_TTL3VR`, `Y_VOLTAGELEVEL_TTL5V`, `Y_VOLTAGELEVEL_TTL5VR`, `Y_VOLTAGELEVEL_RS232` and `Y_VOLTAGELEVEL_RS485` corresponding to the voltage level used on the serial line',ext:'On failure, throws an exception or returns `Y_VOLTAGELEVEL_INVALID`.'}; doc['SpiPort']['isOnline']={syn:'Checks if the SPI port is currently reachable, without raising any error.',lib:'spiport.isOnline()',pro:'function isOnline()',cmt:'

Checks if the SPI port is currently reachable, without raising any error. If there is a cached value for the SPI port in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the SPI port.

',ret:'`true` if the SPI port can be reached, and `false` otherwise'}; doc['SpiPort']['isOnline_async']={syn:'Checks if the SPI port is currently reachable, without raising any error (asynchronous version).',lib:'spiport.isOnline_async()',pro:'function isOnline_async(callback, context)',cmt:'

Checks if the SPI port is currently reachable, without raising any error (asynchronous version). If there is a cached value for the SPI port in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the requested function.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the boolean result',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['SpiPort']['load']={syn:'Preloads the SPI port cache with a specified validity duration.',lib:'spiport.load()',pro:'function load(msValidity)',cmt:'

Preloads the SPI port cache with a specified validity duration. By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network traffic for instance.

',par:{msValidity:'an integer corresponding to the validity attributed to the loaded function parameters, in milliseconds'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['SpiPort']['loadAttribute']={syn:'Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.',lib:'spiport.loadAttribute()',pro:'function loadAttribute(attrName)',cmt:'

Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.

',par:{attrName:'the name of the requested attribute'},ret:'a string with the value of the the attribute',ext:'On failure, throws an exception or returns an empty string.'}; doc['SpiPort']['load_async']={syn:'Preloads the SPI port cache with a specified validity duration (asynchronous version).',lib:'spiport.load_async()',pro:'function load_async(msValidity, callback, context)',cmt:'

Preloads the SPI port cache with a specified validity duration (asynchronous version). By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network trafic for instance.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{msValidity:'an integer corresponding to the validity of the loaded function parameters, in milliseconds',callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the error code (or `YAPI_SUCCESS`)',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['SpiPort']['muteValueCallbacks']={syn:'Disables the propagation of every new advertised value to the parent hub.',lib:'spiport.muteValueCallbacks()',pro:'function muteValueCallbacks()',cmt:'

Disables the propagation of every new advertised value to the parent hub. You can use this function to save bandwidth and CPU on computers with limited resources, or to prevent unwanted invocations of the HTTP callback. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['SpiPort']['nextSpiPort']={syn:'Continues the enumeration of SPI ports started using `yFirstSpiPort()`.',lib:'spiport.nextSpiPort()',pro:'function nextSpiPort()',cmt:'

Continues the enumeration of SPI ports started using `yFirstSpiPort()`.

',ret:'a pointer to a `YSpiPort` object, corresponding to a SPI port currently online, or a `null` pointer if there are no more SPI ports to enumerate.'}; doc['SpiPort']['queryLine']={syn:'Sends a text line query to the serial port, and reads the reply, if any.',lib:'spiport.queryLine()',pro:'function queryLine(query, maxWait)',cmt:'

Sends a text line query to the serial port, and reads the reply, if any. This function is intended to be used when the serial port is configured for \x27Line\x27 protocol.

',par:{query:'the line query to send (without CR/LF)',maxWait:'the maximum number of milliseconds to wait for a reply.'},ret:'the next text line received after sending the text query, as a string. Additional lines can be obtained by calling readLine or readMessages.',ext:'On failure, throws an exception or returns an empty array.'}; doc['SpiPort']['readArray']={syn:'Reads data from the receive buffer as a list of bytes, starting at current stream position.',lib:'spiport.readArray()',pro:'function readArray(nChars)',cmt:'

Reads data from the receive buffer as a list of bytes, starting at current stream position. If data at current stream position is not available anymore in the receive buffer, the function performs a short read.

',par:{nChars:'the maximum number of bytes to read'},ret:'a sequence of bytes with receive buffer contents',ext:'On failure, throws an exception or returns a negative error code.'}; doc['SpiPort']['readBin']={syn:'Reads data from the receive buffer as a binary buffer, starting at current stream position.',lib:'spiport.readBin()',pro:'function readBin(nChars)',cmt:'

Reads data from the receive buffer as a binary buffer, starting at current stream position. If data at current stream position is not available anymore in the receive buffer, the function performs a short read.

',par:{nChars:'the maximum number of bytes to read'},ret:'a binary object with receive buffer contents',ext:'On failure, throws an exception or returns a negative error code.'}; doc['SpiPort']['readByte']={syn:'Reads one byte from the receive buffer, starting at current stream position.',lib:'spiport.readByte()',pro:'function readByte()',cmt:'

Reads one byte from the receive buffer, starting at current stream position. If data at current stream position is not available anymore in the receive buffer, or if there is no data available yet, the function returns YAPI_NO_MORE_DATA.

',ret:'the next byte',ext:'On failure, throws an exception or returns a negative error code.'}; doc['SpiPort']['readHex']={syn:'Reads data from the receive buffer as a hexadecimal string, starting at current stream position.',lib:'spiport.readHex()',pro:'function readHex(nBytes)',cmt:'

Reads data from the receive buffer as a hexadecimal string, starting at current stream position. If data at current stream position is not available anymore in the receive buffer, the function performs a short read.

',par:{nBytes:'the maximum number of bytes to read'},ret:'a string with receive buffer contents, encoded in hexadecimal',ext:'On failure, throws an exception or returns a negative error code.'}; doc['SpiPort']['readLine']={syn:'Reads a single line (or message) from the receive buffer, starting at current stream position.',lib:'spiport.readLine()',pro:'function readLine()',cmt:'

Reads a single line (or message) from the receive buffer, starting at current stream position. This function is intended to be used when the serial port is configured for a message protocol, such as \x27Line\x27 mode or frame protocols.

If data at current stream position is not available anymore in the receive buffer, the function returns the oldest available line and moves the stream position just after. If no new full line is received, the function returns an empty line.

',ret:'a string with a single line of text',ext:'On failure, throws an exception or returns a negative error code.'}; doc['SpiPort']['readMessages']={syn:'Searches for incoming messages in the serial port receive buffer matching a given pattern, starting at current position.',lib:'spiport.readMessages()',pro:'function readMessages(pattern, maxWait)',cmt:'

Searches for incoming messages in the serial port receive buffer matching a given pattern, starting at current position. This function will only compare and return printable characters in the message strings. Binary protocols are handled as hexadecimal strings.

The search returns all messages matching the expression provided as argument in the buffer. If no matching message is found, the search waits for one up to the specified maximum timeout (in milliseconds).

',par:{pattern:'a limited regular expression describing the expected message format, or an empty string if all messages should be returned (no filtering). When using binary protocols, the format applies to the hexadecimal representation of the message.',maxWait:'the maximum number of milliseconds to wait for a message if none is found in the receive buffer.'},ret:'an array of strings containing the messages found, if any. Binary messages are converted to hexadecimal representation.',ext:'On failure, throws an exception or returns an empty array.'}; doc['SpiPort']['readStr']={syn:'Reads data from the receive buffer as a string, starting at current stream position.',lib:'spiport.readStr()',pro:'function readStr(nChars)',cmt:'

Reads data from the receive buffer as a string, starting at current stream position. If data at current stream position is not available anymore in the receive buffer, the function performs a short read.

',par:{nChars:'the maximum number of characters to read'},ret:'a string with receive buffer contents',ext:'On failure, throws an exception or returns a negative error code.'}; doc['SpiPort']['read_avail']={syn:'Returns the number of bytes available to read in the input buffer starting from the current absolute stream position pointer of the API object.',lib:'spiport.read_avail()',pro:'function read_avail()',cmt:'

Returns the number of bytes available to read in the input buffer starting from the current absolute stream position pointer of the API object.

',ret:'the number of bytes available to read'}; doc['SpiPort']['read_seek']={syn:'Changes the current internal stream position to the specified value.',lib:'spiport.read_seek()',pro:'function read_seek(absPos)',cmt:'

Changes the current internal stream position to the specified value. This function does not affect the device, it only changes the value stored in the API object for the next read operations.

',par:{absPos:'the absolute position index for next read operations.'},ret:'nothing.'}; doc['SpiPort']['read_tell']={syn:'Returns the current absolute stream position pointer of the API object.',lib:'spiport.read_tell()',pro:'function read_tell()',cmt:'

Returns the current absolute stream position pointer of the API object.

',ret:'the absolute position index for next read operations.'}; doc['SpiPort']['registerValueCallback']={syn:'Registers the callback function that is invoked on every change of advertised value.',lib:'spiport.registerValueCallback()',pro:'function registerValueCallback(callback)',cmt:'

Registers the callback function that is invoked on every change of advertised value. The callback is invoked only during the execution of `ySleep` or `yHandleEvents`. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a null pointer as argument.

',par:{callback:'the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and the character string describing the new advertised value.'}}; doc['SpiPort']['reset']={syn:'Clears the serial port buffer and resets counters to zero.',lib:'spiport.reset()',pro:'function reset()',cmt:'

Clears the serial port buffer and resets counters to zero.

',ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['SpiPort']['selectJob']={syn:'Load and start processing the specified job file.',lib:'spiport.selectJob()',pro:'function selectJob(jobfile)',cmt:'

Load and start processing the specified job file. The file must have been previously created using the user interface or uploaded on the device filesystem using the `uploadJob()` function.

',par:{jobfile:'name of the job file (on the device filesystem)'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['SpiPort']['set_SS']={syn:'Manually sets the state of the SS line.',lib:'spiport.set_SS()',pro:'function set_SS(val)',cmt:'

Manually sets the state of the SS line. This function has no effect when the SS line is handled automatically.

',par:{val:'1 to turn SS active, 0 to release SS.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['SpiPort']['set_currentJob']={syn:'Changes the job to use when the device is powered on.',lib:'spiport.set_currentJob()',pro:'function set_currentJob(newval)',cmt:'

Changes the job to use when the device is powered on. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',par:{newval:'a string corresponding to the job to use when the device is powered on'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['SpiPort']['set_logicalName']={syn:'Changes the logical name of the SPI port.',lib:'spiport.set_logicalName()',pro:'function set_logicalName(newval)',cmt:'

Changes the logical name of the SPI port. You can use `yCheckLogicalName()` prior to this call to make sure that your parameter is valid. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',par:{newval:'a string corresponding to the logical name of the SPI port.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['SpiPort']['set_protocol']={syn:'Changes the type of protocol used over the serial line.',lib:'spiport.set_protocol()',pro:'function set_protocol(newval)',cmt:'

Changes the type of protocol used over the serial line. Possible values are \x22Line\x22 for ASCII messages separated by CR and/or LF, \x22Frame:[timeout]ms\x22 for binary messages separated by a delay time, \x22Char\x22 for a continuous ASCII stream or \x22Byte\x22 for a continuous binary stream. The suffix \x22/[wait]ms\x22 can be added to reduce the transmit rate so that there is always at lest the specified number of milliseconds between each bytes sent.

',par:{newval:'a string corresponding to the type of protocol used over the serial line'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['SpiPort']['set_shitftSampling']={syn:'Changes the SDI line sampling shift.',lib:'spiport.set_shitftSampling()',pro:'function set_shitftSampling(newval)',cmt:'

Changes the SDI line sampling shift. When disabled, SDI line is sampled in the middle of data output time. When enabled, SDI line is samples at the end of data output time.

',par:{newval:'either `Y_SHITFTSAMPLING_OFF` or `Y_SHITFTSAMPLING_ON`, according to the SDI line sampling shift'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['SpiPort']['set_spiMode']={syn:'Changes the SPI port communication parameters, with a string such as \x22125000,0,msb\x22.',lib:'spiport.set_spiMode()',pro:'function set_spiMode(newval)',cmt:'

Changes the SPI port communication parameters, with a string such as \x22125000,0,msb\x22. The string includes the baud rate, the SPI mode (between 0 and 3) and the bit order.

',par:{newval:'a string corresponding to the SPI port communication parameters, with a string such as \x22125000,0,msb\x22'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['SpiPort']['set_ssPolarity']={syn:'Changes the SS line polarity.',lib:'spiport.set_ssPolarity()',pro:'function set_ssPolarity(newval)',cmt:'

Changes the SS line polarity.

',par:{newval:'either `Y_SSPOLARITY_ACTIVE_LOW` or `Y_SSPOLARITY_ACTIVE_HIGH`, according to the SS line polarity'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['SpiPort']['set_startupJob']={syn:'Changes the job to use when the device is powered on.',lib:'spiport.set_startupJob()',pro:'function set_startupJob(newval)',cmt:'

Changes the job to use when the device is powered on. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',par:{newval:'a string corresponding to the job to use when the device is powered on'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['SpiPort']['set_userData']={syn:'Stores a user context provided as argument in the userData attribute of the function.',lib:'spiport.set_userData()',pro:'function set_userData(data)',cmt:'

Stores a user context provided as argument in the userData attribute of the function. This attribute is never touched by the API, and is at disposal of the caller to store a context.

',par:{data:'any kind of object to be stored'}}; doc['SpiPort']['set_voltageLevel']={syn:'Changes the voltage type used on the serial line.',lib:'spiport.set_voltageLevel()',pro:'function set_voltageLevel(newval)',cmt:'

Changes the voltage type used on the serial line. Valid values will depend on the Yoctopuce device model featuring the serial port feature. Check your device documentation to find out which values are valid for that specific model. \x09 Trying to set an invalid value will have no effect.

',par:{newval:'a value among `Y_VOLTAGELEVEL_OFF`, `Y_VOLTAGELEVEL_TTL3V`, `Y_VOLTAGELEVEL_TTL3VR`, `Y_VOLTAGELEVEL_TTL5V`, `Y_VOLTAGELEVEL_TTL5VR`, `Y_VOLTAGELEVEL_RS232` and `Y_VOLTAGELEVEL_RS485` corresponding to the voltage type used on the serial line'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['SpiPort']['unmuteValueCallbacks']={syn:'Re-enables the propagation of every new advertised value to the parent hub.',lib:'spiport.unmuteValueCallbacks()',pro:'function unmuteValueCallbacks()',cmt:'

Re-enables the propagation of every new advertised value to the parent hub. This function reverts the effect of a previous call to `muteValueCallbacks()`. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['SpiPort']['uploadJob']={syn:'Saves the job definition string (JSON data) into a job file.',lib:'spiport.uploadJob()',pro:'function uploadJob(jobfile, jsonDef)',cmt:'

Saves the job definition string (JSON data) into a job file. The job file can be later enabled using `selectJob()`.

',par:{jobfile:'name of the job file to save on the device filesystem',jsonDef:'a string containing a JSON definition of the job'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['SpiPort']['wait_async']={syn:'Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function.',lib:'spiport.wait_async()',pro:'function wait_async(callback, context)',cmt:'

Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function. The callback function can therefore freely issue synchronous or asynchronous commands, without risking to block the Javascript VM.

',par:{callback:'callback function that is invoked when all pending commands on the module are completed. The callback function receives two arguments: the caller-specific context object and the receiving function object.',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing.'}; doc['SpiPort']['writeArray']={syn:'Sends a byte sequence (provided as a list of bytes) to the serial port.',lib:'spiport.writeArray()',pro:'function writeArray(byteList)',cmt:'

Sends a byte sequence (provided as a list of bytes) to the serial port.

',par:{byteList:'a list of byte codes'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['SpiPort']['writeBin']={syn:'Sends a binary buffer to the serial port, as is.',lib:'spiport.writeBin()',pro:'function writeBin(buff)',cmt:'

Sends a binary buffer to the serial port, as is.

',par:{buff:'the binary buffer to send'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['SpiPort']['writeByte']={syn:'Sends a single byte to the serial port.',lib:'spiport.writeByte()',pro:'function writeByte(code)',cmt:'

Sends a single byte to the serial port.

',par:{code:'the byte to send'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['SpiPort']['writeHex']={syn:'Sends a byte sequence (provided as a hexadecimal string) to the serial port.',lib:'spiport.writeHex()',pro:'function writeHex(hexString)',cmt:'

Sends a byte sequence (provided as a hexadecimal string) to the serial port.

',par:{hexString:'a string of hexadecimal byte codes'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['SpiPort']['writeLine']={syn:'Sends an ASCII string to the serial port, followed by a line break (CR LF).',lib:'spiport.writeLine()',pro:'function writeLine(text)',cmt:'

Sends an ASCII string to the serial port, followed by a line break (CR LF).

',par:{text:'the text string to send'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['SpiPort']['writeStr']={syn:'Sends an ASCII string to the serial port, as is.',lib:'spiport.writeStr()',pro:'function writeStr(text)',cmt:'

Sends an ASCII string to the serial port, as is.

',par:{text:'the text string to send'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; //--- (end of generated code: SpiPort) //--- (generated code: MessageBox) doc['MessageBox']={'':{syn:'MessageBox function interface',inc:'<script type='text/javascript' src='yocto_messagebox.js'></script>',cmt:'

YMessageBox functions provides SMS sending and receiving capability to GSM-enabled Yoctopuce devices.

'}}; doc['MessageBox']['FindMessageBox']={syn:'Retrieves a MessageBox interface for a given identifier.',lib:'YMessageBox.FindMessageBox()',pro:'function FindMessageBox(func)',cmt:'

Retrieves a MessageBox interface for a given identifier. The identifier can be specified using several formats:

- FunctionLogicalName
- ModuleSerialNumber.FunctionIdentifier
- ModuleSerialNumber.FunctionLogicalName
- ModuleLogicalName.FunctionIdentifier
- ModuleLogicalName.FunctionLogicalName

This function does not require that the MessageBox interface is online at the time it is invoked. The returned object is nevertheless valid. Use the method `YMessageBox.isOnline()` to test if the MessageBox interface is indeed online at a given time. In case of ambiguity when looking for a MessageBox interface by logical name, no error is notified: the first instance found is returned. The search is performed first by hardware name, then by logical name.

If a call to this object\x27s is_online() method returns FALSE although you are certain that the matching device is plugged, make sure that you did call registerHub() at application initialization time.

',par:{func:'a string that uniquely characterizes the MessageBox interface'},ret:'a `YMessageBox` object allowing you to drive the MessageBox interface.'}; doc['MessageBox']['FirstMessageBox']={syn:'Starts the enumeration of MessageBox interfaces currently accessible.',lib:'YMessageBox.FirstMessageBox()',pro:'function FirstMessageBox()',cmt:'

Starts the enumeration of MessageBox interfaces currently accessible. Use the method `YMessageBox.nextMessageBox()` to iterate on next MessageBox interfaces.

',ret:'a pointer to a `YMessageBox` object, corresponding to the first MessageBox interface currently online, or a `null` pointer if there are none.'}; doc['MessageBox']['clearCache']={syn:'Invalidates the cache.',lib:'messagebox.clearCache()',pro:'function clearCache()',cmt:'

Invalidates the cache. Invalidates the cache of the MessageBox interface attributes. Forces the next call to get_xxx() or loadxxx() to use values that come from the device.

'}; doc['MessageBox']['clearPduCounters']={syn:'Clear the SMS units counters.',lib:'messagebox.clearPduCounters()',pro:'function clearPduCounters()',cmt:'

Clear the SMS units counters.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['MessageBox']['describe']={syn:'Returns a short text that describes unambiguously the instance of the MessageBox interface in the form `TYPE(NAME)=SERIAL.FUNCTIONID`.',lib:'messagebox.describe()',pro:'function describe()',cmt:'

Returns a short text that describes unambiguously the instance of the MessageBox interface in the form `TYPE(NAME)=SERIAL.FUNCTIONID`. More precisely, `TYPE` is the type of the function, `NAME` it the name used for the first access to the function, `SERIAL` is the serial number of the module if the module is connected or `\x22unresolved\x22`, and `FUNCTIONID` is the hardware identifier of the function if the module is connected. For example, this method returns `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1` if the module is already connected or `Relay(BadCustomeName.relay1)=unresolved` if the module has not yet been connected. This method does not trigger any USB or TCP transaction and can therefore be used in a debugger.

',ret:'a string that describes the MessageBox interface (ex: `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1`)'}; doc['MessageBox']['get_advertisedValue']={syn:'Returns the current value of the MessageBox interface (no more than 6 characters).',lib:'messagebox.get_advertisedValue()',pro:'function get_advertisedValue()',cmt:'

Returns the current value of the MessageBox interface (no more than 6 characters).

',ret:'a string corresponding to the current value of the MessageBox interface (no more than 6 characters).',ext:'On failure, throws an exception or returns `Y_ADVERTISEDVALUE_INVALID`.'}; doc['MessageBox']['get_errorMessage']={syn:'Returns the error message of the latest error with the MessageBox interface.',lib:'messagebox.get_errorMessage()',pro:'function get_errorMessage()',cmt:'

Returns the error message of the latest error with the MessageBox interface. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a string corresponding to the latest error message that occured while using the MessageBox interface object'}; doc['MessageBox']['get_errorType']={syn:'Returns the numerical error code of the latest error with the MessageBox interface.',lib:'messagebox.get_errorType()',pro:'function get_errorType()',cmt:'

Returns the numerical error code of the latest error with the MessageBox interface. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a number corresponding to the code of the latest error that occurred while using the MessageBox interface object'}; doc['MessageBox']['get_friendlyName']={syn:'Returns a global identifier of the MessageBox interface in the format `MODULE_NAME.FUNCTION_NAME`.',lib:'messagebox.get_friendlyName()',pro:'function get_friendlyName()',cmt:'

Returns a global identifier of the MessageBox interface in the format `MODULE_NAME.FUNCTION_NAME`. The returned string uses the logical names of the module and of the MessageBox interface if they are defined, otherwise the serial number of the module and the hardware identifier of the MessageBox interface (for example: `MyCustomName.relay1`)

',ret:'a string that uniquely identifies the MessageBox interface using logical names (ex: `MyCustomName.relay1`)',ext:'On failure, throws an exception or returns `Y_FRIENDLYNAME_INVALID`.'}; doc['MessageBox']['get_functionDescriptor']={syn:'Returns a unique identifier of type `YFUN_DESCR` corresponding to the function.',lib:'messagebox.get_functionDescriptor()',pro:'function get_functionDescriptor()',cmt:'

Returns a unique identifier of type `YFUN_DESCR` corresponding to the function. This identifier can be used to test if two instances of `YFunction` reference the same physical function on the same physical device.

',ret:'an identifier of type `YFUN_DESCR`.',ext:'If the function has never been contacted, the returned value is `Y_FUNCTIONDESCRIPTOR_INVALID`.'}; doc['MessageBox']['get_functionId']={syn:'Returns the hardware identifier of the MessageBox interface, without reference to the module.',lib:'messagebox.get_functionId()',pro:'function get_functionId()',cmt:'

Returns the hardware identifier of the MessageBox interface, without reference to the module. For example `relay1`

',ret:'a string that identifies the MessageBox interface (ex: `relay1`)',ext:'On failure, throws an exception or returns `Y_FUNCTIONID_INVALID`.'}; doc['MessageBox']['get_hardwareId']={syn:'Returns the unique hardware identifier of the MessageBox interface in the form `SERIAL.FUNCTIONID`.',lib:'messagebox.get_hardwareId()',pro:'function get_hardwareId()',cmt:'

Returns the unique hardware identifier of the MessageBox interface in the form `SERIAL.FUNCTIONID`. The unique hardware identifier is composed of the device serial number and of the hardware identifier of the MessageBox interface (for example `RELAYLO1-123456.relay1`).

',ret:'a string that uniquely identifies the MessageBox interface (ex: `RELAYLO1-123456.relay1`)',ext:'On failure, throws an exception or returns `Y_HARDWAREID_INVALID`.'}; doc['MessageBox']['get_logicalName']={syn:'Returns the logical name of the MessageBox interface.',lib:'messagebox.get_logicalName()',pro:'function get_logicalName()',cmt:'

Returns the logical name of the MessageBox interface.

',ret:'a string corresponding to the logical name of the MessageBox interface.',ext:'On failure, throws an exception or returns `Y_LOGICALNAME_INVALID`.'}; doc['MessageBox']['get_messages']={syn:'Returns the list of messages received and not deleted.',lib:'messagebox.get_messages()',pro:'function get_messages()',cmt:'

Returns the list of messages received and not deleted. This function will automatically decode concatenated SMS.

',ret:'an YSms object list.',ext:'On failure, throws an exception or returns an empty list.'}; doc['MessageBox']['get_module']={syn:'Gets the `YModule` object for the device on which the function is located.',lib:'messagebox.get_module()',pro:'function get_module()',cmt:'

Gets the `YModule` object for the device on which the function is located. If the function cannot be located on any module, the returned instance of `YModule` is not shown as on-line.

',ret:'an instance of `YModule`'}; doc['MessageBox']['get_module_async']={syn:'Gets the `YModule` object for the device on which the function is located (asynchronous version).',lib:'messagebox.get_module_async()',pro:'function get_module_async(callback, context)',cmt:'

Gets the `YModule` object for the device on which the function is located (asynchronous version). If the function cannot be located on any module, the returned `YModule` object does not show as on-line.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking Firefox javascript VM that does not implement context switching during blocking I/O calls. See the documentation section on asynchronous Javascript calls for more details.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the requested `YModule` object',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['MessageBox']['get_pduReceived']={syn:'Returns the number of SMS units received so far.',lib:'messagebox.get_pduReceived()',pro:'function get_pduReceived()',cmt:'

Returns the number of SMS units received so far.

',ret:'an integer corresponding to the number of SMS units received so far',ext:'On failure, throws an exception or returns `Y_PDURECEIVED_INVALID`.'}; doc['MessageBox']['get_pduSent']={syn:'Returns the number of SMS units sent so far.',lib:'messagebox.get_pduSent()',pro:'function get_pduSent()',cmt:'

Returns the number of SMS units sent so far.

',ret:'an integer corresponding to the number of SMS units sent so far',ext:'On failure, throws an exception or returns `Y_PDUSENT_INVALID`.'}; doc['MessageBox']['get_slotsCount']={syn:'Returns the total number of message storage slots on the SIM card.',lib:'messagebox.get_slotsCount()',pro:'function get_slotsCount()',cmt:'

Returns the total number of message storage slots on the SIM card.

',ret:'an integer corresponding to the total number of message storage slots on the SIM card',ext:'On failure, throws an exception or returns `Y_SLOTSCOUNT_INVALID`.'}; doc['MessageBox']['get_slotsInUse']={syn:'Returns the number of message storage slots currently in use.',lib:'messagebox.get_slotsInUse()',pro:'function get_slotsInUse()',cmt:'

Returns the number of message storage slots currently in use.

',ret:'an integer corresponding to the number of message storage slots currently in use',ext:'On failure, throws an exception or returns `Y_SLOTSINUSE_INVALID`.'}; doc['MessageBox']['get_userData']={syn:'Returns the value of the userData attribute, as previously stored using method `set_userData`.',lib:'messagebox.get_userData()',pro:'function get_userData()',cmt:'

Returns the value of the userData attribute, as previously stored using method `set_userData`. This attribute is never touched directly by the API, and is at disposal of the caller to store a context.

',ret:'the object stored previously by the caller.'}; doc['MessageBox']['isOnline']={syn:'Checks if the MessageBox interface is currently reachable, without raising any error.',lib:'messagebox.isOnline()',pro:'function isOnline()',cmt:'

Checks if the MessageBox interface is currently reachable, without raising any error. If there is a cached value for the MessageBox interface in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the MessageBox interface.

',ret:'`true` if the MessageBox interface can be reached, and `false` otherwise'}; doc['MessageBox']['isOnline_async']={syn:'Checks if the MessageBox interface is currently reachable, without raising any error (asynchronous version).',lib:'messagebox.isOnline_async()',pro:'function isOnline_async(callback, context)',cmt:'

Checks if the MessageBox interface is currently reachable, without raising any error (asynchronous version). If there is a cached value for the MessageBox interface in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the requested function.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the boolean result',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['MessageBox']['load']={syn:'Preloads the MessageBox interface cache with a specified validity duration.',lib:'messagebox.load()',pro:'function load(msValidity)',cmt:'

Preloads the MessageBox interface cache with a specified validity duration. By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network traffic for instance.

',par:{msValidity:'an integer corresponding to the validity attributed to the loaded function parameters, in milliseconds'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['MessageBox']['loadAttribute']={syn:'Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.',lib:'messagebox.loadAttribute()',pro:'function loadAttribute(attrName)',cmt:'

Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.

',par:{attrName:'the name of the requested attribute'},ret:'a string with the value of the the attribute',ext:'On failure, throws an exception or returns an empty string.'}; doc['MessageBox']['load_async']={syn:'Preloads the MessageBox interface cache with a specified validity duration (asynchronous version).',lib:'messagebox.load_async()',pro:'function load_async(msValidity, callback, context)',cmt:'

Preloads the MessageBox interface cache with a specified validity duration (asynchronous version). By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network trafic for instance.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{msValidity:'an integer corresponding to the validity of the loaded function parameters, in milliseconds',callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the error code (or `YAPI_SUCCESS`)',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['MessageBox']['muteValueCallbacks']={syn:'Disables the propagation of every new advertised value to the parent hub.',lib:'messagebox.muteValueCallbacks()',pro:'function muteValueCallbacks()',cmt:'

Disables the propagation of every new advertised value to the parent hub. You can use this function to save bandwidth and CPU on computers with limited resources, or to prevent unwanted invocations of the HTTP callback. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['MessageBox']['newMessage']={syn:'Creates a new empty SMS message, to be configured and sent later on.',lib:'messagebox.newMessage()',pro:'function newMessage(recipient)',cmt:'

Creates a new empty SMS message, to be configured and sent later on.

',par:{recipient:'a text string with the recipient phone number, either as a national number, or in international format starting with a plus sign'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['MessageBox']['nextMessageBox']={syn:'Continues the enumeration of MessageBox interfaces started using `yFirstMessageBox()`.',lib:'messagebox.nextMessageBox()',pro:'function nextMessageBox()',cmt:'

Continues the enumeration of MessageBox interfaces started using `yFirstMessageBox()`.

',ret:'a pointer to a `YMessageBox` object, corresponding to a MessageBox interface currently online, or a `null` pointer if there are no more MessageBox interfaces to enumerate.'}; doc['MessageBox']['registerValueCallback']={syn:'Registers the callback function that is invoked on every change of advertised value.',lib:'messagebox.registerValueCallback()',pro:'function registerValueCallback(callback)',cmt:'

Registers the callback function that is invoked on every change of advertised value. The callback is invoked only during the execution of `ySleep` or `yHandleEvents`. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a null pointer as argument.

',par:{callback:'the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and the character string describing the new advertised value.'}}; doc['MessageBox']['sendFlashMessage']={syn:'Sends a Flash SMS (class 0 message).',lib:'messagebox.sendFlashMessage()',pro:'function sendFlashMessage(recipient, message)',cmt:'

Sends a Flash SMS (class 0 message). Flash messages are displayed on the handset immediately and are usually not saved on the SIM card. This function can send messages of more than 160 characters, using SMS concatenation. ISO-latin accented characters are supported. For sending messages with special unicode characters such as asian characters and emoticons, use `newMessage` to create a new message and define the content of using methods `addText` et `addUnicodeData`.

',par:{recipient:'a text string with the recipient phone number, either as a national number, or in international format starting with a plus sign',message:'the text to be sent in the message'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['MessageBox']['sendTextMessage']={syn:'Sends a regular text SMS, with standard parameters.',lib:'messagebox.sendTextMessage()',pro:'function sendTextMessage(recipient, message)',cmt:'

Sends a regular text SMS, with standard parameters. This function can send messages of more than 160 characters, using SMS concatenation. ISO-latin accented characters are supported. For sending messages with special unicode characters such as asian characters and emoticons, use `newMessage` to create a new message and define the content of using methods `addText` and `addUnicodeData`.

',par:{recipient:'a text string with the recipient phone number, either as a national number, or in international format starting with a plus sign',message:'the text to be sent in the message'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['MessageBox']['set_logicalName']={syn:'Changes the logical name of the MessageBox interface.',lib:'messagebox.set_logicalName()',pro:'function set_logicalName(newval)',cmt:'

Changes the logical name of the MessageBox interface. You can use `yCheckLogicalName()` prior to this call to make sure that your parameter is valid. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',par:{newval:'a string corresponding to the logical name of the MessageBox interface.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['MessageBox']['set_pduReceived']={syn:'Changes the value of the incoming SMS units counter.',lib:'messagebox.set_pduReceived()',pro:'function set_pduReceived(newval)',cmt:'

Changes the value of the incoming SMS units counter.

',par:{newval:'an integer corresponding to the value of the incoming SMS units counter'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['MessageBox']['set_pduSent']={syn:'Changes the value of the outgoing SMS units counter.',lib:'messagebox.set_pduSent()',pro:'function set_pduSent(newval)',cmt:'

Changes the value of the outgoing SMS units counter.

',par:{newval:'an integer corresponding to the value of the outgoing SMS units counter'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['MessageBox']['set_userData']={syn:'Stores a user context provided as argument in the userData attribute of the function.',lib:'messagebox.set_userData()',pro:'function set_userData(data)',cmt:'

Stores a user context provided as argument in the userData attribute of the function. This attribute is never touched by the API, and is at disposal of the caller to store a context.

',par:{data:'any kind of object to be stored'}}; doc['MessageBox']['unmuteValueCallbacks']={syn:'Re-enables the propagation of every new advertised value to the parent hub.',lib:'messagebox.unmuteValueCallbacks()',pro:'function unmuteValueCallbacks()',cmt:'

Re-enables the propagation of every new advertised value to the parent hub. This function reverts the effect of a previous call to `muteValueCallbacks()`. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['MessageBox']['wait_async']={syn:'Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function.',lib:'messagebox.wait_async()',pro:'function wait_async(callback, context)',cmt:'

Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function. The callback function can therefore freely issue synchronous or asynchronous commands, without risking to block the Javascript VM.

',par:{callback:'callback function that is invoked when all pending commands on the module are completed. The callback function receives two arguments: the caller-specific context object and the receiving function object.',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing.'}; //--- (end of generated code: MessageBox) //--- (generated code: StepperMotor) doc['StepperMotor']={'':{syn:'StepperMotor function interface',inc:'<script type='text/javascript' src='yocto_steppermotor.js'></script>',cmt:'

The Yoctopuce application programming interface allows you to drive a stepper motor.

'}}; doc['StepperMotor']['FindStepperMotor']={syn:'Retrieves a stepper motor for a given identifier.',lib:'YStepperMotor.FindStepperMotor()',pro:'function FindStepperMotor(func)',cmt:'

Retrieves a stepper motor for a given identifier. The identifier can be specified using several formats:

- FunctionLogicalName
- ModuleSerialNumber.FunctionIdentifier
- ModuleSerialNumber.FunctionLogicalName
- ModuleLogicalName.FunctionIdentifier
- ModuleLogicalName.FunctionLogicalName

This function does not require that the stepper motor is online at the time it is invoked. The returned object is nevertheless valid. Use the method `YStepperMotor.isOnline()` to test if the stepper motor is indeed online at a given time. In case of ambiguity when looking for a stepper motor by logical name, no error is notified: the first instance found is returned. The search is performed first by hardware name, then by logical name.

If a call to this object\x27s is_online() method returns FALSE although you are certain that the matching device is plugged, make sure that you did call registerHub() at application initialization time.

',par:{func:'a string that uniquely characterizes the stepper motor'},ret:'a `YStepperMotor` object allowing you to drive the stepper motor.'}; doc['StepperMotor']['FirstStepperMotor']={syn:'Starts the enumeration of stepper motors currently accessible.',lib:'YStepperMotor.FirstStepperMotor()',pro:'function FirstStepperMotor()',cmt:'

Starts the enumeration of stepper motors currently accessible. Use the method `YStepperMotor.nextStepperMotor()` to iterate on next stepper motors.

',ret:'a pointer to a `YStepperMotor` object, corresponding to the first stepper motor currently online, or a `null` pointer if there are none.'}; doc['StepperMotor']['abortAndBrake']={syn:'Stops the motor smoothly as soon as possible, without waiting for ongoing move completion.',lib:'steppermotor.abortAndBrake()',pro:'function abortAndBrake()',cmt:'

Stops the motor smoothly as soon as possible, without waiting for ongoing move completion.

',ret:'`YAPI_SUCCESS` if the call succeeds. On failure, throws an exception or returns a negative error code.'}; doc['StepperMotor']['abortAndHiZ']={syn:'Turn the controller into Hi-Z mode immediately, without waiting for ongoing move completion.',lib:'steppermotor.abortAndHiZ()',pro:'function abortAndHiZ()',cmt:'

Turn the controller into Hi-Z mode immediately, without waiting for ongoing move completion.

',ret:'`YAPI_SUCCESS` if the call succeeds. On failure, throws an exception or returns a negative error code.'}; doc['StepperMotor']['alertStepOut']={syn:'Move one step in the direction opposite the direction set when the most recent alert was raised.',lib:'steppermotor.alertStepOut()',pro:'function alertStepOut()',cmt:'

Move one step in the direction opposite the direction set when the most recent alert was raised. The move occures even if the system is still in alert mode (end switch depressed). Caution. use this function with great care as it may cause mechanical damages !

',ret:'`YAPI_SUCCESS` if the call succeeds. On failure, throws an exception or returns a negative error code.'}; doc['StepperMotor']['changeSpeed']={syn:'Starts the motor at a given speed.',lib:'steppermotor.changeSpeed()',pro:'function changeSpeed(speed)',cmt:'

Starts the motor at a given speed. The time needed to reach the requested speed will depend on the acceleration parameters configured for the motor.

',par:{speed:'desired speed, in steps per second. The minimal non-zero speed is 0.001 pulse per second.'},ret:'`YAPI_SUCCESS` if the call succeeds. On failure, throws an exception or returns a negative error code.'}; doc['StepperMotor']['clearCache']={syn:'Invalidates the cache.',lib:'steppermotor.clearCache()',pro:'function clearCache()',cmt:'

Invalidates the cache. Invalidates the cache of the stepper motor attributes. Forces the next call to get_xxx() or loadxxx() to use values that come from the device.

'}; doc['StepperMotor']['describe']={syn:'Returns a short text that describes unambiguously the instance of the stepper motor in the form `TYPE(NAME)=SERIAL.FUNCTIONID`.',lib:'steppermotor.describe()',pro:'function describe()',cmt:'

Returns a short text that describes unambiguously the instance of the stepper motor in the form `TYPE(NAME)=SERIAL.FUNCTIONID`. More precisely, `TYPE` is the type of the function, `NAME` it the name used for the first access to the function, `SERIAL` is the serial number of the module if the module is connected or `\x22unresolved\x22`, and `FUNCTIONID` is the hardware identifier of the function if the module is connected. For example, this method returns `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1` if the module is already connected or `Relay(BadCustomeName.relay1)=unresolved` if the module has not yet been connected. This method does not trigger any USB or TCP transaction and can therefore be used in a debugger.

',ret:'a string that describes the stepper motor (ex: `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1`)'}; doc['StepperMotor']['emergencyStop']={syn:'Stops the motor with an emergency alert, without taking any additional precaution.',lib:'steppermotor.emergencyStop()',pro:'function emergencyStop()',cmt:'

Stops the motor with an emergency alert, without taking any additional precaution.

',ret:'`YAPI_SUCCESS` if the call succeeds. On failure, throws an exception or returns a negative error code.'}; doc['StepperMotor']['findHomePosition']={syn:'Starts the motor backward at the specified speed, to search for the motor home position.',lib:'steppermotor.findHomePosition()',pro:'function findHomePosition(speed)',cmt:'

Starts the motor backward at the specified speed, to search for the motor home position.

',par:{speed:'desired speed, in steps per second.'},ret:'`YAPI_SUCCESS` if the call succeeds. On failure, throws an exception or returns a negative error code.'}; doc['StepperMotor']['get_advertisedValue']={syn:'Returns the current value of the stepper motor (no more than 6 characters).',lib:'steppermotor.get_advertisedValue()',pro:'function get_advertisedValue()',cmt:'

Returns the current value of the stepper motor (no more than 6 characters).

',ret:'a string corresponding to the current value of the stepper motor (no more than 6 characters).',ext:'On failure, throws an exception or returns `Y_ADVERTISEDVALUE_INVALID`.'}; doc['StepperMotor']['get_auxSignal']={syn:'Returns the current value of the signal generated on the auxiliary output.',lib:'steppermotor.get_auxSignal()',pro:'function get_auxSignal()',cmt:'

Returns the current value of the signal generated on the auxiliary output.

',ret:'an integer corresponding to the current value of the signal generated on the auxiliary output',ext:'On failure, throws an exception or returns `Y_AUXSIGNAL_INVALID`.'}; doc['StepperMotor']['get_diags']={syn:'Returns the stepper motor controller diagnostics, as a bitmap.',lib:'steppermotor.get_diags()',pro:'function get_diags()',cmt:'

Returns the stepper motor controller diagnostics, as a bitmap.

',ret:'an integer corresponding to the stepper motor controller diagnostics, as a bitmap',ext:'On failure, throws an exception or returns `Y_DIAGS_INVALID`.'}; doc['StepperMotor']['get_errorMessage']={syn:'Returns the error message of the latest error with the stepper motor.',lib:'steppermotor.get_errorMessage()',pro:'function get_errorMessage()',cmt:'

Returns the error message of the latest error with the stepper motor. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a string corresponding to the latest error message that occured while using the stepper motor object'}; doc['StepperMotor']['get_errorType']={syn:'Returns the numerical error code of the latest error with the stepper motor.',lib:'steppermotor.get_errorType()',pro:'function get_errorType()',cmt:'

Returns the numerical error code of the latest error with the stepper motor. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a number corresponding to the code of the latest error that occurred while using the stepper motor object'}; doc['StepperMotor']['get_friendlyName']={syn:'Returns a global identifier of the stepper motor in the format `MODULE_NAME.FUNCTION_NAME`.',lib:'steppermotor.get_friendlyName()',pro:'function get_friendlyName()',cmt:'

Returns a global identifier of the stepper motor in the format `MODULE_NAME.FUNCTION_NAME`. The returned string uses the logical names of the module and of the stepper motor if they are defined, otherwise the serial number of the module and the hardware identifier of the stepper motor (for example: `MyCustomName.relay1`)

',ret:'a string that uniquely identifies the stepper motor using logical names (ex: `MyCustomName.relay1`)',ext:'On failure, throws an exception or returns `Y_FRIENDLYNAME_INVALID`.'}; doc['StepperMotor']['get_functionDescriptor']={syn:'Returns a unique identifier of type `YFUN_DESCR` corresponding to the function.',lib:'steppermotor.get_functionDescriptor()',pro:'function get_functionDescriptor()',cmt:'

Returns a unique identifier of type `YFUN_DESCR` corresponding to the function. This identifier can be used to test if two instances of `YFunction` reference the same physical function on the same physical device.

',ret:'an identifier of type `YFUN_DESCR`.',ext:'If the function has never been contacted, the returned value is `Y_FUNCTIONDESCRIPTOR_INVALID`.'}; doc['StepperMotor']['get_functionId']={syn:'Returns the hardware identifier of the stepper motor, without reference to the module.',lib:'steppermotor.get_functionId()',pro:'function get_functionId()',cmt:'

Returns the hardware identifier of the stepper motor, without reference to the module. For example `relay1`

',ret:'a string that identifies the stepper motor (ex: `relay1`)',ext:'On failure, throws an exception or returns `Y_FUNCTIONID_INVALID`.'}; doc['StepperMotor']['get_hardwareId']={syn:'Returns the unique hardware identifier of the stepper motor in the form `SERIAL.FUNCTIONID`.',lib:'steppermotor.get_hardwareId()',pro:'function get_hardwareId()',cmt:'

Returns the unique hardware identifier of the stepper motor in the form `SERIAL.FUNCTIONID`. The unique hardware identifier is composed of the device serial number and of the hardware identifier of the stepper motor (for example `RELAYLO1-123456.relay1`).

',ret:'a string that uniquely identifies the stepper motor (ex: `RELAYLO1-123456.relay1`)',ext:'On failure, throws an exception or returns `Y_HARDWAREID_INVALID`.'}; doc['StepperMotor']['get_logicalName']={syn:'Returns the logical name of the stepper motor.',lib:'steppermotor.get_logicalName()',pro:'function get_logicalName()',cmt:'

Returns the logical name of the stepper motor.

',ret:'a string corresponding to the logical name of the stepper motor.',ext:'On failure, throws an exception or returns `Y_LOGICALNAME_INVALID`.'}; doc['StepperMotor']['get_maxAccel']={syn:'Returns the maximal motor acceleration, measured in steps per second^2.',lib:'steppermotor.get_maxAccel()',pro:'function get_maxAccel()',cmt:'

Returns the maximal motor acceleration, measured in steps per second^2.

',ret:'a floating point number corresponding to the maximal motor acceleration, measured in steps per second^2',ext:'On failure, throws an exception or returns `Y_MAXACCEL_INVALID`.'}; doc['StepperMotor']['get_maxSpeed']={syn:'Returns the maximal motor speed, measured in steps per second.',lib:'steppermotor.get_maxSpeed()',pro:'function get_maxSpeed()',cmt:'

Returns the maximal motor speed, measured in steps per second.

',ret:'a floating point number corresponding to the maximal motor speed, measured in steps per second',ext:'On failure, throws an exception or returns `Y_MAXSPEED_INVALID`.'}; doc['StepperMotor']['get_module']={syn:'Gets the `YModule` object for the device on which the function is located.',lib:'steppermotor.get_module()',pro:'function get_module()',cmt:'

Gets the `YModule` object for the device on which the function is located. If the function cannot be located on any module, the returned instance of `YModule` is not shown as on-line.

',ret:'an instance of `YModule`'}; doc['StepperMotor']['get_module_async']={syn:'Gets the `YModule` object for the device on which the function is located (asynchronous version).',lib:'steppermotor.get_module_async()',pro:'function get_module_async(callback, context)',cmt:'

Gets the `YModule` object for the device on which the function is located (asynchronous version). If the function cannot be located on any module, the returned `YModule` object does not show as on-line.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking Firefox javascript VM that does not implement context switching during blocking I/O calls. See the documentation section on asynchronous Javascript calls for more details.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the requested `YModule` object',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['StepperMotor']['get_motorState']={syn:'Returns the motor working state.',lib:'steppermotor.get_motorState()',pro:'function get_motorState()',cmt:'

Returns the motor working state.

',ret:'a value among `Y_MOTORSTATE_ABSENT`, `Y_MOTORSTATE_ALERT`, `Y_MOTORSTATE_HI_Z`, `Y_MOTORSTATE_STOP`, `Y_MOTORSTATE_RUN` and `Y_MOTORSTATE_BATCH` corresponding to the motor working state',ext:'On failure, throws an exception or returns `Y_MOTORSTATE_INVALID`.'}; doc['StepperMotor']['get_overcurrent']={syn:'Returns the overcurrent alert and emergency stop threshold, measured in mA.',lib:'steppermotor.get_overcurrent()',pro:'function get_overcurrent()',cmt:'

Returns the overcurrent alert and emergency stop threshold, measured in mA.

',ret:'an integer corresponding to the overcurrent alert and emergency stop threshold, measured in mA',ext:'On failure, throws an exception or returns `Y_OVERCURRENT_INVALID`.'}; doc['StepperMotor']['get_pullinSpeed']={syn:'Returns the motor speed immediately reachable from stop state, measured in steps per second.',lib:'steppermotor.get_pullinSpeed()',pro:'function get_pullinSpeed()',cmt:'

Returns the motor speed immediately reachable from stop state, measured in steps per second.

',ret:'a floating point number corresponding to the motor speed immediately reachable from stop state, measured in steps per second',ext:'On failure, throws an exception or returns `Y_PULLINSPEED_INVALID`.'}; doc['StepperMotor']['get_speed']={syn:'Returns current motor speed, measured in steps per second.',lib:'steppermotor.get_speed()',pro:'function get_speed()',cmt:'

Returns current motor speed, measured in steps per second. To change speed, use method `changeSpeed()`.

',ret:'a floating point number corresponding to current motor speed, measured in steps per second',ext:'On failure, throws an exception or returns `Y_SPEED_INVALID`.'}; doc['StepperMotor']['get_stepPos']={syn:'Returns the current logical motor position, measured in steps.',lib:'steppermotor.get_stepPos()',pro:'function get_stepPos()',cmt:'

Returns the current logical motor position, measured in steps. The value may include a fractional part when micro-stepping is in use.

',ret:'a floating point number corresponding to the current logical motor position, measured in steps',ext:'On failure, throws an exception or returns `Y_STEPPOS_INVALID`.'}; doc['StepperMotor']['get_stepping']={syn:'Returns the stepping mode used to drive the motor.',lib:'steppermotor.get_stepping()',pro:'function get_stepping()',cmt:'

Returns the stepping mode used to drive the motor.

',ret:'a value among `Y_STEPPING_MICROSTEP16`, `Y_STEPPING_MICROSTEP8`, `Y_STEPPING_MICROSTEP4`, `Y_STEPPING_HALFSTEP` and `Y_STEPPING_FULLSTEP` corresponding to the stepping mode used to drive the motor',ext:'On failure, throws an exception or returns `Y_STEPPING_INVALID`.'}; doc['StepperMotor']['get_tCurrRun']={syn:'Returns the torque regulation current when the motor is running, measured in mA.',lib:'steppermotor.get_tCurrRun()',pro:'function get_tCurrRun()',cmt:'

Returns the torque regulation current when the motor is running, measured in mA.

',ret:'an integer corresponding to the torque regulation current when the motor is running, measured in mA',ext:'On failure, throws an exception or returns `Y_TCURRRUN_INVALID`.'}; doc['StepperMotor']['get_tCurrStop']={syn:'Returns the torque regulation current when the motor is stopped, measured in mA.',lib:'steppermotor.get_tCurrStop()',pro:'function get_tCurrStop()',cmt:'

Returns the torque regulation current when the motor is stopped, measured in mA.

',ret:'an integer corresponding to the torque regulation current when the motor is stopped, measured in mA',ext:'On failure, throws an exception or returns `Y_TCURRSTOP_INVALID`.'}; doc['StepperMotor']['get_userData']={syn:'Returns the value of the userData attribute, as previously stored using method `set_userData`.',lib:'steppermotor.get_userData()',pro:'function get_userData()',cmt:'

Returns the value of the userData attribute, as previously stored using method `set_userData`. This attribute is never touched directly by the API, and is at disposal of the caller to store a context.

',ret:'the object stored previously by the caller.'}; doc['StepperMotor']['isOnline']={syn:'Checks if the stepper motor is currently reachable, without raising any error.',lib:'steppermotor.isOnline()',pro:'function isOnline()',cmt:'

Checks if the stepper motor is currently reachable, without raising any error. If there is a cached value for the stepper motor in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the stepper motor.

',ret:'`true` if the stepper motor can be reached, and `false` otherwise'}; doc['StepperMotor']['isOnline_async']={syn:'Checks if the stepper motor is currently reachable, without raising any error (asynchronous version).',lib:'steppermotor.isOnline_async()',pro:'function isOnline_async(callback, context)',cmt:'

Checks if the stepper motor is currently reachable, without raising any error (asynchronous version). If there is a cached value for the stepper motor in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the requested function.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the boolean result',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['StepperMotor']['load']={syn:'Preloads the stepper motor cache with a specified validity duration.',lib:'steppermotor.load()',pro:'function load(msValidity)',cmt:'

Preloads the stepper motor cache with a specified validity duration. By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network traffic for instance.

',par:{msValidity:'an integer corresponding to the validity attributed to the loaded function parameters, in milliseconds'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['StepperMotor']['loadAttribute']={syn:'Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.',lib:'steppermotor.loadAttribute()',pro:'function loadAttribute(attrName)',cmt:'

Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.

',par:{attrName:'the name of the requested attribute'},ret:'a string with the value of the the attribute',ext:'On failure, throws an exception or returns an empty string.'}; doc['StepperMotor']['load_async']={syn:'Preloads the stepper motor cache with a specified validity duration (asynchronous version).',lib:'steppermotor.load_async()',pro:'function load_async(msValidity, callback, context)',cmt:'

Preloads the stepper motor cache with a specified validity duration (asynchronous version). By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network trafic for instance.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{msValidity:'an integer corresponding to the validity of the loaded function parameters, in milliseconds',callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the error code (or `YAPI_SUCCESS`)',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['StepperMotor']['moveRel']={syn:'Starts the motor to reach a given relative position.',lib:'steppermotor.moveRel()',pro:'function moveRel(relPos)',cmt:'

Starts the motor to reach a given relative position. The time needed to reach the requested position will depend on the acceleration and max speed parameters configured for the motor.

',par:{relPos:'relative position, measured in steps from the current position.'},ret:'`YAPI_SUCCESS` if the call succeeds. On failure, throws an exception or returns a negative error code.'}; doc['StepperMotor']['moveTo']={syn:'Starts the motor to reach a given absolute position.',lib:'steppermotor.moveTo()',pro:'function moveTo(absPos)',cmt:'

Starts the motor to reach a given absolute position. The time needed to reach the requested position will depend on the acceleration and max speed parameters configured for the motor.

',par:{absPos:'absolute position, measured in steps from the origin.'},ret:'`YAPI_SUCCESS` if the call succeeds. On failure, throws an exception or returns a negative error code.'}; doc['StepperMotor']['muteValueCallbacks']={syn:'Disables the propagation of every new advertised value to the parent hub.',lib:'steppermotor.muteValueCallbacks()',pro:'function muteValueCallbacks()',cmt:'

Disables the propagation of every new advertised value to the parent hub. You can use this function to save bandwidth and CPU on computers with limited resources, or to prevent unwanted invocations of the HTTP callback. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['StepperMotor']['nextStepperMotor']={syn:'Continues the enumeration of stepper motors started using `yFirstStepperMotor()`.',lib:'steppermotor.nextStepperMotor()',pro:'function nextStepperMotor()',cmt:'

Continues the enumeration of stepper motors started using `yFirstStepperMotor()`.

',ret:'a pointer to a `YStepperMotor` object, corresponding to a stepper motor currently online, or a `null` pointer if there are no more stepper motors to enumerate.'}; doc['StepperMotor']['pause']={syn:'Keep the motor in the same state for the specified amount of time, before processing next command.',lib:'steppermotor.pause()',pro:'function pause(waitMs)',cmt:'

Keep the motor in the same state for the specified amount of time, before processing next command.

',par:{waitMs:'wait time, specified in milliseconds.'},ret:'`YAPI_SUCCESS` if the call succeeds. On failure, throws an exception or returns a negative error code.'}; doc['StepperMotor']['registerValueCallback']={syn:'Registers the callback function that is invoked on every change of advertised value.',lib:'steppermotor.registerValueCallback()',pro:'function registerValueCallback(callback)',cmt:'

Registers the callback function that is invoked on every change of advertised value. The callback is invoked only during the execution of `ySleep` or `yHandleEvents`. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a null pointer as argument.

',par:{callback:'the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and the character string describing the new advertised value.'}}; doc['StepperMotor']['reset']={syn:'Reinitialize the controller and clear all alert flags.',lib:'steppermotor.reset()',pro:'function reset()',cmt:'

Reinitialize the controller and clear all alert flags.

',ret:'`YAPI_SUCCESS` if the call succeeds. On failure, throws an exception or returns a negative error code.'}; doc['StepperMotor']['set_auxSignal']={syn:'Changes the value of the signal generated on the auxiliary output.',lib:'steppermotor.set_auxSignal()',pro:'function set_auxSignal(newval)',cmt:'

Changes the value of the signal generated on the auxiliary output. Acceptable values depend on the auxiliary output signal type configured.

',par:{newval:'an integer corresponding to the value of the signal generated on the auxiliary output'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['StepperMotor']['set_logicalName']={syn:'Changes the logical name of the stepper motor.',lib:'steppermotor.set_logicalName()',pro:'function set_logicalName(newval)',cmt:'

Changes the logical name of the stepper motor. You can use `yCheckLogicalName()` prior to this call to make sure that your parameter is valid. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',par:{newval:'a string corresponding to the logical name of the stepper motor.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['StepperMotor']['set_maxAccel']={syn:'Changes the maximal motor acceleration, measured in steps per second^2.',lib:'steppermotor.set_maxAccel()',pro:'function set_maxAccel(newval)',cmt:'

Changes the maximal motor acceleration, measured in steps per second^2.

',par:{newval:'a floating point number corresponding to the maximal motor acceleration, measured in steps per second^2'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['StepperMotor']['set_maxSpeed']={syn:'Changes the maximal motor speed, measured in steps per second.',lib:'steppermotor.set_maxSpeed()',pro:'function set_maxSpeed(newval)',cmt:'

Changes the maximal motor speed, measured in steps per second.

',par:{newval:'a floating point number corresponding to the maximal motor speed, measured in steps per second'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['StepperMotor']['set_overcurrent']={syn:'Changes the overcurrent alert and emergency stop threshold, measured in mA.',lib:'steppermotor.set_overcurrent()',pro:'function set_overcurrent(newval)',cmt:'

Changes the overcurrent alert and emergency stop threshold, measured in mA.

',par:{newval:'an integer corresponding to the overcurrent alert and emergency stop threshold, measured in mA'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['StepperMotor']['set_pullinSpeed']={syn:'Changes the motor speed immediately reachable from stop state, measured in steps per second.',lib:'steppermotor.set_pullinSpeed()',pro:'function set_pullinSpeed(newval)',cmt:'

Changes the motor speed immediately reachable from stop state, measured in steps per second.

',par:{newval:'a floating point number corresponding to the motor speed immediately reachable from stop state, measured in steps per second'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['StepperMotor']['set_stepPos']={syn:'Changes the current logical motor position, measured in steps.',lib:'steppermotor.set_stepPos()',pro:'function set_stepPos(newval)',cmt:'

Changes the current logical motor position, measured in steps. This command does not cause any motor move, as its purpose is only to setup the origin of the position counter. The fractional part of the position, that corresponds to the physical position of the rotor, is not changed. To trigger a motor move, use methods `moveTo()` or `moveRel()` instead.

',par:{newval:'a floating point number corresponding to the current logical motor position, measured in steps'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['StepperMotor']['set_stepping']={syn:'Changes the stepping mode used to drive the motor.',lib:'steppermotor.set_stepping()',pro:'function set_stepping(newval)',cmt:'

Changes the stepping mode used to drive the motor.

',par:{newval:'a value among `Y_STEPPING_MICROSTEP16`, `Y_STEPPING_MICROSTEP8`, `Y_STEPPING_MICROSTEP4`, `Y_STEPPING_HALFSTEP` and `Y_STEPPING_FULLSTEP` corresponding to the stepping mode used to drive the motor'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['StepperMotor']['set_tCurrRun']={syn:'Changes the torque regulation current when the motor is running, measured in mA.',lib:'steppermotor.set_tCurrRun()',pro:'function set_tCurrRun(newval)',cmt:'

Changes the torque regulation current when the motor is running, measured in mA.

',par:{newval:'an integer corresponding to the torque regulation current when the motor is running, measured in mA'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['StepperMotor']['set_tCurrStop']={syn:'Changes the torque regulation current when the motor is stopped, measured in mA.',lib:'steppermotor.set_tCurrStop()',pro:'function set_tCurrStop(newval)',cmt:'

Changes the torque regulation current when the motor is stopped, measured in mA.

',par:{newval:'an integer corresponding to the torque regulation current when the motor is stopped, measured in mA'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['StepperMotor']['set_userData']={syn:'Stores a user context provided as argument in the userData attribute of the function.',lib:'steppermotor.set_userData()',pro:'function set_userData(data)',cmt:'

Stores a user context provided as argument in the userData attribute of the function. This attribute is never touched by the API, and is at disposal of the caller to store a context.

',par:{data:'any kind of object to be stored'}}; doc['StepperMotor']['unmuteValueCallbacks']={syn:'Re-enables the propagation of every new advertised value to the parent hub.',lib:'steppermotor.unmuteValueCallbacks()',pro:'function unmuteValueCallbacks()',cmt:'

Re-enables the propagation of every new advertised value to the parent hub. This function reverts the effect of a previous call to `muteValueCallbacks()`. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['StepperMotor']['wait_async']={syn:'Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function.',lib:'steppermotor.wait_async()',pro:'function wait_async(callback, context)',cmt:'

Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function. The callback function can therefore freely issue synchronous or asynchronous commands, without risking to block the Javascript VM.

',par:{callback:'callback function that is invoked when all pending commands on the module are completed. The callback function receives two arguments: the caller-specific context object and the receiving function object.',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing.'}; //--- (end of generated code: StepperMotor) //--- (generated code: Proximity) doc['Proximity']={'':{syn:'Proximity function interface',inc:'<script type='text/javascript' src='yocto_proximity.js'></script>',cmt:'

The Yoctopuce class YProximity allows you to use and configure Yoctopuce proximity sensors. It inherits from the YSensor class the core functions to read measurements, to register callback functions, to access the autonomous datalogger. This class adds the ability to easily perform a one-point linear calibration to compensate the effect of a glass or filter placed in front of the sensor.

'}}; doc['Proximity']['FindProximity']={syn:'Retrieves a proximity sensor for a given identifier.',lib:'YProximity.FindProximity()',pro:'function FindProximity(func)',cmt:'

Retrieves a proximity sensor for a given identifier. The identifier can be specified using several formats:

- FunctionLogicalName
- ModuleSerialNumber.FunctionIdentifier
- ModuleSerialNumber.FunctionLogicalName
- ModuleLogicalName.FunctionIdentifier
- ModuleLogicalName.FunctionLogicalName

This function does not require that the proximity sensor is online at the time it is invoked. The returned object is nevertheless valid. Use the method `YProximity.isOnline()` to test if the proximity sensor is indeed online at a given time. In case of ambiguity when looking for a proximity sensor by logical name, no error is notified: the first instance found is returned. The search is performed first by hardware name, then by logical name.

If a call to this object\x27s is_online() method returns FALSE although you are certain that the matching device is plugged, make sure that you did call registerHub() at application initialization time.

',par:{func:'a string that uniquely characterizes the proximity sensor'},ret:'a `YProximity` object allowing you to drive the proximity sensor.'}; doc['Proximity']['FirstProximity']={syn:'Starts the enumeration of proximity sensors currently accessible.',lib:'YProximity.FirstProximity()',pro:'function FirstProximity()',cmt:'

Starts the enumeration of proximity sensors currently accessible. Use the method `YProximity.nextProximity()` to iterate on next proximity sensors.

',ret:'a pointer to a `YProximity` object, corresponding to the first proximity sensor currently online, or a `null` pointer if there are none.'}; doc['Proximity']['calibrateFromPoints']={syn:'Configures error correction data points, in particular to compensate for a possible perturbation of the measure caused by an enclosure.',lib:'proximity.calibrateFromPoints()',pro:'function calibrateFromPoints(rawValues, refValues)',cmt:'

Configures error correction data points, in particular to compensate for a possible perturbation of the measure caused by an enclosure. It is possible to configure up to five correction points. Correction points must be provided in ascending order, and be in the range of the sensor. The device will automatically perform a linear interpolation of the error correction between specified points. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

For more information on advanced capabilities to refine the calibration of sensors, please contact support@yoctopuce.com.

',par:{rawValues:'array of floating point numbers, corresponding to the raw values returned by the sensor for the correction points.',refValues:'array of floating point numbers, corresponding to the corrected values for the correction points.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Proximity']['clearCache']={syn:'Invalidates the cache.',lib:'proximity.clearCache()',pro:'function clearCache()',cmt:'

Invalidates the cache. Invalidates the cache of the proximity sensor attributes. Forces the next call to get_xxx() or loadxxx() to use values that come from the device.

'}; doc['Proximity']['describe']={syn:'Returns a short text that describes unambiguously the instance of the proximity sensor in the form `TYPE(NAME)=SERIAL.FUNCTIONID`.',lib:'proximity.describe()',pro:'function describe()',cmt:'

Returns a short text that describes unambiguously the instance of the proximity sensor in the form `TYPE(NAME)=SERIAL.FUNCTIONID`. More precisely, `TYPE` is the type of the function, `NAME` it the name used for the first access to the function, `SERIAL` is the serial number of the module if the module is connected or `\x22unresolved\x22`, and `FUNCTIONID` is the hardware identifier of the function if the module is connected. For example, this method returns `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1` if the module is already connected or `Relay(BadCustomeName.relay1)=unresolved` if the module has not yet been connected. This method does not trigger any USB or TCP transaction and can therefore be used in a debugger.

',ret:'a string that describes the proximity sensor (ex: `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1`)'}; doc['Proximity']['get_advMode']={syn:'Returns the measuring mode used for the advertised value pushed to the parent hub.',lib:'proximity.get_advMode()',pro:'function get_advMode()',cmt:'

Returns the measuring mode used for the advertised value pushed to the parent hub.

',ret:'a value among `Y_ADVMODE_IMMEDIATE`, `Y_ADVMODE_PERIOD_AVG`, `Y_ADVMODE_PERIOD_MIN` and `Y_ADVMODE_PERIOD_MAX` corresponding to the measuring mode used for the advertised value pushed to the parent hub',ext:'On failure, throws an exception or returns `Y_ADVMODE_INVALID`.'}; doc['Proximity']['get_advertisedValue']={syn:'Returns the current value of the proximity sensor (no more than 6 characters).',lib:'proximity.get_advertisedValue()',pro:'function get_advertisedValue()',cmt:'

Returns the current value of the proximity sensor (no more than 6 characters).

',ret:'a string corresponding to the current value of the proximity sensor (no more than 6 characters).',ext:'On failure, throws an exception or returns `Y_ADVERTISEDVALUE_INVALID`.'}; doc['Proximity']['get_currentRawValue']={syn:'Returns the uncalibrated, unrounded raw value returned by the sensor, in the specified unit, as a floating point number.',lib:'proximity.get_currentRawValue()',pro:'function get_currentRawValue()',cmt:'

Returns the uncalibrated, unrounded raw value returned by the sensor, in the specified unit, as a floating point number.

',ret:'a floating point number corresponding to the uncalibrated, unrounded raw value returned by the sensor, in the specified unit, as a floating point number',ext:'On failure, throws an exception or returns `Y_CURRENTRAWVALUE_INVALID`.'}; doc['Proximity']['get_currentValue']={syn:'Returns the current value of the proximity detection, in the specified unit, as a floating point number.',lib:'proximity.get_currentValue()',pro:'function get_currentValue()',cmt:'

Returns the current value of the proximity detection, in the specified unit, as a floating point number.

',ret:'a floating point number corresponding to the current value of the proximity detection, in the specified unit, as a floating point number',ext:'On failure, throws an exception or returns `Y_CURRENTVALUE_INVALID`.'}; doc['Proximity']['get_dataLogger']={syn:'Returns the YDatalogger object of the device hosting the sensor.',lib:'proximity.get_dataLogger()',pro:'function get_dataLogger()',cmt:'

Returns the YDatalogger object of the device hosting the sensor. This method returns an object of class YDatalogger that can control global parameters of the data logger. The returned object should not be freed.

',ret:'an YDataLogger object or null on error.'}; doc['Proximity']['get_detectionThreshold']={syn:'Returns the threshold used to determine the logical state of the proximity sensor, when considered as a binary input (on/off).',lib:'proximity.get_detectionThreshold()',pro:'function get_detectionThreshold()',cmt:'

Returns the threshold used to determine the logical state of the proximity sensor, when considered as a binary input (on/off).

',ret:'an integer corresponding to the threshold used to determine the logical state of the proximity sensor, when considered as a binary input (on/off)',ext:'On failure, throws an exception or returns `Y_DETECTIONTHRESHOLD_INVALID`.'}; doc['Proximity']['get_errorMessage']={syn:'Returns the error message of the latest error with the proximity sensor.',lib:'proximity.get_errorMessage()',pro:'function get_errorMessage()',cmt:'

Returns the error message of the latest error with the proximity sensor. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a string corresponding to the latest error message that occured while using the proximity sensor object'}; doc['Proximity']['get_errorType']={syn:'Returns the numerical error code of the latest error with the proximity sensor.',lib:'proximity.get_errorType()',pro:'function get_errorType()',cmt:'

Returns the numerical error code of the latest error with the proximity sensor. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a number corresponding to the code of the latest error that occurred while using the proximity sensor object'}; doc['Proximity']['get_friendlyName']={syn:'Returns a global identifier of the proximity sensor in the format `MODULE_NAME.FUNCTION_NAME`.',lib:'proximity.get_friendlyName()',pro:'function get_friendlyName()',cmt:'

Returns a global identifier of the proximity sensor in the format `MODULE_NAME.FUNCTION_NAME`. The returned string uses the logical names of the module and of the proximity sensor if they are defined, otherwise the serial number of the module and the hardware identifier of the proximity sensor (for example: `MyCustomName.relay1`)

',ret:'a string that uniquely identifies the proximity sensor using logical names (ex: `MyCustomName.relay1`)',ext:'On failure, throws an exception or returns `Y_FRIENDLYNAME_INVALID`.'}; doc['Proximity']['get_functionDescriptor']={syn:'Returns a unique identifier of type `YFUN_DESCR` corresponding to the function.',lib:'proximity.get_functionDescriptor()',pro:'function get_functionDescriptor()',cmt:'

Returns a unique identifier of type `YFUN_DESCR` corresponding to the function. This identifier can be used to test if two instances of `YFunction` reference the same physical function on the same physical device.

',ret:'an identifier of type `YFUN_DESCR`.',ext:'If the function has never been contacted, the returned value is `Y_FUNCTIONDESCRIPTOR_INVALID`.'}; doc['Proximity']['get_functionId']={syn:'Returns the hardware identifier of the proximity sensor, without reference to the module.',lib:'proximity.get_functionId()',pro:'function get_functionId()',cmt:'

Returns the hardware identifier of the proximity sensor, without reference to the module. For example `relay1`

',ret:'a string that identifies the proximity sensor (ex: `relay1`)',ext:'On failure, throws an exception or returns `Y_FUNCTIONID_INVALID`.'}; doc['Proximity']['get_hardwareId']={syn:'Returns the unique hardware identifier of the proximity sensor in the form `SERIAL.FUNCTIONID`.',lib:'proximity.get_hardwareId()',pro:'function get_hardwareId()',cmt:'

Returns the unique hardware identifier of the proximity sensor in the form `SERIAL.FUNCTIONID`. The unique hardware identifier is composed of the device serial number and of the hardware identifier of the proximity sensor (for example `RELAYLO1-123456.relay1`).

',ret:'a string that uniquely identifies the proximity sensor (ex: `RELAYLO1-123456.relay1`)',ext:'On failure, throws an exception or returns `Y_HARDWAREID_INVALID`.'}; doc['Proximity']['get_highestValue']={syn:'Returns the maximal value observed for the proximity detection since the device was started.',lib:'proximity.get_highestValue()',pro:'function get_highestValue()',cmt:'

Returns the maximal value observed for the proximity detection since the device was started. Can be reset to an arbitrary value thanks to set_highestValue().

',ret:'a floating point number corresponding to the maximal value observed for the proximity detection since the device was started',ext:'On failure, throws an exception or returns `Y_HIGHESTVALUE_INVALID`.'}; doc['Proximity']['get_isPresent']={syn:'Returns true if the input (considered as binary) is active (detection value is smaller than the specified `threshold`), and false otherwise.',lib:'proximity.get_isPresent()',pro:'function get_isPresent()',cmt:'

Returns true if the input (considered as binary) is active (detection value is smaller than the specified `threshold`), and false otherwise.

',ret:'either `Y_ISPRESENT_FALSE` or `Y_ISPRESENT_TRUE`, according to true if the input (considered as binary) is active (detection value is smaller than the specified `threshold`), and false otherwise',ext:'On failure, throws an exception or returns `Y_ISPRESENT_INVALID`.'}; doc['Proximity']['get_lastTimeApproached']={syn:'Returns the number of elapsed milliseconds between the module power on and the last observed detection (the input contact transitioned from absent to present).',lib:'proximity.get_lastTimeApproached()',pro:'function get_lastTimeApproached()',cmt:'

Returns the number of elapsed milliseconds between the module power on and the last observed detection (the input contact transitioned from absent to present).

',ret:'an integer corresponding to the number of elapsed milliseconds between the module power on and the last observed detection (the input contact transitioned from absent to present)',ext:'On failure, throws an exception or returns `Y_LASTTIMEAPPROACHED_INVALID`.'}; doc['Proximity']['get_lastTimeRemoved']={syn:'Returns the number of elapsed milliseconds between the module power on and the last observed detection (the input contact transitioned from present to absent).',lib:'proximity.get_lastTimeRemoved()',pro:'function get_lastTimeRemoved()',cmt:'

Returns the number of elapsed milliseconds between the module power on and the last observed detection (the input contact transitioned from present to absent).

',ret:'an integer corresponding to the number of elapsed milliseconds between the module power on and the last observed detection (the input contact transitioned from present to absent)',ext:'On failure, throws an exception or returns `Y_LASTTIMEREMOVED_INVALID`.'}; doc['Proximity']['get_logFrequency']={syn:'Returns the datalogger recording frequency for this function, or \x22OFF\x22 when measures are not stored in the data logger flash memory.',lib:'proximity.get_logFrequency()',pro:'function get_logFrequency()',cmt:'

Returns the datalogger recording frequency for this function, or \x22OFF\x22 when measures are not stored in the data logger flash memory.

',ret:'a string corresponding to the datalogger recording frequency for this function, or \x22OFF\x22 when measures are not stored in the data logger flash memory',ext:'On failure, throws an exception or returns `Y_LOGFREQUENCY_INVALID`.'}; doc['Proximity']['get_logicalName']={syn:'Returns the logical name of the proximity sensor.',lib:'proximity.get_logicalName()',pro:'function get_logicalName()',cmt:'

Returns the logical name of the proximity sensor.

',ret:'a string corresponding to the logical name of the proximity sensor.',ext:'On failure, throws an exception or returns `Y_LOGICALNAME_INVALID`.'}; doc['Proximity']['get_lowestValue']={syn:'Returns the minimal value observed for the proximity detection since the device was started.',lib:'proximity.get_lowestValue()',pro:'function get_lowestValue()',cmt:'

Returns the minimal value observed for the proximity detection since the device was started. Can be reset to an arbitrary value thanks to set_lowestValue().

',ret:'a floating point number corresponding to the minimal value observed for the proximity detection since the device was started',ext:'On failure, throws an exception or returns `Y_LOWESTVALUE_INVALID`.'}; doc['Proximity']['get_module']={syn:'Gets the `YModule` object for the device on which the function is located.',lib:'proximity.get_module()',pro:'function get_module()',cmt:'

Gets the `YModule` object for the device on which the function is located. If the function cannot be located on any module, the returned instance of `YModule` is not shown as on-line.

',ret:'an instance of `YModule`'}; doc['Proximity']['get_module_async']={syn:'Gets the `YModule` object for the device on which the function is located (asynchronous version).',lib:'proximity.get_module_async()',pro:'function get_module_async(callback, context)',cmt:'

Gets the `YModule` object for the device on which the function is located (asynchronous version). If the function cannot be located on any module, the returned `YModule` object does not show as on-line.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking Firefox javascript VM that does not implement context switching during blocking I/O calls. See the documentation section on asynchronous Javascript calls for more details.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the requested `YModule` object',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['Proximity']['get_proximityReportMode']={syn:'Returns the parameter (sensor value, presence or pulse count) returned by the get_currentValue function and callbacks.',lib:'proximity.get_proximityReportMode()',pro:'function get_proximityReportMode()',cmt:'

Returns the parameter (sensor value, presence or pulse count) returned by the get_currentValue function and callbacks.

',ret:'a value among `Y_PROXIMITYREPORTMODE_NUMERIC`, `Y_PROXIMITYREPORTMODE_PRESENCE` and `Y_PROXIMITYREPORTMODE_PULSECOUNT` corresponding to the parameter (sensor value, presence or pulse count) returned by the get_currentValue function and callbacks',ext:'On failure, throws an exception or returns `Y_PROXIMITYREPORTMODE_INVALID`.'}; doc['Proximity']['get_pulseCounter']={syn:'Returns the pulse counter value.',lib:'proximity.get_pulseCounter()',pro:'function get_pulseCounter()',cmt:'

Returns the pulse counter value. The value is a 32 bit integer. In case of overflow (>=2^32), the counter will wrap. To reset the counter, just \x09 call the resetCounter() method.

',ret:'an integer corresponding to the pulse counter value',ext:'On failure, throws an exception or returns `Y_PULSECOUNTER_INVALID`.'}; doc['Proximity']['get_pulseTimer']={syn:'Returns the timer of the pulse counter (ms).',lib:'proximity.get_pulseTimer()',pro:'function get_pulseTimer()',cmt:'

Returns the timer of the pulse counter (ms).

',ret:'an integer corresponding to the timer of the pulse counter (ms)',ext:'On failure, throws an exception or returns `Y_PULSETIMER_INVALID`.'}; doc['Proximity']['get_recordedData']={syn:'Retrieves a DataSet object holding historical data for this sensor, for a specified time interval.',lib:'proximity.get_recordedData()',pro:'function get_recordedData(startTime, endTime)',cmt:'

Retrieves a DataSet object holding historical data for this sensor, for a specified time interval. The measures will be retrieved from the data logger, which must have been turned on at the desired time. See the documentation of the DataSet class for information on how to get an overview of the recorded data, and how to load progressively a large set of measures from the data logger.

This function only works if the device uses a recent firmware, as DataSet objects are not supported by firmwares older than version 13000.

',par:{startTime:'the start of the desired measure time interval, as a Unix timestamp, i.e. the number of seconds since January 1, 1970 UTC. The special value 0 can be used to include any meaasure, without initial limit.',endTime:'the end of the desired measure time interval, as a Unix timestamp, i.e. the number of seconds since January 1, 1970 UTC. The special value 0 can be used to include any meaasure, without ending limit.'},ret:'an instance of YDataSet, providing access to historical data. Past measures can be loaded progressively using methods from the YDataSet object.'}; doc['Proximity']['get_reportFrequency']={syn:'Returns the timed value notification frequency, or \x22OFF\x22 if timed value notifications are disabled for this function.',lib:'proximity.get_reportFrequency()',pro:'function get_reportFrequency()',cmt:'

Returns the timed value notification frequency, or \x22OFF\x22 if timed value notifications are disabled for this function.

',ret:'a string corresponding to the timed value notification frequency, or \x22OFF\x22 if timed value notifications are disabled for this function',ext:'On failure, throws an exception or returns `Y_REPORTFREQUENCY_INVALID`.'}; doc['Proximity']['get_resolution']={syn:'Returns the resolution of the measured values.',lib:'proximity.get_resolution()',pro:'function get_resolution()',cmt:'

Returns the resolution of the measured values. The resolution corresponds to the numerical precision of the measures, which is not always the same as the actual precision of the sensor.

',ret:'a floating point number corresponding to the resolution of the measured values',ext:'On failure, throws an exception or returns `Y_RESOLUTION_INVALID`.'}; doc['Proximity']['get_sensorState']={syn:'Returns the sensor health state code, which is zero when there is an up-to-date measure available or a positive code if the sensor is not able to provide a measure right now.',lib:'proximity.get_sensorState()',pro:'function get_sensorState()',cmt:'

Returns the sensor health state code, which is zero when there is an up-to-date measure available or a positive code if the sensor is not able to provide a measure right now.

',ret:'an integer corresponding to the sensor health state code, which is zero when there is an up-to-date measure available or a positive code if the sensor is not able to provide a measure right now',ext:'On failure, throws an exception or returns `Y_SENSORSTATE_INVALID`.'}; doc['Proximity']['get_signalValue']={syn:'Returns the current value of signal measured by the proximity sensor.',lib:'proximity.get_signalValue()',pro:'function get_signalValue()',cmt:'

Returns the current value of signal measured by the proximity sensor.

',ret:'a floating point number corresponding to the current value of signal measured by the proximity sensor',ext:'On failure, throws an exception or returns `Y_SIGNALVALUE_INVALID`.'}; doc['Proximity']['get_unit']={syn:'Returns the measuring unit for the proximity detection.',lib:'proximity.get_unit()',pro:'function get_unit()',cmt:'

Returns the measuring unit for the proximity detection.

',ret:'a string corresponding to the measuring unit for the proximity detection',ext:'On failure, throws an exception or returns `Y_UNIT_INVALID`.'}; doc['Proximity']['get_userData']={syn:'Returns the value of the userData attribute, as previously stored using method `set_userData`.',lib:'proximity.get_userData()',pro:'function get_userData()',cmt:'

Returns the value of the userData attribute, as previously stored using method `set_userData`. This attribute is never touched directly by the API, and is at disposal of the caller to store a context.

',ret:'the object stored previously by the caller.'}; doc['Proximity']['isOnline']={syn:'Checks if the proximity sensor is currently reachable, without raising any error.',lib:'proximity.isOnline()',pro:'function isOnline()',cmt:'

Checks if the proximity sensor is currently reachable, without raising any error. If there is a cached value for the proximity sensor in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the proximity sensor.

',ret:'`true` if the proximity sensor can be reached, and `false` otherwise'}; doc['Proximity']['isOnline_async']={syn:'Checks if the proximity sensor is currently reachable, without raising any error (asynchronous version).',lib:'proximity.isOnline_async()',pro:'function isOnline_async(callback, context)',cmt:'

Checks if the proximity sensor is currently reachable, without raising any error (asynchronous version). If there is a cached value for the proximity sensor in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the requested function.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the boolean result',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['Proximity']['load']={syn:'Preloads the proximity sensor cache with a specified validity duration.',lib:'proximity.load()',pro:'function load(msValidity)',cmt:'

Preloads the proximity sensor cache with a specified validity duration. By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network traffic for instance.

',par:{msValidity:'an integer corresponding to the validity attributed to the loaded function parameters, in milliseconds'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Proximity']['loadAttribute']={syn:'Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.',lib:'proximity.loadAttribute()',pro:'function loadAttribute(attrName)',cmt:'

Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.

',par:{attrName:'the name of the requested attribute'},ret:'a string with the value of the the attribute',ext:'On failure, throws an exception or returns an empty string.'}; doc['Proximity']['loadCalibrationPoints']={syn:'Retrieves error correction data points previously entered using the method `calibrateFromPoints`.',lib:'proximity.loadCalibrationPoints()',pro:'function loadCalibrationPoints(rawValues, refValues)',cmt:'

Retrieves error correction data points previously entered using the method `calibrateFromPoints`.

',par:{rawValues:'array of floating point numbers, that will be filled by the function with the raw sensor values for the correction points.',refValues:'array of floating point numbers, that will be filled by the function with the desired values for the correction points.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Proximity']['load_async']={syn:'Preloads the proximity sensor cache with a specified validity duration (asynchronous version).',lib:'proximity.load_async()',pro:'function load_async(msValidity, callback, context)',cmt:'

Preloads the proximity sensor cache with a specified validity duration (asynchronous version). By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network trafic for instance.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{msValidity:'an integer corresponding to the validity of the loaded function parameters, in milliseconds',callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the error code (or `YAPI_SUCCESS`)',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['Proximity']['muteValueCallbacks']={syn:'Disables the propagation of every new advertised value to the parent hub.',lib:'proximity.muteValueCallbacks()',pro:'function muteValueCallbacks()',cmt:'

Disables the propagation of every new advertised value to the parent hub. You can use this function to save bandwidth and CPU on computers with limited resources, or to prevent unwanted invocations of the HTTP callback. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Proximity']['nextProximity']={syn:'Continues the enumeration of proximity sensors started using `yFirstProximity()`.',lib:'proximity.nextProximity()',pro:'function nextProximity()',cmt:'

Continues the enumeration of proximity sensors started using `yFirstProximity()`.

',ret:'a pointer to a `YProximity` object, corresponding to a proximity sensor currently online, or a `null` pointer if there are no more proximity sensors to enumerate.'}; doc['Proximity']['registerTimedReportCallback']={syn:'Registers the callback function that is invoked on every periodic timed notification.',lib:'proximity.registerTimedReportCallback()',pro:'function registerTimedReportCallback(callback)',cmt:'

Registers the callback function that is invoked on every periodic timed notification. The callback is invoked only during the execution of `ySleep` or `yHandleEvents`. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a null pointer as argument.

',par:{callback:'the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and an YMeasure object describing the new advertised value.'}}; doc['Proximity']['registerValueCallback']={syn:'Registers the callback function that is invoked on every change of advertised value.',lib:'proximity.registerValueCallback()',pro:'function registerValueCallback(callback)',cmt:'

Registers the callback function that is invoked on every change of advertised value. The callback is invoked only during the execution of `ySleep` or `yHandleEvents`. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a null pointer as argument.

',par:{callback:'the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and the character string describing the new advertised value.'}}; doc['Proximity']['resetCounter']={syn:'Resets the pulse counter value as well as its timer.',lib:'proximity.resetCounter()',pro:'function resetCounter()',cmt:'

Resets the pulse counter value as well as its timer.

',ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Proximity']['set_advMode']={syn:'Changes the measuring mode used for the advertised value pushed to the parent hub.',lib:'proximity.set_advMode()',pro:'function set_advMode(newval)',cmt:'

Changes the measuring mode used for the advertised value pushed to the parent hub.

',par:{newval:'a value among `Y_ADVMODE_IMMEDIATE`, `Y_ADVMODE_PERIOD_AVG`, `Y_ADVMODE_PERIOD_MIN` and `Y_ADVMODE_PERIOD_MAX` corresponding to the measuring mode used for the advertised value pushed to the parent hub'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Proximity']['set_detectionThreshold']={syn:'Changes the threshold used to determine the logical state of the proximity sensor, when considered as a binary input (on/off).',lib:'proximity.set_detectionThreshold()',pro:'function set_detectionThreshold(newval)',cmt:'

Changes the threshold used to determine the logical state of the proximity sensor, when considered as a binary input (on/off).

',par:{newval:'an integer corresponding to the threshold used to determine the logical state of the proximity sensor, when considered as a binary input (on/off)'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Proximity']['set_highestValue']={syn:'Changes the recorded maximal value observed.',lib:'proximity.set_highestValue()',pro:'function set_highestValue(newval)',cmt:'

Changes the recorded maximal value observed. Can be used to reset the value returned by get_lowestValue().

',par:{newval:'a floating point number corresponding to the recorded maximal value observed'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Proximity']['set_logFrequency']={syn:'Changes the datalogger recording frequency for this function.',lib:'proximity.set_logFrequency()',pro:'function set_logFrequency(newval)',cmt:'

Changes the datalogger recording frequency for this function. The frequency can be specified as samples per second, as sample per minute (for instance \x2215/m\x22) or in samples per hour (eg. \x224/h\x22). To disable recording for this function, use the value \x22OFF\x22.

',par:{newval:'a string corresponding to the datalogger recording frequency for this function'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Proximity']['set_logicalName']={syn:'Changes the logical name of the proximity sensor.',lib:'proximity.set_logicalName()',pro:'function set_logicalName(newval)',cmt:'

Changes the logical name of the proximity sensor. You can use `yCheckLogicalName()` prior to this call to make sure that your parameter is valid. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',par:{newval:'a string corresponding to the logical name of the proximity sensor.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Proximity']['set_lowestValue']={syn:'Changes the recorded minimal value observed.',lib:'proximity.set_lowestValue()',pro:'function set_lowestValue(newval)',cmt:'

Changes the recorded minimal value observed. Can be used to reset the value returned by get_lowestValue().

',par:{newval:'a floating point number corresponding to the recorded minimal value observed'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Proximity']['set_proximityReportMode']={syn:'Changes the parameter type (sensor value, presence or pulse count) returned by the get_currentValue function and callbacks.',lib:'proximity.set_proximityReportMode()',pro:'function set_proximityReportMode(newval)',cmt:'

Changes the parameter type (sensor value, presence or pulse count) returned by the get_currentValue function and callbacks. The edge count value is limited to the 6 lowest digits. For values greater than one million, use get_pulseCounter().

',par:{newval:'a value among `Y_PROXIMITYREPORTMODE_NUMERIC`, `Y_PROXIMITYREPORTMODE_PRESENCE` and `Y_PROXIMITYREPORTMODE_PULSECOUNT` corresponding to the parameter type (sensor value, presence or pulse count) returned by the get_currentValue function and callbacks'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Proximity']['set_reportFrequency']={syn:'Changes the timed value notification frequency for this function.',lib:'proximity.set_reportFrequency()',pro:'function set_reportFrequency(newval)',cmt:'

Changes the timed value notification frequency for this function. The frequency can be specified as samples per second, as sample per minute (for instance \x2215/m\x22) or in samples per hour (eg. \x224/h\x22). To disable timed value notifications for this function, use the value \x22OFF\x22.

',par:{newval:'a string corresponding to the timed value notification frequency for this function'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Proximity']['set_resolution']={syn:'Changes the resolution of the measured physical values.',lib:'proximity.set_resolution()',pro:'function set_resolution(newval)',cmt:'

Changes the resolution of the measured physical values. The resolution corresponds to the numerical precision when displaying value. It does not change the precision of the measure itself.

',par:{newval:'a floating point number corresponding to the resolution of the measured physical values'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Proximity']['set_userData']={syn:'Stores a user context provided as argument in the userData attribute of the function.',lib:'proximity.set_userData()',pro:'function set_userData(data)',cmt:'

Stores a user context provided as argument in the userData attribute of the function. This attribute is never touched by the API, and is at disposal of the caller to store a context.

',par:{data:'any kind of object to be stored'}}; doc['Proximity']['startDataLogger']={syn:'Starts the data logger on the device.',lib:'proximity.startDataLogger()',pro:'function startDataLogger()',cmt:'

Starts the data logger on the device. Note that the data logger will only save the measures on this sensor if the logFrequency is not set to \x22OFF\x22.

',ret:'`YAPI_SUCCESS` if the call succeeds.'}; doc['Proximity']['stopDataLogger']={syn:'Stops the datalogger on the device.',lib:'proximity.stopDataLogger()',pro:'function stopDataLogger()',cmt:'

Stops the datalogger on the device.

',ret:'`YAPI_SUCCESS` if the call succeeds.'}; doc['Proximity']['unmuteValueCallbacks']={syn:'Re-enables the propagation of every new advertised value to the parent hub.',lib:'proximity.unmuteValueCallbacks()',pro:'function unmuteValueCallbacks()',cmt:'

Re-enables the propagation of every new advertised value to the parent hub. This function reverts the effect of a previous call to `muteValueCallbacks()`. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['Proximity']['wait_async']={syn:'Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function.',lib:'proximity.wait_async()',pro:'function wait_async(callback, context)',cmt:'

Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function. The callback function can therefore freely issue synchronous or asynchronous commands, without risking to block the Javascript VM.

',par:{callback:'callback function that is invoked when all pending commands on the module are completed. The callback function receives two arguments: the caller-specific context object and the receiving function object.',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing.'}; //--- (end of generated code: Proximity) //--- (generated code: MultiAxisController) doc['MultiAxisController']={'':{syn:'MultiAxisController function interface',inc:'<script type='text/javascript' src='yocto_multiaxiscontroller.js'></script>',cmt:'

The Yoctopuce application programming interface allows you to drive a stepper motor.

'}}; doc['MultiAxisController']['FindMultiAxisController']={syn:'Retrieves a multi-axis controller for a given identifier.',lib:'YMultiAxisController.FindMultiAxisController()',pro:'function FindMultiAxisController(func)',cmt:'

Retrieves a multi-axis controller for a given identifier. The identifier can be specified using several formats:

- FunctionLogicalName
- ModuleSerialNumber.FunctionIdentifier
- ModuleSerialNumber.FunctionLogicalName
- ModuleLogicalName.FunctionIdentifier
- ModuleLogicalName.FunctionLogicalName

This function does not require that the multi-axis controller is online at the time it is invoked. The returned object is nevertheless valid. Use the method `YMultiAxisController.isOnline()` to test if the multi-axis controller is indeed online at a given time. In case of ambiguity when looking for a multi-axis controller by logical name, no error is notified: the first instance found is returned. The search is performed first by hardware name, then by logical name.

If a call to this object\x27s is_online() method returns FALSE although you are certain that the matching device is plugged, make sure that you did call registerHub() at application initialization time.

',par:{func:'a string that uniquely characterizes the multi-axis controller'},ret:'a `YMultiAxisController` object allowing you to drive the multi-axis controller.'}; doc['MultiAxisController']['FirstMultiAxisController']={syn:'Starts the enumeration of multi-axis controllers currently accessible.',lib:'YMultiAxisController.FirstMultiAxisController()',pro:'function FirstMultiAxisController()',cmt:'

Starts the enumeration of multi-axis controllers currently accessible. Use the method `YMultiAxisController.nextMultiAxisController()` to iterate on next multi-axis controllers.

',ret:'a pointer to a `YMultiAxisController` object, corresponding to the first multi-axis controller currently online, or a `null` pointer if there are none.'}; doc['MultiAxisController']['abortAndBrake']={syn:'Stops the motor smoothly as soon as possible, without waiting for ongoing move completion.',lib:'multiaxiscontroller.abortAndBrake()',pro:'function abortAndBrake()',cmt:'

Stops the motor smoothly as soon as possible, without waiting for ongoing move completion.

',ret:'`YAPI_SUCCESS` if the call succeeds. On failure, throws an exception or returns a negative error code.'}; doc['MultiAxisController']['abortAndHiZ']={syn:'Turn the controller into Hi-Z mode immediately, without waiting for ongoing move completion.',lib:'multiaxiscontroller.abortAndHiZ()',pro:'function abortAndHiZ()',cmt:'

Turn the controller into Hi-Z mode immediately, without waiting for ongoing move completion.

',ret:'`YAPI_SUCCESS` if the call succeeds. On failure, throws an exception or returns a negative error code.'}; doc['MultiAxisController']['clearCache']={syn:'Invalidates the cache.',lib:'multiaxiscontroller.clearCache()',pro:'function clearCache()',cmt:'

Invalidates the cache. Invalidates the cache of the multi-axis controller attributes. Forces the next call to get_xxx() or loadxxx() to use values that come from the device.

'}; doc['MultiAxisController']['describe']={syn:'Returns a short text that describes unambiguously the instance of the multi-axis controller in the form `TYPE(NAME)=SERIAL.FUNCTIONID`.',lib:'multiaxiscontroller.describe()',pro:'function describe()',cmt:'

Returns a short text that describes unambiguously the instance of the multi-axis controller in the form `TYPE(NAME)=SERIAL.FUNCTIONID`. More precisely, `TYPE` is the type of the function, `NAME` it the name used for the first access to the function, `SERIAL` is the serial number of the module if the module is connected or `\x22unresolved\x22`, and `FUNCTIONID` is the hardware identifier of the function if the module is connected. For example, this method returns `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1` if the module is already connected or `Relay(BadCustomeName.relay1)=unresolved` if the module has not yet been connected. This method does not trigger any USB or TCP transaction and can therefore be used in a debugger.

',ret:'a string that describes the multi-axis controller (ex: `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1`)'}; doc['MultiAxisController']['emergencyStop']={syn:'Stops the motor with an emergency alert, without taking any additional precaution.',lib:'multiaxiscontroller.emergencyStop()',pro:'function emergencyStop()',cmt:'

Stops the motor with an emergency alert, without taking any additional precaution.

',ret:'`YAPI_SUCCESS` if the call succeeds. On failure, throws an exception or returns a negative error code.'}; doc['MultiAxisController']['findHomePosition']={syn:'Starts all motors backward at the specified speeds, to search for the motor home position.',lib:'multiaxiscontroller.findHomePosition()',pro:'function findHomePosition(speed)',cmt:'

Starts all motors backward at the specified speeds, to search for the motor home position.

',par:{speed:'desired speed for all axis, in steps per second.'},ret:'`YAPI_SUCCESS` if the call succeeds. On failure, throws an exception or returns a negative error code.'}; doc['MultiAxisController']['get_advertisedValue']={syn:'Returns the current value of the multi-axis controller (no more than 6 characters).',lib:'multiaxiscontroller.get_advertisedValue()',pro:'function get_advertisedValue()',cmt:'

Returns the current value of the multi-axis controller (no more than 6 characters).

',ret:'a string corresponding to the current value of the multi-axis controller (no more than 6 characters).',ext:'On failure, throws an exception or returns `Y_ADVERTISEDVALUE_INVALID`.'}; doc['MultiAxisController']['get_errorMessage']={syn:'Returns the error message of the latest error with the multi-axis controller.',lib:'multiaxiscontroller.get_errorMessage()',pro:'function get_errorMessage()',cmt:'

Returns the error message of the latest error with the multi-axis controller. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a string corresponding to the latest error message that occured while using the multi-axis controller object'}; doc['MultiAxisController']['get_errorType']={syn:'Returns the numerical error code of the latest error with the multi-axis controller.',lib:'multiaxiscontroller.get_errorType()',pro:'function get_errorType()',cmt:'

Returns the numerical error code of the latest error with the multi-axis controller. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a number corresponding to the code of the latest error that occurred while using the multi-axis controller object'}; doc['MultiAxisController']['get_friendlyName']={syn:'Returns a global identifier of the multi-axis controller in the format `MODULE_NAME.FUNCTION_NAME`.',lib:'multiaxiscontroller.get_friendlyName()',pro:'function get_friendlyName()',cmt:'

Returns a global identifier of the multi-axis controller in the format `MODULE_NAME.FUNCTION_NAME`. The returned string uses the logical names of the module and of the multi-axis controller if they are defined, otherwise the serial number of the module and the hardware identifier of the multi-axis controller (for example: `MyCustomName.relay1`)

',ret:'a string that uniquely identifies the multi-axis controller using logical names (ex: `MyCustomName.relay1`)',ext:'On failure, throws an exception or returns `Y_FRIENDLYNAME_INVALID`.'}; doc['MultiAxisController']['get_functionDescriptor']={syn:'Returns a unique identifier of type `YFUN_DESCR` corresponding to the function.',lib:'multiaxiscontroller.get_functionDescriptor()',pro:'function get_functionDescriptor()',cmt:'

Returns a unique identifier of type `YFUN_DESCR` corresponding to the function. This identifier can be used to test if two instances of `YFunction` reference the same physical function on the same physical device.

',ret:'an identifier of type `YFUN_DESCR`.',ext:'If the function has never been contacted, the returned value is `Y_FUNCTIONDESCRIPTOR_INVALID`.'}; doc['MultiAxisController']['get_functionId']={syn:'Returns the hardware identifier of the multi-axis controller, without reference to the module.',lib:'multiaxiscontroller.get_functionId()',pro:'function get_functionId()',cmt:'

Returns the hardware identifier of the multi-axis controller, without reference to the module. For example `relay1`

',ret:'a string that identifies the multi-axis controller (ex: `relay1`)',ext:'On failure, throws an exception or returns `Y_FUNCTIONID_INVALID`.'}; doc['MultiAxisController']['get_globalState']={syn:'Returns the stepper motor set overall state.',lib:'multiaxiscontroller.get_globalState()',pro:'function get_globalState()',cmt:'

Returns the stepper motor set overall state.

',ret:'a value among `Y_GLOBALSTATE_ABSENT`, `Y_GLOBALSTATE_ALERT`, `Y_GLOBALSTATE_HI_Z`, `Y_GLOBALSTATE_STOP`, `Y_GLOBALSTATE_RUN` and `Y_GLOBALSTATE_BATCH` corresponding to the stepper motor set overall state',ext:'On failure, throws an exception or returns `Y_GLOBALSTATE_INVALID`.'}; doc['MultiAxisController']['get_hardwareId']={syn:'Returns the unique hardware identifier of the multi-axis controller in the form `SERIAL.FUNCTIONID`.',lib:'multiaxiscontroller.get_hardwareId()',pro:'function get_hardwareId()',cmt:'

Returns the unique hardware identifier of the multi-axis controller in the form `SERIAL.FUNCTIONID`. The unique hardware identifier is composed of the device serial number and of the hardware identifier of the multi-axis controller (for example `RELAYLO1-123456.relay1`).

',ret:'a string that uniquely identifies the multi-axis controller (ex: `RELAYLO1-123456.relay1`)',ext:'On failure, throws an exception or returns `Y_HARDWAREID_INVALID`.'}; doc['MultiAxisController']['get_logicalName']={syn:'Returns the logical name of the multi-axis controller.',lib:'multiaxiscontroller.get_logicalName()',pro:'function get_logicalName()',cmt:'

Returns the logical name of the multi-axis controller.

',ret:'a string corresponding to the logical name of the multi-axis controller.',ext:'On failure, throws an exception or returns `Y_LOGICALNAME_INVALID`.'}; doc['MultiAxisController']['get_module']={syn:'Gets the `YModule` object for the device on which the function is located.',lib:'multiaxiscontroller.get_module()',pro:'function get_module()',cmt:'

Gets the `YModule` object for the device on which the function is located. If the function cannot be located on any module, the returned instance of `YModule` is not shown as on-line.

',ret:'an instance of `YModule`'}; doc['MultiAxisController']['get_module_async']={syn:'Gets the `YModule` object for the device on which the function is located (asynchronous version).',lib:'multiaxiscontroller.get_module_async()',pro:'function get_module_async(callback, context)',cmt:'

Gets the `YModule` object for the device on which the function is located (asynchronous version). If the function cannot be located on any module, the returned `YModule` object does not show as on-line.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking Firefox javascript VM that does not implement context switching during blocking I/O calls. See the documentation section on asynchronous Javascript calls for more details.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the requested `YModule` object',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['MultiAxisController']['get_nAxis']={syn:'Returns the number of synchronized controllers.',lib:'multiaxiscontroller.get_nAxis()',pro:'function get_nAxis()',cmt:'

Returns the number of synchronized controllers.

',ret:'an integer corresponding to the number of synchronized controllers',ext:'On failure, throws an exception or returns `Y_NAXIS_INVALID`.'}; doc['MultiAxisController']['get_userData']={syn:'Returns the value of the userData attribute, as previously stored using method `set_userData`.',lib:'multiaxiscontroller.get_userData()',pro:'function get_userData()',cmt:'

Returns the value of the userData attribute, as previously stored using method `set_userData`. This attribute is never touched directly by the API, and is at disposal of the caller to store a context.

',ret:'the object stored previously by the caller.'}; doc['MultiAxisController']['isOnline']={syn:'Checks if the multi-axis controller is currently reachable, without raising any error.',lib:'multiaxiscontroller.isOnline()',pro:'function isOnline()',cmt:'

Checks if the multi-axis controller is currently reachable, without raising any error. If there is a cached value for the multi-axis controller in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the multi-axis controller.

',ret:'`true` if the multi-axis controller can be reached, and `false` otherwise'}; doc['MultiAxisController']['isOnline_async']={syn:'Checks if the multi-axis controller is currently reachable, without raising any error (asynchronous version).',lib:'multiaxiscontroller.isOnline_async()',pro:'function isOnline_async(callback, context)',cmt:'

Checks if the multi-axis controller is currently reachable, without raising any error (asynchronous version). If there is a cached value for the multi-axis controller in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the requested function.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the boolean result',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['MultiAxisController']['load']={syn:'Preloads the multi-axis controller cache with a specified validity duration.',lib:'multiaxiscontroller.load()',pro:'function load(msValidity)',cmt:'

Preloads the multi-axis controller cache with a specified validity duration. By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network traffic for instance.

',par:{msValidity:'an integer corresponding to the validity attributed to the loaded function parameters, in milliseconds'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['MultiAxisController']['loadAttribute']={syn:'Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.',lib:'multiaxiscontroller.loadAttribute()',pro:'function loadAttribute(attrName)',cmt:'

Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.

',par:{attrName:'the name of the requested attribute'},ret:'a string with the value of the the attribute',ext:'On failure, throws an exception or returns an empty string.'}; doc['MultiAxisController']['load_async']={syn:'Preloads the multi-axis controller cache with a specified validity duration (asynchronous version).',lib:'multiaxiscontroller.load_async()',pro:'function load_async(msValidity, callback, context)',cmt:'

Preloads the multi-axis controller cache with a specified validity duration (asynchronous version). By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network trafic for instance.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{msValidity:'an integer corresponding to the validity of the loaded function parameters, in milliseconds',callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the error code (or `YAPI_SUCCESS`)',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['MultiAxisController']['moveRel']={syn:'Starts all motors synchronously to reach a given relative position.',lib:'multiaxiscontroller.moveRel()',pro:'function moveRel(relPos)',cmt:'

Starts all motors synchronously to reach a given relative position. The time needed to reach the requested position will depend on the lowest acceleration and max speed parameters configured for all motors. The final position will be reached on all axis at the same time.

',par:{relPos:'relative position, measured in steps from the current position.'},ret:'`YAPI_SUCCESS` if the call succeeds. On failure, throws an exception or returns a negative error code.'}; doc['MultiAxisController']['moveTo']={syn:'Starts all motors synchronously to reach a given absolute position.',lib:'multiaxiscontroller.moveTo()',pro:'function moveTo(absPos)',cmt:'

Starts all motors synchronously to reach a given absolute position. The time needed to reach the requested position will depend on the lowest acceleration and max speed parameters configured for all motors. The final position will be reached on all axis at the same time.

',par:{absPos:'absolute position, measured in steps from each origin.'},ret:'`YAPI_SUCCESS` if the call succeeds. On failure, throws an exception or returns a negative error code.'}; doc['MultiAxisController']['muteValueCallbacks']={syn:'Disables the propagation of every new advertised value to the parent hub.',lib:'multiaxiscontroller.muteValueCallbacks()',pro:'function muteValueCallbacks()',cmt:'

Disables the propagation of every new advertised value to the parent hub. You can use this function to save bandwidth and CPU on computers with limited resources, or to prevent unwanted invocations of the HTTP callback. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['MultiAxisController']['nextMultiAxisController']={syn:'Continues the enumeration of multi-axis controllers started using `yFirstMultiAxisController()`.',lib:'multiaxiscontroller.nextMultiAxisController()',pro:'function nextMultiAxisController()',cmt:'

Continues the enumeration of multi-axis controllers started using `yFirstMultiAxisController()`.

',ret:'a pointer to a `YMultiAxisController` object, corresponding to a multi-axis controller currently online, or a `null` pointer if there are no more multi-axis controllers to enumerate.'}; doc['MultiAxisController']['pause']={syn:'Keep the motor in the same state for the specified amount of time, before processing next command.',lib:'multiaxiscontroller.pause()',pro:'function pause(waitMs)',cmt:'

Keep the motor in the same state for the specified amount of time, before processing next command.

',par:{waitMs:'wait time, specified in milliseconds.'},ret:'`YAPI_SUCCESS` if the call succeeds. On failure, throws an exception or returns a negative error code.'}; doc['MultiAxisController']['registerValueCallback']={syn:'Registers the callback function that is invoked on every change of advertised value.',lib:'multiaxiscontroller.registerValueCallback()',pro:'function registerValueCallback(callback)',cmt:'

Registers the callback function that is invoked on every change of advertised value. The callback is invoked only during the execution of `ySleep` or `yHandleEvents`. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a null pointer as argument.

',par:{callback:'the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and the character string describing the new advertised value.'}}; doc['MultiAxisController']['reset']={syn:'Reinitialize all controllers and clear all alert flags.',lib:'multiaxiscontroller.reset()',pro:'function reset()',cmt:'

Reinitialize all controllers and clear all alert flags.

',ret:'`YAPI_SUCCESS` if the call succeeds. On failure, throws an exception or returns a negative error code.'}; doc['MultiAxisController']['set_logicalName']={syn:'Changes the logical name of the multi-axis controller.',lib:'multiaxiscontroller.set_logicalName()',pro:'function set_logicalName(newval)',cmt:'

Changes the logical name of the multi-axis controller. You can use `yCheckLogicalName()` prior to this call to make sure that your parameter is valid. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',par:{newval:'a string corresponding to the logical name of the multi-axis controller.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['MultiAxisController']['set_nAxis']={syn:'Changes the number of synchronized controllers.',lib:'multiaxiscontroller.set_nAxis()',pro:'function set_nAxis(newval)',cmt:'

Changes the number of synchronized controllers.

',par:{newval:'an integer corresponding to the number of synchronized controllers'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['MultiAxisController']['set_userData']={syn:'Stores a user context provided as argument in the userData attribute of the function.',lib:'multiaxiscontroller.set_userData()',pro:'function set_userData(data)',cmt:'

Stores a user context provided as argument in the userData attribute of the function. This attribute is never touched by the API, and is at disposal of the caller to store a context.

',par:{data:'any kind of object to be stored'}}; doc['MultiAxisController']['unmuteValueCallbacks']={syn:'Re-enables the propagation of every new advertised value to the parent hub.',lib:'multiaxiscontroller.unmuteValueCallbacks()',pro:'function unmuteValueCallbacks()',cmt:'

Re-enables the propagation of every new advertised value to the parent hub. This function reverts the effect of a previous call to `muteValueCallbacks()`. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['MultiAxisController']['wait_async']={syn:'Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function.',lib:'multiaxiscontroller.wait_async()',pro:'function wait_async(callback, context)',cmt:'

Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function. The callback function can therefore freely issue synchronous or asynchronous commands, without risking to block the Javascript VM.

',par:{callback:'callback function that is invoked when all pending commands on the module are completed. The callback function receives two arguments: the caller-specific context object and the receiving function object.',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing.'}; //--- (end of generated code: MultiAxisController) //--- (generated code: RangeFinder) doc['RangeFinder']={'':{syn:'RangeFinder function interface',inc:'<script type='text/javascript' src='yocto_rangefinder.js'></script>',cmt:'

The Yoctopuce class YRangeFinder allows you to use and configure Yoctopuce range finder sensors. It inherits from the YSensor class the core functions to read measurements, register callback functions, access the autonomous datalogger. This class adds the ability to easily perform a one-point linear calibration to compensate the effect of a glass or filter placed in front of the sensor.

'}}; doc['RangeFinder']['FindRangeFinder']={syn:'Retrieves a range finder for a given identifier.',lib:'YRangeFinder.FindRangeFinder()',pro:'function FindRangeFinder(func)',cmt:'

Retrieves a range finder for a given identifier. The identifier can be specified using several formats:

- FunctionLogicalName
- ModuleSerialNumber.FunctionIdentifier
- ModuleSerialNumber.FunctionLogicalName
- ModuleLogicalName.FunctionIdentifier
- ModuleLogicalName.FunctionLogicalName

This function does not require that the range finder is online at the time it is invoked. The returned object is nevertheless valid. Use the method `YRangeFinder.isOnline()` to test if the range finder is indeed online at a given time. In case of ambiguity when looking for a range finder by logical name, no error is notified: the first instance found is returned. The search is performed first by hardware name, then by logical name.

If a call to this object\x27s is_online() method returns FALSE although you are certain that the matching device is plugged, make sure that you did call registerHub() at application initialization time.

',par:{func:'a string that uniquely characterizes the range finder'},ret:'a `YRangeFinder` object allowing you to drive the range finder.'}; doc['RangeFinder']['FirstRangeFinder']={syn:'Starts the enumeration of range finders currently accessible.',lib:'YRangeFinder.FirstRangeFinder()',pro:'function FirstRangeFinder()',cmt:'

Starts the enumeration of range finders currently accessible. Use the method `YRangeFinder.nextRangeFinder()` to iterate on next range finders.

',ret:'a pointer to a `YRangeFinder` object, corresponding to the first range finder currently online, or a `null` pointer if there are none.'}; doc['RangeFinder']['calibrateFromPoints']={syn:'Configures error correction data points, in particular to compensate for a possible perturbation of the measure caused by an enclosure.',lib:'rangefinder.calibrateFromPoints()',pro:'function calibrateFromPoints(rawValues, refValues)',cmt:'

Configures error correction data points, in particular to compensate for a possible perturbation of the measure caused by an enclosure. It is possible to configure up to five correction points. Correction points must be provided in ascending order, and be in the range of the sensor. The device will automatically perform a linear interpolation of the error correction between specified points. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

For more information on advanced capabilities to refine the calibration of sensors, please contact support@yoctopuce.com.

',par:{rawValues:'array of floating point numbers, corresponding to the raw values returned by the sensor for the correction points.',refValues:'array of floating point numbers, corresponding to the corrected values for the correction points.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['RangeFinder']['cancelCoverGlassCalibrations']={syn:'Cancels the effect of previous hardware calibration procedures to compensate for cover glass, and restores factory settings.',lib:'rangefinder.cancelCoverGlassCalibrations()',pro:'function cancelCoverGlassCalibrations()',cmt:'

Cancels the effect of previous hardware calibration procedures to compensate for cover glass, and restores factory settings. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` if the call succeeds. On failure, throws an exception or returns a negative error code.'}; doc['RangeFinder']['clearCache']={syn:'Invalidates the cache.',lib:'rangefinder.clearCache()',pro:'function clearCache()',cmt:'

Invalidates the cache. Invalidates the cache of the range finder attributes. Forces the next call to get_xxx() or loadxxx() to use values that come from the device.

'}; doc['RangeFinder']['describe']={syn:'Returns a short text that describes unambiguously the instance of the range finder in the form `TYPE(NAME)=SERIAL.FUNCTIONID`.',lib:'rangefinder.describe()',pro:'function describe()',cmt:'

Returns a short text that describes unambiguously the instance of the range finder in the form `TYPE(NAME)=SERIAL.FUNCTIONID`. More precisely, `TYPE` is the type of the function, `NAME` it the name used for the first access to the function, `SERIAL` is the serial number of the module if the module is connected or `\x22unresolved\x22`, and `FUNCTIONID` is the hardware identifier of the function if the module is connected. For example, this method returns `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1` if the module is already connected or `Relay(BadCustomeName.relay1)=unresolved` if the module has not yet been connected. This method does not trigger any USB or TCP transaction and can therefore be used in a debugger.

',ret:'a string that describes the range finder (ex: `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1`)'}; doc['RangeFinder']['get_advMode']={syn:'Returns the measuring mode used for the advertised value pushed to the parent hub.',lib:'rangefinder.get_advMode()',pro:'function get_advMode()',cmt:'

Returns the measuring mode used for the advertised value pushed to the parent hub.

',ret:'a value among `Y_ADVMODE_IMMEDIATE`, `Y_ADVMODE_PERIOD_AVG`, `Y_ADVMODE_PERIOD_MIN` and `Y_ADVMODE_PERIOD_MAX` corresponding to the measuring mode used for the advertised value pushed to the parent hub',ext:'On failure, throws an exception or returns `Y_ADVMODE_INVALID`.'}; doc['RangeFinder']['get_advertisedValue']={syn:'Returns the current value of the range finder (no more than 6 characters).',lib:'rangefinder.get_advertisedValue()',pro:'function get_advertisedValue()',cmt:'

Returns the current value of the range finder (no more than 6 characters).

',ret:'a string corresponding to the current value of the range finder (no more than 6 characters).',ext:'On failure, throws an exception or returns `Y_ADVERTISEDVALUE_INVALID`.'}; doc['RangeFinder']['get_currentRawValue']={syn:'Returns the uncalibrated, unrounded raw value returned by the sensor, in mm, as a floating point number.',lib:'rangefinder.get_currentRawValue()',pro:'function get_currentRawValue()',cmt:'

Returns the uncalibrated, unrounded raw value returned by the sensor, in mm, as a floating point number.

',ret:'a floating point number corresponding to the uncalibrated, unrounded raw value returned by the sensor, in mm, as a floating point number',ext:'On failure, throws an exception or returns `Y_CURRENTRAWVALUE_INVALID`.'}; doc['RangeFinder']['get_currentTemperature']={syn:'Returns the current sensor temperature, as a floating point number.',lib:'rangefinder.get_currentTemperature()',pro:'function get_currentTemperature()',cmt:'

Returns the current sensor temperature, as a floating point number.

',ret:'a floating point number corresponding to the current sensor temperature, as a floating point number',ext:'On failure, throws an exception or returns `Y_CURRENTTEMPERATURE_INVALID`.'}; doc['RangeFinder']['get_currentValue']={syn:'Returns the current value of the range measured, in mm, as a floating point number.',lib:'rangefinder.get_currentValue()',pro:'function get_currentValue()',cmt:'

Returns the current value of the range measured, in mm, as a floating point number.

',ret:'a floating point number corresponding to the current value of the range measured, in mm, as a floating point number',ext:'On failure, throws an exception or returns `Y_CURRENTVALUE_INVALID`.'}; doc['RangeFinder']['get_dataLogger']={syn:'Returns the YDatalogger object of the device hosting the sensor.',lib:'rangefinder.get_dataLogger()',pro:'function get_dataLogger()',cmt:'

Returns the YDatalogger object of the device hosting the sensor. This method returns an object of class YDatalogger that can control global parameters of the data logger. The returned object should not be freed.

',ret:'an YDataLogger object or null on error.'}; doc['RangeFinder']['get_errorMessage']={syn:'Returns the error message of the latest error with the range finder.',lib:'rangefinder.get_errorMessage()',pro:'function get_errorMessage()',cmt:'

Returns the error message of the latest error with the range finder. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a string corresponding to the latest error message that occured while using the range finder object'}; doc['RangeFinder']['get_errorType']={syn:'Returns the numerical error code of the latest error with the range finder.',lib:'rangefinder.get_errorType()',pro:'function get_errorType()',cmt:'

Returns the numerical error code of the latest error with the range finder. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a number corresponding to the code of the latest error that occurred while using the range finder object'}; doc['RangeFinder']['get_friendlyName']={syn:'Returns a global identifier of the range finder in the format `MODULE_NAME.FUNCTION_NAME`.',lib:'rangefinder.get_friendlyName()',pro:'function get_friendlyName()',cmt:'

Returns a global identifier of the range finder in the format `MODULE_NAME.FUNCTION_NAME`. The returned string uses the logical names of the module and of the range finder if they are defined, otherwise the serial number of the module and the hardware identifier of the range finder (for example: `MyCustomName.relay1`)

',ret:'a string that uniquely identifies the range finder using logical names (ex: `MyCustomName.relay1`)',ext:'On failure, throws an exception or returns `Y_FRIENDLYNAME_INVALID`.'}; doc['RangeFinder']['get_functionDescriptor']={syn:'Returns a unique identifier of type `YFUN_DESCR` corresponding to the function.',lib:'rangefinder.get_functionDescriptor()',pro:'function get_functionDescriptor()',cmt:'

Returns a unique identifier of type `YFUN_DESCR` corresponding to the function. This identifier can be used to test if two instances of `YFunction` reference the same physical function on the same physical device.

',ret:'an identifier of type `YFUN_DESCR`.',ext:'If the function has never been contacted, the returned value is `Y_FUNCTIONDESCRIPTOR_INVALID`.'}; doc['RangeFinder']['get_functionId']={syn:'Returns the hardware identifier of the range finder, without reference to the module.',lib:'rangefinder.get_functionId()',pro:'function get_functionId()',cmt:'

Returns the hardware identifier of the range finder, without reference to the module. For example `relay1`

',ret:'a string that identifies the range finder (ex: `relay1`)',ext:'On failure, throws an exception or returns `Y_FUNCTIONID_INVALID`.'}; doc['RangeFinder']['get_hardwareCalibrationTemperature']={syn:'Returns the temperature at the time when the latest calibration was performed.',lib:'rangefinder.get_hardwareCalibrationTemperature()',pro:'function get_hardwareCalibrationTemperature()',cmt:'

Returns the temperature at the time when the latest calibration was performed. This function can be used to determine if a new calibration for ambient temperature is required.

',ret:'a temperature, as a floating point number. On failure, throws an exception or return YAPI_INVALID_DOUBLE.'}; doc['RangeFinder']['get_hardwareId']={syn:'Returns the unique hardware identifier of the range finder in the form `SERIAL.FUNCTIONID`.',lib:'rangefinder.get_hardwareId()',pro:'function get_hardwareId()',cmt:'

Returns the unique hardware identifier of the range finder in the form `SERIAL.FUNCTIONID`. The unique hardware identifier is composed of the device serial number and of the hardware identifier of the range finder (for example `RELAYLO1-123456.relay1`).

',ret:'a string that uniquely identifies the range finder (ex: `RELAYLO1-123456.relay1`)',ext:'On failure, throws an exception or returns `Y_HARDWAREID_INVALID`.'}; doc['RangeFinder']['get_highestValue']={syn:'Returns the maximal value observed for the range measured since the device was started.',lib:'rangefinder.get_highestValue()',pro:'function get_highestValue()',cmt:'

Returns the maximal value observed for the range measured since the device was started. Can be reset to an arbitrary value thanks to set_highestValue().

',ret:'a floating point number corresponding to the maximal value observed for the range measured since the device was started',ext:'On failure, throws an exception or returns `Y_HIGHESTVALUE_INVALID`.'}; doc['RangeFinder']['get_logFrequency']={syn:'Returns the datalogger recording frequency for this function, or \x22OFF\x22 when measures are not stored in the data logger flash memory.',lib:'rangefinder.get_logFrequency()',pro:'function get_logFrequency()',cmt:'

Returns the datalogger recording frequency for this function, or \x22OFF\x22 when measures are not stored in the data logger flash memory.

',ret:'a string corresponding to the datalogger recording frequency for this function, or \x22OFF\x22 when measures are not stored in the data logger flash memory',ext:'On failure, throws an exception or returns `Y_LOGFREQUENCY_INVALID`.'}; doc['RangeFinder']['get_logicalName']={syn:'Returns the logical name of the range finder.',lib:'rangefinder.get_logicalName()',pro:'function get_logicalName()',cmt:'

Returns the logical name of the range finder.

',ret:'a string corresponding to the logical name of the range finder.',ext:'On failure, throws an exception or returns `Y_LOGICALNAME_INVALID`.'}; doc['RangeFinder']['get_lowestValue']={syn:'Returns the minimal value observed for the range measured since the device was started.',lib:'rangefinder.get_lowestValue()',pro:'function get_lowestValue()',cmt:'

Returns the minimal value observed for the range measured since the device was started. Can be reset to an arbitrary value thanks to set_lowestValue().

',ret:'a floating point number corresponding to the minimal value observed for the range measured since the device was started',ext:'On failure, throws an exception or returns `Y_LOWESTVALUE_INVALID`.'}; doc['RangeFinder']['get_module']={syn:'Gets the `YModule` object for the device on which the function is located.',lib:'rangefinder.get_module()',pro:'function get_module()',cmt:'

Gets the `YModule` object for the device on which the function is located. If the function cannot be located on any module, the returned instance of `YModule` is not shown as on-line.

',ret:'an instance of `YModule`'}; doc['RangeFinder']['get_module_async']={syn:'Gets the `YModule` object for the device on which the function is located (asynchronous version).',lib:'rangefinder.get_module_async()',pro:'function get_module_async(callback, context)',cmt:'

Gets the `YModule` object for the device on which the function is located (asynchronous version). If the function cannot be located on any module, the returned `YModule` object does not show as on-line.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking Firefox javascript VM that does not implement context switching during blocking I/O calls. See the documentation section on asynchronous Javascript calls for more details.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the requested `YModule` object',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['RangeFinder']['get_rangeFinderMode']={syn:'Returns the range finder running mode.',lib:'rangefinder.get_rangeFinderMode()',pro:'function get_rangeFinderMode()',cmt:'

Returns the range finder running mode. The rangefinder running mode allows you to put priority on precision, speed or maximum range.

',ret:'a value among `Y_RANGEFINDERMODE_DEFAULT`, `Y_RANGEFINDERMODE_LONG_RANGE`, `Y_RANGEFINDERMODE_HIGH_ACCURACY` and `Y_RANGEFINDERMODE_HIGH_SPEED` corresponding to the range finder running mode',ext:'On failure, throws an exception or returns `Y_RANGEFINDERMODE_INVALID`.'}; doc['RangeFinder']['get_recordedData']={syn:'Retrieves a DataSet object holding historical data for this sensor, for a specified time interval.',lib:'rangefinder.get_recordedData()',pro:'function get_recordedData(startTime, endTime)',cmt:'

Retrieves a DataSet object holding historical data for this sensor, for a specified time interval. The measures will be retrieved from the data logger, which must have been turned on at the desired time. See the documentation of the DataSet class for information on how to get an overview of the recorded data, and how to load progressively a large set of measures from the data logger.

This function only works if the device uses a recent firmware, as DataSet objects are not supported by firmwares older than version 13000.

',par:{startTime:'the start of the desired measure time interval, as a Unix timestamp, i.e. the number of seconds since January 1, 1970 UTC. The special value 0 can be used to include any meaasure, without initial limit.',endTime:'the end of the desired measure time interval, as a Unix timestamp, i.e. the number of seconds since January 1, 1970 UTC. The special value 0 can be used to include any meaasure, without ending limit.'},ret:'an instance of YDataSet, providing access to historical data. Past measures can be loaded progressively using methods from the YDataSet object.'}; doc['RangeFinder']['get_reportFrequency']={syn:'Returns the timed value notification frequency, or \x22OFF\x22 if timed value notifications are disabled for this function.',lib:'rangefinder.get_reportFrequency()',pro:'function get_reportFrequency()',cmt:'

Returns the timed value notification frequency, or \x22OFF\x22 if timed value notifications are disabled for this function.

',ret:'a string corresponding to the timed value notification frequency, or \x22OFF\x22 if timed value notifications are disabled for this function',ext:'On failure, throws an exception or returns `Y_REPORTFREQUENCY_INVALID`.'}; doc['RangeFinder']['get_resolution']={syn:'Returns the resolution of the measured values.',lib:'rangefinder.get_resolution()',pro:'function get_resolution()',cmt:'

Returns the resolution of the measured values. The resolution corresponds to the numerical precision of the measures, which is not always the same as the actual precision of the sensor.

',ret:'a floating point number corresponding to the resolution of the measured values',ext:'On failure, throws an exception or returns `Y_RESOLUTION_INVALID`.'}; doc['RangeFinder']['get_sensorState']={syn:'Returns the sensor health state code, which is zero when there is an up-to-date measure available or a positive code if the sensor is not able to provide a measure right now.',lib:'rangefinder.get_sensorState()',pro:'function get_sensorState()',cmt:'

Returns the sensor health state code, which is zero when there is an up-to-date measure available or a positive code if the sensor is not able to provide a measure right now.

',ret:'an integer corresponding to the sensor health state code, which is zero when there is an up-to-date measure available or a positive code if the sensor is not able to provide a measure right now',ext:'On failure, throws an exception or returns `Y_SENSORSTATE_INVALID`.'}; doc['RangeFinder']['get_unit']={syn:'Returns the measuring unit for the range measured.',lib:'rangefinder.get_unit()',pro:'function get_unit()',cmt:'

Returns the measuring unit for the range measured.

',ret:'a string corresponding to the measuring unit for the range measured',ext:'On failure, throws an exception or returns `Y_UNIT_INVALID`.'}; doc['RangeFinder']['get_userData']={syn:'Returns the value of the userData attribute, as previously stored using method `set_userData`.',lib:'rangefinder.get_userData()',pro:'function get_userData()',cmt:'

Returns the value of the userData attribute, as previously stored using method `set_userData`. This attribute is never touched directly by the API, and is at disposal of the caller to store a context.

',ret:'the object stored previously by the caller.'}; doc['RangeFinder']['isOnline']={syn:'Checks if the range finder is currently reachable, without raising any error.',lib:'rangefinder.isOnline()',pro:'function isOnline()',cmt:'

Checks if the range finder is currently reachable, without raising any error. If there is a cached value for the range finder in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the range finder.

',ret:'`true` if the range finder can be reached, and `false` otherwise'}; doc['RangeFinder']['isOnline_async']={syn:'Checks if the range finder is currently reachable, without raising any error (asynchronous version).',lib:'rangefinder.isOnline_async()',pro:'function isOnline_async(callback, context)',cmt:'

Checks if the range finder is currently reachable, without raising any error (asynchronous version). If there is a cached value for the range finder in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the requested function.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the boolean result',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['RangeFinder']['load']={syn:'Preloads the range finder cache with a specified validity duration.',lib:'rangefinder.load()',pro:'function load(msValidity)',cmt:'

Preloads the range finder cache with a specified validity duration. By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network traffic for instance.

',par:{msValidity:'an integer corresponding to the validity attributed to the loaded function parameters, in milliseconds'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['RangeFinder']['loadAttribute']={syn:'Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.',lib:'rangefinder.loadAttribute()',pro:'function loadAttribute(attrName)',cmt:'

Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.

',par:{attrName:'the name of the requested attribute'},ret:'a string with the value of the the attribute',ext:'On failure, throws an exception or returns an empty string.'}; doc['RangeFinder']['loadCalibrationPoints']={syn:'Retrieves error correction data points previously entered using the method `calibrateFromPoints`.',lib:'rangefinder.loadCalibrationPoints()',pro:'function loadCalibrationPoints(rawValues, refValues)',cmt:'

Retrieves error correction data points previously entered using the method `calibrateFromPoints`.

',par:{rawValues:'array of floating point numbers, that will be filled by the function with the raw sensor values for the correction points.',refValues:'array of floating point numbers, that will be filled by the function with the desired values for the correction points.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['RangeFinder']['load_async']={syn:'Preloads the range finder cache with a specified validity duration (asynchronous version).',lib:'rangefinder.load_async()',pro:'function load_async(msValidity, callback, context)',cmt:'

Preloads the range finder cache with a specified validity duration (asynchronous version). By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network trafic for instance.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{msValidity:'an integer corresponding to the validity of the loaded function parameters, in milliseconds',callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the error code (or `YAPI_SUCCESS`)',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['RangeFinder']['muteValueCallbacks']={syn:'Disables the propagation of every new advertised value to the parent hub.',lib:'rangefinder.muteValueCallbacks()',pro:'function muteValueCallbacks()',cmt:'

Disables the propagation of every new advertised value to the parent hub. You can use this function to save bandwidth and CPU on computers with limited resources, or to prevent unwanted invocations of the HTTP callback. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['RangeFinder']['nextRangeFinder']={syn:'Continues the enumeration of range finders started using `yFirstRangeFinder()`.',lib:'rangefinder.nextRangeFinder()',pro:'function nextRangeFinder()',cmt:'

Continues the enumeration of range finders started using `yFirstRangeFinder()`.

',ret:'a pointer to a `YRangeFinder` object, corresponding to a range finder currently online, or a `null` pointer if there are no more range finders to enumerate.'}; doc['RangeFinder']['registerTimedReportCallback']={syn:'Registers the callback function that is invoked on every periodic timed notification.',lib:'rangefinder.registerTimedReportCallback()',pro:'function registerTimedReportCallback(callback)',cmt:'

Registers the callback function that is invoked on every periodic timed notification. The callback is invoked only during the execution of `ySleep` or `yHandleEvents`. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a null pointer as argument.

',par:{callback:'the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and an YMeasure object describing the new advertised value.'}}; doc['RangeFinder']['registerValueCallback']={syn:'Registers the callback function that is invoked on every change of advertised value.',lib:'rangefinder.registerValueCallback()',pro:'function registerValueCallback(callback)',cmt:'

Registers the callback function that is invoked on every change of advertised value. The callback is invoked only during the execution of `ySleep` or `yHandleEvents`. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a null pointer as argument.

',par:{callback:'the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and the character string describing the new advertised value.'}}; doc['RangeFinder']['set_advMode']={syn:'Changes the measuring mode used for the advertised value pushed to the parent hub.',lib:'rangefinder.set_advMode()',pro:'function set_advMode(newval)',cmt:'

Changes the measuring mode used for the advertised value pushed to the parent hub.

',par:{newval:'a value among `Y_ADVMODE_IMMEDIATE`, `Y_ADVMODE_PERIOD_AVG`, `Y_ADVMODE_PERIOD_MIN` and `Y_ADVMODE_PERIOD_MAX` corresponding to the measuring mode used for the advertised value pushed to the parent hub'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['RangeFinder']['set_highestValue']={syn:'Changes the recorded maximal value observed.',lib:'rangefinder.set_highestValue()',pro:'function set_highestValue(newval)',cmt:'

Changes the recorded maximal value observed. Can be used to reset the value returned by get_lowestValue().

',par:{newval:'a floating point number corresponding to the recorded maximal value observed'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['RangeFinder']['set_logFrequency']={syn:'Changes the datalogger recording frequency for this function.',lib:'rangefinder.set_logFrequency()',pro:'function set_logFrequency(newval)',cmt:'

Changes the datalogger recording frequency for this function. The frequency can be specified as samples per second, as sample per minute (for instance \x2215/m\x22) or in samples per hour (eg. \x224/h\x22). To disable recording for this function, use the value \x22OFF\x22.

',par:{newval:'a string corresponding to the datalogger recording frequency for this function'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['RangeFinder']['set_logicalName']={syn:'Changes the logical name of the range finder.',lib:'rangefinder.set_logicalName()',pro:'function set_logicalName(newval)',cmt:'

Changes the logical name of the range finder. You can use `yCheckLogicalName()` prior to this call to make sure that your parameter is valid. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',par:{newval:'a string corresponding to the logical name of the range finder.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['RangeFinder']['set_lowestValue']={syn:'Changes the recorded minimal value observed.',lib:'rangefinder.set_lowestValue()',pro:'function set_lowestValue(newval)',cmt:'

Changes the recorded minimal value observed. Can be used to reset the value returned by get_lowestValue().

',par:{newval:'a floating point number corresponding to the recorded minimal value observed'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['RangeFinder']['set_rangeFinderMode']={syn:'Changes the rangefinder running mode, allowing you to put priority on precision, speed or maximum range.',lib:'rangefinder.set_rangeFinderMode()',pro:'function set_rangeFinderMode(newval)',cmt:'

Changes the rangefinder running mode, allowing you to put priority on precision, speed or maximum range.

',par:{newval:'a value among `Y_RANGEFINDERMODE_DEFAULT`, `Y_RANGEFINDERMODE_LONG_RANGE`, `Y_RANGEFINDERMODE_HIGH_ACCURACY` and `Y_RANGEFINDERMODE_HIGH_SPEED` corresponding to the rangefinder running mode, allowing you to put priority on precision, speed or maximum range'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['RangeFinder']['set_reportFrequency']={syn:'Changes the timed value notification frequency for this function.',lib:'rangefinder.set_reportFrequency()',pro:'function set_reportFrequency(newval)',cmt:'

Changes the timed value notification frequency for this function. The frequency can be specified as samples per second, as sample per minute (for instance \x2215/m\x22) or in samples per hour (eg. \x224/h\x22). To disable timed value notifications for this function, use the value \x22OFF\x22.

',par:{newval:'a string corresponding to the timed value notification frequency for this function'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['RangeFinder']['set_resolution']={syn:'Changes the resolution of the measured physical values.',lib:'rangefinder.set_resolution()',pro:'function set_resolution(newval)',cmt:'

Changes the resolution of the measured physical values. The resolution corresponds to the numerical precision when displaying value. It does not change the precision of the measure itself.

',par:{newval:'a floating point number corresponding to the resolution of the measured physical values'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['RangeFinder']['set_unit']={syn:'Changes the measuring unit for the measured range.',lib:'rangefinder.set_unit()',pro:'function set_unit(newval)',cmt:'

Changes the measuring unit for the measured range. That unit is a string. String value can be `\x22` or `mm`. Any other value is ignored. Remember to call the `saveToFlash()` method of the module if the modification must be kept. WARNING: if a specific calibration is defined for the rangeFinder function, a unit system change will probably break it.

',par:{newval:'a string corresponding to the measuring unit for the measured range'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['RangeFinder']['set_userData']={syn:'Stores a user context provided as argument in the userData attribute of the function.',lib:'rangefinder.set_userData()',pro:'function set_userData(data)',cmt:'

Stores a user context provided as argument in the userData attribute of the function. This attribute is never touched by the API, and is at disposal of the caller to store a context.

',par:{data:'any kind of object to be stored'}}; doc['RangeFinder']['startDataLogger']={syn:'Starts the data logger on the device.',lib:'rangefinder.startDataLogger()',pro:'function startDataLogger()',cmt:'

Starts the data logger on the device. Note that the data logger will only save the measures on this sensor if the logFrequency is not set to \x22OFF\x22.

',ret:'`YAPI_SUCCESS` if the call succeeds.'}; doc['RangeFinder']['stopDataLogger']={syn:'Stops the datalogger on the device.',lib:'rangefinder.stopDataLogger()',pro:'function stopDataLogger()',cmt:'

Stops the datalogger on the device.

',ret:'`YAPI_SUCCESS` if the call succeeds.'}; doc['RangeFinder']['triggerOffsetCalibration']={syn:'Triggers the hardware offset calibration of the distance sensor.',lib:'rangefinder.triggerOffsetCalibration()',pro:'function triggerOffsetCalibration(targetDist)',cmt:'

Triggers the hardware offset calibration of the distance sensor. This function is part of the calibration procedure to compensate for the the effect of a cover glass. Make sure to read the chapter about hardware calibration for details on the calibration procedure for proper results.

',par:{targetDist:'true distance of the calibration target, in mm or inches, depending on the unit selected in the device'},ret:'`YAPI_SUCCESS` if the call succeeds. On failure, throws an exception or returns a negative error code.'}; doc['RangeFinder']['triggerSpadCalibration']={syn:'Triggers the photon detector hardware calibration.',lib:'rangefinder.triggerSpadCalibration()',pro:'function triggerSpadCalibration()',cmt:'

Triggers the photon detector hardware calibration. This function is part of the calibration procedure to compensate for the the effect of a cover glass. Make sure to read the chapter about hardware calibration for details on the calibration procedure for proper results.

',ret:'`YAPI_SUCCESS` if the call succeeds. On failure, throws an exception or returns a negative error code.'}; doc['RangeFinder']['triggerTemperatureCalibration']={syn:'Triggers a sensor calibration according to the current ambient temperature.',lib:'rangefinder.triggerTemperatureCalibration()',pro:'function triggerTemperatureCalibration()',cmt:'

Triggers a sensor calibration according to the current ambient temperature. That calibration process needs no physical interaction with the sensor. It is performed automatically at device startup, but it is recommended to start it again when the temperature delta since the latest calibration exceeds 8\xB0C.

',ret:'`YAPI_SUCCESS` if the call succeeds. On failure, throws an exception or returns a negative error code.'}; doc['RangeFinder']['triggerXTalkCalibration']={syn:'Triggers the hardware cross-talk calibration of the distance sensor.',lib:'rangefinder.triggerXTalkCalibration()',pro:'function triggerXTalkCalibration(targetDist)',cmt:'

Triggers the hardware cross-talk calibration of the distance sensor. This function is part of the calibration procedure to compensate for the the effect of a cover glass. Make sure to read the chapter about hardware calibration for details on the calibration procedure for proper results.

',par:{targetDist:'true distance of the calibration target, in mm or inches, depending on the unit selected in the device'},ret:'`YAPI_SUCCESS` if the call succeeds. On failure, throws an exception or returns a negative error code.'}; doc['RangeFinder']['unmuteValueCallbacks']={syn:'Re-enables the propagation of every new advertised value to the parent hub.',lib:'rangefinder.unmuteValueCallbacks()',pro:'function unmuteValueCallbacks()',cmt:'

Re-enables the propagation of every new advertised value to the parent hub. This function reverts the effect of a previous call to `muteValueCallbacks()`. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['RangeFinder']['wait_async']={syn:'Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function.',lib:'rangefinder.wait_async()',pro:'function wait_async(callback, context)',cmt:'

Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function. The callback function can therefore freely issue synchronous or asynchronous commands, without risking to block the Javascript VM.

',par:{callback:'callback function that is invoked when all pending commands on the module are completed. The callback function receives two arguments: the caller-specific context object and the receiving function object.',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing.'}; //--- (end of generated code: RangeFinder) //--- (generated code: DaisyChain) doc['DaisyChain']={'':{syn:'DaisyChain function interface',inc:'<script type='text/javascript' src='yocto_daisychain.js'></script>',cmt:'

The YDaisyChain interface can be used to verify that devices that are daisy-chained directly from device to device, without a hub, are detected properly.

'}}; doc['DaisyChain']['FindDaisyChain']={syn:'Retrieves a module chain for a given identifier.',lib:'YDaisyChain.FindDaisyChain()',pro:'function FindDaisyChain(func)',cmt:'

Retrieves a module chain for a given identifier. The identifier can be specified using several formats:

- FunctionLogicalName
- ModuleSerialNumber.FunctionIdentifier
- ModuleSerialNumber.FunctionLogicalName
- ModuleLogicalName.FunctionIdentifier
- ModuleLogicalName.FunctionLogicalName

This function does not require that the module chain is online at the time it is invoked. The returned object is nevertheless valid. Use the method `YDaisyChain.isOnline()` to test if the module chain is indeed online at a given time. In case of ambiguity when looking for a module chain by logical name, no error is notified: the first instance found is returned. The search is performed first by hardware name, then by logical name.

If a call to this object\x27s is_online() method returns FALSE although you are certain that the matching device is plugged, make sure that you did call registerHub() at application initialization time.

',par:{func:'a string that uniquely characterizes the module chain'},ret:'a `YDaisyChain` object allowing you to drive the module chain.'}; doc['DaisyChain']['FirstDaisyChain']={syn:'Starts the enumeration of module chains currently accessible.',lib:'YDaisyChain.FirstDaisyChain()',pro:'function FirstDaisyChain()',cmt:'

Starts the enumeration of module chains currently accessible. Use the method `YDaisyChain.nextDaisyChain()` to iterate on next module chains.

',ret:'a pointer to a `YDaisyChain` object, corresponding to the first module chain currently online, or a `null` pointer if there are none.'}; doc['DaisyChain']['clearCache']={syn:'Invalidates the cache.',lib:'daisychain.clearCache()',pro:'function clearCache()',cmt:'

Invalidates the cache. Invalidates the cache of the module chain attributes. Forces the next call to get_xxx() or loadxxx() to use values that come from the device.

'}; doc['DaisyChain']['describe']={syn:'Returns a short text that describes unambiguously the instance of the module chain in the form `TYPE(NAME)=SERIAL.FUNCTIONID`.',lib:'daisychain.describe()',pro:'function describe()',cmt:'

Returns a short text that describes unambiguously the instance of the module chain in the form `TYPE(NAME)=SERIAL.FUNCTIONID`. More precisely, `TYPE` is the type of the function, `NAME` it the name used for the first access to the function, `SERIAL` is the serial number of the module if the module is connected or `\x22unresolved\x22`, and `FUNCTIONID` is the hardware identifier of the function if the module is connected. For example, this method returns `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1` if the module is already connected or `Relay(BadCustomeName.relay1)=unresolved` if the module has not yet been connected. This method does not trigger any USB or TCP transaction and can therefore be used in a debugger.

',ret:'a string that describes the module chain (ex: `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1`)'}; doc['DaisyChain']['get_advertisedValue']={syn:'Returns the current value of the module chain (no more than 6 characters).',lib:'daisychain.get_advertisedValue()',pro:'function get_advertisedValue()',cmt:'

Returns the current value of the module chain (no more than 6 characters).

',ret:'a string corresponding to the current value of the module chain (no more than 6 characters).',ext:'On failure, throws an exception or returns `Y_ADVERTISEDVALUE_INVALID`.'}; doc['DaisyChain']['get_childCount']={syn:'Returns the number of child nodes currently detected.',lib:'daisychain.get_childCount()',pro:'function get_childCount()',cmt:'

Returns the number of child nodes currently detected.

',ret:'an integer corresponding to the number of child nodes currently detected',ext:'On failure, throws an exception or returns `Y_CHILDCOUNT_INVALID`.'}; doc['DaisyChain']['get_daisyState']={syn:'Returns the state of the daisy-link between modules.',lib:'daisychain.get_daisyState()',pro:'function get_daisyState()',cmt:'

Returns the state of the daisy-link between modules.

',ret:'a value among `Y_DAISYSTATE_READY`, `Y_DAISYSTATE_IS_CHILD`, `Y_DAISYSTATE_FIRMWARE_MISMATCH`, `Y_DAISYSTATE_CHILD_MISSING` and `Y_DAISYSTATE_CHILD_LOST` corresponding to the state of the daisy-link between modules',ext:'On failure, throws an exception or returns `Y_DAISYSTATE_INVALID`.'}; doc['DaisyChain']['get_errorMessage']={syn:'Returns the error message of the latest error with the module chain.',lib:'daisychain.get_errorMessage()',pro:'function get_errorMessage()',cmt:'

Returns the error message of the latest error with the module chain. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a string corresponding to the latest error message that occured while using the module chain object'}; doc['DaisyChain']['get_errorType']={syn:'Returns the numerical error code of the latest error with the module chain.',lib:'daisychain.get_errorType()',pro:'function get_errorType()',cmt:'

Returns the numerical error code of the latest error with the module chain. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a number corresponding to the code of the latest error that occurred while using the module chain object'}; doc['DaisyChain']['get_friendlyName']={syn:'Returns a global identifier of the module chain in the format `MODULE_NAME.FUNCTION_NAME`.',lib:'daisychain.get_friendlyName()',pro:'function get_friendlyName()',cmt:'

Returns a global identifier of the module chain in the format `MODULE_NAME.FUNCTION_NAME`. The returned string uses the logical names of the module and of the module chain if they are defined, otherwise the serial number of the module and the hardware identifier of the module chain (for example: `MyCustomName.relay1`)

',ret:'a string that uniquely identifies the module chain using logical names (ex: `MyCustomName.relay1`)',ext:'On failure, throws an exception or returns `Y_FRIENDLYNAME_INVALID`.'}; doc['DaisyChain']['get_functionDescriptor']={syn:'Returns a unique identifier of type `YFUN_DESCR` corresponding to the function.',lib:'daisychain.get_functionDescriptor()',pro:'function get_functionDescriptor()',cmt:'

Returns a unique identifier of type `YFUN_DESCR` corresponding to the function. This identifier can be used to test if two instances of `YFunction` reference the same physical function on the same physical device.

',ret:'an identifier of type `YFUN_DESCR`.',ext:'If the function has never been contacted, the returned value is `Y_FUNCTIONDESCRIPTOR_INVALID`.'}; doc['DaisyChain']['get_functionId']={syn:'Returns the hardware identifier of the module chain, without reference to the module.',lib:'daisychain.get_functionId()',pro:'function get_functionId()',cmt:'

Returns the hardware identifier of the module chain, without reference to the module. For example `relay1`

',ret:'a string that identifies the module chain (ex: `relay1`)',ext:'On failure, throws an exception or returns `Y_FUNCTIONID_INVALID`.'}; doc['DaisyChain']['get_hardwareId']={syn:'Returns the unique hardware identifier of the module chain in the form `SERIAL.FUNCTIONID`.',lib:'daisychain.get_hardwareId()',pro:'function get_hardwareId()',cmt:'

Returns the unique hardware identifier of the module chain in the form `SERIAL.FUNCTIONID`. The unique hardware identifier is composed of the device serial number and of the hardware identifier of the module chain (for example `RELAYLO1-123456.relay1`).

',ret:'a string that uniquely identifies the module chain (ex: `RELAYLO1-123456.relay1`)',ext:'On failure, throws an exception or returns `Y_HARDWAREID_INVALID`.'}; doc['DaisyChain']['get_logicalName']={syn:'Returns the logical name of the module chain.',lib:'daisychain.get_logicalName()',pro:'function get_logicalName()',cmt:'

Returns the logical name of the module chain.

',ret:'a string corresponding to the logical name of the module chain.',ext:'On failure, throws an exception or returns `Y_LOGICALNAME_INVALID`.'}; doc['DaisyChain']['get_module']={syn:'Gets the `YModule` object for the device on which the function is located.',lib:'daisychain.get_module()',pro:'function get_module()',cmt:'

Gets the `YModule` object for the device on which the function is located. If the function cannot be located on any module, the returned instance of `YModule` is not shown as on-line.

',ret:'an instance of `YModule`'}; doc['DaisyChain']['get_module_async']={syn:'Gets the `YModule` object for the device on which the function is located (asynchronous version).',lib:'daisychain.get_module_async()',pro:'function get_module_async(callback, context)',cmt:'

Gets the `YModule` object for the device on which the function is located (asynchronous version). If the function cannot be located on any module, the returned `YModule` object does not show as on-line.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking Firefox javascript VM that does not implement context switching during blocking I/O calls. See the documentation section on asynchronous Javascript calls for more details.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the requested `YModule` object',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['DaisyChain']['get_requiredChildCount']={syn:'Returns the number of child nodes expected in normal conditions.',lib:'daisychain.get_requiredChildCount()',pro:'function get_requiredChildCount()',cmt:'

Returns the number of child nodes expected in normal conditions.

',ret:'an integer corresponding to the number of child nodes expected in normal conditions',ext:'On failure, throws an exception or returns `Y_REQUIREDCHILDCOUNT_INVALID`.'}; doc['DaisyChain']['get_userData']={syn:'Returns the value of the userData attribute, as previously stored using method `set_userData`.',lib:'daisychain.get_userData()',pro:'function get_userData()',cmt:'

Returns the value of the userData attribute, as previously stored using method `set_userData`. This attribute is never touched directly by the API, and is at disposal of the caller to store a context.

',ret:'the object stored previously by the caller.'}; doc['DaisyChain']['isOnline']={syn:'Checks if the module chain is currently reachable, without raising any error.',lib:'daisychain.isOnline()',pro:'function isOnline()',cmt:'

Checks if the module chain is currently reachable, without raising any error. If there is a cached value for the module chain in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the module chain.

',ret:'`true` if the module chain can be reached, and `false` otherwise'}; doc['DaisyChain']['isOnline_async']={syn:'Checks if the module chain is currently reachable, without raising any error (asynchronous version).',lib:'daisychain.isOnline_async()',pro:'function isOnline_async(callback, context)',cmt:'

Checks if the module chain is currently reachable, without raising any error (asynchronous version). If there is a cached value for the module chain in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the requested function.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the boolean result',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['DaisyChain']['load']={syn:'Preloads the module chain cache with a specified validity duration.',lib:'daisychain.load()',pro:'function load(msValidity)',cmt:'

Preloads the module chain cache with a specified validity duration. By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network traffic for instance.

',par:{msValidity:'an integer corresponding to the validity attributed to the loaded function parameters, in milliseconds'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['DaisyChain']['loadAttribute']={syn:'Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.',lib:'daisychain.loadAttribute()',pro:'function loadAttribute(attrName)',cmt:'

Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.

',par:{attrName:'the name of the requested attribute'},ret:'a string with the value of the the attribute',ext:'On failure, throws an exception or returns an empty string.'}; doc['DaisyChain']['load_async']={syn:'Preloads the module chain cache with a specified validity duration (asynchronous version).',lib:'daisychain.load_async()',pro:'function load_async(msValidity, callback, context)',cmt:'

Preloads the module chain cache with a specified validity duration (asynchronous version). By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network trafic for instance.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{msValidity:'an integer corresponding to the validity of the loaded function parameters, in milliseconds',callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the error code (or `YAPI_SUCCESS`)',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['DaisyChain']['muteValueCallbacks']={syn:'Disables the propagation of every new advertised value to the parent hub.',lib:'daisychain.muteValueCallbacks()',pro:'function muteValueCallbacks()',cmt:'

Disables the propagation of every new advertised value to the parent hub. You can use this function to save bandwidth and CPU on computers with limited resources, or to prevent unwanted invocations of the HTTP callback. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['DaisyChain']['nextDaisyChain']={syn:'Continues the enumeration of module chains started using `yFirstDaisyChain()`.',lib:'daisychain.nextDaisyChain()',pro:'function nextDaisyChain()',cmt:'

Continues the enumeration of module chains started using `yFirstDaisyChain()`.

',ret:'a pointer to a `YDaisyChain` object, corresponding to a module chain currently online, or a `null` pointer if there are no more module chains to enumerate.'}; doc['DaisyChain']['registerValueCallback']={syn:'Registers the callback function that is invoked on every change of advertised value.',lib:'daisychain.registerValueCallback()',pro:'function registerValueCallback(callback)',cmt:'

Registers the callback function that is invoked on every change of advertised value. The callback is invoked only during the execution of `ySleep` or `yHandleEvents`. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a null pointer as argument.

',par:{callback:'the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and the character string describing the new advertised value.'}}; doc['DaisyChain']['set_logicalName']={syn:'Changes the logical name of the module chain.',lib:'daisychain.set_logicalName()',pro:'function set_logicalName(newval)',cmt:'

Changes the logical name of the module chain. You can use `yCheckLogicalName()` prior to this call to make sure that your parameter is valid. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',par:{newval:'a string corresponding to the logical name of the module chain.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['DaisyChain']['set_requiredChildCount']={syn:'Changes the number of child nodes expected in normal conditions.',lib:'daisychain.set_requiredChildCount()',pro:'function set_requiredChildCount(newval)',cmt:'

Changes the number of child nodes expected in normal conditions. If the value is zero, no check is performed. If it is non-zero, the number child nodes is checked on startup and the status will change to error if the count does not match.

',par:{newval:'an integer corresponding to the number of child nodes expected in normal conditions'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['DaisyChain']['set_userData']={syn:'Stores a user context provided as argument in the userData attribute of the function.',lib:'daisychain.set_userData()',pro:'function set_userData(data)',cmt:'

Stores a user context provided as argument in the userData attribute of the function. This attribute is never touched by the API, and is at disposal of the caller to store a context.

',par:{data:'any kind of object to be stored'}}; doc['DaisyChain']['unmuteValueCallbacks']={syn:'Re-enables the propagation of every new advertised value to the parent hub.',lib:'daisychain.unmuteValueCallbacks()',pro:'function unmuteValueCallbacks()',cmt:'

Re-enables the propagation of every new advertised value to the parent hub. This function reverts the effect of a previous call to `muteValueCallbacks()`. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['DaisyChain']['wait_async']={syn:'Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function.',lib:'daisychain.wait_async()',pro:'function wait_async(callback, context)',cmt:'

Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function. The callback function can therefore freely issue synchronous or asynchronous commands, without risking to block the Javascript VM.

',par:{callback:'callback function that is invoked when all pending commands on the module are completed. The callback function receives two arguments: the caller-specific context object and the receiving function object.',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing.'}; //--- (end of generated code: DaisyChain) //--- (generated code: VoltageOutput) doc['VoltageOutput']={'':{syn:'VoltageOutput function interface',inc:'<script type='text/javascript' src='yocto_voltageoutput.js'></script>',cmt:'

The Yoctopuce application programming interface allows you to change the value of the voltage output.

'}}; doc['VoltageOutput']['FindVoltageOutput']={syn:'Retrieves a voltage output for a given identifier.',lib:'YVoltageOutput.FindVoltageOutput()',pro:'function FindVoltageOutput(func)',cmt:'

Retrieves a voltage output for a given identifier. The identifier can be specified using several formats:

- FunctionLogicalName
- ModuleSerialNumber.FunctionIdentifier
- ModuleSerialNumber.FunctionLogicalName
- ModuleLogicalName.FunctionIdentifier
- ModuleLogicalName.FunctionLogicalName

This function does not require that the voltage output is online at the time it is invoked. The returned object is nevertheless valid. Use the method `YVoltageOutput.isOnline()` to test if the voltage output is indeed online at a given time. In case of ambiguity when looking for a voltage output by logical name, no error is notified: the first instance found is returned. The search is performed first by hardware name, then by logical name.

If a call to this object\x27s is_online() method returns FALSE although you are certain that the matching device is plugged, make sure that you did call registerHub() at application initialization time.

',par:{func:'a string that uniquely characterizes the voltage output'},ret:'a `YVoltageOutput` object allowing you to drive the voltage output.'}; doc['VoltageOutput']['FirstVoltageOutput']={syn:'Starts the enumeration of voltage outputs currently accessible.',lib:'YVoltageOutput.FirstVoltageOutput()',pro:'function FirstVoltageOutput()',cmt:'

Starts the enumeration of voltage outputs currently accessible. Use the method `YVoltageOutput.nextVoltageOutput()` to iterate on next voltage outputs.

',ret:'a pointer to a `YVoltageOutput` object, corresponding to the first voltage output currently online, or a `null` pointer if there are none.'}; doc['VoltageOutput']['clearCache']={syn:'Invalidates the cache.',lib:'voltageoutput.clearCache()',pro:'function clearCache()',cmt:'

Invalidates the cache. Invalidates the cache of the voltage output attributes. Forces the next call to get_xxx() or loadxxx() to use values that come from the device.

'}; doc['VoltageOutput']['describe']={syn:'Returns a short text that describes unambiguously the instance of the voltage output in the form `TYPE(NAME)=SERIAL.FUNCTIONID`.',lib:'voltageoutput.describe()',pro:'function describe()',cmt:'

Returns a short text that describes unambiguously the instance of the voltage output in the form `TYPE(NAME)=SERIAL.FUNCTIONID`. More precisely, `TYPE` is the type of the function, `NAME` it the name used for the first access to the function, `SERIAL` is the serial number of the module if the module is connected or `\x22unresolved\x22`, and `FUNCTIONID` is the hardware identifier of the function if the module is connected. For example, this method returns `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1` if the module is already connected or `Relay(BadCustomeName.relay1)=unresolved` if the module has not yet been connected. This method does not trigger any USB or TCP transaction and can therefore be used in a debugger.

',ret:'a string that describes the voltage output (ex: `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1`)'}; doc['VoltageOutput']['get_advertisedValue']={syn:'Returns the current value of the voltage output (no more than 6 characters).',lib:'voltageoutput.get_advertisedValue()',pro:'function get_advertisedValue()',cmt:'

Returns the current value of the voltage output (no more than 6 characters).

',ret:'a string corresponding to the current value of the voltage output (no more than 6 characters).',ext:'On failure, throws an exception or returns `Y_ADVERTISEDVALUE_INVALID`.'}; doc['VoltageOutput']['get_currentVoltage']={syn:'Returns the output voltage set point, in V.',lib:'voltageoutput.get_currentVoltage()',pro:'function get_currentVoltage()',cmt:'

Returns the output voltage set point, in V.

',ret:'a floating point number corresponding to the output voltage set point, in V',ext:'On failure, throws an exception or returns `Y_CURRENTVOLTAGE_INVALID`.'}; doc['VoltageOutput']['get_errorMessage']={syn:'Returns the error message of the latest error with the voltage output.',lib:'voltageoutput.get_errorMessage()',pro:'function get_errorMessage()',cmt:'

Returns the error message of the latest error with the voltage output. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a string corresponding to the latest error message that occured while using the voltage output object'}; doc['VoltageOutput']['get_errorType']={syn:'Returns the numerical error code of the latest error with the voltage output.',lib:'voltageoutput.get_errorType()',pro:'function get_errorType()',cmt:'

Returns the numerical error code of the latest error with the voltage output. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a number corresponding to the code of the latest error that occurred while using the voltage output object'}; doc['VoltageOutput']['get_friendlyName']={syn:'Returns a global identifier of the voltage output in the format `MODULE_NAME.FUNCTION_NAME`.',lib:'voltageoutput.get_friendlyName()',pro:'function get_friendlyName()',cmt:'

Returns a global identifier of the voltage output in the format `MODULE_NAME.FUNCTION_NAME`. The returned string uses the logical names of the module and of the voltage output if they are defined, otherwise the serial number of the module and the hardware identifier of the voltage output (for example: `MyCustomName.relay1`)

',ret:'a string that uniquely identifies the voltage output using logical names (ex: `MyCustomName.relay1`)',ext:'On failure, throws an exception or returns `Y_FRIENDLYNAME_INVALID`.'}; doc['VoltageOutput']['get_functionDescriptor']={syn:'Returns a unique identifier of type `YFUN_DESCR` corresponding to the function.',lib:'voltageoutput.get_functionDescriptor()',pro:'function get_functionDescriptor()',cmt:'

Returns a unique identifier of type `YFUN_DESCR` corresponding to the function. This identifier can be used to test if two instances of `YFunction` reference the same physical function on the same physical device.

',ret:'an identifier of type `YFUN_DESCR`.',ext:'If the function has never been contacted, the returned value is `Y_FUNCTIONDESCRIPTOR_INVALID`.'}; doc['VoltageOutput']['get_functionId']={syn:'Returns the hardware identifier of the voltage output, without reference to the module.',lib:'voltageoutput.get_functionId()',pro:'function get_functionId()',cmt:'

Returns the hardware identifier of the voltage output, without reference to the module. For example `relay1`

',ret:'a string that identifies the voltage output (ex: `relay1`)',ext:'On failure, throws an exception or returns `Y_FUNCTIONID_INVALID`.'}; doc['VoltageOutput']['get_hardwareId']={syn:'Returns the unique hardware identifier of the voltage output in the form `SERIAL.FUNCTIONID`.',lib:'voltageoutput.get_hardwareId()',pro:'function get_hardwareId()',cmt:'

Returns the unique hardware identifier of the voltage output in the form `SERIAL.FUNCTIONID`. The unique hardware identifier is composed of the device serial number and of the hardware identifier of the voltage output (for example `RELAYLO1-123456.relay1`).

',ret:'a string that uniquely identifies the voltage output (ex: `RELAYLO1-123456.relay1`)',ext:'On failure, throws an exception or returns `Y_HARDWAREID_INVALID`.'}; doc['VoltageOutput']['get_logicalName']={syn:'Returns the logical name of the voltage output.',lib:'voltageoutput.get_logicalName()',pro:'function get_logicalName()',cmt:'

Returns the logical name of the voltage output.

',ret:'a string corresponding to the logical name of the voltage output.',ext:'On failure, throws an exception or returns `Y_LOGICALNAME_INVALID`.'}; doc['VoltageOutput']['get_module']={syn:'Gets the `YModule` object for the device on which the function is located.',lib:'voltageoutput.get_module()',pro:'function get_module()',cmt:'

Gets the `YModule` object for the device on which the function is located. If the function cannot be located on any module, the returned instance of `YModule` is not shown as on-line.

',ret:'an instance of `YModule`'}; doc['VoltageOutput']['get_module_async']={syn:'Gets the `YModule` object for the device on which the function is located (asynchronous version).',lib:'voltageoutput.get_module_async()',pro:'function get_module_async(callback, context)',cmt:'

Gets the `YModule` object for the device on which the function is located (asynchronous version). If the function cannot be located on any module, the returned `YModule` object does not show as on-line.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking Firefox javascript VM that does not implement context switching during blocking I/O calls. See the documentation section on asynchronous Javascript calls for more details.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the requested `YModule` object',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['VoltageOutput']['get_userData']={syn:'Returns the value of the userData attribute, as previously stored using method `set_userData`.',lib:'voltageoutput.get_userData()',pro:'function get_userData()',cmt:'

Returns the value of the userData attribute, as previously stored using method `set_userData`. This attribute is never touched directly by the API, and is at disposal of the caller to store a context.

',ret:'the object stored previously by the caller.'}; doc['VoltageOutput']['get_voltageAtStartUp']={syn:'Returns the selected voltage output at device startup, in V.',lib:'voltageoutput.get_voltageAtStartUp()',pro:'function get_voltageAtStartUp()',cmt:'

Returns the selected voltage output at device startup, in V.

',ret:'a floating point number corresponding to the selected voltage output at device startup, in V',ext:'On failure, throws an exception or returns `Y_VOLTAGEATSTARTUP_INVALID`.'}; doc['VoltageOutput']['isOnline']={syn:'Checks if the voltage output is currently reachable, without raising any error.',lib:'voltageoutput.isOnline()',pro:'function isOnline()',cmt:'

Checks if the voltage output is currently reachable, without raising any error. If there is a cached value for the voltage output in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the voltage output.

',ret:'`true` if the voltage output can be reached, and `false` otherwise'}; doc['VoltageOutput']['isOnline_async']={syn:'Checks if the voltage output is currently reachable, without raising any error (asynchronous version).',lib:'voltageoutput.isOnline_async()',pro:'function isOnline_async(callback, context)',cmt:'

Checks if the voltage output is currently reachable, without raising any error (asynchronous version). If there is a cached value for the voltage output in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the requested function.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the boolean result',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['VoltageOutput']['load']={syn:'Preloads the voltage output cache with a specified validity duration.',lib:'voltageoutput.load()',pro:'function load(msValidity)',cmt:'

Preloads the voltage output cache with a specified validity duration. By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network traffic for instance.

',par:{msValidity:'an integer corresponding to the validity attributed to the loaded function parameters, in milliseconds'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['VoltageOutput']['loadAttribute']={syn:'Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.',lib:'voltageoutput.loadAttribute()',pro:'function loadAttribute(attrName)',cmt:'

Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.

',par:{attrName:'the name of the requested attribute'},ret:'a string with the value of the the attribute',ext:'On failure, throws an exception or returns an empty string.'}; doc['VoltageOutput']['load_async']={syn:'Preloads the voltage output cache with a specified validity duration (asynchronous version).',lib:'voltageoutput.load_async()',pro:'function load_async(msValidity, callback, context)',cmt:'

Preloads the voltage output cache with a specified validity duration (asynchronous version). By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network trafic for instance.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{msValidity:'an integer corresponding to the validity of the loaded function parameters, in milliseconds',callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the error code (or `YAPI_SUCCESS`)',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['VoltageOutput']['muteValueCallbacks']={syn:'Disables the propagation of every new advertised value to the parent hub.',lib:'voltageoutput.muteValueCallbacks()',pro:'function muteValueCallbacks()',cmt:'

Disables the propagation of every new advertised value to the parent hub. You can use this function to save bandwidth and CPU on computers with limited resources, or to prevent unwanted invocations of the HTTP callback. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['VoltageOutput']['nextVoltageOutput']={syn:'Continues the enumeration of voltage outputs started using `yFirstVoltageOutput()`.',lib:'voltageoutput.nextVoltageOutput()',pro:'function nextVoltageOutput()',cmt:'

Continues the enumeration of voltage outputs started using `yFirstVoltageOutput()`.

',ret:'a pointer to a `YVoltageOutput` object, corresponding to a voltage output currently online, or a `null` pointer if there are no more voltage outputs to enumerate.'}; doc['VoltageOutput']['registerValueCallback']={syn:'Registers the callback function that is invoked on every change of advertised value.',lib:'voltageoutput.registerValueCallback()',pro:'function registerValueCallback(callback)',cmt:'

Registers the callback function that is invoked on every change of advertised value. The callback is invoked only during the execution of `ySleep` or `yHandleEvents`. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a null pointer as argument.

',par:{callback:'the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and the character string describing the new advertised value.'}}; doc['VoltageOutput']['set_currentVoltage']={syn:'Changes the output voltage, in V.',lib:'voltageoutput.set_currentVoltage()',pro:'function set_currentVoltage(newval)',cmt:'

Changes the output voltage, in V. Valid range is from 0 to 10V.

',par:{newval:'a floating point number corresponding to the output voltage, in V'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['VoltageOutput']['set_logicalName']={syn:'Changes the logical name of the voltage output.',lib:'voltageoutput.set_logicalName()',pro:'function set_logicalName(newval)',cmt:'

Changes the logical name of the voltage output. You can use `yCheckLogicalName()` prior to this call to make sure that your parameter is valid. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',par:{newval:'a string corresponding to the logical name of the voltage output.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['VoltageOutput']['set_userData']={syn:'Stores a user context provided as argument in the userData attribute of the function.',lib:'voltageoutput.set_userData()',pro:'function set_userData(data)',cmt:'

Stores a user context provided as argument in the userData attribute of the function. This attribute is never touched by the API, and is at disposal of the caller to store a context.

',par:{data:'any kind of object to be stored'}}; doc['VoltageOutput']['set_voltageAtStartUp']={syn:'Changes the output voltage at device start up.',lib:'voltageoutput.set_voltageAtStartUp()',pro:'function set_voltageAtStartUp(newval)',cmt:'

Changes the output voltage at device start up. Remember to call the matching module `saveToFlash()` method, otherwise this call has no effect.

',par:{newval:'a floating point number corresponding to the output voltage at device start up'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['VoltageOutput']['unmuteValueCallbacks']={syn:'Re-enables the propagation of every new advertised value to the parent hub.',lib:'voltageoutput.unmuteValueCallbacks()',pro:'function unmuteValueCallbacks()',cmt:'

Re-enables the propagation of every new advertised value to the parent hub. This function reverts the effect of a previous call to `muteValueCallbacks()`. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['VoltageOutput']['voltageMove']={syn:'Performs a smooth transistion of output voltage.',lib:'voltageoutput.voltageMove()',pro:'function voltageMove(V_target, ms_duration)',cmt:'

Performs a smooth transistion of output voltage. Any explicit voltage change cancels any ongoing transition process.

',par:{V_target:'new output voltage value at the end of the transition (floating-point number, representing the end voltage in V)',ms_duration:'total duration of the transition, in milliseconds'},ret:'`YAPI_SUCCESS` when the call succeeds.'}; doc['VoltageOutput']['wait_async']={syn:'Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function.',lib:'voltageoutput.wait_async()',pro:'function wait_async(callback, context)',cmt:'

Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function. The callback function can therefore freely issue synchronous or asynchronous commands, without risking to block the Javascript VM.

',par:{callback:'callback function that is invoked when all pending commands on the module are completed. The callback function receives two arguments: the caller-specific context object and the receiving function object.',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing.'}; //--- (end of generated code: VoltageOutput) //--- (generated code: WeighScale) doc['WeighScale']={'':{syn:'WeighScale function interface',inc:'<script type='text/javascript' src='yocto_weighscale.js'></script>',cmt:'

The YWeighScale class provides a weight measurement from a ratiometric load cell sensor. It can be used to control the bridge excitation parameters, in order to avoid measure shifts caused by temperature variation in the electronics, and can also automatically apply an additional correction factor based on temperature to compensate for offsets in the load cell itself.

'}}; doc['WeighScale']['FindWeighScale']={syn:'Retrieves a weighing scale sensor for a given identifier.',lib:'YWeighScale.FindWeighScale()',pro:'function FindWeighScale(func)',cmt:'

Retrieves a weighing scale sensor for a given identifier. The identifier can be specified using several formats:

- FunctionLogicalName
- ModuleSerialNumber.FunctionIdentifier
- ModuleSerialNumber.FunctionLogicalName
- ModuleLogicalName.FunctionIdentifier
- ModuleLogicalName.FunctionLogicalName

This function does not require that the weighing scale sensor is online at the time it is invoked. The returned object is nevertheless valid. Use the method `YWeighScale.isOnline()` to test if the weighing scale sensor is indeed online at a given time. In case of ambiguity when looking for a weighing scale sensor by logical name, no error is notified: the first instance found is returned. The search is performed first by hardware name, then by logical name.

If a call to this object\x27s is_online() method returns FALSE although you are certain that the matching device is plugged, make sure that you did call registerHub() at application initialization time.

',par:{func:'a string that uniquely characterizes the weighing scale sensor'},ret:'a `YWeighScale` object allowing you to drive the weighing scale sensor.'}; doc['WeighScale']['FirstWeighScale']={syn:'Starts the enumeration of weighing scale sensors currently accessible.',lib:'YWeighScale.FirstWeighScale()',pro:'function FirstWeighScale()',cmt:'

Starts the enumeration of weighing scale sensors currently accessible. Use the method `YWeighScale.nextWeighScale()` to iterate on next weighing scale sensors.

',ret:'a pointer to a `YWeighScale` object, corresponding to the first weighing scale sensor currently online, or a `null` pointer if there are none.'}; doc['WeighScale']['calibrateFromPoints']={syn:'Configures error correction data points, in particular to compensate for a possible perturbation of the measure caused by an enclosure.',lib:'weighscale.calibrateFromPoints()',pro:'function calibrateFromPoints(rawValues, refValues)',cmt:'

Configures error correction data points, in particular to compensate for a possible perturbation of the measure caused by an enclosure. It is possible to configure up to five correction points. Correction points must be provided in ascending order, and be in the range of the sensor. The device will automatically perform a linear interpolation of the error correction between specified points. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

For more information on advanced capabilities to refine the calibration of sensors, please contact support@yoctopuce.com.

',par:{rawValues:'array of floating point numbers, corresponding to the raw values returned by the sensor for the correction points.',refValues:'array of floating point numbers, corresponding to the corrected values for the correction points.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['WeighScale']['clearCache']={syn:'Invalidates the cache.',lib:'weighscale.clearCache()',pro:'function clearCache()',cmt:'

Invalidates the cache. Invalidates the cache of the weighing scale sensor attributes. Forces the next call to get_xxx() or loadxxx() to use values that come from the device.

'}; doc['WeighScale']['describe']={syn:'Returns a short text that describes unambiguously the instance of the weighing scale sensor in the form `TYPE(NAME)=SERIAL.FUNCTIONID`.',lib:'weighscale.describe()',pro:'function describe()',cmt:'

Returns a short text that describes unambiguously the instance of the weighing scale sensor in the form `TYPE(NAME)=SERIAL.FUNCTIONID`. More precisely, `TYPE` is the type of the function, `NAME` it the name used for the first access to the function, `SERIAL` is the serial number of the module if the module is connected or `\x22unresolved\x22`, and `FUNCTIONID` is the hardware identifier of the function if the module is connected. For example, this method returns `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1` if the module is already connected or `Relay(BadCustomeName.relay1)=unresolved` if the module has not yet been connected. This method does not trigger any USB or TCP transaction and can therefore be used in a debugger.

',ret:'a string that describes the weighing scale sensor (ex: `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1`)'}; doc['WeighScale']['get_advMode']={syn:'Returns the measuring mode used for the advertised value pushed to the parent hub.',lib:'weighscale.get_advMode()',pro:'function get_advMode()',cmt:'

Returns the measuring mode used for the advertised value pushed to the parent hub.

',ret:'a value among `Y_ADVMODE_IMMEDIATE`, `Y_ADVMODE_PERIOD_AVG`, `Y_ADVMODE_PERIOD_MIN` and `Y_ADVMODE_PERIOD_MAX` corresponding to the measuring mode used for the advertised value pushed to the parent hub',ext:'On failure, throws an exception or returns `Y_ADVMODE_INVALID`.'}; doc['WeighScale']['get_advertisedValue']={syn:'Returns the current value of the weighing scale sensor (no more than 6 characters).',lib:'weighscale.get_advertisedValue()',pro:'function get_advertisedValue()',cmt:'

Returns the current value of the weighing scale sensor (no more than 6 characters).

',ret:'a string corresponding to the current value of the weighing scale sensor (no more than 6 characters).',ext:'On failure, throws an exception or returns `Y_ADVERTISEDVALUE_INVALID`.'}; doc['WeighScale']['get_compTempAdaptRatio']={syn:'Returns the averaged temperature update rate, in percents.',lib:'weighscale.get_compTempAdaptRatio()',pro:'function get_compTempAdaptRatio()',cmt:'

Returns the averaged temperature update rate, in percents. The averaged temperature is updated every 10 seconds, by applying this adaptation rate to the difference between the measures ambiant temperature and the current compensation temperature. The standard rate is 0.04 percents, and the maximal rate is 65 percents.

',ret:'a floating point number corresponding to the averaged temperature update rate, in percents',ext:'On failure, throws an exception or returns `Y_COMPTEMPADAPTRATIO_INVALID`.'}; doc['WeighScale']['get_compTempAvg']={syn:'Returns the current averaged temperature, used for thermal compensation.',lib:'weighscale.get_compTempAvg()',pro:'function get_compTempAvg()',cmt:'

Returns the current averaged temperature, used for thermal compensation.

',ret:'a floating point number corresponding to the current averaged temperature, used for thermal compensation',ext:'On failure, throws an exception or returns `Y_COMPTEMPAVG_INVALID`.'}; doc['WeighScale']['get_compTempChg']={syn:'Returns the current temperature variation, used for thermal compensation.',lib:'weighscale.get_compTempChg()',pro:'function get_compTempChg()',cmt:'

Returns the current temperature variation, used for thermal compensation.

',ret:'a floating point number corresponding to the current temperature variation, used for thermal compensation',ext:'On failure, throws an exception or returns `Y_COMPTEMPCHG_INVALID`.'}; doc['WeighScale']['get_compensation']={syn:'Returns the current current thermal compensation value.',lib:'weighscale.get_compensation()',pro:'function get_compensation()',cmt:'

Returns the current current thermal compensation value.

',ret:'a floating point number corresponding to the current current thermal compensation value',ext:'On failure, throws an exception or returns `Y_COMPENSATION_INVALID`.'}; doc['WeighScale']['get_currentRawValue']={syn:'Returns the uncalibrated, unrounded raw value returned by the sensor, in the specified unit, as a floating point number.',lib:'weighscale.get_currentRawValue()',pro:'function get_currentRawValue()',cmt:'

Returns the uncalibrated, unrounded raw value returned by the sensor, in the specified unit, as a floating point number.

',ret:'a floating point number corresponding to the uncalibrated, unrounded raw value returned by the sensor, in the specified unit, as a floating point number',ext:'On failure, throws an exception or returns `Y_CURRENTRAWVALUE_INVALID`.'}; doc['WeighScale']['get_currentValue']={syn:'Returns the current value of the measure, in the specified unit, as a floating point number.',lib:'weighscale.get_currentValue()',pro:'function get_currentValue()',cmt:'

Returns the current value of the measure, in the specified unit, as a floating point number.

',ret:'a floating point number corresponding to the current value of the measure, in the specified unit, as a floating point number',ext:'On failure, throws an exception or returns `Y_CURRENTVALUE_INVALID`.'}; doc['WeighScale']['get_dataLogger']={syn:'Returns the YDatalogger object of the device hosting the sensor.',lib:'weighscale.get_dataLogger()',pro:'function get_dataLogger()',cmt:'

Returns the YDatalogger object of the device hosting the sensor. This method returns an object of class YDatalogger that can control global parameters of the data logger. The returned object should not be freed.

',ret:'an YDataLogger object or null on error.'}; doc['WeighScale']['get_errorMessage']={syn:'Returns the error message of the latest error with the weighing scale sensor.',lib:'weighscale.get_errorMessage()',pro:'function get_errorMessage()',cmt:'

Returns the error message of the latest error with the weighing scale sensor. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a string corresponding to the latest error message that occured while using the weighing scale sensor object'}; doc['WeighScale']['get_errorType']={syn:'Returns the numerical error code of the latest error with the weighing scale sensor.',lib:'weighscale.get_errorType()',pro:'function get_errorType()',cmt:'

Returns the numerical error code of the latest error with the weighing scale sensor. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a number corresponding to the code of the latest error that occurred while using the weighing scale sensor object'}; doc['WeighScale']['get_excitation']={syn:'Returns the current load cell bridge excitation method.',lib:'weighscale.get_excitation()',pro:'function get_excitation()',cmt:'

Returns the current load cell bridge excitation method.

',ret:'a value among `Y_EXCITATION_OFF`, `Y_EXCITATION_DC` and `Y_EXCITATION_AC` corresponding to the current load cell bridge excitation method',ext:'On failure, throws an exception or returns `Y_EXCITATION_INVALID`.'}; doc['WeighScale']['get_friendlyName']={syn:'Returns a global identifier of the weighing scale sensor in the format `MODULE_NAME.FUNCTION_NAME`.',lib:'weighscale.get_friendlyName()',pro:'function get_friendlyName()',cmt:'

Returns a global identifier of the weighing scale sensor in the format `MODULE_NAME.FUNCTION_NAME`. The returned string uses the logical names of the module and of the weighing scale sensor if they are defined, otherwise the serial number of the module and the hardware identifier of the weighing scale sensor (for example: `MyCustomName.relay1`)

',ret:'a string that uniquely identifies the weighing scale sensor using logical names (ex: `MyCustomName.relay1`)',ext:'On failure, throws an exception or returns `Y_FRIENDLYNAME_INVALID`.'}; doc['WeighScale']['get_functionDescriptor']={syn:'Returns a unique identifier of type `YFUN_DESCR` corresponding to the function.',lib:'weighscale.get_functionDescriptor()',pro:'function get_functionDescriptor()',cmt:'

Returns a unique identifier of type `YFUN_DESCR` corresponding to the function. This identifier can be used to test if two instances of `YFunction` reference the same physical function on the same physical device.

',ret:'an identifier of type `YFUN_DESCR`.',ext:'If the function has never been contacted, the returned value is `Y_FUNCTIONDESCRIPTOR_INVALID`.'}; doc['WeighScale']['get_functionId']={syn:'Returns the hardware identifier of the weighing scale sensor, without reference to the module.',lib:'weighscale.get_functionId()',pro:'function get_functionId()',cmt:'

Returns the hardware identifier of the weighing scale sensor, without reference to the module. For example `relay1`

',ret:'a string that identifies the weighing scale sensor (ex: `relay1`)',ext:'On failure, throws an exception or returns `Y_FUNCTIONID_INVALID`.'}; doc['WeighScale']['get_hardwareId']={syn:'Returns the unique hardware identifier of the weighing scale sensor in the form `SERIAL.FUNCTIONID`.',lib:'weighscale.get_hardwareId()',pro:'function get_hardwareId()',cmt:'

Returns the unique hardware identifier of the weighing scale sensor in the form `SERIAL.FUNCTIONID`. The unique hardware identifier is composed of the device serial number and of the hardware identifier of the weighing scale sensor (for example `RELAYLO1-123456.relay1`).

',ret:'a string that uniquely identifies the weighing scale sensor (ex: `RELAYLO1-123456.relay1`)',ext:'On failure, throws an exception or returns `Y_HARDWAREID_INVALID`.'}; doc['WeighScale']['get_highestValue']={syn:'Returns the maximal value observed for the measure since the device was started.',lib:'weighscale.get_highestValue()',pro:'function get_highestValue()',cmt:'

Returns the maximal value observed for the measure since the device was started. Can be reset to an arbitrary value thanks to set_highestValue().

',ret:'a floating point number corresponding to the maximal value observed for the measure since the device was started',ext:'On failure, throws an exception or returns `Y_HIGHESTVALUE_INVALID`.'}; doc['WeighScale']['get_logFrequency']={syn:'Returns the datalogger recording frequency for this function, or \x22OFF\x22 when measures are not stored in the data logger flash memory.',lib:'weighscale.get_logFrequency()',pro:'function get_logFrequency()',cmt:'

Returns the datalogger recording frequency for this function, or \x22OFF\x22 when measures are not stored in the data logger flash memory.

',ret:'a string corresponding to the datalogger recording frequency for this function, or \x22OFF\x22 when measures are not stored in the data logger flash memory',ext:'On failure, throws an exception or returns `Y_LOGFREQUENCY_INVALID`.'}; doc['WeighScale']['get_logicalName']={syn:'Returns the logical name of the weighing scale sensor.',lib:'weighscale.get_logicalName()',pro:'function get_logicalName()',cmt:'

Returns the logical name of the weighing scale sensor.

',ret:'a string corresponding to the logical name of the weighing scale sensor.',ext:'On failure, throws an exception or returns `Y_LOGICALNAME_INVALID`.'}; doc['WeighScale']['get_lowestValue']={syn:'Returns the minimal value observed for the measure since the device was started.',lib:'weighscale.get_lowestValue()',pro:'function get_lowestValue()',cmt:'

Returns the minimal value observed for the measure since the device was started. Can be reset to an arbitrary value thanks to set_lowestValue().

',ret:'a floating point number corresponding to the minimal value observed for the measure since the device was started',ext:'On failure, throws an exception or returns `Y_LOWESTVALUE_INVALID`.'}; doc['WeighScale']['get_module']={syn:'Gets the `YModule` object for the device on which the function is located.',lib:'weighscale.get_module()',pro:'function get_module()',cmt:'

Gets the `YModule` object for the device on which the function is located. If the function cannot be located on any module, the returned instance of `YModule` is not shown as on-line.

',ret:'an instance of `YModule`'}; doc['WeighScale']['get_module_async']={syn:'Gets the `YModule` object for the device on which the function is located (asynchronous version).',lib:'weighscale.get_module_async()',pro:'function get_module_async(callback, context)',cmt:'

Gets the `YModule` object for the device on which the function is located (asynchronous version). If the function cannot be located on any module, the returned `YModule` object does not show as on-line.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking Firefox javascript VM that does not implement context switching during blocking I/O calls. See the documentation section on asynchronous Javascript calls for more details.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the requested `YModule` object',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['WeighScale']['get_recordedData']={syn:'Retrieves a DataSet object holding historical data for this sensor, for a specified time interval.',lib:'weighscale.get_recordedData()',pro:'function get_recordedData(startTime, endTime)',cmt:'

Retrieves a DataSet object holding historical data for this sensor, for a specified time interval. The measures will be retrieved from the data logger, which must have been turned on at the desired time. See the documentation of the DataSet class for information on how to get an overview of the recorded data, and how to load progressively a large set of measures from the data logger.

This function only works if the device uses a recent firmware, as DataSet objects are not supported by firmwares older than version 13000.

',par:{startTime:'the start of the desired measure time interval, as a Unix timestamp, i.e. the number of seconds since January 1, 1970 UTC. The special value 0 can be used to include any meaasure, without initial limit.',endTime:'the end of the desired measure time interval, as a Unix timestamp, i.e. the number of seconds since January 1, 1970 UTC. The special value 0 can be used to include any meaasure, without ending limit.'},ret:'an instance of YDataSet, providing access to historical data. Past measures can be loaded progressively using methods from the YDataSet object.'}; doc['WeighScale']['get_reportFrequency']={syn:'Returns the timed value notification frequency, or \x22OFF\x22 if timed value notifications are disabled for this function.',lib:'weighscale.get_reportFrequency()',pro:'function get_reportFrequency()',cmt:'

Returns the timed value notification frequency, or \x22OFF\x22 if timed value notifications are disabled for this function.

',ret:'a string corresponding to the timed value notification frequency, or \x22OFF\x22 if timed value notifications are disabled for this function',ext:'On failure, throws an exception or returns `Y_REPORTFREQUENCY_INVALID`.'}; doc['WeighScale']['get_resolution']={syn:'Returns the resolution of the measured values.',lib:'weighscale.get_resolution()',pro:'function get_resolution()',cmt:'

Returns the resolution of the measured values. The resolution corresponds to the numerical precision of the measures, which is not always the same as the actual precision of the sensor.

',ret:'a floating point number corresponding to the resolution of the measured values',ext:'On failure, throws an exception or returns `Y_RESOLUTION_INVALID`.'}; doc['WeighScale']['get_sensorState']={syn:'Returns the sensor health state code, which is zero when there is an up-to-date measure available or a positive code if the sensor is not able to provide a measure right now.',lib:'weighscale.get_sensorState()',pro:'function get_sensorState()',cmt:'

Returns the sensor health state code, which is zero when there is an up-to-date measure available or a positive code if the sensor is not able to provide a measure right now.

',ret:'an integer corresponding to the sensor health state code, which is zero when there is an up-to-date measure available or a positive code if the sensor is not able to provide a measure right now',ext:'On failure, throws an exception or returns `Y_SENSORSTATE_INVALID`.'}; doc['WeighScale']['get_unit']={syn:'Returns the measuring unit for the measure.',lib:'weighscale.get_unit()',pro:'function get_unit()',cmt:'

Returns the measuring unit for the measure.

',ret:'a string corresponding to the measuring unit for the measure',ext:'On failure, throws an exception or returns `Y_UNIT_INVALID`.'}; doc['WeighScale']['get_userData']={syn:'Returns the value of the userData attribute, as previously stored using method `set_userData`.',lib:'weighscale.get_userData()',pro:'function get_userData()',cmt:'

Returns the value of the userData attribute, as previously stored using method `set_userData`. This attribute is never touched directly by the API, and is at disposal of the caller to store a context.

',ret:'the object stored previously by the caller.'}; doc['WeighScale']['get_zeroTracking']={syn:'Returns the zero tracking threshold value.',lib:'weighscale.get_zeroTracking()',pro:'function get_zeroTracking()',cmt:'

Returns the zero tracking threshold value. When this threshold is larger than zero, any measure under the threshold will automatically be ignored and the zero compensation will be updated.

',ret:'a floating point number corresponding to the zero tracking threshold value',ext:'On failure, throws an exception or returns `Y_ZEROTRACKING_INVALID`.'}; doc['WeighScale']['isOnline']={syn:'Checks if the weighing scale sensor is currently reachable, without raising any error.',lib:'weighscale.isOnline()',pro:'function isOnline()',cmt:'

Checks if the weighing scale sensor is currently reachable, without raising any error. If there is a cached value for the weighing scale sensor in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the weighing scale sensor.

',ret:'`true` if the weighing scale sensor can be reached, and `false` otherwise'}; doc['WeighScale']['isOnline_async']={syn:'Checks if the weighing scale sensor is currently reachable, without raising any error (asynchronous version).',lib:'weighscale.isOnline_async()',pro:'function isOnline_async(callback, context)',cmt:'

Checks if the weighing scale sensor is currently reachable, without raising any error (asynchronous version). If there is a cached value for the weighing scale sensor in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the requested function.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the boolean result',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['WeighScale']['load']={syn:'Preloads the weighing scale sensor cache with a specified validity duration.',lib:'weighscale.load()',pro:'function load(msValidity)',cmt:'

Preloads the weighing scale sensor cache with a specified validity duration. By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network traffic for instance.

',par:{msValidity:'an integer corresponding to the validity attributed to the loaded function parameters, in milliseconds'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['WeighScale']['loadAttribute']={syn:'Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.',lib:'weighscale.loadAttribute()',pro:'function loadAttribute(attrName)',cmt:'

Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.

',par:{attrName:'the name of the requested attribute'},ret:'a string with the value of the the attribute',ext:'On failure, throws an exception or returns an empty string.'}; doc['WeighScale']['loadCalibrationPoints']={syn:'Retrieves error correction data points previously entered using the method `calibrateFromPoints`.',lib:'weighscale.loadCalibrationPoints()',pro:'function loadCalibrationPoints(rawValues, refValues)',cmt:'

Retrieves error correction data points previously entered using the method `calibrateFromPoints`.

',par:{rawValues:'array of floating point numbers, that will be filled by the function with the raw sensor values for the correction points.',refValues:'array of floating point numbers, that will be filled by the function with the desired values for the correction points.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['WeighScale']['loadOffsetAvgCompensationTable']={syn:'Retrieves the weight offset thermal compensation table previously configured using the `set_offsetAvgCompensationTable` function.',lib:'weighscale.loadOffsetAvgCompensationTable()',pro:'function loadOffsetAvgCompensationTable(tempValues, compValues)',cmt:'

Retrieves the weight offset thermal compensation table previously configured using the `set_offsetAvgCompensationTable` function. The weight correction is applied by linear interpolation between specified points.

',par:{tempValues:'array of floating point numbers, that is filled by the function with all averaged temperatures for which an offset correction is specified.',compValues:'array of floating point numbers, that is filled by the function with the offset correction applied for each of the temperature included in the first argument, index by index.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['WeighScale']['loadOffsetChgCompensationTable']={syn:'Retrieves the weight offset thermal compensation table previously configured using the `set_offsetChgCompensationTable` function.',lib:'weighscale.loadOffsetChgCompensationTable()',pro:'function loadOffsetChgCompensationTable(tempValues, compValues)',cmt:'

Retrieves the weight offset thermal compensation table previously configured using the `set_offsetChgCompensationTable` function. The weight correction is applied by linear interpolation between specified points.

',par:{tempValues:'array of floating point numbers, that is filled by the function with all temperature variations for which an offset correction is specified.',compValues:'array of floating point numbers, that is filled by the function with the offset correction applied for each of the temperature variation included in the first argument, index by index.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['WeighScale']['loadSpanAvgCompensationTable']={syn:'Retrieves the weight span thermal compensation table previously configured using the `set_spanAvgCompensationTable` function.',lib:'weighscale.loadSpanAvgCompensationTable()',pro:'function loadSpanAvgCompensationTable(tempValues, compValues)',cmt:'

Retrieves the weight span thermal compensation table previously configured using the `set_spanAvgCompensationTable` function. The weight correction is applied by linear interpolation between specified points.

',par:{tempValues:'array of floating point numbers, that is filled by the function with all averaged temperatures for which an span correction is specified.',compValues:'array of floating point numbers, that is filled by the function with the span correction applied for each of the temperature included in the first argument, index by index.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['WeighScale']['loadSpanChgCompensationTable']={syn:'Retrieves the weight span thermal compensation table previously configured using the `set_spanChgCompensationTable` function.',lib:'weighscale.loadSpanChgCompensationTable()',pro:'function loadSpanChgCompensationTable(tempValues, compValues)',cmt:'

Retrieves the weight span thermal compensation table previously configured using the `set_spanChgCompensationTable` function. The weight correction is applied by linear interpolation between specified points.

',par:{tempValues:'array of floating point numbers, that is filled by the function with all variation of temperature for which an span correction is specified.',compValues:'array of floating point numbers, that is filled by the function with the span correction applied for each of variation of temperature included in the first argument, index by index.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['WeighScale']['load_async']={syn:'Preloads the weighing scale sensor cache with a specified validity duration (asynchronous version).',lib:'weighscale.load_async()',pro:'function load_async(msValidity, callback, context)',cmt:'

Preloads the weighing scale sensor cache with a specified validity duration (asynchronous version). By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network trafic for instance.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{msValidity:'an integer corresponding to the validity of the loaded function parameters, in milliseconds',callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the error code (or `YAPI_SUCCESS`)',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['WeighScale']['muteValueCallbacks']={syn:'Disables the propagation of every new advertised value to the parent hub.',lib:'weighscale.muteValueCallbacks()',pro:'function muteValueCallbacks()',cmt:'

Disables the propagation of every new advertised value to the parent hub. You can use this function to save bandwidth and CPU on computers with limited resources, or to prevent unwanted invocations of the HTTP callback. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['WeighScale']['nextWeighScale']={syn:'Continues the enumeration of weighing scale sensors started using `yFirstWeighScale()`.',lib:'weighscale.nextWeighScale()',pro:'function nextWeighScale()',cmt:'

Continues the enumeration of weighing scale sensors started using `yFirstWeighScale()`.

',ret:'a pointer to a `YWeighScale` object, corresponding to a weighing scale sensor currently online, or a `null` pointer if there are no more weighing scale sensors to enumerate.'}; doc['WeighScale']['registerTimedReportCallback']={syn:'Registers the callback function that is invoked on every periodic timed notification.',lib:'weighscale.registerTimedReportCallback()',pro:'function registerTimedReportCallback(callback)',cmt:'

Registers the callback function that is invoked on every periodic timed notification. The callback is invoked only during the execution of `ySleep` or `yHandleEvents`. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a null pointer as argument.

',par:{callback:'the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and an YMeasure object describing the new advertised value.'}}; doc['WeighScale']['registerValueCallback']={syn:'Registers the callback function that is invoked on every change of advertised value.',lib:'weighscale.registerValueCallback()',pro:'function registerValueCallback(callback)',cmt:'

Registers the callback function that is invoked on every change of advertised value. The callback is invoked only during the execution of `ySleep` or `yHandleEvents`. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a null pointer as argument.

',par:{callback:'the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and the character string describing the new advertised value.'}}; doc['WeighScale']['set_advMode']={syn:'Changes the measuring mode used for the advertised value pushed to the parent hub.',lib:'weighscale.set_advMode()',pro:'function set_advMode(newval)',cmt:'

Changes the measuring mode used for the advertised value pushed to the parent hub.

',par:{newval:'a value among `Y_ADVMODE_IMMEDIATE`, `Y_ADVMODE_PERIOD_AVG`, `Y_ADVMODE_PERIOD_MIN` and `Y_ADVMODE_PERIOD_MAX` corresponding to the measuring mode used for the advertised value pushed to the parent hub'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['WeighScale']['set_compTempAdaptRatio']={syn:'Changes the averaged temperature update rate, in percents.',lib:'weighscale.set_compTempAdaptRatio()',pro:'function set_compTempAdaptRatio(newval)',cmt:'

Changes the averaged temperature update rate, in percents. The averaged temperature is updated every 10 seconds, by applying this adaptation rate to the difference between the measures ambiant temperature and the current compensation temperature. The standard rate is 0.04 percents, and the maximal rate is 65 percents.

',par:{newval:'a floating point number corresponding to the averaged temperature update rate, in percents'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['WeighScale']['set_excitation']={syn:'Changes the current load cell bridge excitation method.',lib:'weighscale.set_excitation()',pro:'function set_excitation(newval)',cmt:'

Changes the current load cell bridge excitation method.

',par:{newval:'a value among `Y_EXCITATION_OFF`, `Y_EXCITATION_DC` and `Y_EXCITATION_AC` corresponding to the current load cell bridge excitation method'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['WeighScale']['set_highestValue']={syn:'Changes the recorded maximal value observed.',lib:'weighscale.set_highestValue()',pro:'function set_highestValue(newval)',cmt:'

Changes the recorded maximal value observed. Can be used to reset the value returned by get_lowestValue().

',par:{newval:'a floating point number corresponding to the recorded maximal value observed'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['WeighScale']['set_logFrequency']={syn:'Changes the datalogger recording frequency for this function.',lib:'weighscale.set_logFrequency()',pro:'function set_logFrequency(newval)',cmt:'

Changes the datalogger recording frequency for this function. The frequency can be specified as samples per second, as sample per minute (for instance \x2215/m\x22) or in samples per hour (eg. \x224/h\x22). To disable recording for this function, use the value \x22OFF\x22.

',par:{newval:'a string corresponding to the datalogger recording frequency for this function'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['WeighScale']['set_logicalName']={syn:'Changes the logical name of the weighing scale sensor.',lib:'weighscale.set_logicalName()',pro:'function set_logicalName(newval)',cmt:'

Changes the logical name of the weighing scale sensor. You can use `yCheckLogicalName()` prior to this call to make sure that your parameter is valid. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',par:{newval:'a string corresponding to the logical name of the weighing scale sensor.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['WeighScale']['set_lowestValue']={syn:'Changes the recorded minimal value observed.',lib:'weighscale.set_lowestValue()',pro:'function set_lowestValue(newval)',cmt:'

Changes the recorded minimal value observed. Can be used to reset the value returned by get_lowestValue().

',par:{newval:'a floating point number corresponding to the recorded minimal value observed'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['WeighScale']['set_offsetAvgCompensationTable']={syn:'Records a weight offset thermal compensation table, in order to automatically correct the measured weight based on the averaged compensation temperature.',lib:'weighscale.set_offsetAvgCompensationTable()',pro:'function set_offsetAvgCompensationTable(tempValues, compValues)',cmt:'

Records a weight offset thermal compensation table, in order to automatically correct the measured weight based on the averaged compensation temperature. The weight correction will be applied by linear interpolation between specified points.

',par:{tempValues:'array of floating point numbers, corresponding to all averaged temperatures for which an offset correction is specified.',compValues:'array of floating point numbers, corresponding to the offset correction to apply for each of the temperature included in the first argument, index by index.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['WeighScale']['set_offsetChgCompensationTable']={syn:'Records a weight offset thermal compensation table, in order to automatically correct the measured weight based on the variation of temperature.',lib:'weighscale.set_offsetChgCompensationTable()',pro:'function set_offsetChgCompensationTable(tempValues, compValues)',cmt:'

Records a weight offset thermal compensation table, in order to automatically correct the measured weight based on the variation of temperature. The weight correction will be applied by linear interpolation between specified points.

',par:{tempValues:'array of floating point numbers, corresponding to temperature variations for which an offset correction is specified.',compValues:'array of floating point numbers, corresponding to the offset correction to apply for each of the temperature variation included in the first argument, index by index.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['WeighScale']['set_reportFrequency']={syn:'Changes the timed value notification frequency for this function.',lib:'weighscale.set_reportFrequency()',pro:'function set_reportFrequency(newval)',cmt:'

Changes the timed value notification frequency for this function. The frequency can be specified as samples per second, as sample per minute (for instance \x2215/m\x22) or in samples per hour (eg. \x224/h\x22). To disable timed value notifications for this function, use the value \x22OFF\x22.

',par:{newval:'a string corresponding to the timed value notification frequency for this function'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['WeighScale']['set_resolution']={syn:'Changes the resolution of the measured physical values.',lib:'weighscale.set_resolution()',pro:'function set_resolution(newval)',cmt:'

Changes the resolution of the measured physical values. The resolution corresponds to the numerical precision when displaying value. It does not change the precision of the measure itself.

',par:{newval:'a floating point number corresponding to the resolution of the measured physical values'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['WeighScale']['set_spanAvgCompensationTable']={syn:'Records a weight span thermal compensation table, in order to automatically correct the measured weight based on the compensation temperature.',lib:'weighscale.set_spanAvgCompensationTable()',pro:'function set_spanAvgCompensationTable(tempValues, compValues)',cmt:'

Records a weight span thermal compensation table, in order to automatically correct the measured weight based on the compensation temperature. The weight correction will be applied by linear interpolation between specified points.

',par:{tempValues:'array of floating point numbers, corresponding to all averaged temperatures for which a span correction is specified.',compValues:'array of floating point numbers, corresponding to the span correction (in percents) to apply for each of the temperature included in the first argument, index by index.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['WeighScale']['set_spanChgCompensationTable']={syn:'Records a weight span thermal compensation table, in order to automatically correct the measured weight based on the variation of temperature.',lib:'weighscale.set_spanChgCompensationTable()',pro:'function set_spanChgCompensationTable(tempValues, compValues)',cmt:'

Records a weight span thermal compensation table, in order to automatically correct the measured weight based on the variation of temperature. The weight correction will be applied by linear interpolation between specified points.

',par:{tempValues:'array of floating point numbers, corresponding to all variations of temperatures for which a span correction is specified.',compValues:'array of floating point numbers, corresponding to the span correction (in percents) to apply for each of the temperature variation included in the first argument, index by index.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['WeighScale']['set_userData']={syn:'Stores a user context provided as argument in the userData attribute of the function.',lib:'weighscale.set_userData()',pro:'function set_userData(data)',cmt:'

Stores a user context provided as argument in the userData attribute of the function. This attribute is never touched by the API, and is at disposal of the caller to store a context.

',par:{data:'any kind of object to be stored'}}; doc['WeighScale']['set_zeroTracking']={syn:'Changes the compensation temperature update rate, in percents.',lib:'weighscale.set_zeroTracking()',pro:'function set_zeroTracking(newval)',cmt:'

Changes the compensation temperature update rate, in percents.

',par:{newval:'a floating point number corresponding to the compensation temperature update rate, in percents'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['WeighScale']['setupSpan']={syn:'Configures the load cell span parameters (stored in the corresponding genericSensor) so that the current signal corresponds to the specified reference weight.',lib:'weighscale.setupSpan()',pro:'function setupSpan(currWeight, maxWeight)',cmt:'

Configures the load cell span parameters (stored in the corresponding genericSensor) so that the current signal corresponds to the specified reference weight.

',par:{currWeight:'reference weight presently on the load cell.',maxWeight:'maximum weight to be expectect on the load cell.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['WeighScale']['startDataLogger']={syn:'Starts the data logger on the device.',lib:'weighscale.startDataLogger()',pro:'function startDataLogger()',cmt:'

Starts the data logger on the device. Note that the data logger will only save the measures on this sensor if the logFrequency is not set to \x22OFF\x22.

',ret:'`YAPI_SUCCESS` if the call succeeds.'}; doc['WeighScale']['stopDataLogger']={syn:'Stops the datalogger on the device.',lib:'weighscale.stopDataLogger()',pro:'function stopDataLogger()',cmt:'

Stops the datalogger on the device.

',ret:'`YAPI_SUCCESS` if the call succeeds.'}; doc['WeighScale']['tare']={syn:'Adapts the load cell signal bias (stored in the corresponding genericSensor) so that the current signal corresponds to a zero weight.',lib:'weighscale.tare()',pro:'function tare()',cmt:'

Adapts the load cell signal bias (stored in the corresponding genericSensor) so that the current signal corresponds to a zero weight.

',ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['WeighScale']['unmuteValueCallbacks']={syn:'Re-enables the propagation of every new advertised value to the parent hub.',lib:'weighscale.unmuteValueCallbacks()',pro:'function unmuteValueCallbacks()',cmt:'

Re-enables the propagation of every new advertised value to the parent hub. This function reverts the effect of a previous call to `muteValueCallbacks()`. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['WeighScale']['wait_async']={syn:'Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function.',lib:'weighscale.wait_async()',pro:'function wait_async(callback, context)',cmt:'

Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function. The callback function can therefore freely issue synchronous or asynchronous commands, without risking to block the Javascript VM.

',par:{callback:'callback function that is invoked when all pending commands on the module are completed. The callback function receives two arguments: the caller-specific context object and the receiving function object.',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing.'}; //--- (end of generated code: WeighScale) //--- (generated code: PowerSupply) doc['PowerSupply']={'':{syn:'PowerSupply function interface',inc:'<script type='text/javascript' src='yocto_powersupply.js'></script>',cmt:'

The Yoctopuce application programming interface allows you to change the voltage set point, the current limit and the enable/disable the output.

'}}; doc['PowerSupply']['FindPowerSupply']={syn:'Retrieves a regulated power supply for a given identifier.',lib:'YPowerSupply.FindPowerSupply()',pro:'function FindPowerSupply(func)',cmt:'

Retrieves a regulated power supply for a given identifier. The identifier can be specified using several formats:

- FunctionLogicalName
- ModuleSerialNumber.FunctionIdentifier
- ModuleSerialNumber.FunctionLogicalName
- ModuleLogicalName.FunctionIdentifier
- ModuleLogicalName.FunctionLogicalName

This function does not require that the regulated power supply is online at the time it is invoked. The returned object is nevertheless valid. Use the method `YPowerSupply.isOnline()` to test if the regulated power supply is indeed online at a given time. In case of ambiguity when looking for a regulated power supply by logical name, no error is notified: the first instance found is returned. The search is performed first by hardware name, then by logical name.

If a call to this object\x27s is_online() method returns FALSE although you are certain that the matching device is plugged, make sure that you did call registerHub() at application initialization time.

',par:{func:'a string that uniquely characterizes the regulated power supply'},ret:'a `YPowerSupply` object allowing you to drive the regulated power supply.'}; doc['PowerSupply']['FirstPowerSupply']={syn:'Starts the enumeration of regulated power supplies currently accessible.',lib:'YPowerSupply.FirstPowerSupply()',pro:'function FirstPowerSupply()',cmt:'

Starts the enumeration of regulated power supplies currently accessible. Use the method `YPowerSupply.nextPowerSupply()` to iterate on next regulated power supplies.

',ret:'a pointer to a `YPowerSupply` object, corresponding to the first regulated power supply currently online, or a `null` pointer if there are none.'}; doc['PowerSupply']['clearCache']={syn:'Invalidates the cache.',lib:'powersupply.clearCache()',pro:'function clearCache()',cmt:'

Invalidates the cache. Invalidates the cache of the regulated power supply attributes. Forces the next call to get_xxx() or loadxxx() to use values that come from the device.

'}; doc['PowerSupply']['describe']={syn:'Returns a short text that describes unambiguously the instance of the regulated power supply in the form `TYPE(NAME)=SERIAL.FUNCTIONID`.',lib:'powersupply.describe()',pro:'function describe()',cmt:'

Returns a short text that describes unambiguously the instance of the regulated power supply in the form `TYPE(NAME)=SERIAL.FUNCTIONID`. More precisely, `TYPE` is the type of the function, `NAME` it the name used for the first access to the function, `SERIAL` is the serial number of the module if the module is connected or `\x22unresolved\x22`, and `FUNCTIONID` is the hardware identifier of the function if the module is connected. For example, this method returns `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1` if the module is already connected or `Relay(BadCustomeName.relay1)=unresolved` if the module has not yet been connected. This method does not trigger any USB or TCP transaction and can therefore be used in a debugger.

',ret:'a string that describes the regulated power supply (ex: `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1`)'}; doc['PowerSupply']['get_advertisedValue']={syn:'Returns the current value of the regulated power supply (no more than 6 characters).',lib:'powersupply.get_advertisedValue()',pro:'function get_advertisedValue()',cmt:'

Returns the current value of the regulated power supply (no more than 6 characters).

',ret:'a string corresponding to the current value of the regulated power supply (no more than 6 characters).',ext:'On failure, throws an exception or returns `Y_ADVERTISEDVALUE_INVALID`.'}; doc['PowerSupply']['get_currentAtStartUp']={syn:'Returns the selected current limit at device startup, in mA.',lib:'powersupply.get_currentAtStartUp()',pro:'function get_currentAtStartUp()',cmt:'

Returns the selected current limit at device startup, in mA.

',ret:'a floating point number corresponding to the selected current limit at device startup, in mA',ext:'On failure, throws an exception or returns `Y_CURRENTATSTARTUP_INVALID`.'}; doc['PowerSupply']['get_currentLimit']={syn:'Returns the current limit, in mA.',lib:'powersupply.get_currentLimit()',pro:'function get_currentLimit()',cmt:'

Returns the current limit, in mA.

',ret:'a floating point number corresponding to the current limit, in mA',ext:'On failure, throws an exception or returns `Y_CURRENTLIMIT_INVALID`.'}; doc['PowerSupply']['get_errorMessage']={syn:'Returns the error message of the latest error with the regulated power supply.',lib:'powersupply.get_errorMessage()',pro:'function get_errorMessage()',cmt:'

Returns the error message of the latest error with the regulated power supply. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a string corresponding to the latest error message that occured while using the regulated power supply object'}; doc['PowerSupply']['get_errorType']={syn:'Returns the numerical error code of the latest error with the regulated power supply.',lib:'powersupply.get_errorType()',pro:'function get_errorType()',cmt:'

Returns the numerical error code of the latest error with the regulated power supply. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a number corresponding to the code of the latest error that occurred while using the regulated power supply object'}; doc['PowerSupply']['get_friendlyName']={syn:'Returns a global identifier of the regulated power supply in the format `MODULE_NAME.FUNCTION_NAME`.',lib:'powersupply.get_friendlyName()',pro:'function get_friendlyName()',cmt:'

Returns a global identifier of the regulated power supply in the format `MODULE_NAME.FUNCTION_NAME`. The returned string uses the logical names of the module and of the regulated power supply if they are defined, otherwise the serial number of the module and the hardware identifier of the regulated power supply (for example: `MyCustomName.relay1`)

',ret:'a string that uniquely identifies the regulated power supply using logical names (ex: `MyCustomName.relay1`)',ext:'On failure, throws an exception or returns `Y_FRIENDLYNAME_INVALID`.'}; doc['PowerSupply']['get_functionDescriptor']={syn:'Returns a unique identifier of type `YFUN_DESCR` corresponding to the function.',lib:'powersupply.get_functionDescriptor()',pro:'function get_functionDescriptor()',cmt:'

Returns a unique identifier of type `YFUN_DESCR` corresponding to the function. This identifier can be used to test if two instances of `YFunction` reference the same physical function on the same physical device.

',ret:'an identifier of type `YFUN_DESCR`.',ext:'If the function has never been contacted, the returned value is `Y_FUNCTIONDESCRIPTOR_INVALID`.'}; doc['PowerSupply']['get_functionId']={syn:'Returns the hardware identifier of the regulated power supply, without reference to the module.',lib:'powersupply.get_functionId()',pro:'function get_functionId()',cmt:'

Returns the hardware identifier of the regulated power supply, without reference to the module. For example `relay1`

',ret:'a string that identifies the regulated power supply (ex: `relay1`)',ext:'On failure, throws an exception or returns `Y_FUNCTIONID_INVALID`.'}; doc['PowerSupply']['get_hardwareId']={syn:'Returns the unique hardware identifier of the regulated power supply in the form `SERIAL.FUNCTIONID`.',lib:'powersupply.get_hardwareId()',pro:'function get_hardwareId()',cmt:'

Returns the unique hardware identifier of the regulated power supply in the form `SERIAL.FUNCTIONID`. The unique hardware identifier is composed of the device serial number and of the hardware identifier of the regulated power supply (for example `RELAYLO1-123456.relay1`).

',ret:'a string that uniquely identifies the regulated power supply (ex: `RELAYLO1-123456.relay1`)',ext:'On failure, throws an exception or returns `Y_HARDWAREID_INVALID`.'}; doc['PowerSupply']['get_inputVoltage']={syn:'Returns the measured input voltage, in V.',lib:'powersupply.get_inputVoltage()',pro:'function get_inputVoltage()',cmt:'

Returns the measured input voltage, in V.

',ret:'a floating point number corresponding to the measured input voltage, in V',ext:'On failure, throws an exception or returns `Y_INPUTVOLTAGE_INVALID`.'}; doc['PowerSupply']['get_ldoTemperature']={syn:'Returns the LDO temperature, in Celsius.',lib:'powersupply.get_ldoTemperature()',pro:'function get_ldoTemperature()',cmt:'

Returns the LDO temperature, in Celsius.

',ret:'a floating point number corresponding to the LDO temperature, in Celsius',ext:'On failure, throws an exception or returns `Y_LDOTEMPERATURE_INVALID`.'}; doc['PowerSupply']['get_logicalName']={syn:'Returns the logical name of the regulated power supply.',lib:'powersupply.get_logicalName()',pro:'function get_logicalName()',cmt:'

Returns the logical name of the regulated power supply.

',ret:'a string corresponding to the logical name of the regulated power supply.',ext:'On failure, throws an exception or returns `Y_LOGICALNAME_INVALID`.'}; doc['PowerSupply']['get_measuredCurrent']={syn:'Returns the measured output current, in mA.',lib:'powersupply.get_measuredCurrent()',pro:'function get_measuredCurrent()',cmt:'

Returns the measured output current, in mA.

',ret:'a floating point number corresponding to the measured output current, in mA',ext:'On failure, throws an exception or returns `Y_MEASUREDCURRENT_INVALID`.'}; doc['PowerSupply']['get_measuredVoltage']={syn:'Returns the measured output voltage, in V.',lib:'powersupply.get_measuredVoltage()',pro:'function get_measuredVoltage()',cmt:'

Returns the measured output voltage, in V.

',ret:'a floating point number corresponding to the measured output voltage, in V',ext:'On failure, throws an exception or returns `Y_MEASUREDVOLTAGE_INVALID`.'}; doc['PowerSupply']['get_module']={syn:'Gets the `YModule` object for the device on which the function is located.',lib:'powersupply.get_module()',pro:'function get_module()',cmt:'

Gets the `YModule` object for the device on which the function is located. If the function cannot be located on any module, the returned instance of `YModule` is not shown as on-line.

',ret:'an instance of `YModule`'}; doc['PowerSupply']['get_module_async']={syn:'Gets the `YModule` object for the device on which the function is located (asynchronous version).',lib:'powersupply.get_module_async()',pro:'function get_module_async(callback, context)',cmt:'

Gets the `YModule` object for the device on which the function is located (asynchronous version). If the function cannot be located on any module, the returned `YModule` object does not show as on-line.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking Firefox javascript VM that does not implement context switching during blocking I/O calls. See the documentation section on asynchronous Javascript calls for more details.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the requested `YModule` object',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['PowerSupply']['get_powerOutput']={syn:'Returns the power supply output switch state.',lib:'powersupply.get_powerOutput()',pro:'function get_powerOutput()',cmt:'

Returns the power supply output switch state.

',ret:'either `Y_POWEROUTPUT_OFF` or `Y_POWEROUTPUT_ON`, according to the power supply output switch state',ext:'On failure, throws an exception or returns `Y_POWEROUTPUT_INVALID`.'}; doc['PowerSupply']['get_userData']={syn:'Returns the value of the userData attribute, as previously stored using method `set_userData`.',lib:'powersupply.get_userData()',pro:'function get_userData()',cmt:'

Returns the value of the userData attribute, as previously stored using method `set_userData`. This attribute is never touched directly by the API, and is at disposal of the caller to store a context.

',ret:'the object stored previously by the caller.'}; doc['PowerSupply']['get_vInt']={syn:'Returns the internal voltage, in V.',lib:'powersupply.get_vInt()',pro:'function get_vInt()',cmt:'

Returns the internal voltage, in V.

',ret:'a floating point number corresponding to the internal voltage, in V',ext:'On failure, throws an exception or returns `Y_VINT_INVALID`.'}; doc['PowerSupply']['get_voltageAtStartUp']={syn:'Returns the selected voltage set point at device startup, in V.',lib:'powersupply.get_voltageAtStartUp()',pro:'function get_voltageAtStartUp()',cmt:'

Returns the selected voltage set point at device startup, in V.

',ret:'a floating point number corresponding to the selected voltage set point at device startup, in V',ext:'On failure, throws an exception or returns `Y_VOLTAGEATSTARTUP_INVALID`.'}; doc['PowerSupply']['get_voltageSense']={syn:'Returns the output voltage control point.',lib:'powersupply.get_voltageSense()',pro:'function get_voltageSense()',cmt:'

Returns the output voltage control point.

',ret:'either `Y_VOLTAGESENSE_INT` or `Y_VOLTAGESENSE_EXT`, according to the output voltage control point',ext:'On failure, throws an exception or returns `Y_VOLTAGESENSE_INVALID`.'}; doc['PowerSupply']['get_voltageSetPoint']={syn:'Returns the voltage set point, in V.',lib:'powersupply.get_voltageSetPoint()',pro:'function get_voltageSetPoint()',cmt:'

Returns the voltage set point, in V.

',ret:'a floating point number corresponding to the voltage set point, in V',ext:'On failure, throws an exception or returns `Y_VOLTAGESETPOINT_INVALID`.'}; doc['PowerSupply']['isOnline']={syn:'Checks if the regulated power supply is currently reachable, without raising any error.',lib:'powersupply.isOnline()',pro:'function isOnline()',cmt:'

Checks if the regulated power supply is currently reachable, without raising any error. If there is a cached value for the regulated power supply in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the regulated power supply.

',ret:'`true` if the regulated power supply can be reached, and `false` otherwise'}; doc['PowerSupply']['isOnline_async']={syn:'Checks if the regulated power supply is currently reachable, without raising any error (asynchronous version).',lib:'powersupply.isOnline_async()',pro:'function isOnline_async(callback, context)',cmt:'

Checks if the regulated power supply is currently reachable, without raising any error (asynchronous version). If there is a cached value for the regulated power supply in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the requested function.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the boolean result',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['PowerSupply']['load']={syn:'Preloads the regulated power supply cache with a specified validity duration.',lib:'powersupply.load()',pro:'function load(msValidity)',cmt:'

Preloads the regulated power supply cache with a specified validity duration. By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network traffic for instance.

',par:{msValidity:'an integer corresponding to the validity attributed to the loaded function parameters, in milliseconds'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['PowerSupply']['loadAttribute']={syn:'Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.',lib:'powersupply.loadAttribute()',pro:'function loadAttribute(attrName)',cmt:'

Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.

',par:{attrName:'the name of the requested attribute'},ret:'a string with the value of the the attribute',ext:'On failure, throws an exception or returns an empty string.'}; doc['PowerSupply']['load_async']={syn:'Preloads the regulated power supply cache with a specified validity duration (asynchronous version).',lib:'powersupply.load_async()',pro:'function load_async(msValidity, callback, context)',cmt:'

Preloads the regulated power supply cache with a specified validity duration (asynchronous version). By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network trafic for instance.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{msValidity:'an integer corresponding to the validity of the loaded function parameters, in milliseconds',callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the error code (or `YAPI_SUCCESS`)',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['PowerSupply']['muteValueCallbacks']={syn:'Disables the propagation of every new advertised value to the parent hub.',lib:'powersupply.muteValueCallbacks()',pro:'function muteValueCallbacks()',cmt:'

Disables the propagation of every new advertised value to the parent hub. You can use this function to save bandwidth and CPU on computers with limited resources, or to prevent unwanted invocations of the HTTP callback. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['PowerSupply']['nextPowerSupply']={syn:'Continues the enumeration of regulated power supplies started using `yFirstPowerSupply()`.',lib:'powersupply.nextPowerSupply()',pro:'function nextPowerSupply()',cmt:'

Continues the enumeration of regulated power supplies started using `yFirstPowerSupply()`.

',ret:'a pointer to a `YPowerSupply` object, corresponding to a regulated power supply currently online, or a `null` pointer if there are no more regulated power supplies to enumerate.'}; doc['PowerSupply']['registerValueCallback']={syn:'Registers the callback function that is invoked on every change of advertised value.',lib:'powersupply.registerValueCallback()',pro:'function registerValueCallback(callback)',cmt:'

Registers the callback function that is invoked on every change of advertised value. The callback is invoked only during the execution of `ySleep` or `yHandleEvents`. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a null pointer as argument.

',par:{callback:'the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and the character string describing the new advertised value.'}}; doc['PowerSupply']['set_currentAtStartUp']={syn:'Changes the current limit at device start up.',lib:'powersupply.set_currentAtStartUp()',pro:'function set_currentAtStartUp(newval)',cmt:'

Changes the current limit at device start up. Remember to call the matching module `saveToFlash()` method, otherwise this call has no effect.

',par:{newval:'a floating point number corresponding to the current limit at device start up'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['PowerSupply']['set_currentLimit']={syn:'Changes the current limit, in mA.',lib:'powersupply.set_currentLimit()',pro:'function set_currentLimit(newval)',cmt:'

Changes the current limit, in mA.

',par:{newval:'a floating point number corresponding to the current limit, in mA'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['PowerSupply']['set_logicalName']={syn:'Changes the logical name of the regulated power supply.',lib:'powersupply.set_logicalName()',pro:'function set_logicalName(newval)',cmt:'

Changes the logical name of the regulated power supply. You can use `yCheckLogicalName()` prior to this call to make sure that your parameter is valid. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',par:{newval:'a string corresponding to the logical name of the regulated power supply.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['PowerSupply']['set_powerOutput']={syn:'Changes the power supply output switch state.',lib:'powersupply.set_powerOutput()',pro:'function set_powerOutput(newval)',cmt:'

Changes the power supply output switch state.

',par:{newval:'either `Y_POWEROUTPUT_OFF` or `Y_POWEROUTPUT_ON`, according to the power supply output switch state'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['PowerSupply']['set_userData']={syn:'Stores a user context provided as argument in the userData attribute of the function.',lib:'powersupply.set_userData()',pro:'function set_userData(data)',cmt:'

Stores a user context provided as argument in the userData attribute of the function. This attribute is never touched by the API, and is at disposal of the caller to store a context.

',par:{data:'any kind of object to be stored'}}; doc['PowerSupply']['set_voltageAtStartUp']={syn:'Changes the voltage set point at device start up.',lib:'powersupply.set_voltageAtStartUp()',pro:'function set_voltageAtStartUp(newval)',cmt:'

Changes the voltage set point at device start up. Remember to call the matching module `saveToFlash()` method, otherwise this call has no effect.

',par:{newval:'a floating point number corresponding to the voltage set point at device start up'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['PowerSupply']['set_voltageSense']={syn:'Changes the voltage control point.',lib:'powersupply.set_voltageSense()',pro:'function set_voltageSense(newval)',cmt:'

Changes the voltage control point.

',par:{newval:'either `Y_VOLTAGESENSE_INT` or `Y_VOLTAGESENSE_EXT`, according to the voltage control point'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['PowerSupply']['set_voltageSetPoint']={syn:'Changes the voltage set point, in V.',lib:'powersupply.set_voltageSetPoint()',pro:'function set_voltageSetPoint(newval)',cmt:'

Changes the voltage set point, in V.

',par:{newval:'a floating point number corresponding to the voltage set point, in V'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['PowerSupply']['unmuteValueCallbacks']={syn:'Re-enables the propagation of every new advertised value to the parent hub.',lib:'powersupply.unmuteValueCallbacks()',pro:'function unmuteValueCallbacks()',cmt:'

Re-enables the propagation of every new advertised value to the parent hub. This function reverts the effect of a previous call to `muteValueCallbacks()`. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['PowerSupply']['wait_async']={syn:'Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function.',lib:'powersupply.wait_async()',pro:'function wait_async(callback, context)',cmt:'

Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function. The callback function can therefore freely issue synchronous or asynchronous commands, without risking to block the Javascript VM.

',par:{callback:'callback function that is invoked when all pending commands on the module are completed. The callback function receives two arguments: the caller-specific context object and the receiving function object.',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing.'}; //--- (end of generated code: PowerSupply) //--- (generated code: MultiCellWeighScale) doc['MultiCellWeighScale']={'':{syn:'MultiCellWeighScale function interface',inc:'<script type='text/javascript' src='yocto_multicellweighscale.js'></script>',cmt:'

The YMultiCellWeighScale class provides a weight measurement from a set of ratiometric load cells sensor. It can be used to control the bridge excitation parameters, in order to avoid measure shifts caused by temperature variation in the electronics, and can also automatically apply an additional correction factor based on temperature to compensate for offsets in the load cells themselves.

'}}; doc['MultiCellWeighScale']['FindMultiCellWeighScale']={syn:'Retrieves a multi-cell weighing scale sensor for a given identifier.',lib:'YMultiCellWeighScale.FindMultiCellWeighScale()',pro:'function FindMultiCellWeighScale(func)',cmt:'

Retrieves a multi-cell weighing scale sensor for a given identifier. The identifier can be specified using several formats:

- FunctionLogicalName
- ModuleSerialNumber.FunctionIdentifier
- ModuleSerialNumber.FunctionLogicalName
- ModuleLogicalName.FunctionIdentifier
- ModuleLogicalName.FunctionLogicalName

This function does not require that the multi-cell weighing scale sensor is online at the time it is invoked. The returned object is nevertheless valid. Use the method `YMultiCellWeighScale.isOnline()` to test if the multi-cell weighing scale sensor is indeed online at a given time. In case of ambiguity when looking for a multi-cell weighing scale sensor by logical name, no error is notified: the first instance found is returned. The search is performed first by hardware name, then by logical name.

If a call to this object\x27s is_online() method returns FALSE although you are certain that the matching device is plugged, make sure that you did call registerHub() at application initialization time.

',par:{func:'a string that uniquely characterizes the multi-cell weighing scale sensor'},ret:'a `YMultiCellWeighScale` object allowing you to drive the multi-cell weighing scale sensor.'}; doc['MultiCellWeighScale']['FirstMultiCellWeighScale']={syn:'Starts the enumeration of multi-cell weighing scale sensors currently accessible.',lib:'YMultiCellWeighScale.FirstMultiCellWeighScale()',pro:'function FirstMultiCellWeighScale()',cmt:'

Starts the enumeration of multi-cell weighing scale sensors currently accessible. Use the method `YMultiCellWeighScale.nextMultiCellWeighScale()` to iterate on next multi-cell weighing scale sensors.

',ret:'a pointer to a `YMultiCellWeighScale` object, corresponding to the first multi-cell weighing scale sensor currently online, or a `null` pointer if there are none.'}; doc['MultiCellWeighScale']['calibrateFromPoints']={syn:'Configures error correction data points, in particular to compensate for a possible perturbation of the measure caused by an enclosure.',lib:'multicellweighscale.calibrateFromPoints()',pro:'function calibrateFromPoints(rawValues, refValues)',cmt:'

Configures error correction data points, in particular to compensate for a possible perturbation of the measure caused by an enclosure. It is possible to configure up to five correction points. Correction points must be provided in ascending order, and be in the range of the sensor. The device will automatically perform a linear interpolation of the error correction between specified points. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

For more information on advanced capabilities to refine the calibration of sensors, please contact support@yoctopuce.com.

',par:{rawValues:'array of floating point numbers, corresponding to the raw values returned by the sensor for the correction points.',refValues:'array of floating point numbers, corresponding to the corrected values for the correction points.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['MultiCellWeighScale']['clearCache']={syn:'Invalidates the cache.',lib:'multicellweighscale.clearCache()',pro:'function clearCache()',cmt:'

Invalidates the cache. Invalidates the cache of the multi-cell weighing scale sensor attributes. Forces the next call to get_xxx() or loadxxx() to use values that come from the device.

'}; doc['MultiCellWeighScale']['describe']={syn:'Returns a short text that describes unambiguously the instance of the multi-cell weighing scale sensor in the form `TYPE(NAME)=SERIAL.FUNCTIONID`.',lib:'multicellweighscale.describe()',pro:'function describe()',cmt:'

Returns a short text that describes unambiguously the instance of the multi-cell weighing scale sensor in the form `TYPE(NAME)=SERIAL.FUNCTIONID`. More precisely, `TYPE` is the type of the function, `NAME` it the name used for the first access to the function, `SERIAL` is the serial number of the module if the module is connected or `\x22unresolved\x22`, and `FUNCTIONID` is the hardware identifier of the function if the module is connected. For example, this method returns `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1` if the module is already connected or `Relay(BadCustomeName.relay1)=unresolved` if the module has not yet been connected. This method does not trigger any USB or TCP transaction and can therefore be used in a debugger.

',ret:'a string that describes the multi-cell weighing scale sensor (ex: `Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1`)'}; doc['MultiCellWeighScale']['get_advMode']={syn:'Returns the measuring mode used for the advertised value pushed to the parent hub.',lib:'multicellweighscale.get_advMode()',pro:'function get_advMode()',cmt:'

Returns the measuring mode used for the advertised value pushed to the parent hub.

',ret:'a value among `Y_ADVMODE_IMMEDIATE`, `Y_ADVMODE_PERIOD_AVG`, `Y_ADVMODE_PERIOD_MIN` and `Y_ADVMODE_PERIOD_MAX` corresponding to the measuring mode used for the advertised value pushed to the parent hub',ext:'On failure, throws an exception or returns `Y_ADVMODE_INVALID`.'}; doc['MultiCellWeighScale']['get_advertisedValue']={syn:'Returns the current value of the multi-cell weighing scale sensor (no more than 6 characters).',lib:'multicellweighscale.get_advertisedValue()',pro:'function get_advertisedValue()',cmt:'

Returns the current value of the multi-cell weighing scale sensor (no more than 6 characters).

',ret:'a string corresponding to the current value of the multi-cell weighing scale sensor (no more than 6 characters).',ext:'On failure, throws an exception or returns `Y_ADVERTISEDVALUE_INVALID`.'}; doc['MultiCellWeighScale']['get_cellCount']={syn:'Returns the number of load cells in use.',lib:'multicellweighscale.get_cellCount()',pro:'function get_cellCount()',cmt:'

Returns the number of load cells in use.

',ret:'an integer corresponding to the number of load cells in use',ext:'On failure, throws an exception or returns `Y_CELLCOUNT_INVALID`.'}; doc['MultiCellWeighScale']['get_compTempAdaptRatio']={syn:'Returns the averaged temperature update rate, in percents.',lib:'multicellweighscale.get_compTempAdaptRatio()',pro:'function get_compTempAdaptRatio()',cmt:'

Returns the averaged temperature update rate, in percents. The averaged temperature is updated every 10 seconds, by applying this adaptation rate to the difference between the measures ambiant temperature and the current compensation temperature. The standard rate is 0.04 percents, and the maximal rate is 65 percents.

',ret:'a floating point number corresponding to the averaged temperature update rate, in percents',ext:'On failure, throws an exception or returns `Y_COMPTEMPADAPTRATIO_INVALID`.'}; doc['MultiCellWeighScale']['get_compTempAvg']={syn:'Returns the current averaged temperature, used for thermal compensation.',lib:'multicellweighscale.get_compTempAvg()',pro:'function get_compTempAvg()',cmt:'

Returns the current averaged temperature, used for thermal compensation.

',ret:'a floating point number corresponding to the current averaged temperature, used for thermal compensation',ext:'On failure, throws an exception or returns `Y_COMPTEMPAVG_INVALID`.'}; doc['MultiCellWeighScale']['get_compTempChg']={syn:'Returns the current temperature variation, used for thermal compensation.',lib:'multicellweighscale.get_compTempChg()',pro:'function get_compTempChg()',cmt:'

Returns the current temperature variation, used for thermal compensation.

',ret:'a floating point number corresponding to the current temperature variation, used for thermal compensation',ext:'On failure, throws an exception or returns `Y_COMPTEMPCHG_INVALID`.'}; doc['MultiCellWeighScale']['get_compensation']={syn:'Returns the current current thermal compensation value.',lib:'multicellweighscale.get_compensation()',pro:'function get_compensation()',cmt:'

Returns the current current thermal compensation value.

',ret:'a floating point number corresponding to the current current thermal compensation value',ext:'On failure, throws an exception or returns `Y_COMPENSATION_INVALID`.'}; doc['MultiCellWeighScale']['get_currentRawValue']={syn:'Returns the uncalibrated, unrounded raw value returned by the sensor, in the specified unit, as a floating point number.',lib:'multicellweighscale.get_currentRawValue()',pro:'function get_currentRawValue()',cmt:'

Returns the uncalibrated, unrounded raw value returned by the sensor, in the specified unit, as a floating point number.

',ret:'a floating point number corresponding to the uncalibrated, unrounded raw value returned by the sensor, in the specified unit, as a floating point number',ext:'On failure, throws an exception or returns `Y_CURRENTRAWVALUE_INVALID`.'}; doc['MultiCellWeighScale']['get_currentValue']={syn:'Returns the current value of the measure, in the specified unit, as a floating point number.',lib:'multicellweighscale.get_currentValue()',pro:'function get_currentValue()',cmt:'

Returns the current value of the measure, in the specified unit, as a floating point number.

',ret:'a floating point number corresponding to the current value of the measure, in the specified unit, as a floating point number',ext:'On failure, throws an exception or returns `Y_CURRENTVALUE_INVALID`.'}; doc['MultiCellWeighScale']['get_dataLogger']={syn:'Returns the YDatalogger object of the device hosting the sensor.',lib:'multicellweighscale.get_dataLogger()',pro:'function get_dataLogger()',cmt:'

Returns the YDatalogger object of the device hosting the sensor. This method returns an object of class YDatalogger that can control global parameters of the data logger. The returned object should not be freed.

',ret:'an YDataLogger object or null on error.'}; doc['MultiCellWeighScale']['get_errorMessage']={syn:'Returns the error message of the latest error with the multi-cell weighing scale sensor.',lib:'multicellweighscale.get_errorMessage()',pro:'function get_errorMessage()',cmt:'

Returns the error message of the latest error with the multi-cell weighing scale sensor. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a string corresponding to the latest error message that occured while using the multi-cell weighing scale sensor object'}; doc['MultiCellWeighScale']['get_errorType']={syn:'Returns the numerical error code of the latest error with the multi-cell weighing scale sensor.',lib:'multicellweighscale.get_errorType()',pro:'function get_errorType()',cmt:'

Returns the numerical error code of the latest error with the multi-cell weighing scale sensor. This method is mostly useful when using the Yoctopuce library with exceptions disabled.

',ret:'a number corresponding to the code of the latest error that occurred while using the multi-cell weighing scale sensor object'}; doc['MultiCellWeighScale']['get_excitation']={syn:'Returns the current load cell bridge excitation method.',lib:'multicellweighscale.get_excitation()',pro:'function get_excitation()',cmt:'

Returns the current load cell bridge excitation method.

',ret:'a value among `Y_EXCITATION_OFF`, `Y_EXCITATION_DC` and `Y_EXCITATION_AC` corresponding to the current load cell bridge excitation method',ext:'On failure, throws an exception or returns `Y_EXCITATION_INVALID`.'}; doc['MultiCellWeighScale']['get_friendlyName']={syn:'Returns a global identifier of the multi-cell weighing scale sensor in the format `MODULE_NAME.FUNCTION_NAME`.',lib:'multicellweighscale.get_friendlyName()',pro:'function get_friendlyName()',cmt:'

Returns a global identifier of the multi-cell weighing scale sensor in the format `MODULE_NAME.FUNCTION_NAME`. The returned string uses the logical names of the module and of the multi-cell weighing scale sensor if they are defined, otherwise the serial number of the module and the hardware identifier of the multi-cell weighing scale sensor (for example: `MyCustomName.relay1`)

',ret:'a string that uniquely identifies the multi-cell weighing scale sensor using logical names (ex: `MyCustomName.relay1`)',ext:'On failure, throws an exception or returns `Y_FRIENDLYNAME_INVALID`.'}; doc['MultiCellWeighScale']['get_functionDescriptor']={syn:'Returns a unique identifier of type `YFUN_DESCR` corresponding to the function.',lib:'multicellweighscale.get_functionDescriptor()',pro:'function get_functionDescriptor()',cmt:'

Returns a unique identifier of type `YFUN_DESCR` corresponding to the function. This identifier can be used to test if two instances of `YFunction` reference the same physical function on the same physical device.

',ret:'an identifier of type `YFUN_DESCR`.',ext:'If the function has never been contacted, the returned value is `Y_FUNCTIONDESCRIPTOR_INVALID`.'}; doc['MultiCellWeighScale']['get_functionId']={syn:'Returns the hardware identifier of the multi-cell weighing scale sensor, without reference to the module.',lib:'multicellweighscale.get_functionId()',pro:'function get_functionId()',cmt:'

Returns the hardware identifier of the multi-cell weighing scale sensor, without reference to the module. For example `relay1`

',ret:'a string that identifies the multi-cell weighing scale sensor (ex: `relay1`)',ext:'On failure, throws an exception or returns `Y_FUNCTIONID_INVALID`.'}; doc['MultiCellWeighScale']['get_hardwareId']={syn:'Returns the unique hardware identifier of the multi-cell weighing scale sensor in the form `SERIAL.FUNCTIONID`.',lib:'multicellweighscale.get_hardwareId()',pro:'function get_hardwareId()',cmt:'

Returns the unique hardware identifier of the multi-cell weighing scale sensor in the form `SERIAL.FUNCTIONID`. The unique hardware identifier is composed of the device serial number and of the hardware identifier of the multi-cell weighing scale sensor (for example `RELAYLO1-123456.relay1`).

',ret:'a string that uniquely identifies the multi-cell weighing scale sensor (ex: `RELAYLO1-123456.relay1`)',ext:'On failure, throws an exception or returns `Y_HARDWAREID_INVALID`.'}; doc['MultiCellWeighScale']['get_highestValue']={syn:'Returns the maximal value observed for the measure since the device was started.',lib:'multicellweighscale.get_highestValue()',pro:'function get_highestValue()',cmt:'

Returns the maximal value observed for the measure since the device was started. Can be reset to an arbitrary value thanks to set_highestValue().

',ret:'a floating point number corresponding to the maximal value observed for the measure since the device was started',ext:'On failure, throws an exception or returns `Y_HIGHESTVALUE_INVALID`.'}; doc['MultiCellWeighScale']['get_logFrequency']={syn:'Returns the datalogger recording frequency for this function, or \x22OFF\x22 when measures are not stored in the data logger flash memory.',lib:'multicellweighscale.get_logFrequency()',pro:'function get_logFrequency()',cmt:'

Returns the datalogger recording frequency for this function, or \x22OFF\x22 when measures are not stored in the data logger flash memory.

',ret:'a string corresponding to the datalogger recording frequency for this function, or \x22OFF\x22 when measures are not stored in the data logger flash memory',ext:'On failure, throws an exception or returns `Y_LOGFREQUENCY_INVALID`.'}; doc['MultiCellWeighScale']['get_logicalName']={syn:'Returns the logical name of the multi-cell weighing scale sensor.',lib:'multicellweighscale.get_logicalName()',pro:'function get_logicalName()',cmt:'

Returns the logical name of the multi-cell weighing scale sensor.

',ret:'a string corresponding to the logical name of the multi-cell weighing scale sensor.',ext:'On failure, throws an exception or returns `Y_LOGICALNAME_INVALID`.'}; doc['MultiCellWeighScale']['get_lowestValue']={syn:'Returns the minimal value observed for the measure since the device was started.',lib:'multicellweighscale.get_lowestValue()',pro:'function get_lowestValue()',cmt:'

Returns the minimal value observed for the measure since the device was started. Can be reset to an arbitrary value thanks to set_lowestValue().

',ret:'a floating point number corresponding to the minimal value observed for the measure since the device was started',ext:'On failure, throws an exception or returns `Y_LOWESTVALUE_INVALID`.'}; doc['MultiCellWeighScale']['get_module']={syn:'Gets the `YModule` object for the device on which the function is located.',lib:'multicellweighscale.get_module()',pro:'function get_module()',cmt:'

Gets the `YModule` object for the device on which the function is located. If the function cannot be located on any module, the returned instance of `YModule` is not shown as on-line.

',ret:'an instance of `YModule`'}; doc['MultiCellWeighScale']['get_module_async']={syn:'Gets the `YModule` object for the device on which the function is located (asynchronous version).',lib:'multicellweighscale.get_module_async()',pro:'function get_module_async(callback, context)',cmt:'

Gets the `YModule` object for the device on which the function is located (asynchronous version). If the function cannot be located on any module, the returned `YModule` object does not show as on-line.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking Firefox javascript VM that does not implement context switching during blocking I/O calls. See the documentation section on asynchronous Javascript calls for more details.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the requested `YModule` object',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['MultiCellWeighScale']['get_recordedData']={syn:'Retrieves a DataSet object holding historical data for this sensor, for a specified time interval.',lib:'multicellweighscale.get_recordedData()',pro:'function get_recordedData(startTime, endTime)',cmt:'

Retrieves a DataSet object holding historical data for this sensor, for a specified time interval. The measures will be retrieved from the data logger, which must have been turned on at the desired time. See the documentation of the DataSet class for information on how to get an overview of the recorded data, and how to load progressively a large set of measures from the data logger.

This function only works if the device uses a recent firmware, as DataSet objects are not supported by firmwares older than version 13000.

',par:{startTime:'the start of the desired measure time interval, as a Unix timestamp, i.e. the number of seconds since January 1, 1970 UTC. The special value 0 can be used to include any meaasure, without initial limit.',endTime:'the end of the desired measure time interval, as a Unix timestamp, i.e. the number of seconds since January 1, 1970 UTC. The special value 0 can be used to include any meaasure, without ending limit.'},ret:'an instance of YDataSet, providing access to historical data. Past measures can be loaded progressively using methods from the YDataSet object.'}; doc['MultiCellWeighScale']['get_reportFrequency']={syn:'Returns the timed value notification frequency, or \x22OFF\x22 if timed value notifications are disabled for this function.',lib:'multicellweighscale.get_reportFrequency()',pro:'function get_reportFrequency()',cmt:'

Returns the timed value notification frequency, or \x22OFF\x22 if timed value notifications are disabled for this function.

',ret:'a string corresponding to the timed value notification frequency, or \x22OFF\x22 if timed value notifications are disabled for this function',ext:'On failure, throws an exception or returns `Y_REPORTFREQUENCY_INVALID`.'}; doc['MultiCellWeighScale']['get_resolution']={syn:'Returns the resolution of the measured values.',lib:'multicellweighscale.get_resolution()',pro:'function get_resolution()',cmt:'

Returns the resolution of the measured values. The resolution corresponds to the numerical precision of the measures, which is not always the same as the actual precision of the sensor.

',ret:'a floating point number corresponding to the resolution of the measured values',ext:'On failure, throws an exception or returns `Y_RESOLUTION_INVALID`.'}; doc['MultiCellWeighScale']['get_sensorState']={syn:'Returns the sensor health state code, which is zero when there is an up-to-date measure available or a positive code if the sensor is not able to provide a measure right now.',lib:'multicellweighscale.get_sensorState()',pro:'function get_sensorState()',cmt:'

Returns the sensor health state code, which is zero when there is an up-to-date measure available or a positive code if the sensor is not able to provide a measure right now.

',ret:'an integer corresponding to the sensor health state code, which is zero when there is an up-to-date measure available or a positive code if the sensor is not able to provide a measure right now',ext:'On failure, throws an exception or returns `Y_SENSORSTATE_INVALID`.'}; doc['MultiCellWeighScale']['get_unit']={syn:'Returns the measuring unit for the measure.',lib:'multicellweighscale.get_unit()',pro:'function get_unit()',cmt:'

Returns the measuring unit for the measure.

',ret:'a string corresponding to the measuring unit for the measure',ext:'On failure, throws an exception or returns `Y_UNIT_INVALID`.'}; doc['MultiCellWeighScale']['get_userData']={syn:'Returns the value of the userData attribute, as previously stored using method `set_userData`.',lib:'multicellweighscale.get_userData()',pro:'function get_userData()',cmt:'

Returns the value of the userData attribute, as previously stored using method `set_userData`. This attribute is never touched directly by the API, and is at disposal of the caller to store a context.

',ret:'the object stored previously by the caller.'}; doc['MultiCellWeighScale']['get_zeroTracking']={syn:'Returns the zero tracking threshold value.',lib:'multicellweighscale.get_zeroTracking()',pro:'function get_zeroTracking()',cmt:'

Returns the zero tracking threshold value. When this threshold is larger than zero, any measure under the threshold will automatically be ignored and the zero compensation will be updated.

',ret:'a floating point number corresponding to the zero tracking threshold value',ext:'On failure, throws an exception or returns `Y_ZEROTRACKING_INVALID`.'}; doc['MultiCellWeighScale']['isOnline']={syn:'Checks if the multi-cell weighing scale sensor is currently reachable, without raising any error.',lib:'multicellweighscale.isOnline()',pro:'function isOnline()',cmt:'

Checks if the multi-cell weighing scale sensor is currently reachable, without raising any error. If there is a cached value for the multi-cell weighing scale sensor in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the multi-cell weighing scale sensor.

',ret:'`true` if the multi-cell weighing scale sensor can be reached, and `false` otherwise'}; doc['MultiCellWeighScale']['isOnline_async']={syn:'Checks if the multi-cell weighing scale sensor is currently reachable, without raising any error (asynchronous version).',lib:'multicellweighscale.isOnline_async()',pro:'function isOnline_async(callback, context)',cmt:'

Checks if the multi-cell weighing scale sensor is currently reachable, without raising any error (asynchronous version). If there is a cached value for the multi-cell weighing scale sensor in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the requested function.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the boolean result',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['MultiCellWeighScale']['load']={syn:'Preloads the multi-cell weighing scale sensor cache with a specified validity duration.',lib:'multicellweighscale.load()',pro:'function load(msValidity)',cmt:'

Preloads the multi-cell weighing scale sensor cache with a specified validity duration. By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network traffic for instance.

',par:{msValidity:'an integer corresponding to the validity attributed to the loaded function parameters, in milliseconds'},ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['MultiCellWeighScale']['loadAttribute']={syn:'Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.',lib:'multicellweighscale.loadAttribute()',pro:'function loadAttribute(attrName)',cmt:'

Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value.

',par:{attrName:'the name of the requested attribute'},ret:'a string with the value of the the attribute',ext:'On failure, throws an exception or returns an empty string.'}; doc['MultiCellWeighScale']['loadCalibrationPoints']={syn:'Retrieves error correction data points previously entered using the method `calibrateFromPoints`.',lib:'multicellweighscale.loadCalibrationPoints()',pro:'function loadCalibrationPoints(rawValues, refValues)',cmt:'

Retrieves error correction data points previously entered using the method `calibrateFromPoints`.

',par:{rawValues:'array of floating point numbers, that will be filled by the function with the raw sensor values for the correction points.',refValues:'array of floating point numbers, that will be filled by the function with the desired values for the correction points.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['MultiCellWeighScale']['load_async']={syn:'Preloads the multi-cell weighing scale sensor cache with a specified validity duration (asynchronous version).',lib:'multicellweighscale.load_async()',pro:'function load_async(msValidity, callback, context)',cmt:'

Preloads the multi-cell weighing scale sensor cache with a specified validity duration (asynchronous version). By default, whenever accessing a device, all function attributes are kept in cache for the standard duration (5 ms). This method can be used to temporarily mark the cache as valid for a longer period, in order to reduce network trafic for instance.

This asynchronous version exists only in Javascript. It uses a callback instead of a return value in order to avoid blocking the Javascript virtual machine.

',par:{msValidity:'an integer corresponding to the validity of the loaded function parameters, in milliseconds',callback:'callback function that is invoked when the result is known. The callback function receives three arguments: the caller-specific context object, the receiving function object and the error code (or `YAPI_SUCCESS`)',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing : the result is provided to the callback.'}; doc['MultiCellWeighScale']['muteValueCallbacks']={syn:'Disables the propagation of every new advertised value to the parent hub.',lib:'multicellweighscale.muteValueCallbacks()',pro:'function muteValueCallbacks()',cmt:'

Disables the propagation of every new advertised value to the parent hub. You can use this function to save bandwidth and CPU on computers with limited resources, or to prevent unwanted invocations of the HTTP callback. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['MultiCellWeighScale']['nextMultiCellWeighScale']={syn:'Continues the enumeration of multi-cell weighing scale sensors started using `yFirstMultiCellWeighScale()`.',lib:'multicellweighscale.nextMultiCellWeighScale()',pro:'function nextMultiCellWeighScale()',cmt:'

Continues the enumeration of multi-cell weighing scale sensors started using `yFirstMultiCellWeighScale()`.

',ret:'a pointer to a `YMultiCellWeighScale` object, corresponding to a multi-cell weighing scale sensor currently online, or a `null` pointer if there are no more multi-cell weighing scale sensors to enumerate.'}; doc['MultiCellWeighScale']['registerTimedReportCallback']={syn:'Registers the callback function that is invoked on every periodic timed notification.',lib:'multicellweighscale.registerTimedReportCallback()',pro:'function registerTimedReportCallback(callback)',cmt:'

Registers the callback function that is invoked on every periodic timed notification. The callback is invoked only during the execution of `ySleep` or `yHandleEvents`. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a null pointer as argument.

',par:{callback:'the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and an YMeasure object describing the new advertised value.'}}; doc['MultiCellWeighScale']['registerValueCallback']={syn:'Registers the callback function that is invoked on every change of advertised value.',lib:'multicellweighscale.registerValueCallback()',pro:'function registerValueCallback(callback)',cmt:'

Registers the callback function that is invoked on every change of advertised value. The callback is invoked only during the execution of `ySleep` or `yHandleEvents`. This provides control over the time when the callback is triggered. For good responsiveness, remember to call one of these two functions periodically. To unregister a callback, pass a null pointer as argument.

',par:{callback:'the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and the character string describing the new advertised value.'}}; doc['MultiCellWeighScale']['set_advMode']={syn:'Changes the measuring mode used for the advertised value pushed to the parent hub.',lib:'multicellweighscale.set_advMode()',pro:'function set_advMode(newval)',cmt:'

Changes the measuring mode used for the advertised value pushed to the parent hub.

',par:{newval:'a value among `Y_ADVMODE_IMMEDIATE`, `Y_ADVMODE_PERIOD_AVG`, `Y_ADVMODE_PERIOD_MIN` and `Y_ADVMODE_PERIOD_MAX` corresponding to the measuring mode used for the advertised value pushed to the parent hub'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['MultiCellWeighScale']['set_cellCount']={syn:'Changes the number of load cells in use.',lib:'multicellweighscale.set_cellCount()',pro:'function set_cellCount(newval)',cmt:'

Changes the number of load cells in use.

',par:{newval:'an integer corresponding to the number of load cells in use'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['MultiCellWeighScale']['set_compTempAdaptRatio']={syn:'Changes the averaged temperature update rate, in percents.',lib:'multicellweighscale.set_compTempAdaptRatio()',pro:'function set_compTempAdaptRatio(newval)',cmt:'

Changes the averaged temperature update rate, in percents. The averaged temperature is updated every 10 seconds, by applying this adaptation rate to the difference between the measures ambiant temperature and the current compensation temperature. The standard rate is 0.04 percents, and the maximal rate is 65 percents.

',par:{newval:'a floating point number corresponding to the averaged temperature update rate, in percents'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['MultiCellWeighScale']['set_excitation']={syn:'Changes the current load cell bridge excitation method.',lib:'multicellweighscale.set_excitation()',pro:'function set_excitation(newval)',cmt:'

Changes the current load cell bridge excitation method.

',par:{newval:'a value among `Y_EXCITATION_OFF`, `Y_EXCITATION_DC` and `Y_EXCITATION_AC` corresponding to the current load cell bridge excitation method'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['MultiCellWeighScale']['set_highestValue']={syn:'Changes the recorded maximal value observed.',lib:'multicellweighscale.set_highestValue()',pro:'function set_highestValue(newval)',cmt:'

Changes the recorded maximal value observed. Can be used to reset the value returned by get_lowestValue().

',par:{newval:'a floating point number corresponding to the recorded maximal value observed'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['MultiCellWeighScale']['set_logFrequency']={syn:'Changes the datalogger recording frequency for this function.',lib:'multicellweighscale.set_logFrequency()',pro:'function set_logFrequency(newval)',cmt:'

Changes the datalogger recording frequency for this function. The frequency can be specified as samples per second, as sample per minute (for instance \x2215/m\x22) or in samples per hour (eg. \x224/h\x22). To disable recording for this function, use the value \x22OFF\x22.

',par:{newval:'a string corresponding to the datalogger recording frequency for this function'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['MultiCellWeighScale']['set_logicalName']={syn:'Changes the logical name of the multi-cell weighing scale sensor.',lib:'multicellweighscale.set_logicalName()',pro:'function set_logicalName(newval)',cmt:'

Changes the logical name of the multi-cell weighing scale sensor. You can use `yCheckLogicalName()` prior to this call to make sure that your parameter is valid. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',par:{newval:'a string corresponding to the logical name of the multi-cell weighing scale sensor.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['MultiCellWeighScale']['set_lowestValue']={syn:'Changes the recorded minimal value observed.',lib:'multicellweighscale.set_lowestValue()',pro:'function set_lowestValue(newval)',cmt:'

Changes the recorded minimal value observed. Can be used to reset the value returned by get_lowestValue().

',par:{newval:'a floating point number corresponding to the recorded minimal value observed'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['MultiCellWeighScale']['set_reportFrequency']={syn:'Changes the timed value notification frequency for this function.',lib:'multicellweighscale.set_reportFrequency()',pro:'function set_reportFrequency(newval)',cmt:'

Changes the timed value notification frequency for this function. The frequency can be specified as samples per second, as sample per minute (for instance \x2215/m\x22) or in samples per hour (eg. \x224/h\x22). To disable timed value notifications for this function, use the value \x22OFF\x22.

',par:{newval:'a string corresponding to the timed value notification frequency for this function'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['MultiCellWeighScale']['set_resolution']={syn:'Changes the resolution of the measured physical values.',lib:'multicellweighscale.set_resolution()',pro:'function set_resolution(newval)',cmt:'

Changes the resolution of the measured physical values. The resolution corresponds to the numerical precision when displaying value. It does not change the precision of the measure itself.

',par:{newval:'a floating point number corresponding to the resolution of the measured physical values'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['MultiCellWeighScale']['set_userData']={syn:'Stores a user context provided as argument in the userData attribute of the function.',lib:'multicellweighscale.set_userData()',pro:'function set_userData(data)',cmt:'

Stores a user context provided as argument in the userData attribute of the function. This attribute is never touched by the API, and is at disposal of the caller to store a context.

',par:{data:'any kind of object to be stored'}}; doc['MultiCellWeighScale']['set_zeroTracking']={syn:'Changes the compensation temperature update rate, in percents.',lib:'multicellweighscale.set_zeroTracking()',pro:'function set_zeroTracking(newval)',cmt:'

Changes the compensation temperature update rate, in percents.

',par:{newval:'a floating point number corresponding to the compensation temperature update rate, in percents'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['MultiCellWeighScale']['setupSpan']={syn:'Configures the load cells span parameters (stored in the corresponding genericSensors) so that the current signal corresponds to the specified reference weight.',lib:'multicellweighscale.setupSpan()',pro:'function setupSpan(currWeight, maxWeight)',cmt:'

Configures the load cells span parameters (stored in the corresponding genericSensors) so that the current signal corresponds to the specified reference weight.

',par:{currWeight:'reference weight presently on the load cell.',maxWeight:'maximum weight to be expectect on the load cell.'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['MultiCellWeighScale']['startDataLogger']={syn:'Starts the data logger on the device.',lib:'multicellweighscale.startDataLogger()',pro:'function startDataLogger()',cmt:'

Starts the data logger on the device. Note that the data logger will only save the measures on this sensor if the logFrequency is not set to \x22OFF\x22.

',ret:'`YAPI_SUCCESS` if the call succeeds.'}; doc['MultiCellWeighScale']['stopDataLogger']={syn:'Stops the datalogger on the device.',lib:'multicellweighscale.stopDataLogger()',pro:'function stopDataLogger()',cmt:'

Stops the datalogger on the device.

',ret:'`YAPI_SUCCESS` if the call succeeds.'}; doc['MultiCellWeighScale']['tare']={syn:'Adapts the load cells signal bias (stored in the corresponding genericSensor) so that the current signal corresponds to a zero weight.',lib:'multicellweighscale.tare()',pro:'function tare()',cmt:'

Adapts the load cells signal bias (stored in the corresponding genericSensor) so that the current signal corresponds to a zero weight.

',ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['MultiCellWeighScale']['unmuteValueCallbacks']={syn:'Re-enables the propagation of every new advertised value to the parent hub.',lib:'multicellweighscale.unmuteValueCallbacks()',pro:'function unmuteValueCallbacks()',cmt:'

Re-enables the propagation of every new advertised value to the parent hub. This function reverts the effect of a previous call to `muteValueCallbacks()`. Remember to call the `saveToFlash()` method of the module if the modification must be kept.

',ret:'`YAPI_SUCCESS` when the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['MultiCellWeighScale']['wait_async']={syn:'Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function.',lib:'multicellweighscale.wait_async()',pro:'function wait_async(callback, context)',cmt:'

Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function. The callback function can therefore freely issue synchronous or asynchronous commands, without risking to block the Javascript VM.

',par:{callback:'callback function that is invoked when all pending commands on the module are completed. The callback function receives two arguments: the caller-specific context object and the receiving function object.',context:'caller-specific object that is passed as-is to the callback function'},ret:'nothing.'}; //--- (end of generated code: MultiCellWeighScale) //--- (end of generated code) function isClassMethod(str_method) { return str_method.charAt(0) == str_method.charAt(0).toUpperCase(); } // add function aliases to the substitution list for(classname in doc) { for(funcname in doc[classname]) { if(isClassMethod(funcname)) { // class method, generate shortcut sub['y'+funcname] = doc[classname][funcname].lib; } } } function ApplySub(text,classname) { var pos, endpos = 0, key, rep; if(sub['null'] != 'null') text = text.replace('`null`','`'+sub['null']+'`'); if(UseShortcuts) return text; if(classname.substr(0,1)!='Y') classname = 'Y'+classname; while((pos = text.toLowerCase().indexOf('`',endpos)) >= endpos) { pos += 4; endpos = text.indexOf('=32)&&(ascii<=127)&&(ascii!=34)&&(ascii!=39)) str_out =str_out+str_in.charAt(i); else { var hex = ascii.toString(16).toUpperCase(); if (hex.length==1) hex = '0'+hex; str_out = str_out + String.fromCharCode(92) + 'x'+ hex; } } return str_out; } function resizeMargin() { SetSize("MarginLayer",marginSize,WinH-110); SetLeft("FunctionsLayer",marginSize); SetSize("FunctionsLayer",WinW-marginSize,WinH-110); } function resizeSeparator() { SetHeight("separatorLayer",WinH-110); } function positionObject(int_x,int_y) { this.x = int_x; this.y = int_y; } function GetEventPosition(event) { var x,y; if (event.changedTouches) { x = event.changedTouches[0].pageX; y = event.changedTouches[0].pageY; } else { x = event.PageX; y = event.PageY; if (!x) { x= event.clientX + document.body.scrollLeft; y= event.clientY + document.body.scrollTop; } } return new positionObject(x,y); } function EnableDrag(var_element,onDragMove,onDragEnd) { //onDragMove & onDragMove are optinnals callbacks fct(DomElement,position) where position is an associtative array "x","y if (document.addEventListener) { var_element.addEventListener("mousedown",Drag_start,false); var_element.addEventListener("touchstart",Drag_start,false); } else if (document.attachEvent) var_element.attachEvent("onmousedown",Drag_start); if (onDragMove) var_element.onDragMove = onDragMove; if (onDragEnd) var_element.onDragEnd = onDragEnd; } var LastDraggedObject = null; function DraggedObject(obj_element,obj_elmtInitialPos,obj_mouseInitalPos) {this.element = obj_element; this.elmtInitialPos = obj_elmtInitialPos; this.elmtCurrentPos = new positionObject(obj_elmtInitialPos.x,obj_elmtInitialPos.y); this.mouseInitialPos = obj_mouseInitalPos; } function Drag_start(event) { if (!event) event = window.event; var source = event.srcElement; if (event.button!=undefined) { if ((event.button!=1) && (document.attachEvent)) return; // ie; if ((event.button!=0) && (document.addEventListener)) return; // other; } if (!source) source= this; if (!source) return; var originalsource=source; while (source.tagName!="DIV") { if (source.tagName=="A") return false; // there is a link (a probably a button) on the way: cancel drag source=source.parentNode; } if (event.preventDefault) event.preventDefault(); source.style.cursor="col-resize"; lastDraggedObject = new DraggedObject( source, new positionObject(parseInt(source.style.left),parseInt(source.style.top)), GetEventPosition(event) ); if (document.addEventListener) { document.addEventListener("mousemove",Drag_mouseCapture,false); document.addEventListener("mouseup", Drag_stopMouseCapture,false); document.addEventListener("touchmove",Drag_mouseCapture,false); document.addEventListener("touchend", Drag_stopMouseCapture,false); } else if (document.attachEvent) { document.attachEvent("onmousemove",Drag_mouseCapture); document.attachEvent("onmouseup",Drag_stopMouseCapture); } document.onmouseup = Drag_stopMouseCapture; } function Drag_mouseCapture(event) { if (!event) event = window.event; var position = GetEventPosition(event); if (event.preventDefault) event.preventDefault(); var x = (lastDraggedObject.elmtInitialPos.x + position.x - lastDraggedObject.mouseInitialPos.x); var y = (lastDraggedObject.elmtInitialPos.y + position.y - lastDraggedObject.mouseInitialPos.y); var iw = getInnerWidth() var ih = getInnerHeight(); var w = lastDraggedObject.element.offsetWidth; var h = lastDraggedObject.element.offsetHeight; if (x>iw-w) x=iw-w; if (y>ih-h) y=ih-h; if (x<0) x=0; if (y<0) y=0; var p = {x:x,y:y}; if (lastDraggedObject.element.onDragMove) lastDraggedObject.element.onDragMove(lastDraggedObject.element,p); lastDraggedObject.elmtCurrentPos.x = p.x; lastDraggedObject.elmtCurrentPos.y = p.y; lastDraggedObject.element.style.left = p.x+"px"; lastDraggedObject.element.style.top = p.y+"px"; } function Drag_stopMouseCapture() { if (document.removeEventListener) { document.removeEventListener("mousemove",Drag_mouseCapture,false); document.removeEventListener("mouseup", Drag_stopMouseCapture,false); document.removeEventListener("touchmove",Drag_mouseCapture,false); document.removeEventListener("touchend", Drag_stopMouseCapture,false); } else if (document.detachEvent) { document.detachEvent("onmousemove",Drag_mouseCapture); document.detachEvent("onmouseup",Drag_stopMouseCapture); } if (lastDraggedObject) { lastDraggedObject.element.style.cursor='col-resize'; if (lastDraggedObject.element.onDragEnd) lastDraggedObject.element.onDragEnd(lastDraggedObject.element,{x:lastDraggedObject.elmtCurrentPos.x,y:lastDraggedObject.elmtCurrentPos.y}); } lastDraggedObject = null; } function marginMove(el,pos) {pos.y = 80; if (pos.x<100) pos.x=100; if (pos.x>WinW-100) pos.x=WinW-100; marginSize=pos.x; resizeMargin() } function proto(str_classindex, m) { var funcproto = doc[str_classindex][m].pro; if(isClassMethod(m)) { if(UseShortcuts) { funcproto = funcproto.replace(m, 'y'+m); } else if(doc[str_classindex][m].lib.substr(0,1) == '[' && funcproto.substr(0,1) != '+') { var params = doc[str_classindex][m].par; var methodpos = funcproto.search(m); var endrettype = methodpos; while(endrettype > 0 && funcproto.substr(endrettype-1,1)==' ') endrettype--; var newproto = "+("+funcproto.substr(0,endrettype)+") "+m; var pos = methodpos+m.length; for(var p in params) { pos += funcproto.slice(pos).search(/[A-Za-z]/); var argpos = pos + funcproto.slice(pos).search(' pos && funcproto.substr(endargtype-1,1)==' ') endargtype--; var endarg = argpos + funcproto.slice(argpos).search(/[,)]/); newproto += ": ("+funcproto.slice(pos, endargtype)+") "+funcproto.slice(argpos,endarg)+" "; pos = endarg; } funcproto = newproto; } } return funcproto } var lastindex_shown = ""; var lastname_shown = null; function Show(str_classindex,str_name) { if ((str_classindex=='')&&(str_name=='')) { document.getElementById("FunctionsLayerInner").innerHTML =NotFound; return; } var fcthtml=''; fcthtml = ""; lastindex_shown =str_classindex; if (str_name) { lastname_shown = str_name; var fct = doc[str_classindex][str_name]; var funcname = fct.lib; var funcproto = proto(str_classindex, str_name); if(UseShortcuts && isClassMethod(str_name)) { funcname = 'y'+str_name+'()'; } fcthtml = ""+funcname+'' +"
"+funcproto+'' +'
'+ApplySub(fct.cmt,str_classindex); if (fct.par) { fcthtml += ""+ParamLabel+'
\n'; fcthtml +='

' for (var p in fct.par) fcthtml +='
'+p+' | : '+ApplySub(fct.par[p],str_classindex)+'
\n'; fcthtml +='

' } if (fct.ret) { fcthtml += ""+ReturnLabel+'
\n'; fcthtml +='

'+ApplySub(fct.ret,str_classindex)+'

\n'; } if (fct.ext) fcthtml+=ApplySub(fct.ext,str_classindex); } else if (str_classindex!='') { fcthtml = ""+str_classindex+'
' + "

"+ApplySub(doc[str_classindex][''].syn,str_classindex)+"

" + "

"+IncludeLabel+"

" + "

"+doc[str_classindex][''].inc+"

" + "

"+ApplySub(doc[str_classindex][''].cmt,str_classindex)+"

"; for (m in doc[str_classindex]) { if (m!='') { var funcproto = proto(str_classindex, m); fcthtml +="

"+funcproto+'
' +""+ApplySub(doc[str_classindex][m].syn,str_classindex)+'

'; } } } document.getElementById("FunctionsLayerInner").innerHTML = fcthtml; } function expand(source,openonly) { if (document.getElementById(source.id+"List").style.display=='' && !openonly) { document.getElementById(source.id+"List").style.display='none'; document.getElementById(source.id).src=plusimage; } else { document.getElementById(source.id+"List").style.display=''; document.getElementById(source.id).src=minusimage; } } function ShowFunctions(str_currentClassName) { var marginhtml = ""; for (var classname in doc) { var icon = plusimage; var fct = "expand"; var display = "none" if (str_currentClassName==classname) { icon = minusimage; fct = "expand"; display = "" } marginhtml = marginhtml+" "; marginhtml = marginhtml+""+classname+'
'; marginhtml = marginhtml+ "
"; for (var method in doc[classname]) { if (method!='') { var funcname = doc[classname][method].lib; if(UseShortcuts && isClassMethod(method)) funcname = 'y'+method+'()'; marginhtml = marginhtml+""+funcname+''; } } marginhtml = marginhtml+'
' } document.getElementById("MarginLayer").innerHTML = marginhtml; } function fctMatch(classname,method,values) { var found = new Array() var tosearch = new Array() for (var i=0;i=0; if (!found) found=method.search(expr)>=0; if (!found && fct.inc) {if (!found && fct.syn) found=fct.syn.search(expr)>=0; if (!found) found=fct.inc.search(expr)>=0; } if (!found && fct.pro) found=fct.pro.search(expr)>=0; if (fct.par) for (var p in fct.par) { if (!found) found=p.search(expr)>=0; if (!found) found=fct.par[p].search(expr)>=0; } if (fct.ret) { if (!found) found=fct.ret.search(expr)>=0; } if (!found && fct.cmt)found=fct.cmt.search(expr)>=0; if (!found && fct.ext)found=fct.ext.search(expr)>=0; if (!found) return false; } return true; } var searchTimer = null; function doSearch() { searchTimer = null; var value= document.forms['yoctoForm'].elements['search'].value; if (value=='') { for (var classname in doc) { var container = document.getElementById(classname+"List"); for (var method in doc[classname]) if (method!='') { var it = document.getElementById(classname+'.'+method); if (it) it.style.display="block"; } document.getElementById(classname).style.visibility='visible'; var container = document.getElementById(classname+"List"); if (container["originalDisplay"]!="") { document.getElementById(classname+"List").style.display='none'; document.getElementById(classname).src=plusimage; } else { document.getElementById(classname+"List").style.display=''; document.getElementById(classname).src=minusimage; } container["originalDisplay"]=null; } Show(lastindex_shown,lastname_shown); return; } var firstindex = ''; var firstname = ''; qvalue = value; value = ''; for(var i = 0; i < qvalue.length; i++) { var c = qvalue.charAt(i); if(c == '\\' || c == '[' || c == ']' || c == '(' || c == ')') { value += '.'; } else { if (c!=' ') value+='['+qvalue.charAt(i)+']'; else value+=' '; } } for (var classname in doc) { var matchfound=false; var container = document.getElementById(classname+"List"); if (!container["originalDisplay"]) container["originalDisplay"]=null; if (container["originalDisplay"]==null) container["originalDisplay"] = container.style.display; values = value.split(' '); for (var method in doc[classname]) { var it = document.getElementById(classname+'.'+method); var match = fctMatch(classname,method,values); if (match) { if (it) it.style.display="block"; matchfound=true; if (firstindex=='') {firstindex=classname; firstname = method;} } else { if (it) it.style.display="none"; } } if (matchfound) { document.getElementById(classname+"List").style.display=''; document.getElementById(classname).src=minusimage; document.getElementById(classname).style.visibility='visible'; } else { document.getElementById(classname+"List").style.display='none'; document.getElementById(classname).style.visibility='hidden'; document.getElementById(classname).src=plusimage; } } Show(firstindex,firstname); } function initSearch() { if (searchTimer!=null) clearTimeout(searchTimer); searchTimer = setTimeout('doSearch()',500); } function sortObject(o) { var sorted = {}, key, a = []; for (key in o) { if (key != 'YAPI' && o.hasOwnProperty(key)) { a.push(key); } } a.sort(); if (o['YAPI']) sorted['YAPI']=o['YAPI']; for (key = 0; key < a.length; key++) { sorted[a[key]] = o[a[key]]; } return sorted; } function OOcheckboxChange() { UseShortcuts = document.forms["yoctoForm"].elements["OOcheckbox"].checked; ShowFunctions(lastindex_shown); Show(lastindex_shown,lastname_shown); } -->`

| www.yoctopuce.com