Yoctopuce Yocto-RangeFinder User Manual Download Page 269

21. High-level API Reference

YRangeFinder

rangefinder

get_sensorState()

rangefinder

sensorState()

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

js

function get_sensorState( )

cpp

int get_sensorState( )

m

-(int) sensorState

pas

function get_sensorState( ): LongInt

vb

function get_sensorState( ) As Integer

cs

int get_sensorState( )

java

int get_sensorState( )

uwp

async Task<int> get_sensorState( )

py

def get_sensorState( )

php

function get_sensorState( )

es

function get_sensorState( )

cmd

YRangeFinder 

target

 get_sensorState

Returns :

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

On failure, throws an exception or returns 

Y_SENSORSTATE_INVALID

.

www.yoctopuce.com

263

Summary of Contents for Yocto-RangeFinder

Page 1: ...Yocto RangeFinder User s guide...

Page 2: ......

Page 3: ...variations 8 3 6 Hardware calibration procedures 8 4 First steps 13 4 1 Prerequisites 13 4 2 Testing USB connectivity 14 4 3 Localization 15 4 4 Test of the module 15 4 5 Configuration 15 5 Assembly...

Page 4: ...52 9 5 Error handling 55 10 Using Yocto RangeFinder with C 57 10 1 Control of the RangeFinder function 57 10 2 Control of the module part 59 10 3 Error handling 62 10 4 Integration variants for the C...

Page 5: ...113 18 Advanced programming 115 18 1 Event programming 115 18 2 The data logger 118 18 3 Sensor calibration 120 19 Firmware Update 125 19 1 The VirtualHub or the YoctoHub 125 19 2 The command line lib...

Page 6: ...orms HF and EL 480 22 4 Powered module but invisible for the OS 480 22 5 Another process named xxx is already using yAPI 480 22 6 Disconnections erratic behavior 480 22 7 Damaged device 480 23 Charact...

Page 7: ...and the detection range depends on the environment You can find tables describing the expected accuracy depending on the surrounding conditions in the section called Working principles and limitation...

Page 8: ...er is not certified for use in hazardous locations explosive environments or life threatening applications Caution The Yocto RangeFinder is not certified for use in medical environments or life suppor...

Page 9: ...est available Warning the USB connector is simply soldered in surface and can be pulled out if the USB plug acts as a lever In this case if the tracks stayed in position the connector can be soldered...

Page 10: ...y software Serial number Each Yocto module has a unique serial number assigned to it at the factory For Yocto RangeFinder modules this number starts with YRNGFND1 The module can be software driven usi...

Page 11: ...connectivity All of them can drive up to three devices and behave exactly like a regular computer running a VirtualHub 1 27mm or 1 25mm connectors In case you wish to connect your Yocto RangeFinder to...

Page 12: ...will need 4 wire ribbon cable of 1 27mm pitch and Picoflex connectors 4 You can find more details on this topic in the chapter about assembly and connections 4 Header Molex ref 90325 3004 or 90325 00...

Page 13: ...f reflected light and therefore on the maximal detection range and on the accuracy A light object white 88 is typically detected at a distance almost twice as far as a dark object gray 17 and with a t...

Page 14: ...racy Conditions Distance Standard deviation Light target inside 200cm 6 Dark target inside 70cm 7 High frequency mode characteristics Measuring frequency 30 Hz Maximal detection distance 1 2m inside w...

Page 15: ...iven order These calibrations do not need to be repeated as long as the glass does not change position this calibration is relatively stable with regards to external conditions But do not forget that...

Page 16: ...hat is at 80 to 90 of the maximal measurable distance To run this calibration call the triggerXTalkCalibration method and pass as parameters the distance of the target in millimeters or in inches depe...

Page 17: ...re YRangeFinder any get_currentValue And to save the current calibration in the module flash memory add s in any command for example YRangeFinder s any get_currentValue 3 Working principle and limitat...

Page 18: ...12 www yoctopuce com...

Page 19: ...ws 8 and Windows 10 Both 32 bit and 64 bit versions are supported Yoctopuce is frequently testing its modules on Windows 7 and Windows 10 Mac OS X versions currently supported are 10 9 Maverick 10 10...

Page 20: ...chapter about assembly and connections 4 2 Testing USB connectivity At this point your Yocto RangeFinder should be connected to your computer which should have recognized it It is time to make it work...

Page 21: ...4 4 Test of the module The first item to check is that your module is working well click on the serial number corresponding to your module This displays a window summarizing the properties of your Yoc...

Page 22: ...ou try to access one of them through this logical name behavior is undetermined you have no way of knowing which of the two modules answers Luminosity This parameter allows you to act on the maximal i...

Page 23: ...s of assembly on supports The Yocto RangeFinder module contains 2 5mm assembly holes You can use these holes for screws The screw head diameter must not be larger than 4 5mm or they will damage the mo...

Page 24: ...n obtain a better result with 1 27 pitch ribbon cable Consider using solid copper cables rather than threaded ones solid copper cables are somewhat less flexible but much easier to solder Moving the s...

Page 25: ...ey simply connect the computer power supply to every port and declare themselves as self powered hub even when they are taking all their power from the USB bus in order to prevent any power consumptio...

Page 26: ...20 www yoctopuce com...

Page 27: ...ming it is unlikely that this will be a hinderance for using Yoctopuce products Note that you will never need to allocate or deallocate an object linked to the Yoctopuce API it is automatically manage...

Page 28: ...assic enumeration functions FirstXxx and nextXxxx available for each YXxx class Access by hardware name Each module function has a hardware name assigned at the factory and which cannot be modified Th...

Page 29: ...ings Enumerated modifiable luminosity 0 100 modifiable beacon On Off modifiable upTime Time read only usbCurrent Used current mA read only rebootCountdown Integer modifiable userVar Integer modifiable...

Page 30: ...ger read only timeUTC UTC time modifiable recording Enumerated modifiable autoStart On Off modifiable beaconDriven On Off modifiable clearHistory Boolean modifiable 6 3 Module control interface This i...

Page 31: ...variable available for user storage 6 4 RangeFinder function interface The Yoctopuce class YRangeFinder allows you to use and configure Yoctopuce range finder sensors It inherits from the YSensor cla...

Page 32: ...stance to compensate for the effects of an enclosure as an array of 16 bit words resolution Measure resolution i e precision of the numeric representation not necessarily of the measure itself sensorS...

Page 33: ...g unit for the ambient light currentValue Current value of the ambient light in the specified unit as a floating point number lowestValue Minimal value of the ambient light in the specified unit as a...

Page 34: ...hat is automatically advertised up to the parent hub For a temperature sensor the advertised value is the current value of the temperature unit Short character string representing the measuring unit f...

Page 35: ...name is limited to 19 characters among A Z a z 0 9 _ and advertisedValue Short character string summarizing the current state of the data logger that is automatically advertised up to the parent hub F...

Page 36: ...ontrol the locally connected module Native control by DLL Here the main part of the code controlling the modules is located in a DLL The software is compiled with a small library which provides contro...

Page 37: ...es not need to run on the machine on which the modules are connected The application can very well be located on another machine which connects itself to the service to drive the modules Moreover the...

Page 38: ...Programming where to start At this point of the user s guide you should know the main theoretical points of your Yocto RangeFinder It is now time to practice You must download the Yoctopuce library f...

Page 39: ...all set you only need to connect your Yocto RangeFinder open a shell and start working by typing for example C YRangeFinder any get_currentValue To use the command API on Linux you need either have r...

Page 40: ...This prevents you from having to know the exact names of your function and of your module But you can use logical names as well as long as you have configured them beforehand Let us imagine a Yocto R...

Page 41: ...cles of the nonvolatile memory of the module is limited When this limit is reached nothing guaranties that the saving process is performed correctly This limit linked to the technology employed by the...

Page 42: ...36 www yoctopuce com...

Page 43: ...now available out of the box in most Javascript engines No transpilation is needed no Babel no jspm just plain Javascript Here is your favorite engines minimum version needed to run this code All of t...

Page 44: ...code with all benefits of asynchronous I O but without breaking the code flow It is almost like multi threaded execution except that control switch between pending tasks only happens at places where...

Page 45: ...imply use npm instal g babel cli npm instal babel preset env You would typically ask Babel to put the transpiled files in another directory named compat for instance Your files and all files of the Yo...

Page 46: ...instance instead of writing async function logInfo module console log Name await module get_logicalName console log Beacon await module get_beacon logInfo myModule you can use function logInfoProxy m...

Page 47: ...tion is defined only once rangefinder YRangeFinder FindRangeFinder YRNGFND1 123456 rangeFinder rangefinder YRangeFinder FindRangeFinder YRNGFND1 123456 MaFonction rangefinder YRangeFinder FindRangeFin...

Page 48: ...h if await rf isOnline console log Distance await rf get_currentValue Ambient IR await ir get_currentValue Temperature await tmp get_currentValue else console log Module not connected setTimeout refre...

Page 49: ...perature serial temperature1 if await rf isOnline document getElementById msg value document getElementById rf value await rf get_currentValue document getElementById ir value await ir get_currentValu...

Page 50: ...he set_xxx method For more details regarding the used functions refer to the API chapters Changing the module settings When you want to modify the settings of a module you only need to call the corres...

Page 51: ...rformed with the YModule FirstModule function which returns the first module found Then you only need to call the nextModule function of this object to find the following modules and this as long as t...

Page 52: ...elatively easily determine where the problem happened and view the explanatory message linked to the exception Otherwise the exception makes your program crash bang As this latest situation is not the...

Page 53: ...rably locally on you machine If you wish to use the PHP server of your internet provider it is possible but you will probably need to configure your ADSL router for it to accept and forward TCP reques...

Page 54: ...56 which you have named MyModule and for which you have given the rangeFinder function the name MyFunction The following five calls are strictly equivalent as long as MyFunction is defined only once r...

Page 55: ...FindTemperature serial temperature1 Print Module to use input name serial value serial br Print Distance rf get_currentValue br Print Ambient IR ir get_currentValue br Print Temperature tmp get_curren...

Page 56: ...USB current smA br module get_usbCurrent printf logs br pre s pre module get_lastLogs yFreeAPI input type submit value refresh FORM BODY HTML Each property xxx of the module can be read thanks to a m...

Page 57: ...rning the number of write cycles of the nonvolatile memory of the module is limited When this limit is reached nothing guaranties that the saving process is performed correctly This limit linked to th...

Page 58: ...e there is only one official phone number that of the switchboard itself You cannot reach the internal extensions from the outside Typical DSL configuration LAN machines are isolated from the outside...

Page 59: ...outer configuration The module control script is located on an external site and it is the VirtualHub which is in charge of calling it a regular intervals The HTTP callback API uses the VirtualHub whi...

Page 60: ...ivalent include yocto_api php yRegisterHub callback The remainder of the code stays strictly identical On the VirtualHub interface at the bottom of the configuration window for the HTTP callback API t...

Page 61: ...le check that it is online with the isOnline function and then hope that it will stay so during the fraction of a second necessary for the following code lines to run This method is not perfect but it...

Page 62: ...ything went well and a different error code in case of failure When you work without exceptions you can obtain an error code and an error message explaining the source of the error You can request the...

Page 63: ...possible interaction from C The library is naturally also available as binary files so that you can link it directly if you prefer You will soon notice that the C API defines many functions which ret...

Page 64: ...ong as MyFunction is defined only once YRangeFinder rangefinder yFindRangeFinder YRNGFND1 123456 rangeFinder YRangeFinder rangefinder yFindRangeFinder YRNGFND1 123456 MyFunction YRangeFinder rangefind...

Page 65: ...ble endl return 1 target rf get_module get_serialNumber else rf yFindRangeFinder target rangeFinder1 ir yFindLightSensor target lightSensor1 tmp yFindTemperature target temperature1 while 1 if rf isOn...

Page 66: ...yFreeAPI return 0 Each property xxx of the module can be read thanks to a method of type get_xxxx and properties which are not read only can be modified with the help of the set_xxx method For more d...

Page 67: ...the module micro processor is located at about 100000 cycles In short you can use the saveToFlash function only 100000 times in the life of the module Make sure you do not call this function within a...

Page 68: ...brary offers another possibility for error handling allowing you to create a robust program without needing to catch exceptions at every line of code You simply need to call the YAPI DisableExceptions...

Page 69: ...roject the Yoctopuce library and the prerequisite system libraries For Windows yocto static lib For Mac OS X libyocto static a IOKit framework and CoreFoundation framework For Linux libyocto static a...

Page 70: ...gcc lyocto lm lpthread lusb 1 0 lstdc 10 Using Yocto RangeFinder with C 64 www yoctopuce com...

Page 71: ...nes many functions which return objects You do not need to deallocate these objects yourself the API does it automatically at the end of the application In order to keep them simple all the examples p...

Page 72: ...R f n ir get_currentValue NSLog Temperature f n tmp get_currentValue NSLog press Ctrl C to exit n YAPI Sleep 1000 NULL YAPI FreeAPI return 0 There are only a few really important lines in this example...

Page 73: ...RangeFinder FindRangeFinder allows you to obtain the distance measured by the sensor in mm or in inches depending on the sensor configuration 11 2 Control of the module part Each module can be control...

Page 74: ...d Inversely it is possible to force the module to forget its current settings by using the revertFromFlash method The short example below allows you to modify the logical name of a module import Found...

Page 75: ...er will have unplugged the device either before running the software or even while the software is running The Yoctopuce library is designed to help you support this kind of behavior but your code mus...

Page 76: ...a get_currentValue method returns a Y_CURRENTVALUE_INVALID value and so on In any case the returned value is of the expected type and is not a null pointer which would risk crashing your program At w...

Page 77: ...s not a NET DLL but a classic DLL written in C which manages the low level communications with the modules3 The source files in Visual Basic manage the high level part of the API Therefore your need b...

Page 78: ...function initializes the Yoctopuce API and indicates where the modules should be looked for When used with the parameter usb it will use the modules locally connected to the computer running the libr...

Page 79: ...GetCommandLineArgs Dim errmsg As String Dim target As String Dim rf As YRangeFinder Dim ir As YLightSensor Dim tmp As YTemperature If argv Length 2 Then Usage target argv 1 REM Setup the API to use l...

Page 80: ...d If Console WriteLine upTime Str m get_upTime 1000 sec Console WriteLine USB current Str m get_usbCurrent mA Console WriteLine Logs Console WriteLine m get_lastLogs Else Console WriteLine argv 1 not...

Page 81: ...s reached nothing guaranties that the saving process is performed correctly This limit linked to the technology employed by the module micro processor is located at about 100000 cycles In short you ca...

Page 82: ...ou can relatively easily determine where the problem happened and view the explanatory message linked to the exception Otherwise the exception makes your program crash bang As this latest situation is...

Page 83: ...h the modules3 The source files in Visual C manage the high level part of the API Therefore your need both this DLL and the cs files of the sources directory to create a project managing Yoctopuce mod...

Page 84: ...ocally connected to the computer running the library If the initialization does not succeed this function returns a value different from YAPI SUCCESS and errmsg contains the error message YRangeFinder...

Page 85: ...t Exit 0 static void Main string args string errmsg string target YRangeFinder rf YLightSensor ir YTemperature tmp if args Length 1 usage target args 0 ToUpper Setup the API to use local USB devices i...

Page 86: ...sg YAPI SUCCESS Console WriteLine RegisterHub error errmsg Environment Exit 0 if args Length 1 usage m YModule FindModule args 0 use serial or logical name if m isOnline if args Length 2 if args 1 ToU...

Page 87: ...main CurrentDomain FriendlyName Console WriteLine Usage Console WriteLine usage demo serial or logical name new logical name System Threading Thread Sleep 2500 Environment Exit 0 static void Main stri...

Page 88: ...is chapter before accessing a module check that it is online with the isOnline function and then hope that it will stay so during the fraction of a second necessary for the following code lines to run...

Page 89: ...am At worst if you display the value without testing it it will be outside the expected bounds for the returned value In the case of functions which do not normally return information the return value...

Page 90: ...84 www yoctopuce com...

Page 91: ...the Yoctopuce web site and download the Yoctopuce Delphi libraries3 Uncompress everything in a directory of your choice add the subdirectory sources in the list of directories of Delphi libraries 4 By...

Page 92: ...module connected check USB cable halt end m rf get_module target m get_serialNumber end else or use the one specified on command line rf YFindRangeFinder target rangeFinder1 ir YFindLightSensor targe...

Page 93: ...GFND1 123456 MyFunction rangefinder yFindRangeFinder MyModule rangeFinder rangefinder yFindRangeFinder MyModule MyFunction rangefinder yFindRangeFinder MyFunction yFindRangeFinder returns an object wh...

Page 94: ...unctions refer to the API chapters Changing the module settings When you want to modify the settings of a module you only need to call the corresponding set_xxx function However this modification is p...

Page 95: ...can use the saveToFlash function only 100000 times in the life of the module Make sure you do not call this function within a loop Listing the modules Obtaining the list of the connected modules is p...

Page 96: ...u can relatively easily determine where the problem happened and view the explanatory message linked to the exception Otherwise the exception makes your program crash bang As this latest situation is...

Page 97: ...A section of the low level library is written in C but you should not need to interact directly with it it is provided as a DLL under Windows as a so files under UNIX and as a dylib file under Mac OS...

Page 98: ...s are strictly equivalent as long as MyFunction is defined only once rangefinder YRangeFinder FindRangeFinder YRNGFND1 123456 rangeFinder rangefinder YRangeFinder FindRangeFinder YRNGFND1 123456 MyFun...

Page 99: ...tSensor1 tmp YTemperature FindTemperature target temperature1 while rf isOnline print Distance str int rf get_currentValue print Ambiant IR str int ir get_currentValue print Temperature str int tmp ge...

Page 100: ...he YModule saveToFlash method Inversely it is possible to force the module to forget its current settings by using the YModule revertFromFlash method The short example below allows you to modify the l...

Page 101: ...The only way to prevent this is to implement one of the two error handling techniques described below The method recommended by most programming languages for unpredictable error handling is the use o...

Page 102: ...ing the source of the error You can request them from the object which returned the error calling the errType and errMessage methods Their returned values contain the same information as in the except...

Page 103: ...iles in a folder of your choice connect your modules run the VirtualHub software and you are ready to start your first tests You do not need to install any driver In order to keep them simple all the...

Page 104: ...turns an object which you can then use at will to control the range finder isOnline The isOnline method of the object returned by YRangeFinder FindRangeFinder allows you to know if the corresponding m...

Page 105: ...ln Module rf not connected check identification and USB cable System out println ex getMessage System exit 1 16 3 Control of the module part Each module can be controlled in a similar manner you can f...

Page 106: ...e settings of a module you only need to call the corresponding YModule set_xxx function However this modification is performed only in the random access memory RAM of the module if the module is resta...

Page 107: ...t module found Then you only need to call the nextModule function of this object to find the following modules and this as long as the returned value is not null Below a short example listing the conn...

Page 108: ...the fraction of a second necessary for the following code lines to run This method is not perfect but it can be sufficient in some cases You must however be aware that you cannot completely exclude a...

Page 109: ...o connect itself to a VirtualHub running on another OS 17 2 Getting ready Go to the Yoctopuce web site and download the Java for Android programming library1 The library is available as source files a...

Page 110: ...id machine works with Yoctopuce modules consists in trying Supported hardware The library is tested and validated on the following machines Samsung Galaxy S3 Samsung Galaxy Note 2 Google Nexus 5 Googl...

Page 111: ...ED in the section intent filter of the main activity The section activity must have a pointer to an XML file containing the list of USB modules which can run the application manifest xmlns android htt...

Page 112: ...thrown YRangeFinder FindRangeFinder The YRangeFinder FindRangeFinder function allows you to find a range finder from the serial number of the module on which it resides and from its function name You...

Page 113: ...s Activity implements OnItemSelectedListener private ArrayAdapter String aa private String serial private Handler handler null private TextView _rfView private TextView _irView private TextView _tmpVi...

Page 114: ...tch YAPI_Exception e e printStackTrace handler postDelayed this 1000 17 6 Control of the module part Each module can be controlled in a similar manner you can find below a simple sample program displa...

Page 115: ...field if module null return try field TextView findViewById R id serialfield field setText module getSerialNumber field TextView findViewById R id logicalnamefield field setText module getLogicalName...

Page 116: ...e module to forget its current settings by using the YModule revertFromFlash method The short example below allows you to modify the logical name of a module package com yoctopuce doc_examples import...

Page 117: ...atch YAPI_Exception e e printStackTrace Override public void onItemSelected AdapterView parent View view int pos long id String hwid parent getItemAtPosition pos toString module YModule FindModule hwi...

Page 118: ...le import android util TypedValue import android view View import android widget LinearLayout import android widget TextView import com yoctopuce YoctoAPI YAPI import com yoctopuce YoctoAPI YAPI_Excep...

Page 119: ...one used in the short examples provided in this chapter before accessing a module check that it is online with the isOnline function and then hope that it will stay so during the fraction of a second...

Page 120: ...114 www yoctopuce com...

Page 121: ...g model This technique consists in asking the API to signal by itself the important changes as soon as they are detected Each time a key parameter is modified the API calls a callback function which y...

Page 122: ...of the corresponding library Be aware that in most programming languages callbacks must be global procedures and not methods If you wish for the callback to call the method of an object define your c...

Page 123: ...dividually for each sensor with frequencies going from hundred calls per seconds down to one call per hour The callback takes as parameter the relevant function and the measured value as an YMeasure o...

Page 124: ...e device The data logger flash memory can store about 500 000 instant measures or 125 000 averaged measures When the memory is about to be saturated the oldest measures are automatically erased Make s...

Page 125: ...application Instead this function will return an YDataSet object that can be used to retrieve immediately an overview of the measured data summary and then to load progressively the details when desi...

Page 126: ...n Android mobile device it will get the time from the mobile device as long as an app using the Yoctopuce library is launched When none of these conditions applies for instance if the module is simply...

Page 127: ...e read on the sensor is a the rangeFinder function returns b Measure correction with 1 calibration point here 5 10 The application is very simple you only need to call the calibrateFromPoints method o...

Page 128: ...sorted in a strictly ascending order otherwise they are simply ignored 3 to 5 point correction 3 to 5 point corrections are only a generalization of the 2 point method allowing you to create up to 4 c...

Page 129: ...lic static double CustomInterpolation3Points double rawValue int calibType int parameters double beforeValues double afterValues double result the value to be corrected is rawValue calibration points...

Page 130: ...124 www yoctopuce com...

Page 131: ...te command The module selection mechanism works like for a traditional command The target is the name of the module that you want to update You can also use the any or all aliases or even a name list...

Page 132: ...lSettings method byte default_config loadFile default bin YModule m YModule FirstModule while m null if m get_productName YoctoHub Wireless m set_allSettings default_config m m next Finding the correc...

Page 133: ...you must obtain an instance of the YFirmwareUdpate class with the updateFirmware method of a YModule object The only parameter of this method is the path of the firmware that you want to install This...

Page 134: ...rectly anymore you can install a firmware from the update mode To force the module to work in update mode disconnect it wait a few seconds and reconnect it while maintaining the Yocto button down This...

Page 135: ...call the executable must initialize its own API and make an inventory of USB connected modules This requires about one second per call 20 2 VirtualHub and HTTP GET The VirtualHub is available on almos...

Page 136: ...bySerial YRNGFND1 12345 api module luminosity 100 Driving the module functions through the REST interface The module functions can be manipulated in the same way To know the state of the proximity fu...

Page 137: ...f connected Yoctopuce modules It must be called at least once To manage hot plug and detect potential newly connected modules this function must be called at regular intervals The forceupdate paramete...

Page 138: ...the module luminosity if yapiHTTPRequest serial getValue data sizeof dataBuffer fullsize errmsg 0 then begin writeln errmsg halt end searches for the HTTP header end p pos 13 10 13 10 data displays t...

Page 139: ...sage Here is a sample program written in pascal using the yapi dll DLL to list the connected modules device description structure type yDeviceSt packed record vendorid word deviceid word devrelease wo...

Page 140: ...and one Visual Basic 6 compatible version prefixed with vb6_ 20 4 Porting the high level library As all the sources of the Yoctopuce API are fully provided you can very well port the whole API in the...

Page 141: ...define the function interfaces For languages which support exceptions all of these functions throw exceptions in case of error by default rather than returning the documented error value for each func...

Page 142: ...as logical name for a module or a function yClearHTTPCallbackCacheDir bool_removeFiles Disables the HTTP callback cache yDisableExceptions Disables the use of exceptions to report runtime errors yEnab...

Page 143: ...Invoke the specified callback function after a given timeout ySetUSBPacketAckMs pktAckDelay Enables the acknowledge of every USB packet received by the Yoctopuce library ySleep ms_duration errmsg Paus...

Page 144: ...Val name As String As Boolean cs bool CheckLogicalName string name java boolean CheckLogicalName String name uwp bool CheckLogicalName string name py def CheckLogicalName name php function yCheckLogic...

Page 145: ...Disables the HTTP callback cache php function yClearHTTPCallbackCacheDir bool_removeFiles This method disables the HTTP callback cache and can additionally cleanup the cache directory Parameters bool...

Page 146: ...eptions m void DisableExceptions pas procedure yDisableExceptions vb procedure yDisableExceptions cs void DisableExceptions py def DisableExceptions php function yDisableExceptions es function Disable...

Page 147: ...Exceptions vb procedure yEnableExceptions cs void EnableExceptions py def EnableExceptions php function yEnableExceptions es function EnableExceptions Be aware than when exceptions are enabled every f...

Page 148: ...e calling yRegisterHub usb you need to activate the USB host port of the system This function takes as argument an object of class android content Context or any subclass It is not necessary to call t...

Page 149: ...procedure yFreeAPI cs void FreeAPI java void FreeAPI uwp void FreeAPI py def FreeAPI php function yFreeAPI es function FreeAPI It is generally not required to call this function unless you want to fr...

Page 150: ...IVersion The version is a string in the form Major Minor Build for instance 1 01 5535 For languages using an external DLL for instance C VisualBasic or Delphi the character string includes as well the...

Page 151: ...unction yGetTickCount u64 vb function yGetTickCount As Long cs ulong GetTickCount java long GetTickCount uwp ulong GetTickCount py def GetTickCount php function yGetTickCount es function GetTickCount...

Page 152: ...function yHandleEvents errmsg es function HandleEvents errmsg If your program includes significant loops you may want to include a call to this function to make sure that the library takes care of the...

Page 153: ...tAPI mode errmsg es function InitAPI mode errmsg It is not strictly needed to call yInitAPI as the library is automatically initialized when calling yRegisterHub for the first time When Y_DETECT_NONE...

Page 154: ...ng url py def PreregisterHub url errmsg None php function yPreregisterHub url errmsg es function PreregisterHub url errmsg This function has the same purpose and same arguments as RegisterHub but does...

Page 155: ...sterDeviceArrivalCallback ByVal arrivalCallback As yDeviceUpdateFunc cs void RegisterDeviceArrivalCallback yDeviceUpdateFunc arrivalCallback java void RegisterDeviceArrivalCallback DeviceArrivalCallba...

Page 156: ...isterDeviceRemovalCallback ByVal removalCallback As yDeviceUpdateFunc cs void RegisterDeviceRemovalCallback yDeviceUpdateFunc removalCallback java void RegisterDeviceRemovalCallback DeviceRemovalCallb...

Page 157: ...nning a VirtualHub or a networked YoctoHub such as YoctoHub Ethernet or YoctoHub Wireless If you want to use the VirtualHub running on you local computer use the IP address 127 0 0 1 callback that key...

Page 158: ...21 High level API Reference On failure throws an exception or returns a negative error code 152 www yoctopuce com...

Page 159: ...eryCallback cs void RegisterHubDiscoveryCallback YHubDiscoveryCallback hubDiscoveryCallback java void RegisterHubDiscoveryCallback HubDiscoveryCallback hubDiscoveryCallback uwp async Task RegisterHubD...

Page 160: ...ction logfun yLogFunc vb procedure yRegisterLogFunction ByVal logfun As yLogFunc cs void RegisterLogFunction yLogFunc logfun java void RegisterLogFunction LogCallback logfun uwp void RegisterLogFuncti...

Page 161: ...However for Linux ARM it not possible to reliably distinguish between a Hard Float armhf and a Soft Float armel install For in this case it is therefore recommended to manually select the proper archi...

Page 162: ...low the protocol YDeviceHotPlug m void SetDelegate id object The methods yDeviceArrival and yDeviceRemoval will be invoked while yUpdateDeviceList is running You will have to call this function on a r...

Page 163: ...sterHub This method takes in parameter the path of the directory used for saving data between each callback This folder must exist and the PHP script needs to have write access to it It is recommended...

Page 164: ...cally in order to keep the API up to date with current devices Parameters callback the function to call after the timeout occurs On Microsoft Internet Explorer the callback must be provided as a strin...

Page 165: ...is disabled because it doubles the number of packets sent and slows down the API considerably Therefore the acknowledge of incoming USB packets should only be enabled on phones or tablets that loose U...

Page 166: ...ms_duration errmsg es function Sleep ms_duration errmsg This function implements a passive waiting loop meaning that it does not consume CPU cycles significantly The processor is left available for o...

Page 167: ...t py def TestHub url mstimeout errmsg None php function yTestHub url mstimeout errmsg es function TestHub url mstimeout This method do not register the hub it only test if the hub is usable The url pa...

Page 168: ...m YRETCODE TriggerHubDiscovery NSError errmsg pas function yTriggerHubDiscovery var errmsg string integer vb function yTriggerHubDiscovery ByRef errmsg As String As Integer cs int TriggerHubDiscovery...

Page 169: ...nregisterHub const string url m void UnregisterHub NSString url pas procedure yUnregisterHub url string vb procedure yUnregisterHub ByVal url As String cs void UnregisterHub string url java void Unreg...

Page 170: ...t UpdateDeviceList py def UpdateDeviceList errmsg None php function yUpdateDeviceList errmsg es function UpdateDeviceList errmsg The library searches the machines or USB ports previously registered us...

Page 171: ...nd to make the application aware of hot plug events This asynchronous version exists only in Javascript It uses a callback instead of a return value in order to avoid blocking Firefox Javascript VM th...

Page 172: ...n identifier in a YAPI context yFirstModule Starts the enumeration of modules currently accessible YModule methods module checkFirmware path onlynew Tests whether the byn file is valid for this module...

Page 173: ...b Returns the serial number of the YoctoHub on which this module is connected module get_persistentSettings Returns the current state of persistent module settings module get_productId Returns the USB...

Page 174: ...k function module revertFromFlash Reloads the settings stored in the nonvolatile memory as when the module is powered on module saveToFlash Saves current settings in the nonvolatile memory of the modu...

Page 175: ...21 High level API Reference Waits for all pending asynchronous commands on the module to complete and invoke the user provided callback function www yoctopuce com 169...

Page 176: ...odule is online at the time it is invoked The returned object is nevertheless valid Use the method YModule isOnline to test if the module is indeed online at a given time In case of ambiguity when loo...

Page 177: ...ogicalName ModuleLogicalName FunctionIdentifier ModuleLogicalName FunctionLogicalName This function does not require that the module is online at the time it is invoked The returned object is neverthe...

Page 178: ...FirstModule TYModule vb function yFirstModule As YModule cs YModule FirstModule java YModule FirstModule uwp YModule FirstModule py def FirstModule php function yFirstModule es function FirstModule Us...

Page 179: ...checkFirmware path onlynew es function checkFirmware path onlynew cmd YModule target checkFirmware path onlynew This method is useful to test if the module needs to be updated It is possible to pass a...

Page 180: ...void clearCache pas procedure clearCache vb procedure clearCache cs void clearCache java void clearCache py def clearCache php function clearCache es function clearCache Invalidates the cache of the m...

Page 181: ...ng describe m NSString describe pas function describe string vb function describe As String cs string describe java String describe py def describe php function describe es function describe The text...

Page 182: ...thname string TByteArray vb function download As Byte cs byte download string pathname java byte download String pathname uwp async Task byte download string pathname py def download pathname php func...

Page 183: ...ng functionBaseType int functionIndex java String functionBaseType int functionIndex py def functionBaseType functionIndex php function functionBaseType functionIndex es function functionBaseType func...

Page 184: ...t cpp int functionCount m int functionCount pas function functionCount integer vb function functionCount As Integer cs int functionCount java int functionCount py def functionCount php function functi...

Page 185: ...tionIndex As Integer As String cs string functionId int functionIndex java String functionId int functionIndex py def functionId functionIndex php function functionId functionIndex es function functio...

Page 186: ...al functionIndex As Integer As String cs string functionName int functionIndex java String functionName int functionIndex py def functionName functionIndex php function functionName functionIndex es f...

Page 187: ...dex As Integer As String cs string functionType int functionIndex java String functionType int functionIndex py def functionType functionIndex php function functionType functionIndex es function funct...

Page 188: ...ndex As Integer As String cs string functionValue int functionIndex java String functionValue int functionIndex py def functionValue functionIndex php function functionValue functionIndex es function...

Page 189: ...unction get_allSettings As Byte cs byte get_allSettings java byte get_allSettings uwp async Task byte get_allSettings py def get_allSettings php function get_allSettings es function get_allSettings cm...

Page 190: ...ction get_beacon Integer vb function get_beacon As Integer cs int get_beacon java int get_beacon uwp async Task int get_beacon py def get_beacon php function get_beacon es function get_beacon cmd YMod...

Page 191: ...e pas function get_errorMessage string vb function get_errorMessage As String cs string get_errorMessage java String get_errorMessage py def get_errorMessage php function get_errorMessage es function...

Page 192: ...unction get_errorType YRETCODE vb function get_errorType As YRETCODE cs YRETCODE get_errorType java int get_errorType py def get_errorType php function get_errorType es function get_errorType This met...

Page 193: ...ease string vb function get_firmwareRelease As String cs string get_firmwareRelease java String get_firmwareRelease uwp async Task string get_firmwareRelease py def get_firmwareRelease php function ge...

Page 194: ..._functionIds funType string TStringArray vb function get_functionIds As List cs List string get_functionIds string funType java ArrayList String get_functionIds String funType uwp async Task List stri...

Page 195: ...t_hardwareId m NSString hardwareId vb function get_hardwareId As String cs string get_hardwareId java String get_hardwareId py def get_hardwareId php function get_hardwareId es function get_hardwareId...

Page 196: ...rray vb function get_icon2d As Byte cs byte get_icon2d java byte get_icon2d uwp async Task byte get_icon2d py def get_icon2d php function get_icon2d es function get_icon2d cmd YModule target get_icon2...

Page 197: ...tring vb function get_lastLogs As String cs string get_lastLogs java String get_lastLogs uwp async Task string get_lastLogs py def get_lastLogs php function get_lastLogs es function get_lastLogs cmd Y...

Page 198: ...ogicalName string vb function get_logicalName As String cs string get_logicalName java String get_logicalName uwp async Task string get_logicalName py def get_logicalName php function get_logicalName...

Page 199: ...luminosity LongInt vb function get_luminosity As Integer cs int get_luminosity java int get_luminosity uwp async Task int get_luminosity py def get_luminosity php function get_luminosity es function g...

Page 200: ...g parentHub pas function get_parentHub string vb function get_parentHub As String cs string get_parentHub java String get_parentHub py def get_parentHub php function get_parentHub cmd YModule target g...

Page 201: ...ersistentSettings As Integer cs int get_persistentSettings java int get_persistentSettings uwp async Task int get_persistentSettings py def get_persistentSettings php function get_persistentSettings e...

Page 202: ...t_productId LongInt vb function get_productId As Integer cs int get_productId java int get_productId uwp async Task int get_productId py def get_productId php function get_productId es function get_pr...

Page 203: ...roductName string vb function get_productName As String cs string get_productName java String get_productName uwp async Task string get_productName py def get_productName php function get_productName...

Page 204: ...ease LongInt vb function get_productRelease As Integer cs int get_productRelease java int get_productRelease uwp async Task int get_productRelease py def get_productRelease php function get_productRel...

Page 205: ...wn LongInt vb function get_rebootCountdown As Integer cs int get_rebootCountdown java int get_rebootCountdown uwp async Task int get_rebootCountdown py def get_rebootCountdown php function get_rebootC...

Page 206: ...alNumber string vb function get_serialNumber As String cs string get_serialNumber java String get_serialNumber uwp async Task string get_serialNumber py def get_serialNumber php function get_serialNum...

Page 207: ...y subDevices pas function get_subDevices TStringArray vb function get_subDevices As List cs List string get_subDevices java ArrayList String get_subDevices py def get_subDevices php function get_subDe...

Page 208: ...nction get_upTime int64 vb function get_upTime As Long cs long get_upTime java long get_upTime uwp async Task long get_upTime py def get_upTime php function get_upTime es function get_upTime cmd YModu...

Page 209: ...l cpp string get_url m NSString url pas function get_url string vb function get_url As String cs string get_url java String get_url py def get_url php function get_url cmd YModule target get_url If th...

Page 210: ...usbCurrent LongInt vb function get_usbCurrent As Integer cs int get_usbCurrent java int get_usbCurrent uwp async Task int get_usbCurrent py def get_usbCurrent php function get_usbCurrent es function g...

Page 211: ...id get_userData m id userData pas function get_userData Tobject vb function get_userData As Object cs object get_userData java Object get_userData py def get_userData php function get_userData es func...

Page 212: ...get_userVar As Integer cs int get_userVar java int get_userVar uwp async Task int get_userVar py def get_userVar php function get_userVar es function get_userVar cmd YModule target get_userVar On star...

Page 213: ...n hasFunction As Boolean cs bool hasFunction string funcId java boolean hasFunction String funcId uwp async Task bool hasFunction string funcId py def hasFunction funcId php function hasFunction funcI...

Page 214: ...function isOnline As Boolean cs bool isOnline java boolean isOnline py def isOnline php function isOnline es function isOnline If there are valid cached values for the module that have not yet expire...

Page 215: ...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...

Page 216: ...def load msValidity php function load msValidity es function load msValidity By default whenever accessing a device all module attributes are kept in cache for the standard duration 5 ms This method...

Page 217: ...nstead 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 c...

Page 218: ...g text uwp async Task int log string text py def log text php function log text es function log text cmd YModule target log text This function is useful in particular to trace the execution of HTTP ca...

Page 219: ...nextModule pas function nextModule TYModule vb function nextModule As YModule cs YModule nextModule java YModule nextModule uwp YModule nextModule py def nextModule php function nextModule es function...

Page 220: ...unction reboot As Integer cs int reboot int secBeforeReboot java int reboot int secBeforeReboot uwp async Task int reboot int secBeforeReboot py def reboot secBeforeReboot php function reboot secBefor...

Page 221: ...nteger cs int registerLogCallback LogCallback callback java void registerLogCallback LogCallback callback py def registerLogCallback callback This callback will be called each time that a module sends...

Page 222: ...omFlash pas function revertFromFlash LongInt vb function revertFromFlash As Integer cs int revertFromFlash java int revertFromFlash uwp async Task int revertFromFlash py def revertFromFlash php functi...

Page 223: ...eger cs int saveToFlash java int saveToFlash uwp async Task int saveToFlash py def saveToFlash php function saveToFlash es function saveToFlash cmd YModule target saveToFlash Warning the number of all...

Page 224: ...byte settings uwp async Task int set_allSettings py def set_allSettings settings php function set_allSettings settings es function set_allSettings settings cmd YModule target set_allSettings settings...

Page 225: ...ndFiles byte settings uwp async Task int set_allSettingsAndFiles py def set_allSettingsAndFiles settings php function set_allSettingsAndFiles settings es function set_allSettingsAndFiles settings cmd...

Page 226: ...eger vb function set_beacon ByVal newval As Integer As Integer cs int set_beacon int newval java int set_beacon int newval uwp async Task int set_beacon int newval py def set_beacon newval php functio...

Page 227: ...logicalName String newval uwp async Task int set_logicalName string newval py def set_logicalName newval php function set_logicalName newval es function set_logicalName newval cmd YModule target set_l...

Page 228: ...wval java int set_luminosity int newval uwp async Task int set_luminosity int newval py def set_luminosity newval php function set_luminosity newval es function set_luminosity newval cmd YModule targe...

Page 229: ...d setUserData id data pas procedure set_userData data Tobject vb procedure set_userData ByVal data As Object cs void set_userData object data java void set_userData Object data py def set_userData dat...

Page 230: ...Var int newval java int set_userVar int newval uwp async Task int set_userVar int newval py def set_userVar newval php function set_userVar newval es function set_userVar newval cmd YModule target set...

Page 231: ...ate As Integer cs int triggerFirmwareUpdate int secBeforeReboot java int triggerFirmwareUpdate int secBeforeReboot uwp async Task int triggerFirmwareUpdate int secBeforeReboot py def triggerFirmwareUp...

Page 232: ...As YFirmwareUpdate cs YFirmwareUpdate updateFirmware string path java YFirmwareUpdate updateFirmware String path uwp async Task YFirmwareUpdate updateFirmware string path py def updateFirmware path ph...

Page 233: ...string path bool force java YFirmwareUpdate updateFirmwareEx String path boolean force uwp async Task YFirmwareUpdate updateFirmwareEx string path bool force py def updateFirmwareEx path force php fu...

Page 234: ...lback function can therefore freely issue synchronous or asynchronous commands without risking to block the Javascript VM Parameters callback callback function that is invoked when all pending command...

Page 235: ...der for a given identifier yFindRangeFinderInContext yctx func Retrieves a range finder for a given identifier in a YAPI context yFirstRangeFinder Starts the enumeration of range finders currently acc...

Page 236: ...equency for this function or OFF when measures are not stored in the data logger flash memory rangefinder get_logicalName Returns the logical name of the range finder rangefinder get_lowestValue Retur...

Page 237: ...rangefinder registerTimedReportCallback callback Registers the callback function that is invoked on every periodic timed notification rangefinder registerValueCallback callback Registers the callback...

Page 238: ...according to the current ambient temperature rangefinder triggerXTalkCalibration targetDist Triggers the hardware cross talk calibration of the distance sensor rangefinder unmuteValueCallbacks Re ena...

Page 239: ...ctionIdentifier ModuleSerialNumber FunctionLogicalName ModuleLogicalName FunctionIdentifier ModuleLogicalName FunctionLogicalName This function does not require that the range finder is online at the...

Page 240: ...tionLogicalName ModuleLogicalName FunctionIdentifier ModuleLogicalName FunctionLogicalName This function does not require that the range finder is online at the time it is invoked The returned object...

Page 241: ...YRangeFinder vb function yFirstRangeFinder As YRangeFinder cs YRangeFinder FirstRangeFinder java YRangeFinder FirstRangeFinder uwp YRangeFinder FirstRangeFinder py def FirstRangeFinder php function yF...

Page 242: ...derInContext YAPIContext yctx uwp YRangeFinder FirstRangeFinderInContext YAPIContext yctx es function FirstRangeFinderInContext yctx Use the method YRangeFinder nextRangeFinder to iterate on next rang...

Page 243: ...fValues php function calibrateFromPoints rawValues refValues es function calibrateFromPoints rawValues refValues cmd YRangeFinder target calibrateFromPoints rawValues refValues It is possible to confi...

Page 244: ...Int vb function cancelCoverGlassCalibrations As Integer cs int cancelCoverGlassCalibrations java int cancelCoverGlassCalibrations uwp async Task int cancelCoverGlassCalibrations py def cancelCoverGlas...

Page 245: ...m void clearCache pas procedure clearCache vb procedure clearCache cs void clearCache java void clearCache py def clearCache php function clearCache es function clearCache Invalidates the cache of the...

Page 246: ...ion 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 unresolved and FUNCTIONID is the hardware identifier of the funct...

Page 247: ...isedValue string vb function get_advertisedValue As String cs string get_advertisedValue java String get_advertisedValue uwp async Task string get_advertisedValue py def get_advertisedValue php functi...

Page 248: ...double vb function get_currentRawValue As Double cs double get_currentRawValue java double get_currentRawValue uwp async Task double get_currentRawValue py def get_currentRawValue php function get_cu...

Page 249: ...ble vb function get_currentTemperature As Double cs double get_currentTemperature java double get_currentTemperature uwp async Task double get_currentTemperature py def get_currentTemperature php func...

Page 250: ...Value double vb function get_currentValue As Double cs double get_currentValue java double get_currentValue uwp async Task double get_currentValue py def get_currentValue php function get_currentValue...

Page 251: ...aLogger TYDataLogger vb function get_dataLogger As YDataLogger cs YDataLogger get_dataLogger java YDataLogger get_dataLogger uwp async Task YDataLogger get_dataLogger py def get_dataLogger php functio...

Page 252: ...ssage pas function get_errorMessage string vb function get_errorMessage As String cs string get_errorMessage java String get_errorMessage py def get_errorMessage php function get_errorMessage es funct...

Page 253: ...as function get_errorType YRETCODE vb function get_errorType As YRETCODE cs YRETCODE get_errorType java int get_errorType py def get_errorType php function get_errorType es function get_errorType This...

Page 254: ...friendlyName py def get_friendlyName php function get_friendlyName es function get_friendlyName The returned string uses the logical names of the module and of the range finder if they are defined oth...

Page 255: ...ction get_functionDescriptor As YFUN_DESCR cs YFUN_DESCR get_functionDescriptor java String get_functionDescriptor py def get_functionDescriptor php function get_functionDescriptor es function get_fun...

Page 256: ..._functionId cpp string get_functionId m NSString functionId vb function get_functionId As String cs string get_functionId java String get_functionId py def get_functionId php function get_functionId e...

Page 257: ...hardwareCalibrationTemperature As Double cs double get_hardwareCalibrationTemperature java double get_hardwareCalibrationTemperature uwp async Task double get_hardwareCalibrationTemperature py def get...

Page 258: ...dwareId As String cs string get_hardwareId java String get_hardwareId py def get_hardwareId php function get_hardwareId es function get_hardwareId The unique hardware identifier is composed of the dev...

Page 259: ...Value double vb function get_highestValue As Double cs double get_highestValue java double get_highestValue uwp async Task double get_highestValue py def get_highestValue php function get_highestValue...

Page 260: ..._logFrequency string vb function get_logFrequency As String cs string get_logFrequency java String get_logFrequency uwp async Task string get_logFrequency py def get_logFrequency php function get_logF...

Page 261: ...get_logicalName string vb function get_logicalName As String cs string get_logicalName java String get_logicalName uwp async Task string get_logicalName py def get_logicalName php function get_logical...

Page 262: ...tValue double vb function get_lowestValue As Double cs double get_lowestValue java double get_lowestValue uwp async Task double get_lowestValue py def get_lowestValue php function get_lowestValue es f...

Page 263: ...cpp YModule get_module m YModule module pas function get_module TYModule vb function get_module As YModule cs YModule get_module java YModule get_module py def get_module php function get_module es f...

Page 264: ...ck 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 Javascri...

Page 265: ...va int get_rangeFinderMode uwp async Task int get_rangeFinderMode py def get_rangeFinderMode php function get_rangeFinderMode es function get_rangeFinderMode cmd YRangeFinder target get_rangeFinderMod...

Page 266: ...tTime endTime 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 overvie...

Page 267: ...Frequency string vb function get_reportFrequency As String cs string get_reportFrequency java String get_reportFrequency uwp async Task string get_reportFrequency py def get_reportFrequency php functi...

Page 268: ...solution java double get_resolution uwp async Task double get_resolution py def get_resolution php function get_resolution es function get_resolution cmd YRangeFinder target get_resolution The resolut...

Page 269: ...t_sensorState LongInt vb function get_sensorState As Integer cs int get_sensorState java int get_sensorState uwp async Task int get_sensorState py def get_sensorState php function get_sensorState es f...

Page 270: ...nit pas function get_unit string vb function get_unit As String cs string get_unit java String get_unit uwp async Task string get_unit py def get_unit php function get_unit es function get_unit cmd YR...

Page 271: ...cpp void get_userData m id userData pas function get_userData Tobject vb function get_userData As Object cs object get_userData java Object get_userData py def get_userData php function get_userData...

Page 272: ...on isOnline As Boolean cs bool isOnline java boolean isOnline py def isOnline php function isOnline es function isOnline If there is a cached value for the range finder in cache that has not yet expir...

Page 273: ...ing 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 virt...

Page 274: ...d YRangeFinder target isSensorReady Returns false if the device is unreachable or if the sensor does not have a current measure to transmit No exception is raised if there is an error while trying to...

Page 275: ...ity py def load msValidity php function load msValidity es function load msValidity By default whenever accessing a device all function attributes are kept in cache for the standard duration 5 ms This...

Page 276: ...ame pas function loadAttribute attrName string string vb function loadAttribute As String cs string loadAttribute string attrName java String loadAttribute String attrName uwp async Task string loadAt...

Page 277: ...a int loadCalibrationPoints ArrayList Double rawValues ArrayList Double refValues uwp async Task int loadCalibrationPoints List double rawValues List double refValues py def loadCalibrationPoints rawV...

Page 278: ...nce 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 Parameters msValidity an integer correspo...

Page 279: ...teValueCallbacks uwp async Task int muteValueCallbacks py def muteValueCallbacks php function muteValueCallbacks es function muteValueCallbacks cmd YRangeFinder target muteValueCallbacks You can use t...

Page 280: ...unction nextRangeFinder TYRangeFinder vb function nextRangeFinder As YRangeFinder cs YRangeFinder nextRangeFinder java YRangeFinder nextRangeFinder uwp YRangeFinder nextRangeFinder py def nextRangeFin...

Page 281: ...dReportCallback TimedReportCallback callback uwp async Task int registerTimedReportCallback TimedReportCallback callback py def registerTimedReportCallback callback php function registerTimedReportCal...

Page 282: ...teCallback callback uwp async Task int registerValueCallback ValueCallback callback py def registerValueCallback callback php function registerValueCallback callback es function registerValueCallback...

Page 283: ...yVal newval As Double As Integer cs int set_highestValue double newval java int set_highestValue double newval uwp async Task int set_highestValue double newval py def set_highestValue newval php func...

Page 284: ...t set_logFrequency String newval uwp async Task int set_logFrequency string newval py def set_logFrequency newval php function set_logFrequency newval es function set_logFrequency newval cmd YRangeFin...

Page 285: ...set_logicalName String newval uwp async Task int set_logicalName string newval py def set_logicalName newval php function set_logicalName newval es function set_logicalName newval cmd YRangeFinder ta...

Page 286: ...yVal newval As Double As Integer cs int set_lowestValue double newval java int set_lowestValue double newval uwp async Task int set_lowestValue double newval py def set_lowestValue newval php function...

Page 287: ...inderMode int newval java int set_rangeFinderMode int newval uwp async Task int set_rangeFinderMode int newval py def set_rangeFinderMode newval php function set_rangeFinderMode newval es function set...

Page 288: ..._reportFrequency String newval uwp async Task int set_reportFrequency string newval py def set_reportFrequency newval php function set_reportFrequency newval es function set_reportFrequency newval cmd...

Page 289: ...al java int set_resolution double newval uwp async Task int set_resolution double newval py def set_resolution newval php function set_resolution newval es function set_resolution newval cmd YRangeFin...

Page 290: ...newval py def set_unit newval php function set_unit newval es function set_unit newval cmd YRangeFinder target set_unit newval That unit is a string String value can be or mm Any other value is ignor...

Page 291: ...a m void setUserData id data pas procedure set_userData data Tobject vb procedure set_userData ByVal data As Object cs void set_userData object data java void set_userData Object data py def set_userD...

Page 292: ...t vb function startDataLogger As Integer cs int startDataLogger java int startDataLogger uwp async Task int startDataLogger py def startDataLogger php function startDataLogger es function startDataLog...

Page 293: ...int stopDataLogger pas function stopDataLogger LongInt vb function stopDataLogger As Integer cs int stopDataLogger java int stopDataLogger uwp async Task int stopDataLogger py def stopDataLogger php...

Page 294: ...k int triggerOffsetCalibration double targetDist py def triggerOffsetCalibration targetDist php function triggerOffsetCalibration targetDist es function triggerOffsetCalibration targetDist cmd YRangeF...

Page 295: ...gerSpadCalibration uwp async Task int triggerSpadCalibration py def triggerSpadCalibration php function triggerSpadCalibration es function triggerSpadCalibration cmd YRangeFinder target triggerSpadCal...

Page 296: ...va int triggerTemperatureCalibration uwp async Task int triggerTemperatureCalibration py def triggerTemperatureCalibration php function triggerTemperatureCalibration es function triggerTemperatureCali...

Page 297: ...k int triggerXTalkCalibration double targetDist py def triggerXTalkCalibration targetDist php function triggerXTalkCalibration targetDist es function triggerXTalkCalibration targetDist cmd YRangeFinde...

Page 298: ...int unmuteValueCallbacks java int unmuteValueCallbacks uwp async Task int unmuteValueCallbacks py def unmuteValueCallbacks php function unmuteValueCallbacks es function unmuteValueCallbacks cmd YRang...

Page 299: ...e callback function can therefore freely issue synchronous or asynchronous commands without risking to block the Javascript VM Parameters callback callback function that is invoked when all pending co...

Page 300: ...mperatureInContext yctx func Retrieves a temperature sensor for a given identifier in a YAPI context yFirstTemperature Starts the enumeration of temperature sensors currently accessible yFirstTemperat...

Page 301: ...the function is located temperature get_module_async callback context Gets the YModule object for the device on which the function is located asynchronous version temperature get_recordedData startTim...

Page 302: ...sterTimedReportCallback callback Registers the callback function that is invoked on every periodic timed notification temperature registerValueCallback callback Registers the callback function that is...

Page 303: ...tops the datalogger on the device temperature unmuteValueCallbacks Re enables the propagation of every new advertised value to the parent hub temperature wait_async callback context Waits for all pend...

Page 304: ...ier ModuleSerialNumber FunctionLogicalName ModuleLogicalName FunctionIdentifier ModuleLogicalName FunctionLogicalName This function does not require that the temperature sensor is online at the time i...

Page 305: ...ame ModuleLogicalName FunctionIdentifier ModuleLogicalName FunctionLogicalName This function does not require that the temperature sensor is online at the time it is invoked The returned object is nev...

Page 306: ...mperature vb function yFirstTemperature As YTemperature cs YTemperature FirstTemperature java YTemperature FirstTemperature uwp YTemperature FirstTemperature py def FirstTemperature php function yFirs...

Page 307: ...InContext YAPIContext yctx uwp YTemperature FirstTemperatureInContext YAPIContext yctx es function FirstTemperatureInContext yctx Use the method YTemperature nextTemperature to iterate on next tempera...

Page 308: ...fValues php function calibrateFromPoints rawValues refValues es function calibrateFromPoints rawValues refValues cmd YTemperature target calibrateFromPoints rawValues refValues It is possible to confi...

Page 309: ...oid clearCache pas procedure clearCache vb procedure clearCache cs void clearCache java void clearCache py def clearCache php function clearCache es function clearCache Invalidates the cache of the te...

Page 310: ...ame used for the first access to the function SERIAL is the serial number of the module if the module is connected or unresolved and FUNCTIONID is the hardware identifier of the function if the module...

Page 311: ...isedValue string vb function get_advertisedValue As String cs string get_advertisedValue java String get_advertisedValue uwp async Task string get_advertisedValue py def get_advertisedValue php functi...

Page 312: ...double vb function get_currentRawValue As Double cs double get_currentRawValue java double get_currentRawValue uwp async Task double get_currentRawValue py def get_currentRawValue php function get_cu...

Page 313: ...Value double vb function get_currentValue As Double cs double get_currentValue java double get_currentValue uwp async Task double get_currentValue py def get_currentValue php function get_currentValue...

Page 314: ...aLogger TYDataLogger vb function get_dataLogger As YDataLogger cs YDataLogger get_dataLogger java YDataLogger get_dataLogger uwp async Task YDataLogger get_dataLogger py def get_dataLogger php functio...

Page 315: ...ssage pas function get_errorMessage string vb function get_errorMessage As String cs string get_errorMessage java String get_errorMessage py def get_errorMessage php function get_errorMessage es funct...

Page 316: ...as function get_errorType YRETCODE vb function get_errorType As YRETCODE cs YRETCODE get_errorType java int get_errorType py def get_errorType php function get_errorType es function get_errorType This...

Page 317: ...lyName py def get_friendlyName php function get_friendlyName es function get_friendlyName The returned string uses the logical names of the module and of the temperature sensor if they are defined oth...

Page 318: ...ction get_functionDescriptor As YFUN_DESCR cs YFUN_DESCR get_functionDescriptor java String get_functionDescriptor py def get_functionDescriptor php function get_functionDescriptor es function get_fun...

Page 319: ..._functionId cpp string get_functionId m NSString functionId vb function get_functionId As String cs string get_functionId java String get_functionId py def get_functionId php function get_functionId e...

Page 320: ...reId As String cs string get_hardwareId java String get_hardwareId py def get_hardwareId php function get_hardwareId es function get_hardwareId The unique hardware identifier is composed of the device...

Page 321: ...Value double vb function get_highestValue As Double cs double get_highestValue java double get_highestValue uwp async Task double get_highestValue py def get_highestValue php function get_highestValue...

Page 322: ..._logFrequency string vb function get_logFrequency As String cs string get_logFrequency java String get_logFrequency uwp async Task string get_logFrequency py def get_logFrequency php function get_logF...

Page 323: ...get_logicalName string vb function get_logicalName As String cs string get_logicalName java String get_logicalName uwp async Task string get_logicalName py def get_logicalName php function get_logical...

Page 324: ...tValue double vb function get_lowestValue As Double cs double get_lowestValue java double get_lowestValue uwp async Task double get_lowestValue py def get_lowestValue php function get_lowestValue es f...

Page 325: ...cpp YModule get_module m YModule module pas function get_module TYModule vb function get_module As YModule cs YModule get_module java YModule get_module py def get_module php function get_module es f...

Page 326: ...ck 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 Javascri...

Page 327: ...tTime endTime 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 overvie...

Page 328: ...Frequency string vb function get_reportFrequency As String cs string get_reportFrequency java String get_reportFrequency uwp async Task string get_reportFrequency py def get_reportFrequency php functi...

Page 329: ...solution java double get_resolution uwp async Task double get_resolution py def get_resolution php function get_resolution es function get_resolution cmd YTemperature target get_resolution The resolut...

Page 330: ...t_sensorState LongInt vb function get_sensorState As Integer cs int get_sensorState java int get_sensorState uwp async Task int get_sensorState py def get_sensorState php function get_sensorState es f...

Page 331: ...nsorType php function get_sensorType es function get_sensorType cmd YTemperature target get_sensorType Returns a value among Y_SENSORTYPE_DIGITAL Y_SENSORTYPE_TYPE_K Y_SENSORTYPE_TYPE_E Y_SENSORTYPE_T...

Page 332: ...n get_signalUnit string vb function get_signalUnit As String cs string get_signalUnit java String get_signalUnit uwp async Task string get_signalUnit py def get_signalUnit php function get_signalUnit...

Page 333: ...lValue double vb function get_signalValue As Double cs double get_signalValue java double get_signalValue uwp async Task double get_signalValue py def get_signalValue php function get_signalValue es f...

Page 334: ...nit pas function get_unit string vb function get_unit As String cs string get_unit java String get_unit uwp async Task string get_unit py def get_unit php function get_unit es function get_unit cmd YT...

Page 335: ...cpp void get_userData m id userData pas function get_userData Tobject vb function get_userData As Object cs object get_userData java Object get_userData py def get_userData php function get_userData...

Page 336: ...nline As Boolean cs bool isOnline java boolean isOnline py def isOnline php function isOnline es function isOnline If there is a cached value for the temperature sensor in cache that has not yet expir...

Page 337: ...le 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 Javascrip...

Page 338: ...d YTemperature target isSensorReady Returns false if the device is unreachable or if the sensor does not have a current measure to transmit No exception is raised if there is an error while trying to...

Page 339: ...lidity py def load msValidity php function load msValidity es function load msValidity By default whenever accessing a device all function attributes are kept in cache for the standard duration 5 ms T...

Page 340: ...ame pas function loadAttribute attrName string string vb function loadAttribute As String cs string loadAttribute string attrName java String loadAttribute String attrName uwp async Task string loadAt...

Page 341: ...a int loadCalibrationPoints ArrayList Double rawValues ArrayList Double refValues uwp async Task int loadCalibrationPoints List double rawValues List double refValues py def loadCalibrationPoints rawV...

Page 342: ...Double resValues uwp async Task int loadThermistorResponseTable List double tempValues List double resValues py def loadThermistorResponseTable tempValues resValues php function loadThermistorRespons...

Page 343: ...stance 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 Parameters msValidity an integer corre...

Page 344: ...teValueCallbacks uwp async Task int muteValueCallbacks py def muteValueCallbacks php function muteValueCallbacks es function muteValueCallbacks cmd YTemperature target muteValueCallbacks You can use t...

Page 345: ...tion nextTemperature TYTemperature vb function nextTemperature As YTemperature cs YTemperature nextTemperature java YTemperature nextTemperature uwp YTemperature nextTemperature py def nextTemperature...

Page 346: ...dReportCallback TimedReportCallback callback uwp async Task int registerTimedReportCallback TimedReportCallback callback py def registerTimedReportCallback callback php function registerTimedReportCal...

Page 347: ...teCallback callback uwp async Task int registerValueCallback ValueCallback callback py def registerValueCallback callback php function registerValueCallback callback es function registerValueCallback...

Page 348: ...yVal newval As Double As Integer cs int set_highestValue double newval java int set_highestValue double newval uwp async Task int set_highestValue double newval py def set_highestValue newval php func...

Page 349: ...t set_logFrequency String newval uwp async Task int set_logFrequency string newval py def set_logFrequency newval php function set_logFrequency newval es function set_logFrequency newval cmd YTemperat...

Page 350: ...set_logicalName String newval uwp async Task int set_logicalName string newval py def set_logicalName newval php function set_logicalName newval es function set_logicalName newval cmd YTemperature ta...

Page 351: ...yVal newval As Double As Integer cs int set_lowestValue double newval java int set_lowestValue double newval uwp async Task int set_lowestValue double newval py def set_lowestValue newval php function...

Page 352: ...e res25 double beta java int set_ntcParameters double res25 double beta uwp async Task int set_ntcParameters double res25 double beta py def set_ntcParameters res25 beta php function set_ntcParameters...

Page 353: ..._reportFrequency String newval uwp async Task int set_reportFrequency string newval py def set_reportFrequency newval php function set_reportFrequency newval es function set_reportFrequency newval cmd...

Page 354: ...al java int set_resolution double newval uwp async Task int set_resolution double newval py def set_resolution newval php function set_resolution newval es function set_resolution newval cmd YTemperat...

Page 355: ...l cmd YTemperature target set_sensorType newval This function is used to define the type of thermocouple K E used with the device It has no effect if module is using a digital sensor or a thermistor R...

Page 356: ...ouble tempValues ArrayList Double resValues uwp async Task int set_thermistorResponseTable List double tempValues List double resValues py def set_thermistorResponseTable tempValues resValues php func...

Page 357: ...string If that strings end with the letter F all temperatures values will returned in Fahrenheit degrees If that String ends with the letter K all values will be returned in Kelvin degrees If that st...

Page 358: ...a m void setUserData id data pas procedure set_userData data Tobject vb procedure set_userData ByVal data As Object cs void set_userData object data java void set_userData Object data py def set_userD...

Page 359: ...t vb function startDataLogger As Integer cs int startDataLogger java int startDataLogger uwp async Task int startDataLogger py def startDataLogger php function startDataLogger es function startDataLog...

Page 360: ...int stopDataLogger pas function stopDataLogger LongInt vb function stopDataLogger As Integer cs int stopDataLogger java int stopDataLogger uwp async Task int stopDataLogger py def stopDataLogger php...

Page 361: ...int unmuteValueCallbacks java int unmuteValueCallbacks uwp async Task int unmuteValueCallbacks py def unmuteValueCallbacks php function unmuteValueCallbacks es function unmuteValueCallbacks cmd YTemp...

Page 362: ...e callback function can therefore freely issue synchronous or asynchronous commands without risking to block the Javascript VM Parameters callback callback function that is invoked when all pending co...

Page 363: ...ctolib es2017 yocto_lightsensor js Global functions yFindLightSensor func Retrieves a light sensor for a given identifier yFindLightSensorInContext yctx func Retrieves a light sensor for a given ident...

Page 364: ...sensor get_logicalName Returns the logical name of the light sensor lightsensor get_lowestValue Returns the minimal value observed for the ambient light since the device was started lightsensor get_me...

Page 365: ...nvoked on every periodic timed notification lightsensor registerValueCallback callback Registers the callback function that is invoked on every change of advertised value lightsensor set_highestValue...

Page 366: ...ctionIdentifier ModuleSerialNumber FunctionLogicalName ModuleLogicalName FunctionIdentifier ModuleLogicalName FunctionLogicalName This function does not require that the light sensor is online at the...

Page 367: ...tionLogicalName ModuleLogicalName FunctionIdentifier ModuleLogicalName FunctionLogicalName This function does not require that the light sensor is online at the time it is invoked The returned object...

Page 368: ...YLightSensor vb function yFirstLightSensor As YLightSensor cs YLightSensor FirstLightSensor java YLightSensor FirstLightSensor uwp YLightSensor FirstLightSensor py def FirstLightSensor php function yF...

Page 369: ...sorInContext YAPIContext yctx uwp YLightSensor FirstLightSensorInContext YAPIContext yctx es function FirstLightSensorInContext yctx Use the method YLightSensor nextLightSensor to iterate on next ligh...

Page 370: ...le integer vb function calibrate ByVal calibratedVal As Double As Integer cs int calibrate double calibratedVal java int calibrate double calibratedVal uwp async Task int calibrate double calibratedVa...

Page 371: ...fValues php function calibrateFromPoints rawValues refValues es function calibrateFromPoints rawValues refValues cmd YLightSensor target calibrateFromPoints rawValues refValues It is possible to confi...

Page 372: ...m void clearCache pas procedure clearCache vb procedure clearCache cs void clearCache java void clearCache py def clearCache php function clearCache es function clearCache Invalidates the cache of the...

Page 373: ...ion 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 unresolved and FUNCTIONID is the hardware identifier of the funct...

Page 374: ...isedValue string vb function get_advertisedValue As String cs string get_advertisedValue java String get_advertisedValue uwp async Task string get_advertisedValue py def get_advertisedValue php functi...

Page 375: ...double vb function get_currentRawValue As Double cs double get_currentRawValue java double get_currentRawValue uwp async Task double get_currentRawValue py def get_currentRawValue php function get_cu...

Page 376: ...Value double vb function get_currentValue As Double cs double get_currentValue java double get_currentValue uwp async Task double get_currentValue py def get_currentValue php function get_currentValue...

Page 377: ...aLogger TYDataLogger vb function get_dataLogger As YDataLogger cs YDataLogger get_dataLogger java YDataLogger get_dataLogger uwp async Task YDataLogger get_dataLogger py def get_dataLogger php functio...

Page 378: ...ssage pas function get_errorMessage string vb function get_errorMessage As String cs string get_errorMessage java String get_errorMessage py def get_errorMessage php function get_errorMessage es funct...

Page 379: ...as function get_errorType YRETCODE vb function get_errorType As YRETCODE cs YRETCODE get_errorType java int get_errorType py def get_errorType php function get_errorType es function get_errorType This...

Page 380: ...friendlyName py def get_friendlyName php function get_friendlyName es function get_friendlyName The returned string uses the logical names of the module and of the light sensor if they are defined oth...

Page 381: ...ction get_functionDescriptor As YFUN_DESCR cs YFUN_DESCR get_functionDescriptor java String get_functionDescriptor py def get_functionDescriptor php function get_functionDescriptor es function get_fun...

Page 382: ..._functionId cpp string get_functionId m NSString functionId vb function get_functionId As String cs string get_functionId java String get_functionId py def get_functionId php function get_functionId e...

Page 383: ...dwareId As String cs string get_hardwareId java String get_hardwareId py def get_hardwareId php function get_hardwareId es function get_hardwareId The unique hardware identifier is composed of the dev...

Page 384: ...Value double vb function get_highestValue As Double cs double get_highestValue java double get_highestValue uwp async Task double get_highestValue py def get_highestValue php function get_highestValue...

Page 385: ..._logFrequency string vb function get_logFrequency As String cs string get_logFrequency java String get_logFrequency uwp async Task string get_logFrequency py def get_logFrequency php function get_logF...

Page 386: ...get_logicalName string vb function get_logicalName As String cs string get_logicalName java String get_logicalName uwp async Task string get_logicalName py def get_logicalName php function get_logical...

Page 387: ...tValue double vb function get_lowestValue As Double cs double get_lowestValue java double get_lowestValue uwp async Task double get_lowestValue py def get_lowestValue php function get_lowestValue es f...

Page 388: ...Integer cs int get_measureType java int get_measureType uwp async Task int get_measureType py def get_measureType php function get_measureType es function get_measureType cmd YLightSensor target get_...

Page 389: ...cpp YModule get_module m YModule module pas function get_module TYModule vb function get_module As YModule cs YModule get_module java YModule get_module py def get_module php function get_module es f...

Page 390: ...ck 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 Javascri...

Page 391: ...tTime endTime 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 overvie...

Page 392: ...Frequency string vb function get_reportFrequency As String cs string get_reportFrequency java String get_reportFrequency uwp async Task string get_reportFrequency py def get_reportFrequency php functi...

Page 393: ...solution java double get_resolution uwp async Task double get_resolution py def get_resolution php function get_resolution es function get_resolution cmd YLightSensor target get_resolution The resolut...

Page 394: ...t_sensorState LongInt vb function get_sensorState As Integer cs int get_sensorState java int get_sensorState uwp async Task int get_sensorState py def get_sensorState php function get_sensorState es f...

Page 395: ...nit pas function get_unit string vb function get_unit As String cs string get_unit java String get_unit uwp async Task string get_unit py def get_unit php function get_unit es function get_unit cmd YL...

Page 396: ...cpp void get_userData m id userData pas function get_userData Tobject vb function get_userData As Object cs object get_userData java Object get_userData py def get_userData php function get_userData...

Page 397: ...on isOnline As Boolean cs bool isOnline java boolean isOnline py def isOnline php function isOnline es function isOnline If there is a cached value for the light sensor in cache that has not yet expir...

Page 398: ...ing 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 virt...

Page 399: ...d YLightSensor target isSensorReady Returns false if the device is unreachable or if the sensor does not have a current measure to transmit No exception is raised if there is an error while trying to...

Page 400: ...ity py def load msValidity php function load msValidity es function load msValidity By default whenever accessing a device all function attributes are kept in cache for the standard duration 5 ms This...

Page 401: ...ame pas function loadAttribute attrName string string vb function loadAttribute As String cs string loadAttribute string attrName java String loadAttribute String attrName uwp async Task string loadAt...

Page 402: ...a int loadCalibrationPoints ArrayList Double rawValues ArrayList Double refValues uwp async Task int loadCalibrationPoints List double rawValues List double refValues py def loadCalibrationPoints rawV...

Page 403: ...nce 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 Parameters msValidity an integer correspo...

Page 404: ...teValueCallbacks uwp async Task int muteValueCallbacks py def muteValueCallbacks php function muteValueCallbacks es function muteValueCallbacks cmd YLightSensor target muteValueCallbacks You can use t...

Page 405: ...unction nextLightSensor TYLightSensor vb function nextLightSensor As YLightSensor cs YLightSensor nextLightSensor java YLightSensor nextLightSensor uwp YLightSensor nextLightSensor py def nextLightSen...

Page 406: ...dReportCallback TimedReportCallback callback uwp async Task int registerTimedReportCallback TimedReportCallback callback py def registerTimedReportCallback callback php function registerTimedReportCal...

Page 407: ...teCallback callback uwp async Task int registerValueCallback ValueCallback callback py def registerValueCallback callback php function registerValueCallback callback es function registerValueCallback...

Page 408: ...yVal newval As Double As Integer cs int set_highestValue double newval java int set_highestValue double newval uwp async Task int set_highestValue double newval py def set_highestValue newval php func...

Page 409: ...t set_logFrequency String newval uwp async Task int set_logFrequency string newval py def set_logFrequency newval php function set_logFrequency newval es function set_logFrequency newval cmd YLightSen...

Page 410: ...set_logicalName String newval uwp async Task int set_logicalName string newval py def set_logicalName newval php function set_logicalName newval es function set_logicalName newval cmd YLightSensor ta...

Page 411: ...yVal newval As Double As Integer cs int set_lowestValue double newval java int set_lowestValue double newval uwp async Task int set_lowestValue double newval py def set_lowestValue newval php function...

Page 412: ...pe int newval py def set_measureType newval php function set_measureType newval es function set_measureType newval cmd YLightSensor target set_measureType newval The measure can either approximate the...

Page 413: ..._reportFrequency String newval uwp async Task int set_reportFrequency string newval py def set_reportFrequency newval php function set_reportFrequency newval es function set_reportFrequency newval cmd...

Page 414: ...al java int set_resolution double newval uwp async Task int set_resolution double newval py def set_resolution newval php function set_resolution newval es function set_resolution newval cmd YLightSen...

Page 415: ...a m void setUserData id data pas procedure set_userData data Tobject vb procedure set_userData ByVal data As Object cs void set_userData object data java void set_userData Object data py def set_userD...

Page 416: ...t vb function startDataLogger As Integer cs int startDataLogger java int startDataLogger uwp async Task int startDataLogger py def startDataLogger php function startDataLogger es function startDataLog...

Page 417: ...int stopDataLogger pas function stopDataLogger LongInt vb function stopDataLogger As Integer cs int stopDataLogger java int stopDataLogger uwp async Task int stopDataLogger py def stopDataLogger php...

Page 418: ...int unmuteValueCallbacks java int unmuteValueCallbacks uwp async Task int unmuteValueCallbacks py def unmuteValueCallbacks php function unmuteValueCallbacks es function unmuteValueCallbacks cmd YLigh...

Page 419: ...e callback function can therefore freely issue synchronous or asynchronous commands without risking to block the Javascript VM Parameters callback callback function that is invoked when all pending co...

Page 420: ...I context yFirstDataLogger Starts the enumeration of data loggers currently accessible yFirstDataLoggerInContext yctx Starts the enumeration of data loggers currently accessible YDataLogger methods da...

Page 421: ...a logger datalogger get_timeUTC Returns the Unix timestamp for current UTC time if known datalogger get_userData Returns the value of the userData attribute as previously stored using method set_userD...

Page 422: ...set_timeUTC newval Changes the current UTC time reference used for recorded data datalogger set_userData data Stores a user context provided as argument in the userData attribute of the function data...

Page 423: ...ntifier ModuleSerialNumber FunctionLogicalName ModuleLogicalName FunctionIdentifier ModuleLogicalName FunctionLogicalName This function does not require that the data logger is online at the time it i...

Page 424: ...ionLogicalName ModuleLogicalName FunctionIdentifier ModuleLogicalName FunctionLogicalName This function does not require that the data logger is online at the time it is invoked The returned object is...

Page 425: ...r TYDataLogger vb function yFirstDataLogger As YDataLogger cs YDataLogger FirstDataLogger java YDataLogger FirstDataLogger uwp YDataLogger FirstDataLogger py def FirstDataLogger php function yFirstDat...

Page 426: ...ggerInContext YAPIContext yctx uwp YDataLogger FirstDataLoggerInContext YAPIContext yctx es function FirstDataLoggerInContext yctx Use the method YDataLogger nextDataLogger to iterate on next data log...

Page 427: ...void clearCache pas procedure clearCache vb procedure clearCache cs void clearCache java void clearCache py def clearCache php function clearCache es function clearCache Invalidates the cache of the...

Page 428: ...on 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 unresolved and FUNCTIONID is the hardware identifier of the functi...

Page 429: ...gInt vb function forgetAllDataStreams As Integer cs int forgetAllDataStreams java int forgetAllDataStreams uwp async Task int forgetAllDataStreams py def forgetAllDataStreams php function forgetAllDat...

Page 430: ...sedValue string vb function get_advertisedValue As String cs string get_advertisedValue java String get_advertisedValue uwp async Task string get_advertisedValue py def get_advertisedValue php functio...

Page 431: ...n get_autoStart Integer vb function get_autoStart As Integer cs int get_autoStart java int get_autoStart uwp async Task int get_autoStart py def get_autoStart php function get_autoStart es function ge...

Page 432: ...eaconDriven Integer vb function get_beaconDriven As Integer cs int get_beaconDriven java int get_beaconDriven uwp async Task int get_beaconDriven py def get_beaconDriven php function get_beaconDriven...

Page 433: ...nIndex LongInt vb function get_currentRunIndex As Integer cs int get_currentRunIndex java int get_currentRunIndex uwp async Task int get_currentRunIndex py def get_currentRunIndex php function get_cur...

Page 434: ...tArray vb function get_dataSets As List cs List YDataSet get_dataSets java ArrayList YDataSet get_dataSets uwp async Task List YDataSet get_dataSets py def get_dataSets php function get_dataSets es fu...

Page 435: ...ataStream v py def get_dataStreams v php function get_dataStreams v es function get_dataStreams v The caller must pass by reference an empty array to hold YDataStream objects and the function fills it...

Page 436: ...sage pas function get_errorMessage string vb function get_errorMessage As String cs string get_errorMessage java String get_errorMessage py def get_errorMessage php function get_errorMessage es functi...

Page 437: ...s function get_errorType YRETCODE vb function get_errorType As YRETCODE cs YRETCODE get_errorType java int get_errorType py def get_errorType php function get_errorType es function get_errorType This...

Page 438: ...riendlyName py def get_friendlyName php function get_friendlyName es function get_friendlyName The returned string uses the logical names of the module and of the data logger if they are defined other...

Page 439: ...ion get_functionDescriptor As YFUN_DESCR cs YFUN_DESCR get_functionDescriptor java String get_functionDescriptor py def get_functionDescriptor php function get_functionDescriptor es function get_funct...

Page 440: ...functionId cpp string get_functionId m NSString functionId vb function get_functionId As String cs string get_functionId java String get_functionId py def get_functionId php function get_functionId es...

Page 441: ...wareId As String cs string get_hardwareId java String get_hardwareId py def get_hardwareId php function get_hardwareId es function get_hardwareId The unique hardware identifier is composed of the devi...

Page 442: ...et_logicalName string vb function get_logicalName As String cs string get_logicalName java String get_logicalName uwp async Task string get_logicalName py def get_logicalName php function get_logicalN...

Page 443: ...cpp YModule get_module m YModule module pas function get_module TYModule vb function get_module As YModule cs YModule get_module java YModule get_module py def get_module php function get_module es fu...

Page 444: ...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...

Page 445: ...Integer vb function get_recording As Integer cs int get_recording java int get_recording uwp async Task int get_recording py def get_recording php function get_recording es function get_recording cmd...

Page 446: ...unction get_timeUTC int64 vb function get_timeUTC As Long cs long get_timeUTC java long get_timeUTC uwp async Task long get_timeUTC py def get_timeUTC php function get_timeUTC es function get_timeUTC...

Page 447: ...cpp void get_userData m id userData pas function get_userData Tobject vb function get_userData As Object cs object get_userData java Object get_userData py def get_userData php function get_userData e...

Page 448: ...on isOnline As Boolean cs bool isOnline java boolean isOnline py def isOnline php function isOnline es function isOnline If there is a cached value for the data logger in cache that has not yet expire...

Page 449: ...g 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 virtua...

Page 450: ...y py def load msValidity php function load msValidity es function load msValidity By default whenever accessing a device all function attributes are kept in cache for the standard duration 5 ms This m...

Page 451: ...me pas function loadAttribute attrName string string vb function loadAttribute As String cs string loadAttribute string attrName java String loadAttribute String attrName uwp async Task string loadAtt...

Page 452: ...ce 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 Parameters msValidity an integer correspon...

Page 453: ...eValueCallbacks uwp async Task int muteValueCallbacks py def muteValueCallbacks php function muteValueCallbacks es function muteValueCallbacks cmd YDataLogger target muteValueCallbacks You can use thi...

Page 454: ...s function nextDataLogger TYDataLogger vb function nextDataLogger As YDataLogger cs YDataLogger nextDataLogger java YDataLogger nextDataLogger uwp YDataLogger nextDataLogger py def nextDataLogger php...

Page 455: ...Callback callback uwp async Task int registerValueCallback ValueCallback callback py def registerValueCallback callback php function registerValueCallback callback es function registerValueCallback ca...

Page 456: ...int set_autoStart int newval java int set_autoStart int newval uwp async Task int set_autoStart int newval py def set_autoStart newval php function set_autoStart newval es function set_autoStart newva...

Page 457: ...int set_beaconDriven int newval java int set_beaconDriven int newval uwp async Task int set_beaconDriven int newval py def set_beaconDriven newval php function set_beaconDriven newval es function set_...

Page 458: ...set_logicalName String newval uwp async Task int set_logicalName string newval py def set_logicalName newval php function set_logicalName newval es function set_logicalName newval cmd YDataLogger targ...

Page 459: ...Integer As Integer cs int set_recording int newval java int set_recording int newval uwp async Task int set_recording int newval py def set_recording newval php function set_recording newval es funct...

Page 460: ...eUTC ByVal newval As Long As Integer cs int set_timeUTC long newval java int set_timeUTC long newval uwp async Task int set_timeUTC long newval py def set_timeUTC newval php function set_timeUTC newva...

Page 461: ...m void setUserData id data pas procedure set_userData data Tobject vb procedure set_userData ByVal data As Object cs void set_userData object data java void set_userData Object data py def set_userDa...

Page 462: ...int unmuteValueCallbacks java int unmuteValueCallbacks uwp async Task int unmuteValueCallbacks py def unmuteValueCallbacks php function unmuteValueCallbacks es function unmuteValueCallbacks cmd YDataL...

Page 463: ...callback function can therefore freely issue synchronous or asynchronous commands without risking to block the Javascript VM Parameters callback callback function that is invoked when all pending com...

Page 464: ...com yoctopuce YoctoAPI YModule uwp import com yoctopuce YoctoAPI YModule py from yocto_api import php require_once yocto_api php es in HTML script src lib yocto_api js script in node js require yoctol...

Page 465: ...t_unit Returns the measuring unit for the measured value dataset loadMore Loads the the next block of measures from the dataLogger and updates the progress indicator dataset loadMore_async callback co...

Page 466: ..._endTimeUTC py def get_endTimeUTC php function get_endTimeUTC es function get_endTimeUTC When the YDataSet is created the end time is the value passed in parameter to the get_dataSet function After th...

Page 467: ...nctionId cpp string get_functionId m NSString functionId pas function get_functionId string vb function get_functionId As String cs string get_functionId java String get_functionId uwp async Task stri...

Page 468: ...hardwareId As String cs string get_hardwareId java String get_hardwareId uwp async Task string get_hardwareId py def get_hardwareId php function get_hardwareId es function get_hardwareId The unique ha...

Page 469: ...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 load...

Page 470: ...function get_measuresAt As List cs List YMeasure get_measuresAt YMeasure measure java ArrayList YMeasure get_measuresAt YMeasure measure uwp async Task List YMeasure get_measuresAt YMeasure measure py...

Page 471: ...ew uwp async Task List YMeasure get_preview py def get_preview php function get_preview es function get_preview Each item includes the start of a time interval the end of a time interval the minimal v...

Page 472: ...LongInt vb function get_progress As Integer cs int get_progress java int get_progress uwp async Task int get_progress py def get_progress php function get_progress es function get_progress When the ob...

Page 473: ...t_startTimeUTC py def get_startTimeUTC php function get_startTimeUTC es function get_startTimeUTC When the YDataSet is created the start time is the value passed in parameter to the get_dataSet functi...

Page 474: ...Measure get_summary uwp async Task YMeasure get_summary py def get_summary php function get_summary es function get_summary In includes the following information the start of a time interval the end o...

Page 475: ...ng get_unit m NSString unit pas function get_unit string vb function get_unit As String cs string get_unit java String get_unit uwp async Task string get_unit py def get_unit php function get_unit es...

Page 476: ...loadMore pas function loadMore LongInt vb function loadMore As Integer cs int loadMore java int loadMore uwp async Task int loadMore py def loadMore php function loadMore es function loadMore Returns...

Page 477: ...back 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 e...

Page 478: ...rom yocto_api import php require_once yocto_api php es in HTML script src lib yocto_api js script in node js require yoctolib es2017 yocto_api js YMeasure methods measure get_averageValue Returns the...

Page 479: ...ue cpp double get_averageValue m double averageValue pas function get_averageValue double vb function get_averageValue As Double cs double get_averageValue java double get_averageValue uwp double get_...

Page 480: ...imeUTC double vb function get_endTimeUTC As Double cs double get_endTimeUTC java double get_endTimeUTC uwp double get_endTimeUTC py def get_endTimeUTC php function get_endTimeUTC es function get_endTi...

Page 481: ...ion get_maxValue cpp double get_maxValue m double maxValue pas function get_maxValue double vb function get_maxValue As Double cs double get_maxValue java double get_maxValue uwp double get_maxValue p...

Page 482: ...ion get_minValue cpp double get_minValue m double minValue pas function get_minValue double vb function get_minValue As Double cs double get_minValue java double get_minValue uwp double get_minValue p...

Page 483: ...UTC double vb function get_startTimeUTC As Double cs double get_startTimeUTC java double get_startTimeUTC uwp double get_startTimeUTC py def get_startTimeUTC php function get_startTimeUTC es function...

Page 484: ...478 www yoctopuce com...

Page 485: ...ting the alphabetical order for example the 51 custom rules file is interpreted AFTER the 50 udev default rules file The 50 udev default file contains the system default udev rules To modify the defau...

Page 486: ...octo RangeFinder is connected by USB if its blue led is on but if the operating system cannot see the module check that you are using a true USB cable with data wires and not a charging cable Charging...

Page 487: ...u really want to get rid of your Yocto RangeFinder do not throw it away in a trash bin but bring it to a local WEEE recycling point In this way it will be disposed properly by a specialized WEEE recyc...

Page 488: ...482 www yoctopuce com...

Page 489: ...ccuracy 3 Max distance 2 m 6 Field of view FOV 25 Wavelength 940 nm Chipset VL53L0X Supported Operating Systems Windows Linux Intel ARM Mac OS X Android Drivers no driver needed API SDK Libraries USB...

Page 490: ...23 Characteristics 484 www yoctopuce com...

Page 491: ......

Page 492: ......

Page 493: ...ribe YTemperature 303 Description 33 Detected 7 Device 480 DisableExceptions YAPI 139 Disconnections 480 Distribution 19 download YModule 175 Dynamic 91 131 E EcmaScript 37 38 Elements 3 4 EnableExcep...

Page 494: ...7 get_hardwareCalibrationTemperature YRangeFinder 250 get_hardwareId YDataLogger 434 get_hardwareId YDataSet 461 get_hardwareId YLightSensor 376 get_hardwareId YModule 188 get_hardwareId YRangeFinder...

Page 495: ...rature 330 isSensorReady YLightSensor 392 isSensorReady YRangeFinder 267 isSensorReady YTemperature 331 J Java 97 JavaScript 37 38 L Languages 129 Libraries 131 Library 38 62 91 125 126 134 Light 7 Li...

Page 496: ...Sensor 402 set_logFrequency YRangeFinder 277 set_logFrequency YTemperature 342 set_logicalName YDataLogger 451 set_logicalName YLightSensor 403 set_logicalName YModule 220 set_logicalName YRangeFinder...

Page 497: ...1 yFindDataLogger 416 yFindDataLoggerInContext 417 yFindLightSensor 359 yFindLightSensorInContext 360 yFindModule 169 yFindModuleInContext 170 yFindRangeFinder 232 yFindRangeFinderInContext 233 yFindT...

Reviews: