background image

21. High-level API Reference

YAPI

YAPI.InitAPI()
yInitAPI()

Initializes the Yoctopuce programming library explicitly.

js

function yInitAPI(

mode

errmsg

)

cpp

YRETCODE yInitAPI( int 

mode

, string& 

errmsg

)

m

+(YRETCODE) InitAPI :(int) 

mode

 :(NSError**) 

errmsg

pas

function yInitAPI(

mode

: integer, var 

errmsg

: string): integer

vb

function yInitAPI( ByVal 

mode

 As Integer, ByRef 

errmsg

 As String) As Integer

cs

int InitAPI( int 

mode

, ref string 

errmsg

)

java

int InitAPI( int 

mode

)

uwp

async Task<int> InitAPI( int 

mode

)

py

def InitAPI(

mode

errmsg

=None)

php

function yInitAPI(

$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

 is used as detection 

mode

, you must explicitly use 

yRegisterHub()

 to

point the API to the VirtualHub on which your devices are connected before trying to access them.

Parameters :

mode

an integer corresponding to the type of automatic device detection to use. Possible values are

Y_DETECT_NONE

Y_DETECT_USB

Y_DETECT_NET

, and 

Y_DETECT_ALL

.

errmsg

a string passed by reference to receive any error message.

Returns :

YAPI_SUCCESS

 when the call succeeds.

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

www.yoctopuce.com

147

Содержание Yocto-RangeFinder

Страница 1: ...Yocto RangeFinder User s guide...

Страница 2: ......

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 18: ...12 www yoctopuce com...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 26: ...20 www yoctopuce com...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 42: ...36 www yoctopuce com...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 47: ...tion is defined only once rangefinder YRangeFinder FindRangeFinder YRNGFND1 123456 rangeFinder rangefinder YRangeFinder FindRangeFinder YRNGFND1 123456 MaFonction rangefinder YRangeFinder FindRangeFin...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 64: ...ong as MyFunction is defined only once YRangeFinder rangefinder yFindRangeFinder YRNGFND1 123456 rangeFinder YRangeFinder rangefinder yFindRangeFinder YRNGFND1 123456 MyFunction YRangeFinder rangefind...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 70: ...gcc lyocto lm lpthread lusb 1 0 lstdc 10 Using Yocto RangeFinder with C 64 www yoctopuce com...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 90: ...84 www yoctopuce com...

Страница 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...

Страница 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...

Страница 93: ...GFND1 123456 MyFunction rangefinder yFindRangeFinder MyModule rangeFinder rangefinder yFindRangeFinder MyModule MyFunction rangefinder yFindRangeFinder MyFunction yFindRangeFinder returns an object wh...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 120: ...114 www yoctopuce com...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 130: ...124 www yoctopuce com...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 146: ...eptions m void DisableExceptions pas procedure yDisableExceptions vb procedure yDisableExceptions cs void DisableExceptions py def DisableExceptions php function yDisableExceptions es function Disable...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 155: ...sterDeviceArrivalCallback ByVal arrivalCallback As yDeviceUpdateFunc cs void RegisterDeviceArrivalCallback yDeviceUpdateFunc arrivalCallback java void RegisterDeviceArrivalCallback DeviceArrivalCallba...

Страница 156: ...isterDeviceRemovalCallback ByVal removalCallback As yDeviceUpdateFunc cs void RegisterDeviceRemovalCallback yDeviceUpdateFunc removalCallback java void RegisterDeviceRemovalCallback DeviceRemovalCallb...

Страница 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...

Страница 158: ...21 High level API Reference On failure throws an exception or returns a negative error code 152 www yoctopuce com...

Страница 159: ...eryCallback cs void RegisterHubDiscoveryCallback YHubDiscoveryCallback hubDiscoveryCallback java void RegisterHubDiscoveryCallback HubDiscoveryCallback hubDiscoveryCallback uwp async Task RegisterHubD...

Страница 160: ...ction logfun yLogFunc vb procedure yRegisterLogFunction ByVal logfun As yLogFunc cs void RegisterLogFunction yLogFunc logfun java void RegisterLogFunction LogCallback logfun uwp void RegisterLogFuncti...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 183: ...ng functionBaseType int functionIndex java String functionBaseType int functionIndex py def functionBaseType functionIndex php function functionBaseType functionIndex es function functionBaseType func...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 231: ...ate As Integer cs int triggerFirmwareUpdate int secBeforeReboot java int triggerFirmwareUpdate int secBeforeReboot uwp async Task int triggerFirmwareUpdate int secBeforeReboot py def triggerFirmwareUp...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 237: ...rangefinder registerTimedReportCallback callback Registers the callback function that is invoked on every periodic timed notification rangefinder registerValueCallback callback Registers the callback...

Страница 238: ...according to the current ambient temperature rangefinder triggerXTalkCalibration targetDist Triggers the hardware cross talk calibration of the distance sensor rangefinder unmuteValueCallbacks Re ena...

Страница 239: ...ctionIdentifier ModuleSerialNumber FunctionLogicalName ModuleLogicalName FunctionIdentifier ModuleLogicalName FunctionLogicalName This function does not require that the range finder is online at the...

Страница 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...

Страница 241: ...YRangeFinder vb function yFirstRangeFinder As YRangeFinder cs YRangeFinder FirstRangeFinder java YRangeFinder FirstRangeFinder uwp YRangeFinder FirstRangeFinder py def FirstRangeFinder php function yF...

Страница 242: ...derInContext YAPIContext yctx uwp YRangeFinder FirstRangeFinderInContext YAPIContext yctx es function FirstRangeFinderInContext yctx Use the method YRangeFinder nextRangeFinder to iterate on next rang...

Страница 243: ...fValues php function calibrateFromPoints rawValues refValues es function calibrateFromPoints rawValues refValues cmd YRangeFinder target calibrateFromPoints rawValues refValues It is possible to confi...

Страница 244: ...Int vb function cancelCoverGlassCalibrations As Integer cs int cancelCoverGlassCalibrations java int cancelCoverGlassCalibrations uwp async Task int cancelCoverGlassCalibrations py def cancelCoverGlas...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 257: ...hardwareCalibrationTemperature As Double cs double get_hardwareCalibrationTemperature java double get_hardwareCalibrationTemperature uwp async Task double get_hardwareCalibrationTemperature py def get...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 279: ...teValueCallbacks uwp async Task int muteValueCallbacks py def muteValueCallbacks php function muteValueCallbacks es function muteValueCallbacks cmd YRangeFinder target muteValueCallbacks You can use t...

Страница 280: ...unction nextRangeFinder TYRangeFinder vb function nextRangeFinder As YRangeFinder cs YRangeFinder nextRangeFinder java YRangeFinder nextRangeFinder uwp YRangeFinder nextRangeFinder py def nextRangeFin...

Страница 281: ...dReportCallback TimedReportCallback callback uwp async Task int registerTimedReportCallback TimedReportCallback callback py def registerTimedReportCallback callback php function registerTimedReportCal...

Страница 282: ...teCallback callback uwp async Task int registerValueCallback ValueCallback callback py def registerValueCallback callback php function registerValueCallback callback es function registerValueCallback...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 294: ...k int triggerOffsetCalibration double targetDist py def triggerOffsetCalibration targetDist php function triggerOffsetCalibration targetDist es function triggerOffsetCalibration targetDist cmd YRangeF...

Страница 295: ...gerSpadCalibration uwp async Task int triggerSpadCalibration py def triggerSpadCalibration php function triggerSpadCalibration es function triggerSpadCalibration cmd YRangeFinder target triggerSpadCal...

Страница 296: ...va int triggerTemperatureCalibration uwp async Task int triggerTemperatureCalibration py def triggerTemperatureCalibration php function triggerTemperatureCalibration es function triggerTemperatureCali...

Страница 297: ...k int triggerXTalkCalibration double targetDist py def triggerXTalkCalibration targetDist php function triggerXTalkCalibration targetDist es function triggerXTalkCalibration targetDist cmd YRangeFinde...

Страница 298: ...int unmuteValueCallbacks java int unmuteValueCallbacks uwp async Task int unmuteValueCallbacks py def unmuteValueCallbacks php function unmuteValueCallbacks es function unmuteValueCallbacks cmd YRang...

Страница 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...

Страница 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...

Страница 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...

Страница 302: ...sterTimedReportCallback callback Registers the callback function that is invoked on every periodic timed notification temperature registerValueCallback callback Registers the callback function that is...

Страница 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...

Страница 304: ...ier ModuleSerialNumber FunctionLogicalName ModuleLogicalName FunctionIdentifier ModuleLogicalName FunctionLogicalName This function does not require that the temperature sensor is online at the time i...

Страница 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...

Страница 306: ...mperature vb function yFirstTemperature As YTemperature cs YTemperature FirstTemperature java YTemperature FirstTemperature uwp YTemperature FirstTemperature py def FirstTemperature php function yFirs...

Страница 307: ...InContext YAPIContext yctx uwp YTemperature FirstTemperatureInContext YAPIContext yctx es function FirstTemperatureInContext yctx Use the method YTemperature nextTemperature to iterate on next tempera...

Страница 308: ...fValues php function calibrateFromPoints rawValues refValues es function calibrateFromPoints rawValues refValues cmd YTemperature target calibrateFromPoints rawValues refValues It is possible to confi...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 342: ...Double resValues uwp async Task int loadThermistorResponseTable List double tempValues List double resValues py def loadThermistorResponseTable tempValues resValues php function loadThermistorRespons...

Страница 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...

Страница 344: ...teValueCallbacks uwp async Task int muteValueCallbacks py def muteValueCallbacks php function muteValueCallbacks es function muteValueCallbacks cmd YTemperature target muteValueCallbacks You can use t...

Страница 345: ...tion nextTemperature TYTemperature vb function nextTemperature As YTemperature cs YTemperature nextTemperature java YTemperature nextTemperature uwp YTemperature nextTemperature py def nextTemperature...

Страница 346: ...dReportCallback TimedReportCallback callback uwp async Task int registerTimedReportCallback TimedReportCallback callback py def registerTimedReportCallback callback php function registerTimedReportCal...

Страница 347: ...teCallback callback uwp async Task int registerValueCallback ValueCallback callback py def registerValueCallback callback php function registerValueCallback callback es function registerValueCallback...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 361: ...int unmuteValueCallbacks java int unmuteValueCallbacks uwp async Task int unmuteValueCallbacks py def unmuteValueCallbacks php function unmuteValueCallbacks es function unmuteValueCallbacks cmd YTemp...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 366: ...ctionIdentifier ModuleSerialNumber FunctionLogicalName ModuleLogicalName FunctionIdentifier ModuleLogicalName FunctionLogicalName This function does not require that the light sensor is online at the...

Страница 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...

Страница 368: ...YLightSensor vb function yFirstLightSensor As YLightSensor cs YLightSensor FirstLightSensor java YLightSensor FirstLightSensor uwp YLightSensor FirstLightSensor py def FirstLightSensor php function yF...

Страница 369: ...sorInContext YAPIContext yctx uwp YLightSensor FirstLightSensorInContext YAPIContext yctx es function FirstLightSensorInContext yctx Use the method YLightSensor nextLightSensor to iterate on next ligh...

Страница 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...

Страница 371: ...fValues php function calibrateFromPoints rawValues refValues es function calibrateFromPoints rawValues refValues cmd YLightSensor target calibrateFromPoints rawValues refValues It is possible to confi...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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_...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 404: ...teValueCallbacks uwp async Task int muteValueCallbacks py def muteValueCallbacks php function muteValueCallbacks es function muteValueCallbacks cmd YLightSensor target muteValueCallbacks You can use t...

Страница 405: ...unction nextLightSensor TYLightSensor vb function nextLightSensor As YLightSensor cs YLightSensor nextLightSensor java YLightSensor nextLightSensor uwp YLightSensor nextLightSensor py def nextLightSen...

Страница 406: ...dReportCallback TimedReportCallback callback uwp async Task int registerTimedReportCallback TimedReportCallback callback py def registerTimedReportCallback callback php function registerTimedReportCal...

Страница 407: ...teCallback callback uwp async Task int registerValueCallback ValueCallback callback py def registerValueCallback callback php function registerValueCallback callback es function registerValueCallback...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 418: ...int unmuteValueCallbacks java int unmuteValueCallbacks uwp async Task int unmuteValueCallbacks py def unmuteValueCallbacks php function unmuteValueCallbacks es function unmuteValueCallbacks cmd YLigh...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 423: ...ntifier ModuleSerialNumber FunctionLogicalName ModuleLogicalName FunctionIdentifier ModuleLogicalName FunctionLogicalName This function does not require that the data logger is online at the time it i...

Страница 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...

Страница 425: ...r TYDataLogger vb function yFirstDataLogger As YDataLogger cs YDataLogger FirstDataLogger java YDataLogger FirstDataLogger uwp YDataLogger FirstDataLogger py def FirstDataLogger php function yFirstDat...

Страница 426: ...ggerInContext YAPIContext yctx uwp YDataLogger FirstDataLoggerInContext YAPIContext yctx es function FirstDataLoggerInContext yctx Use the method YDataLogger nextDataLogger to iterate on next data log...

Страница 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...

Страница 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...

Страница 429: ...gInt vb function forgetAllDataStreams As Integer cs int forgetAllDataStreams java int forgetAllDataStreams uwp async Task int forgetAllDataStreams py def forgetAllDataStreams php function forgetAllDat...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 453: ...eValueCallbacks uwp async Task int muteValueCallbacks py def muteValueCallbacks php function muteValueCallbacks es function muteValueCallbacks cmd YDataLogger target muteValueCallbacks You can use thi...

Страница 454: ...s function nextDataLogger TYDataLogger vb function nextDataLogger As YDataLogger cs YDataLogger nextDataLogger java YDataLogger nextDataLogger uwp YDataLogger nextDataLogger py def nextDataLogger php...

Страница 455: ...Callback callback uwp async Task int registerValueCallback ValueCallback callback py def registerValueCallback callback php function registerValueCallback callback es function registerValueCallback ca...

Страница 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...

Страница 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_...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 462: ...int unmuteValueCallbacks java int unmuteValueCallbacks uwp async Task int unmuteValueCallbacks py def unmuteValueCallbacks php function unmuteValueCallbacks es function unmuteValueCallbacks cmd YDataL...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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_...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 484: ...478 www yoctopuce com...

Страница 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...

Страница 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...

Страница 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...

Страница 488: ...482 www yoctopuce com...

Страница 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...

Страница 490: ...23 Characteristics 484 www yoctopuce com...

Страница 491: ......

Страница 492: ......

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 497: ...1 yFindDataLogger 416 yFindDataLoggerInContext 417 yFindLightSensor 359 yFindLightSensorInContext 360 yFindModule 169 yFindModuleInContext 170 yFindRangeFinder 232 yFindRangeFinderInContext 233 yFindT...

Отзывы: