',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.

',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']['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` and `Y_CALLBACKENCODING_YOCTO_API` 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_callbackMaxDelay']={syn:'Returns the maximum waiting time between two callback notifications, in seconds.',lib:'network.get_callbackMaxDelay()',pro:'function get_callbackMaxDelay()',cmt:'

Returns the maximum waiting time between two callback notifications, in seconds.

',ret:'an integer corresponding to the maximum waiting time between two callback notifications, in seconds',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 callback notifications, in seconds.',lib:'network.get_callbackMinDelay()',pro:'function get_callbackMinDelay()',cmt:'

Returns the minimum waiting time between two callback notifications, in seconds.

',ret:'an integer corresponding to the minimum waiting time between two callback notifications, in seconds',ext:'On failure, throws an exception or returns `Y_CALLBACKMINDELAY_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_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_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_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_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']['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']['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 str_host to test the network connectivity.',lib:'network.ping()',pro:'function ping(host)',cmt:'

Pings str_host to test the network connectivity. Sends four ICMP ECHO_REQUEST requests from the module to the target str_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` and `Y_CALLBACKENCODING_YOCTO_API` 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_callbackMaxDelay']={syn:'Changes the maximum waiting time between two callback notifications, in seconds.',lib:'network.set_callbackMaxDelay()',pro:'function set_callbackMaxDelay(newval)',cmt:'

Changes the maximum waiting time between two callback notifications, in seconds.

',par:{newval:'an integer corresponding to the maximum waiting time between two 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_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 callback notifications, in seconds.',lib:'network.set_callbackMinDelay()',pro:'function set_callbackMinDelay(newval)',cmt:'

Changes the minimum waiting time between two callback notifications, in seconds.

',par:{newval:'an integer corresponding to the minimum waiting time between two 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_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_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_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_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']['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']['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.

',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']['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, `adhocNetwork()` must be called to disconnect the module from the current network. The returned list must be unallocated 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']['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']['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']['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']['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, register callback functions, access to 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.

',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']['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_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_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.

',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.

',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_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']['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']['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_highestValue']={syn:'Changes the recorded maximal value observed.',lib:'voc.set_highestValue()',pro:'function set_highestValue(newval)',cmt:'

Changes the recorded maximal value observed.

',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.

',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']['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.

',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']['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']['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']['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']['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, register callback functions, access to 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.

',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']['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_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_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.

',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.

',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_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']['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']['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_highestValue']={syn:'Changes the recorded maximal value observed.',lib:'power.set_highestValue()',pro:'function set_highestValue(newval)',cmt:'

Changes the recorded maximal value observed.

',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.

',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']['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.

',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']['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']['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']['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']['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 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 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.

',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']['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']['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']['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']['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']['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.

',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']['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']['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']['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). If current UTC time is known, utcOffset will be automatically adjusted for the new specified time.

',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. If current UTC time is known, the current time will 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['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.

',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']['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']['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']['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']['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.

',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']['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']['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']['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']['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, register callback functions, access to 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.

',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']['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_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_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.

',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.

',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_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 measured value of the electrical signal used by the sensor.',lib:'genericsensor.get_signalValue()',pro:'function get_signalValue()',cmt:'

Returns the measured value of the electrical signal used by the sensor.

',ret:'a floating point number corresponding to the measured value of the electrical signal used 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']['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']['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_highestValue']={syn:'Changes the recorded maximal value observed.',lib:'genericsensor.set_highestValue()',pro:'function set_highestValue(newval)',cmt:'

Changes the recorded maximal value observed.

',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.

',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.

',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.

',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']['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.

',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']['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_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']['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']['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: 0 makes a bit an input, 1 makes it an output.',lib:'digitalio.set_portPolarity()',pro:'function set_portPolarity(newval)',cmt:'

Changes the polarity of all the 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 will be kept after a reboot.

',par:{newval:'an integer corresponding to the polarity of all the 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_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']['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.

',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']['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']['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']['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']['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_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: AnalogSensorS16) doc['AnalogSensorS16']={'':{syn:'AnalogSensorS16',inc:'
',cmt:'

The Yoctopuce application programming interface allows you to read an instant measure of the sensor, as well as the minimal and maximal values observed.

'}}; doc['AnalogSensorS16']['FindAnalogSensorS16']={syn:'Retrieves $AFUNCTION$ for a given identifier.',lib:'YAnalogSensorS16.FindAnalogSensorS16()',pro:'function FindAnalogSensorS16(func)',cmt:'

Retrieves $AFUNCTION$ 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 $THEFUNCTION$ is online at the time it is invoked. The returned object is nevertheless valid. Use the method `YAnalogSensorS16.isOnline()` to test if $THEFUNCTION$ is indeed online at a given time. In case of ambiguity when looking for $AFUNCTION$ 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 $THEFUNCTION$'},ret:'a `YAnalogSensorS16` object allowing you to drive $THEFUNCTION$.'}; doc['AnalogSensorS16']['FirstAnalogSensorS16']={syn:'Starts the enumeration of $FUNCTIONS$ currently accessible.',lib:'YAnalogSensorS16.FirstAnalogSensorS16()',pro:'function FirstAnalogSensorS16()',cmt:'

Starts the enumeration of $FUNCTIONS$ currently accessible. Use the method `YAnalogSensorS16.nextAnalogSensorS16()` to iterate on next $FUNCTIONS$.

',ret:'a pointer to a `YAnalogSensorS16` object, corresponding to $THEFIRSTFUNCTION$ currently online, or a `null` pointer if there are none.'}; doc['AnalogSensorS16']['calibrateFromPoints']={syn:'Configures error correction data points, in particular to compensate for a possible perturbation of the measure caused by an enclosure.',lib:'analogsensors16.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

',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['AnalogSensorS16']['describe']={syn:'Returns a short text that describes the function in the form `TYPE(NAME)=SERIAL.FUNCTIONID`.',lib:'analogsensors16.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['AnalogSensorS16']['get_advertisedValue']={syn:'Returns the current value of $THEFUNCTION$ (no more than 6 characters).',lib:'analogsensors16.get_advertisedValue()',pro:'function get_advertisedValue()',cmt:'

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

',ret:'a string corresponding to the current value of $THEFUNCTION$ (no more than 6 characters)',ext:'On failure, throws an exception or returns `Y_ADVERTISEDVALUE_INVALID`.'}; doc['AnalogSensorS16']['get_currentRawValue']={syn:'Returns the uncalibrated, unrounded raw value returned by the sensor.',lib:'analogsensors16.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['AnalogSensorS16']['get_currentValue']={syn:'Returns the current measured value.',lib:'analogsensors16.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['AnalogSensorS16']['get_errorMessage']={syn:'Returns the error message of the latest error with this function.',lib:'analogsensors16.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['AnalogSensorS16']['get_errorType']={syn:'Returns the numerical error code of the latest error with this function.',lib:'analogsensors16.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['AnalogSensorS16']['get_friendlyName']={syn:'Returns a global identifier of the function in the format `MODULE_NAME.FUNCTION_NAME`.',lib:'analogsensors16.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['AnalogSensorS16']['get_functionDescriptor']={syn:'Returns a unique identifier of type `YFUN_DESCR` corresponding to the function.',lib:'analogsensors16.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`. If the function has never been contacted, the returned value is `Y_FUNCTIONDESCRIPTOR_INVALID`.'}; doc['AnalogSensorS16']['get_functionId']={syn:'Returns the hardware identifier of the function, without reference to the module.',lib:'analogsensors16.get_functionId()',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['AnalogSensorS16']['get_hardwareId']={syn:'Returns the unique hardware identifier of the function in the form `SERIAL.FUNCTIONID`.',lib:'analogsensors16.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['AnalogSensorS16']['get_highestValue']={syn:'Returns the maximal value observed.',lib:'analogsensors16.get_highestValue()',pro:'function get_highestValue()',cmt:'

Returns the maximal value observed.

',ret:'a floating point number corresponding to the maximal value observed',ext:'On failure, throws an exception or returns `Y_HIGHESTVALUE_INVALID`.'}; doc['AnalogSensorS16']['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:'analogsensors16.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['AnalogSensorS16']['get_logicalName']={syn:'Returns the logical name of $THEFUNCTION$.',lib:'analogsensors16.get_logicalName()',pro:'function get_logicalName()',cmt:'

Returns the logical name of $THEFUNCTION$.

',ret:'a string corresponding to the logical name of $THEFUNCTION$',ext:'On failure, throws an exception or returns `Y_LOGICALNAME_INVALID`.'}; doc['AnalogSensorS16']['get_lowestValue']={syn:'Returns the minimal value observed.',lib:'analogsensors16.get_lowestValue()',pro:'function get_lowestValue()',cmt:'

Returns the minimal value observed.

',ret:'a floating point number corresponding to the minimal value observed',ext:'On failure, throws an exception or returns `Y_LOWESTVALUE_INVALID`.'}; doc['AnalogSensorS16']['get_module']={syn:'Gets the `YModule` object for the device on which the function is located.',lib:'analogsensors16.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['AnalogSensorS16']['get_module_async']={syn:'Gets the `YModule` object for the device on which the function is located (asynchronous version).',lib:'analogsensors16.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['AnalogSensorS16']['get_reportFrequency']={syn:'Returns the timed value notification frequency, or \x22OFF\x22 if timed value notifications are disabled for this function.',lib:'analogsensors16.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['AnalogSensorS16']['get_resolution']={syn:'Returns the resolution of the measured values.',lib:'analogsensors16.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['AnalogSensorS16']['get_unit']={syn:'Returns the measuring unit for the measured value.',lib:'analogsensors16.get_unit()',pro:'function get_unit()',cmt:'

Returns the measuring unit for the measured value.

',ret:'a string corresponding to the measuring unit for the measured value',ext:'On failure, throws an exception or returns `Y_UNIT_INVALID`.'}; doc['AnalogSensorS16']['get_userData']={syn:'Returns the value of the userData attribute, as previously stored using method `set_userData`.',lib:'analogsensors16.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['AnalogSensorS16']['isOnline']={syn:'Checks if the function is currently reachable, without raising any error.',lib:'analogsensors16.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['AnalogSensorS16']['isOnline_async']={syn:'Checks if the function is currently reachable, without raising any error (asynchronous version).',lib:'analogsensors16.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['AnalogSensorS16']['load']={syn:'Preloads the function cache with a specified validity duration.',lib:'analogsensors16.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['AnalogSensorS16']['load_async']={syn:'Preloads the function cache with a specified validity duration (asynchronous version).',lib:'analogsensors16.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['AnalogSensorS16']['nextAnalogSensorS16']={syn:'Continues the enumeration of $FUNCTIONS$ started using `yFirstAnalogSensorS16()`.',lib:'analogsensors16.nextAnalogSensorS16()',pro:'function nextAnalogSensorS16()',cmt:'

Continues the enumeration of $FUNCTIONS$ started using `yFirstAnalogSensorS16()`.

',ret:'a pointer to a `YAnalogSensorS16` object, corresponding to $AFUNCTION$ currently online, or a `null` pointer if there are no more $FUNCTIONS$ to enumerate.'}; doc['AnalogSensorS16']['registerValueCallback']={syn:'Registers the callback function that is invoked on every change of advertised value.',lib:'analogsensors16.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['AnalogSensorS16']['set_highestValue']={syn:'Changes the recorded maximal value observed.',lib:'analogsensors16.set_highestValue()',pro:'function set_highestValue(newval)',cmt:'

Changes the recorded maximal value observed.

',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['AnalogSensorS16']['set_logFrequency']={syn:'Changes the datalogger recording frequency for this function.',lib:'analogsensors16.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['AnalogSensorS16']['set_logicalName']={syn:'Changes the logical name of $THEFUNCTION$.',lib:'analogsensors16.set_logicalName()',pro:'function set_logicalName(newval)',cmt:'

Changes the logical name of $THEFUNCTION$. 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 $THEFUNCTION$'},ret:'`YAPI_SUCCESS` if the call succeeds.',ext:'On failure, throws an exception or returns a negative error code.'}; doc['AnalogSensorS16']['set_lowestValue']={syn:'Changes the recorded minimal value observed.',lib:'analogsensors16.set_lowestValue()',pro:'function set_lowestValue(newval)',cmt:'

Changes the recorded minimal value observed.

',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['AnalogSensorS16']['set_reportFrequency']={syn:'Changes the timed value notification frequency for this function.',lib:'analogsensors16.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['AnalogSensorS16']['set_userData']={syn:'Stores a user context provided as argument in the userData attribute of the function.',lib:'analogsensors16.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['AnalogSensorS16']['wait_async']={syn:'Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function.',lib:'analogsensors16.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: AnalogSensorS16) //--- (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.

',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']['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_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_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.

',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.

',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_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']['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']['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']['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_highestValue']={syn:'Changes the recorded maximal value observed.',lib:'sensor.set_highestValue()',pro:'function set_highestValue(newval)',cmt:'

Changes the recorded maximal value observed.

',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.

',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']['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.

',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']['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_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_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_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.

',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.

',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_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']['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']['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_highestValue']={syn:'Changes the recorded maximal value observed.',lib:'accelerometer.set_highestValue()',pro:'function set_highestValue(newval)',cmt:'

Changes the recorded maximal value observed.

',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.

',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']['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.

',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']['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_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_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_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.

',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.

',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_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']['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']['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_highestValue']={syn:'Changes the recorded maximal value observed.',lib:'magnetometer.set_highestValue()',pro:'function set_highestValue(newval)',cmt:'

Changes the recorded maximal value observed.

',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.

',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']['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.

',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']['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_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_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 a negative error code.'}; 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 a negative error code.'}; 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']['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']['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. Remember to call the `saveToFlash()` method of the module if the modification must be kept.'}}; 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']['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.

',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']['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_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_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_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.

',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.

',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_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']['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']['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_highestValue']={syn:'Changes the recorded maximal value observed.',lib:'compass.set_highestValue()',pro:'function set_highestValue(newval)',cmt:'

Changes the recorded maximal value observed.

',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.

',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']['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.

',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']['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_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_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_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.

',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.

',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_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']['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']['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_highestValue']={syn:'Changes the recorded maximal value observed.',lib:'gyro.set_highestValue()',pro:'function set_highestValue(newval)',cmt:'

Changes the recorded maximal value observed.

',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.

',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']['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.

',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']['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_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_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_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.

',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.

',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_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']['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']['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_highestValue']={syn:'Changes the recorded maximal value observed.',lib:'tilt.set_highestValue()',pro:'function set_highestValue(newval)',cmt:'

Changes the recorded maximal value observed.

',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.

',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']['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.

',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']['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_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_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.

',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.

',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_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']['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']['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_highestValue']={syn:'Changes the recorded maximal value observed.',lib:'qt.set_highestValue()',pro:'function set_highestValue(newval)',cmt:'

Changes the recorded maximal value observed.

',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.

',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']['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:'Pwm 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.

',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']['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']['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']['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']['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.

',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']['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']['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']['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']['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, register callback functions, access to 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.

',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']['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_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_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.

',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.

',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_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']['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']['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_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.

',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.

',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']['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.

',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']['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']['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']['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']['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.

',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']['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, \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']['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']['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 MODBUS 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 YSerialPort 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 YSerialPort 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 YSerialPort 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 YSerialPort object.',lib:'serialport.read_tell()',pro:'function read_tell()',cmt:'

Returns the current absolute stream position pointer of the YSerialPort 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, \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']['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, register callback functions, access to the autonomous datalogger. This class adds the ability to configure the signal parameter used to transmit information: the duty cacle, 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.

',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']['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_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 % or the pulse length in ms.

',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_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.

',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.

',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` and `Y_PWMREPORTMODE_PWM_EDGECOUNT` 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_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']['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']['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_highestValue']={syn:'Changes the recorded maximal value observed.',lib:'pwminput.set_highestValue()',pro:'function set_highestValue(newval)',cmt:'

Changes the recorded maximal value observed.

',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.

',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:'Modifies 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:'

Modifies 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` and `Y_PWMREPORTMODE_PWM_EDGECOUNT`'},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']['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.

',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']['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']['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']['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']['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.

',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']['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']['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']['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']['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']['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.

',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']['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\x27s possible to pass an directory instead of a file. In this case this method return the path of the most recent appropriate byn file. This method will ignore firmware that are older than mintrelase.

',par:{serial:'the serial number of the module to update',path:'the path of a byn file or a directory that contain byn files',minrelease:'an positif integer'},ret:': the path of the byn file to use or a empty string if no byn files match the requirement',ext:'On failure, returns a string that start 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.

',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']['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']['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']['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']['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, register callback functions, 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.

',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']['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_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_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.

',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.

',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_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']['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']['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_highestValue']={syn:'Changes the recorded maximal value observed.',lib:'latitude.set_highestValue()',pro:'function set_highestValue(newval)',cmt:'

Changes the recorded maximal value observed.

',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.

',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']['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.

',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']['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_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_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.

',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.

',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_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']['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']['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_highestValue']={syn:'Changes the recorded maximal value observed.',lib:'longitude.set_highestValue()',pro:'function set_highestValue(newval)',cmt:'

Changes the recorded maximal value observed.

',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.

',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']['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.

',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']['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_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_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.

',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.

',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_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']['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']['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_highestValue']={syn:'Changes the recorded maximal value observed.',lib:'groundspeed.set_highestValue()',pro:'function set_highestValue(newval)',cmt:'

Changes the recorded maximal value observed.

',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.

',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']['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.

',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']['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 ouput featured by the module.',lib:'poweroutput.get_voltage()',pro:'function get_voltage()',cmt:'

Returns the voltage on the power ouput 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 ouput 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']['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']['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']['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.

',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']['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_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_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_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` and `Y_ENABLEDATA_NEVER` 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_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_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']['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']['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_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_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` and `Y_ENABLEDATA_NEVER` 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_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']['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) //--- (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