Table of Contents

Advertisement

Quick Links

Yocto-GPS, User's guide

Advertisement

Table of Contents
loading

Summary of Contents for Yoctopuce Yocto-GPS

  • Page 1 Yocto-GPS, User's guide...
  • Page 3: Table Of Contents

    5.9. GPS function interface ......................5.10. DataLogger function interface ................... 5.11. What interface: Native, DLL or Service ? ................5.12. Programming, where to start? ................... 6. Using the Yocto-GPS in command line ..............6.1. Installing ..........................6.2. Use: general description .....................
  • Page 4 10.3. Error handling ........................11. Using Yocto-GPS with Visual Basic .NET ............11.1. Installation ......................... 11.2. Using the Yoctopuce API in a Visual Basic project ............11.3. Control of the Latitude function ..................11.4. Control of the module part ....................
  • Page 5 14.5. Error handling ........................15. Using the Yocto-GPS with Java ................15.1. Getting ready ........................15.2. Control of the Latitude function ..................15.3. Control of the module part ....................15.4. Error handling ......................... 16. Using the Yocto-GPS with Android ..............
  • Page 6 22. Characteristics ........................ Blueprint ........................... Index .............................
  • Page 7: Introduction

    Yoctopuce thanks you for buying this Yocto-GPS and sincerely hopes that you will be satisfied with it. The Yoctopuce engineers have put a large amount of effort to ensure that your Yocto-GPS is easy to install anywhere and easy to drive from a maximum of programming languages. If you are nevertheless disappointed with this module, do not hesitate to contact Yoctopuce support By design, all Yoctopuce modules are driven the same way.
  • Page 8 The most common USB 2 connectors: A, B, Mini B, Micro A, Micro B. To connect your Yocto-GPS module to a computer, you need a USB cable of type A-micro B. The price of this cable may vary a lot depending on the source, look for it under the name USB A to micro B Data cable.
  • Page 9: Optional Accessories

    Yoctopuce shop. Screws and spacers In order to mount the Yocto-GPS module, you can put small screws in the 2.5mm assembly holes, with a screw head no larger than 4.5mm. The best way is to use threaded spacers, which you can then mount wherever you want.
  • Page 10 www.yoctopuce.com...
  • Page 11: Presentation

    All Yocto-modules share a number of common functionalities. USB connector Yoctopuce modules all come with a micro-B USB socket. The corresponding cables are not the most common, but the sockets are the smallest available. Warning: the USB connector is simply soldered in surface and can be pulled out if the USB plug acts as a lever.
  • Page 12: Specific Elements

    It is yours to define. 2.2. Specific elements The receiver The Yocto-GPS is based on a GNSS SL869 receiver produced by Telit. It has 32 channels and can compute up to 10 positions per second. Satellite reception led The green led (Fix Sat.) on the module indicates the state of the satellite reception.
  • Page 13 If you plan such a scenario, use a small U.FL to SMA (female) cable and an antenna equipped with an SMA connector. Being active, you can deport the antenna several meters away without changing the quality of the reception signal. Use an SMA connector if you plan to frequently disconnect the antenna. www.yoctopuce.com...
  • Page 14 www.yoctopuce.com...
  • Page 15: First Steps

    3. First steps When reading this chapter, your Yocto-GPS should be connected to your computer, which should have recognized it. It is time to make it work. Go to the Yoctopuce web site and download the Virtual Hub software . It is available for Windows, Linux, and Mac OS X.
  • Page 16: Configuration

    Firmware destined for Yoctopuce modules are available as .byn files and can be downloaded from the Yoctopuce web site. To update a firmware, simply click on the upgrade button on the configuration window and follow the instructions.
  • Page 17 Logical names of functions Each Yoctopuce module has a serial number and a logical name. In the same way, each function on each Yoctopuce module has a hardware name and a logical name, the latter can be freely chosen by the user.
  • Page 18 www.yoctopuce.com...
  • Page 19: Assembly And Connections

    Examples of assembly on supports The Yocto-GPS 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 module circuits. Make sure that the lower surface of the module is not in contact with the support.
  • Page 20: Usb Power Distribution

    4. Assembly and connections Antenna cable The Yocto-GPS is sold with a ceramic active antenna at the end of a ten centimeter coaxial cable ending with a U.FL connector. This type of cable is rather fragile: avoid bending it at a right angle, you could damage it.
  • Page 21 2000mA, it actually works in every day life, and seldom makes hardware damage. What you should remember: if you connect Yoctopuce modules through one, or more, USB hub without external power supply, you have no safe-guard and you depend entirely on your computer manufacturer attention to provide as much current as possible on the USB ports, and to detect overloads before they lead to problems or to hardware damages.
  • Page 22 www.yoctopuce.com...
  • Page 23: Programming, General Concepts

    The Yoctopuce API was designed to be at the same time simple to use and sufficiently generic for the concepts used to be valid for all the modules in the Yoctopuce range, and this in all the available programming languages. Therefore, when you have understood how to drive your Yocto-GPS with your favorite programming language, learning to use another module, even with a different language, will most likely take you only a minimum of time.
  • Page 24 YSensor, it will work with all Yoctopuce sensors, even those which do no yet exist. Programmation In the Yoctopuce API, priority was put on the ease of access to the module functions by offering the possibility to make abstractions of the modules implementing them. Therefore, it is quite possible to work with a set of functions without ever knowing exactly which module are hosting them at the hardware level.
  • Page 25: The Yocto-Gps Module

    Inversely, the YModule class provides several methods allowing you to enumerate the functions available on a module. 5.2. The Yocto-GPS module The Yocto-GPS is an GNSS interface . module : Module attribute type...
  • Page 26 Calibration parameters modifiable calibrationParam Fixed-point number modifiable resolution Integer read-only sensorState dataLogger : DataLogger attribute type modifiable ? String modifiable logicalName String modifiable advertisedValue Integer read-only currentRunIndex UTC time modifiable timeUTC Enumerated modifiable recording On/Off modifiable autoStart On/Off modifiable beaconDriven www.yoctopuce.com...
  • Page 27: Module Control Interface

    5.3. Module control interface This interface is identical for all Yoctopuce USB modules. It can be used to control the module global parameters, and to enumerate the functions provided by each module. productName Character string containing the commercial name of the module, as set by the factory.
  • Page 28: Gps Function Interface

    Current longitude dilution Current dilution of precision altitude Current altitude groundSpeed Current ground speed direction Current direction unixTime Unix form of the current time (number of elapsed seconds since Jan 1970 1st) dateTime Current time in the form "YYYY/MM/DD hh:mm:ss" www.yoctopuce.com...
  • Page 29: Latitude Function Interface

    5.5. Latitude function interface The Yoctopuce class YLatitude allows you to read the latitude from Yoctopuce geolocalization sensors. It inherits from the YSensor class the core functions to read measurements, to register callback functions, to access the autonomous datalogger.
  • Page 30: Longitude Function Interface

    Sensor health state (zero when a current measure is available). 5.6. Longitude function interface The Yoctopuce class YLongitude allows you to read the longitude from Yoctopuce geolocalization sensors. It inherits from the YSensor class the core functions to read measurements, register callback functions, access the autonomous datalogger.
  • Page 31: Altitude Function Interface

    Sensor health state (zero when a current measure is available). 5.7. Altitude function interface The Yoctopuce class YAltitude allows you to read and configure Yoctopuce altitude sensors. It inherits from the YSensor class the core functions to read measurements, to register callback functions, to access the autonomous datalogger.
  • Page 32: Groundspeed Function Interface

    Sensor tecnology 5.8. GroundSpeed function interface The Yoctopuce class YGroundSpeed allows you to read the ground speed from Yoctopuce geolocalization sensors. It inherits from the YSensor class the core functions to read measurements, register callback functions, access the autonomous datalogger.
  • Page 33: Gps Function Interface

    Short character string summarizing the current GPS reception state. isFixed Indicates whether the receiver has found enough satellites to work satCount Visible satellite count. coordSystem Representation system to use for positioning data latitude Current latitude longitude Current longitude dilution Current dilution of precision altitude Current altitude www.yoctopuce.com...
  • Page 34: Datalogger Function Interface

    5.10. DataLogger function interface Yoctopuce sensors include a non-volatile memory capable of storing ongoing measured data automatically, without requiring a permanent connection to a computer. The DataLogger function controls the global parameters of the internal data logger.
  • Page 35: What Interface: Native, Dll Or Service

    Attribute that can be set to true to clear recorded data. 5.11. What interface: Native, DLL or Service ? There are several methods to control you Yoctopuce module by software. Native control In this case, the software driving your project is compiled directly with a library which provides control of the modules.
  • Page 36 Some languages do simply not allow you to easily gain access to the hardware layers of the machine. It is the case for Javascript, for instance. To deal with this case, Yoctopuce provides a solution in the form of a small piece of software called VirtualHub .
  • Page 37: Programming, Where To Start

    5.12. Programming, where to start? At this point of the user's guide, you should know the main theoretical points of your Yocto-GPS. It is now time to practice. You must download the Yoctopuce library for your favorite programming language from the Yoctopuce web site .
  • Page 38 www.yoctopuce.com...
  • Page 39: Using The Yocto-Gps In Command Line

    6. Using the Yocto-GPS in command line When you want to perform a punctual operation on your Yocto-GPS, such as reading a value, assigning a logical name, and so on, you can obviously use the Virtual Hub, but there is a simpler, faster, and more efficient method: the command line API.
  • Page 40: Control Of The Latitude Function

    C:\>executable command /help to obtain a detailed description of the parameters of a command. 6.3. Control of the Latitude function To control the Latitude function of your Yocto-GPS, you need the YLatitude executable file. For instance, you can launch: C:\>YGps get_latitude This example uses the "any"...
  • Page 41: Limitations

    6. Using the Yocto-GPS in command line C:\>YModule describe Each property of the module can be obtained thanks to a command of the type, get_xxxx() and the properties which are not read only can be modified with the command. For...
  • Page 42 www.yoctopuce.com...
  • Page 43: Using Yocto-Gps With Javascript / Ecmascript

    EcmaScript 2017 to differentiate it from the previous Library for JavaScript, now deprecated in favor of this new version. This library provides access to Yoctopuce devices for modern JavaScript engines. It can be used within a browser as well as with Node.js. The library will automatically detect upon initialization whether the runtime environment is a browser or a Node.js virtual machine, and use the most...
  • Page 44: Using Yoctopuce Library For Javascript / Ecmascript 2017

    JavaScript is one of those languages which do not generally allow you to directly access the hardware layers of your computer. Therefore the library can only be used to access network-enabled devices (connected through a YoctoHub), or USB devices accessible through Yoctopuce TCP/IP to USB gateway, named VirtualHub.
  • Page 45 For HTML examples, it is even simpler: there is nothing to install. Each example is a single HTML file that you can open in a browser to try it. In this context, loading the Yoctopuce library is no different from any standard HTML script include tag.
  • Page 46: Control Of The Latitude Function

    You can also rewrite this last asynchronous call as: myModule.get_syncProxy().then(logInfoProxy); 7.3. Control of the Latitude function A few lines of code are enough to use a Yocto-GPS. Here is the skeleton of a JavaScript code snipplet to use the Latitude function. import {...
  • Page 47 If your Yocto-GPS is not connected on the host running the browser, replace in the example the address by the IP address of the host on which the Yocto-GPS is connected and where 127.0.0.1...
  • Page 48 If you want to see how to use the library within a browser, switch to the directory example_html/ Doc-GettingStarted-Yocto-GPS. You will find there a subdirectory src as well with a very similar source code (below), but with a few changes compared to the Node.js version since it has to interact through an HTML page rather than through the JavaScript console.
  • Page 49 7. Using Yocto-GPS with JavaScript / EcmaScript refresh(); async function refresh() serial = document.getElementById('serial').value; if(serial == '') { // by default use any connected module suitable for the demo anysensor = YGps.FirstGps(); if(anysensor) { module = await anysensor.module(); serial = await module.get_serialNumber();...
  • Page 50: Control Of The Module Part

    7. Using Yocto-GPS with JavaScript / EcmaScript example using URL http://127.0.0.1/EcmaScript/example_html/Doc-GettingStarted-Yocto-GPS/ demo.html then the beginning of your jspm.browser.js file should look like: SystemJS.config({ baseURL: "/EcmaScript/example_html/Doc-GettingStarted-Yocto-GPS/", If you prefer to open the demo code as a local file rather than through a web server, or if you would...
  • Page 51 7. Using Yocto-GPS with JavaScript / EcmaScript Each property of the module can be read thanks to a method of type , and get_xxxx() properties which are not read-only can be modified with the help of the method. For set_xxx() more details regarding the used functions, refer to the API chapters.
  • Page 52: Error Handling

    The method recommended by most programming languages for unpredictable error handling is the use of exceptions. By default, it is the behavior of the Yoctopuce library. If an error happens while you try to access a module, the library throws an exception. In this case, there are three possibilities: •...
  • Page 53 7. Using Yocto-GPS with JavaScript / EcmaScript values, which can be tested by the caller when necessary. For each function, the name of each return value in case of error is systematically documented in the library reference. The name always...
  • Page 54 www.yoctopuce.com...
  • Page 55: Using Yocto-Gps With Php

    VirtualHub software, and you are ready to start your first tests. You do not need to install any driver. 8.2. Control of the Latitude function A few lines of code are enough to use a Yocto-GPS. Here is the skeleton of a PHP code snipplet to use the Latitude function. include('yocto_api.php');...
  • Page 56 Yocto-GPS. The value returned is a string, the format will vary according to the Yocto-GPS configuration. To get a floating point value, no matter the configuartion, use the YLatitude Class. A real example...
  • Page 57: Control Of The Module Part

    8. Using Yocto-GPS with PHP <HTML> <HEAD> <TITLE>Hello World</TITLE> </HEAD> <BODY> <?php include('yocto_api.php'); include('yocto_gps.php'); // Use explicit error handling rather than exceptions //yDisableExceptions(); // Setup the API to use the VirtualHub on local machine if(yRegisterHub('http://127.0.0.1:4444/',$errmsg) YAPI_SUCCESS) { die("Cannot contact VirtualHub on 127.0.0.1");...
  • Page 58 8. Using Yocto-GPS with PHP // Check if a specified module is available online $module = yFindModule("$serial"); if (!$module->isOnline()) { die("Module not connected (check serial and USB cable)"); } else { // or use any connected module suitable for the demo $module = yFirstModule();...
  • Page 59 8. Using Yocto-GPS with PHP @$serial = $_GET['serial']; ($serial != '') { // Check if a specified module is available online $module = yFindModule("$serial"); if (!$module->isOnline()) { die("Module not connected (check serial and USB cable)"); } else { // or use any connected module suitable for the demo $module = yFirstModule();...
  • Page 60: Http Callback Api And Nat Filters

    The PHP library is able to work in a specific mode called HTTP callback Yocto-API. With this mode, you can control Yoctopuce devices installed behind a NAT filter, such as a DSL router for example, and this without needing to open a port. The typical application is to control Yoctopuce devices, located on a private network, from a public web site.
  • Page 61 8. Using Yocto-GPS with PHP But requests from the outside are blocked. Seeing Internet without being seen provides an enormous security advantage. However, this signifies that you cannot, a priori, set up your own web server at home to control a home automation installation from the outside.
  • Page 62 To code a web site which controls Yoctopuce modules interactively, you must create a user interface which stores in a file or in a database the actions to be performed on the Yoctopuce modules. These actions are then read and run by the control script.
  • Page 63: Error Handling

    The method recommended by most programming languages for unpredictable error handling is the use of exceptions. By default, it is the behavior of the Yoctopuce library. If an error happens while you try to access a module, the library throws an exception. In this case, there are three possibilities: •...
  • Page 64 8. Using Yocto-GPS with PHP bounds for the returned value. In the case of functions which do not normally return information, the return value is if everything went well, and a different error code in case of failure. YAPI_SUCCESS When you work without exceptions, you can obtain an error code and an error message explaining the source of the error.
  • Page 65: Using Yocto-Gps With C

    Yoctopuce libraries. 9.1. Control of the Latitude function A few lines of code are enough to use a Yocto-GPS. Here is the skeleton of a C++ code snipplet to use the Latitude function.
  • Page 66 Yocto-GPS. The value returned is a string, the format will vary according to the Yocto-GPS configuration. To get a floating point value, no matter the configuartion, use the YLatitude Class. A real example Launch your C++ environment and open the corresponding sample project provided in the directory Examples/Doc-GettingStarted-Yocto-GPS of the Yoctopuce library.
  • Page 67: Control Of The Module Part

    9. Using Yocto-GPS with C++ static void usage(void) cout << "usage: demo <serial_number> " << endl; cout << " demo <logical_name>" << endl; cout << " demo any (use any discovered device)" << endl; now = yGetTickCount(); while (yGetTickCount() - now <...
  • Page 68 9. Using Yocto-GPS with C++ int main(int argc, const char argv[]) string errmsg; // Setup the API to use local USB devices if(yRegisterHub("usb", errmsg) YAPI_SUCCESS) { cerr << "RegisterHub error: " << errmsg << endl; return if(argc < usage(argv[0]); YModule *module = yFindModule(argv[1]);...
  • Page 69 9. Using Yocto-GPS with C++ // Setup the API to use local USB devices if(yRegisterHub("usb", errmsg) YAPI_SUCCESS) { cerr << "RegisterHub error: " << errmsg << endl; return if(argc < usage(argv[0]); YModule *module = yFindModule(argv[1]); // use serial or logical name if (module->isOnline()) {...
  • Page 70: Error Handling

    The method recommended by most programming languages for unpredictable error handling is the use of exceptions. By default, it is the behavior of the Yoctopuce library. If an error happens while you try to access a module, the library throws an exception. In this case, there are three possibilities: •...
  • Page 71 • For Linux: libm, libpthread, libusb1.0, and libstdc++ Integration as a static library Integration of the Yoctopuce library as a static library is a simpler manner to build a small executable which uses Yoctopuce modules. You can quickly compile the program with a single command. You do not need to install a dynamic library specific to Yoctopuce, everything is in the executable.
  • Page 72 www.yoctopuce.com...
  • Page 73: Using Yocto-Gps With Objective-C

    Lion. If you are still under Snow Leopard, you need to be registered as Apple developer to be able to download XCode 4.2. The Yoctopuce library is ARC compatible. You can therefore implement your projects either using the traditional retain / release method, or using the Automatic Reference Counting.
  • Page 74 You can use logical names as well, as long as you have initialized them. Let us imagine a Yocto-GPS module with serial number YGNSSMK1-123456 which you have named "MyModule", and for which you have given the latitude function the name "MyFunction".
  • Page 75: Control Of The Module Part

    YGps.FindGps currently measured by the Yocto-GPS. The value returned is a string, the format will vary according to the Yocto-GPS configuration. To get a floating point value, no matter the configuartion, use the YLatitude Class. 10.2. Control of the module part Each module can be controlled in a similar manner, you can find below a simple sample program displaying the main parameters of the module and enabling you to activate the localization beacon.
  • Page 76 10. Using Yocto-GPS with Objective-C Each property of the module can be read thanks to a method of type , and get_xxxx properties which are not read-only can be modified with the help of the method. For set_xxx: more details regarding the used functions, refer to the API chapters.
  • Page 77: Error Handling

    The method recommended by most programming languages for unpredictable error handling is the use of exceptions. By default, it is the behavior of the Yoctopuce library. If an error happens while you try to access a module, the library throws an exception. In this case, there are three possibilities: •...
  • Page 78 10. Using Yocto-GPS with Objective-C method returns a value, and so on. In any get_currentValue Y_CURRENTVALUE_INVALID case, the returned value is of the expected type and is not a null pointer which would risk crashing your program. At worst, if you display the value without testing it, it will be outside the expected bounds for the returned value.
  • Page 79: Using Yocto-Gps With Visual Basic .Net

    Yoctopuce modules that your project is going to manage. If in doubt, select all the files. You then have the choice between simply adding these files to your project, or to add them as links (the Add button is in fact a scroll-down menu).
  • Page 80: Control Of The Latitude Function

    Naturally, the libraries function in a strictly identical manner if you integrate them in an application with a graphical interface. 11.3. Control of the Latitude function A few lines of code are enough to use a Yocto-GPS. Here is the skeleton of a Visual Basic code snipplet to use the Latitude function. [...]...
  • Page 81: Control Of The Module Part

    11. Using Yocto-GPS with Visual Basic .NET Yocto-GPS configuration. To get a floating point value, no matter the configuartion, use the YLatitude Class. A real example Launch Microsoft VisualBasic and open the corresponding sample project provided in the directory Examples/Doc-GettingStarted-Yocto-GPS of the Yoctopuce library.
  • Page 82 11. Using Yocto-GPS with Visual Basic .NET Imports System.IO Imports System.Environment Module Module1 Sub usage() Console.WriteLine("usage: demo <serial or logical name> [ON/OFF]") End Sub Sub Main() Dim argv() As String System.Environment.GetCommandLineArgs() errmsg String "" ymodule (yRegisterHub("usb", errmsg) <> YAPI_SUCCESS) Then Console.WriteLine("RegisterHub error:"...
  • Page 83 11. Using Yocto-GPS with Visual Basic .NET Dim argv() As String System.Environment.GetCommandLineArgs() errmsg String "" newname String YModule (argv.Length <> 3) Then usage() REM Setup the API to use local USB devices yRegisterHub("usb", errmsg) <> YAPI_SUCCESS Then Console.WriteLine("RegisterHub error: "...
  • Page 84: Error Handling

    The method recommended by most programming languages for unpredictable error handling is the use of exceptions. By default, it is the behavior of the Yoctopuce library. If an error happens while you try to access a module, the library throws an exception. In this case, there are three possibilities: •...
  • Page 85: Using Yocto-Gps With C

    12.2. Using the Yoctopuce API in a Visual C# project The Visual C#.NET Yoctopuce library is composed of a DLL and of source files in Visual C#. The DLL is not a .NET DLL, but a classic DLL, written in C, which manages the low level communications with the modules .
  • Page 86: Control Of The Latitude Function

    Naturally, the libraries function in a strictly identical manner if you integrate them in an application with a graphical interface. 12.3. Control of the Latitude function A few lines of code are enough to use a Yocto-GPS. Here is the skeleton of a C# code snipplet to use the Latitude function. [...] string errmsg ="";...
  • Page 87 YGps.FindGps currently measured by the Yocto-GPS. The value returned is a string, the format will vary according to the Yocto-GPS configuration. To get a floating point value, no matter the configuartion, use the YLatitude Class. A real example Launch Microsoft Visual C# and open the corresponding sample project provided in the directory Examples/Doc-GettingStarted-Yocto-GPS of the Yoctopuce library.
  • Page 88: Control Of The Module Part

    12. Using Yocto-GPS with C# YAPI.FreeAPI(); 12.4. Control of the module part Each module can be controlled in a similar manner, you can find below a simple sample program displaying the main parameters of the module and enabling you to activate the localization beacon.
  • Page 89 12. Using Yocto-GPS with C# Each property of the module can be read thanks to a method of type YModule.get_xxxx() and properties which are not read-only can be modified with the help of the YModule.set_xxx() method. For more details regarding the used functions, refer to the API chapters.
  • Page 90: Error Handling

    The method recommended by most programming languages for unpredictable error handling is the use of exceptions. By default, it is the behavior of the Yoctopuce library. If an error happens while you try to access a module, the library throws an exception. In this case, there are three possibilities: •...
  • Page 91 12. Using Yocto-GPS with C# values, which can be tested by the caller when necessary. For each function, the name of each return value in case of error is systematically documented in the library reference. The name always follows the same logic: a...
  • Page 92 www.yoctopuce.com...
  • Page 93: Using Yocto-Gps With Delphi

    Delphi libraries. By default, the Yoctopuce Delphi library uses the yapi.dll DLL, all the applications you will create with Delphi must have access to this DLL. The simplest way to ensure this is to make sure yapi.dll is located in the same directory as the executable file of your application.
  • Page 94 There are only a few really important lines in this sample example. We will look at them in details. yocto_api and yocto_latitude These two units provide access to the functions allowing you to manage Yoctopuce modules. must always be used,...
  • Page 95: Control Of The Module Part

    Yocto-GPS. The value returned is a string, the format will vary according to the Yocto-GPS configuration. To get a floating point value, no matter the configuartion, use the YLatitude Class. 13.3. Control of the module part Each module can be controlled in a similar manner, you can find below a simple sample program displaying the main parameters of the module and enabling you to activate the localization beacon.
  • Page 96 13. Using Yocto-GPS with Delphi else Writeln('Module not connected (check identification and USB cable)'); end; procedure beacon(module:Tymodule;state:integer); begin module.set_beacon(state); refresh(module); end; module : TYModule; : char; errmsg : string; begin // Setup the API to use local USB devices yRegisterHub('usb', errmsg)<>YAPI_SUCCESS...
  • Page 97: Error Handling

    Inevitably, there will be a time when a user 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 must nevertheless be conceived to interpret in the best possible way the errors indicated by the library.
  • Page 98 The method recommended by most programming languages for unpredictable error handling is the use of exceptions. By default, it is the behavior of the Yoctopuce library. If an error happens while you try to access a module, the library throws an exception. In this case, there are three possibilities: •...
  • Page 99: Using The Yocto-Gps With Python

    Naturally, the libraries function in a strictly identical manner if you integrate them in an application with a graphical interface. 14.3. Control of the Latitude function A few lines of code are enough to use a Yocto-GPS. Here is the skeleton of a Python code snipplet to use the Latitude function. http://www.python.org/download/ www.yoctopuce.com/EN/libraries.php...
  • Page 100 You can use logical names as well, as long as you have initialized them. Let us imagine a Yocto-GPS module with serial number YGNSSMK1-123456 which you have named "MyModule", and for which you have given the latitude function the name "MyFunction".
  • Page 101: Control Of The Module Part

    14. Using the Yocto-GPS with Python usage(): scriptname = os.path.basename(sys.argv[0]) print("Usage:") print(scriptname + <serial_number>') print(scriptname + <logical_name>') print(scriptname + ' any sys.exit() die(msg): sys.exit(msg + ' (check USB cable)') if len(sys.argv) < 2: usage() target = sys.argv[1] # Setup the API to use local USB devices...
  • Page 102 14. Using the Yocto-GPS with Python m.set_beacon(YModule.BEACON_OFF) print("serial: " m.get_serialNumber()) print("logical name: " m.get_logicalName()) print("luminosity: " str(m.get_luminosity())) if m.get_beacon() == YModule.BEACON_ON: print("beacon: ON") else: print("beacon: OFF") print("upTime: " str(m.get_upTime() 1000) " sec") print("USB current: " str(m.get_usbCurrent()) " mA") print("logs:\n" m.get_lastLogs()) else: print(sys.argv[1]...
  • Page 103: Error Handling

    The method recommended by most programming languages for unpredictable error handling is the use of exceptions. By default, it is the behavior of the Yoctopuce library. If an error happens while you try to access a module, the library throws an exception. In this case, there are three possibilities: •...
  • Page 104 14. Using the Yocto-GPS with Python methods. Their returned values contain the same information as errType() errMessage() in the exceptions when they are active. www.yoctopuce.com...
  • Page 105: Using The Yocto-Gps With Java

    Naturally, the libraries function in a strictly identical manner if you integrate them in an application with a graphical interface. 15.2. Control of the Latitude function A few lines of code are enough to use a Yocto-GPS. Here is the skeleton of a Java code snippet to use the Latitude function. [...] // Get access to your device, connected locally on USB for instance YAPI.RegisterHub("127.0.0.1");...
  • Page 106 You can use logical names as well, as long as you have initialized them. Let us imagine a Yocto-GPS module with serial number YGNSSMK1-123456 which you have named "MyModule", and for which you have given the latitude function the name "MyFunction".
  • Page 107: Control Of The Module Part

    15. Using the Yocto-GPS with Java gps = YGps.FirstGps(); (gps == null) { System.out.println("No module connected (check USB cable)"); System.exit(1); } else { gps = YGps.FindGps(args[0] + ".temperature"); while (true) { try { if (gps.get_isFixed() YGps.ISFIXED_TRUE) { System.out.println("fixing..."); } else { System.out.println(gps.get_latitude()
  • Page 108 15. Using the Yocto-GPS with Java System.out.println("serial: " + module.get_serialNumber()); System.out.println("logical name: " + module.get_logicalName()); System.out.println("luminosity: " + module.get_luminosity()); if (module.get_beacon() YModule.BEACON_ON) { System.out.println("beacon: ON"); } else { System.out.println("beacon: OFF"); System.out.println("upTime: " module.get_upTime() 1000 " sec"); System.out.println("USB current: " module.get_usbCurrent() "...
  • Page 109: Error Handling

    Inevitably, there will be a time when a user 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 must nevertheless be conceived to interpret in the best possible way the errors indicated by the library.
  • Page 110 15. Using the Yocto-GPS with Java In the Java API, error handling is implemented with exceptions. Therefore you must catch and handle correctly all exceptions that might be thrown by the API if you do not want your software to crash as soon as you unplug a device.
  • Page 111: Using The Yocto-Gps With Android

    In an ideal world, you would only need to have a smart phone running under Android to be able to make Yoctopuce modules work. Unfortunately, it is not quite so in the real world. A machine running under Android must fulfil to a few requirements to be able to manage Yoctopuce USB modules natively.
  • Page 112: Activating The Usb Port Under Android

    The user can deny or authorize access to the device. If the user authorizes the access, the application can access the connected device as long as Yoctohubs are a plug and play way to add network connectivity to your Yoctopuce devices. more info on http:// www.yoctopuce.com/EN/products/category/extensions-and-networking...
  • Page 113 This file contains a list of USB vendorId and deviceID in decimal. The following example runs the application as soon as a Yocto-Relay or a YoctoPowerRelay is connected. You can find the vendorID and the deviceID of Yoctopuce modules in the characteristics section of the documentation.
  • Page 114: Control Of The Latitude Function

    16. Using the Yocto-GPS with Android 16.5. Control of the Latitude function A few lines of code are enough to use a Yocto-GPS. Here is the skeleton of a Java code snippet to use the Latitude function. [...] // Retrieving the object representing the module (connected here locally by USB) YAPI.EnableUSBHost(this);...
  • Page 115 16. Using the Yocto-GPS with Android A real example Launch you Java environment and open the corresponding sample project provided in the directory Examples//Doc-Examples of the Yoctopuce library. In this example, you can recognize the functions explained above, but this time used with all the side materials needed to make it work nicely as a small demo.
  • Page 116: Control Of The Module Part

    16. Using the Yocto-GPS with Android public void onItemSelected(AdapterView<?> parent, View view, pos, long id) { serial = parent.getItemAtPosition(pos).toString(); @Override public void onNothingSelected(AdapterView<?> arg0) { final Runnable new Runnable() { public void run() { (serial != null) { YGps gps = YGps.FindGps(serial);...
  • Page 117 16. Using the Yocto-GPS with Android @Override protected void onStart() super.onStart(); try { aa.clear(); YAPI.EnableUSBHost(this); YAPI.RegisterHub("usb"); YModule r = YModule.FirstModule(); while (r != null) { String hwid = r.get_hardwareId(); aa.add(hwid); r = r.nextModule(); } catch (YAPI_Exception e) { e.printStackTrace(); // refresh Spinner with detected relay aa.notifyDataSetChanged();...
  • Page 118 16. Using the Yocto-GPS with Android try { if (on) { module.setBeacon(YModule.BEACON_ON); } else { module.setBeacon(YModule.BEACON_OFF); } catch (YAPI_Exception e) { e.printStackTrace(); Each property of the module can be read thanks to a method of type YModule.get_xxxx() and properties which are not read-only can be modified with the help of the YModule.set_xxx()
  • Page 119 16. Using the Yocto-GPS with Android aa.add(hwid); r = r.nextModule(); } catch (YAPI_Exception e) { e.printStackTrace(); // refresh Spinner with detected relay aa.notifyDataSetChanged(); @Override protected void onStop() super.onStop(); YAPI.FreeAPI(); private void DisplayModuleInfo() TextView field; (module == null) return; try { YAPI.UpdateDeviceList();// fixme...
  • Page 120 16. Using the Yocto-GPS with Android Listing the modules Obtaining the list of the connected modules is performed with the YModule.yFirstModule() 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 the returned value is not .
  • Page 121: Error Handling

    Inevitably, there will be a time when a user 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 must nevertheless be conceived to interpret in the best possible way the errors indicated by the library.
  • Page 122 www.yoctopuce.com...
  • Page 123: Advanced Programming

    To be warned as soon as a module is connected, you need three pieces of code. The callback The callback is the function which is called each time a new Yoctopuce module is connected. It takes as parameter the relevant module. static void deviceArrival(YModule Console.WriteLine("New module...
  • Page 124 Detecting a modification in the value of a sensor The Yoctopuce API also provides a callback system allowing you to be notified automatically with the value of any sensor, either when the value has changed in a significant way or periodically at a preset frequency.
  • Page 125 Yoctopuce devices (for instance, you can also receive a callback any time a relay state changes).
  • Page 126: The Data Logger

    Examples/Prog-EventBased directory of the corresponding library. 17.2. The data logger Your Yocto-GPS is equipped with a data logger able to store non-stop the measures performed by the module. The maximal frequency is 100 times per second (i.e. "100/s"), and the minimal frequency is 1 time per hour (i.e.
  • Page 127 "OFF": sensor.set_logFrequency("OFF"); Limitation: The Yocto-GPS cannot use a different frequency for timed-report callbacks and for recording data into the datalogger. You can disable either of them individually, but if you enable both timed-report callbacks and logging for a given function, the two will work at the same frequency.
  • Page 128: Sensor Calibration

    Examples/Prog-DataLogger. Timestamp As the Yocto-GPS does not have a battery, it cannot guess alone the current time when powered on. Nevertheless, the Yocto-GPS will automatically try to adjust its real-time reference using the host to which it is connected, in order to properly attach a timestamp to each measure in the datalogger: •...
  • Page 129 The Yoctopuce modules support two types of calibration. On the one hand, a linear interpolation based on 1 to 5 reference points, which can be performed directly inside the Yocto-GPS. On the other hand, the API supports an external arbitrary calibration, implemented with callbacks.
  • Page 130 Correction example with 3 calibration points Back to normal To cancel the effect of a calibration on a function, call the calibrateFromPoints() method with two empty arrays. Double[] ValuesBefore = {}; Double[] ValuesAfter = {}; YLatitude f = YLatitude.FirstLatitude(); www.yoctopuce.com...
  • Page 131 Note that these interpolation callbacks are global, and not specific to each function. Thus, each time someone requests a value from a module which contains in its flash memory the correct number of calibration points, the corresponding callback is called to correct the value before returning it, enabling thus a perfectly transparent measure correction. www.yoctopuce.com...
  • Page 132 www.yoctopuce.com...
  • Page 133: Firmware Update

    You can update your module firmware from your Android phone or tablet with the Yocto-Firmware application. This application lists all the Yoctopuce modules connected by USB and checks if a more recent firmware is available on www.yoctopuce.com. If a more recent firmware is available, you can...
  • Page 134: Updating The Firmware With The Programming Library

    = m.next(); Finding the correct firmware The first step to update a Yoctopuce module is to find which firmware you must use. The method of the YModule object does exactly this. The checkFirmware(path, onlynew) method checks that the firmware given as argument ( ) is compatible with the module.
  • Page 135 " is compatible and newer"); You can also give the "www.yoctopuce.com" string as argument to check whether there is a more recent published firmware on Yoctopuce's web site. In this case, the method returns the firmware URL. You can use this URL to download the firmware on your disk or use this URL when updating the firmware (see below).
  • Page 136: The "Update" Mode

    (or to restore default parameters). null YFirmwareUpdateupdate fw_update; fw_update = YFirmwareUpdate(allBootLoader[0], newfirm, null); status = fw_update.startUpdate(); ..www.yoctopuce.com...
  • Page 137: Using With Unsupported Languages

    (JavaScript, PHP, Java, ...). In fact, the VirtualHub is a small web server able to route HTTP requests to Yoctopuce modules. This means that if you can make an HTTP request from your programming language, you can drive Yoctopuce modules, even if this language is not officially supported.
  • Page 138 Rather logically, attributes can be modified in the same manner. http://127.0.0.1:4444/bySerial/YGNSSMK1-12345/api/latitude?logicalName=myFunction You can find the list of available attributes for your Yocto-GPS at the beginning of the Programming chapter. Accessing Yoctopuce data logger through the REST interface This section only applies to devices with a built-in data logger.
  • Page 139: Using Dynamic Libraries

    19.3. Using dynamic libraries The low level Yoctopuce API is available under several formats of dynamic libraries written in C. The sources are available with the C++ API. If you use one of these low level libraries, you do not need the VirtualHub anymore.
  • Page 140 (yapiHTTPRequest(serial,setValue,data,sizeof(dataBuffer),fullsize,errmsg)<0) then begin writeln(errmsg); halt; end; end. Module inventory To perform an inventory of Yoctopuce modules, you need two functions from the dynamic library: int yapiGetAllDevices(int *buffer,int maxsize,int *neededsize,char *errmsg); int yapiGetDeviceInfo(int devdesc,yDeviceSt *infos, char *errmsg); The yapiGetAllDevices function retrieves the list of all connected modules as a list of handles. buffer points to a 32-bit integer array which contains the returned handles.
  • Page 141 This data structure has the following format: Size Name Type Description (bytes) vendorid Yoctopuce USB ID deviceid Module USB ID devrelease Module version nbinbterfaces int Number of USB interfaces used by the module manufacturer char[]...
  • Page 142: Porting The High Level Library

    19.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 language of your choice. Note, however, that a large portion of the API source code is automatically generated.
  • Page 143: High-Level Api Reference

    20. High-level API Reference This chapter summarizes the high-level API functions to drive your Yocto-GPS. Syntax and exact type names may vary from one language to another, but, unless otherwise stated, all the functions are available in every language. For detailed information regarding the types of arguments and return...
  • Page 144: General Functions

    20. High-level API Reference 20.1. General functions These general functions should be used to initialize and configure the Yoctopuce library. In most cases, a simple call to function should be enough. The module-specific functions yRegisterHub() should then be used to retrieve an object that provides interaction yFind...()
  • Page 145 Force a hub discovery, if a callback as been registered with will be called for each net work hub that will respond to the discovery. yUnregisterHub(url) Setup the Yoctopuce library to no more use modules connected on a previously registered machine with RegisterHub. yUpdateDeviceList(errmsg) Triggers a (re)detection of connected Yoctopuce modules.
  • Page 146 , and . If you try to configure a logical name with an incorrect string, the invalid characters are ignored. Parameters : name a string containing the name to check. Returns : true false if the name is valid, otherwise. www.yoctopuce.com...
  • Page 147 ) void DisableExceptions( ) def DisableExceptions( ) function yDisableExceptions( ) function DisableExceptions( ) When exceptions are disabled, every function returns a specific error value which depends on its type and which is documented in this reference manual. www.yoctopuce.com...
  • Page 148 Be aware than when exceptions are enabled, every function that fails triggers an exception. If the exception is not caught by the user code, it either fires the debugger or aborts (i.e. crash) the program. On failure, throws an exception or returns a negative error code. www.yoctopuce.com...
  • Page 149 USB host port of the system. This yRegisterHub("usb") function takes as argument, an object of class android.content.Context (or any subclass). It is not necessary to call this function to reach modules through the network. Parameters : osContext an object of class android.content.Context (or any subclass). www.yoctopuce.com...
  • Page 150 20. High-level API Reference YAPI.FreeAPI() YAPI yFreeAPI() Frees dynamically allocated memory blocks used by the Yoctopuce library. function yFreeAPI( ) function FreeAPI( ) nodejs void yFreeAPI( ) +(void) FreeAPI procedure yFreeAPI( ) procedure yFreeAPI( ) void FreeAPI( ) void FreeAPI( )
  • Page 151 20. High-level API Reference YAPI.GetAPIVersion() YAPI yGetAPIVersion() Returns the version identifier for the Yoctopuce library in use. function yGetAPIVersion( ) function GetAPIVersion( ) nodejs string yGetAPIVersion( ) +(NSString*) GetAPIVersion function yGetAPIVersion( ): string function yGetAPIVersion( ) As String String GetAPIVersion( )
  • Page 152 GetTickCount( ) def GetTickCount( ) function yGetTickCount( ) function GetTickCount( ) This counter can be used to compute delays in relation with Yoctopuce devices, which also uses the millisecond as timebase. Returns : a long integer corresponding to the millisecond counter.
  • Page 153 This function may signal an error in case there is a communication problem while contacting a module. Parameters : 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...
  • Page 154 20. High-level API Reference YAPI.InitAPI() YAPI yInitAPI() Initializes the Yoctopuce programming library explicitly. function yInitAPI( mode, errmsg) function InitAPI( mode, errmsg) nodejs YRETCODE yInitAPI( int mode, string& errmsg) +(YRETCODE) InitAPI :(int) mode :(NSError**) errmsg function yInitAPI( mode: integer, var errmsg: string): integer...
  • Page 155 "usb","callback" or the root URL of the hub to monitor 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...
  • Page 156 RegisterDeviceArrivalCallback( arrivalCallback) function yRegisterDeviceArrivalCallback( $arrivalCallback) function RegisterDeviceArrivalCallback( arrivalCallback) This callback will be invoked while yUpdateDeviceList is running. You will have to call this function on a regular basis. Parameters : arrivalCallback a procedure taking a YModule parameter, or null www.yoctopuce.com...
  • Page 157 RegisterDeviceRemovalCallback( removalCallback) function yRegisterDeviceRemovalCallback( $removalCallback) function RegisterDeviceRemovalCallback( removalCallback) This callback will be invoked while yUpdateDeviceList is running. You will have to call this function on a regular basis. Parameters : removalCallback a procedure taking a YModule parameter, or null www.yoctopuce.com...
  • Page 158 API run in "HTTP Callback" mode. This a special mode allowing to take control of Yoctopuce devices through a NAT filter when using a VirtualHub or a networked YoctoHub. You only need to configure your hub to call your server script on a regular basis. This mode is currently available for PHP and Node.JS only.
  • Page 159 20. High-level API Reference On failure, throws an exception or returns a negative error code. www.yoctopuce.com...
  • Page 160 URL of the network hub (this URL can be passed to RegisterHub). This callback will be invoked while yUpdateDeviceList is running. You will have to call this function on a regular basis. Parameters : hubDiscoveryCallback a procedure taking two string parameter, or null www.yoctopuce.com...
  • Page 161 RegisterLogFunction( LogCallback logfun) java void RegisterLogFunction( LogHandler logfun) def RegisterLogFunction( logfun) This callback will be called each time the API have something to say. Quite useful to debug the API. Parameters : logfun null a procedure taking a string parameter, or www.yoctopuce.com...
  • Page 162 For in this case, it is therefore recommended to manually select the proper architecture by calling SelectArchitecture() before any other call to the library. Parameters : arch "armhf" "armel" A string containing the architecture to use. Possibles value are: "i386" "x86_64" "32bit" "64bit" Returns : nothing. On failure, throws an exception. www.yoctopuce.com...
  • Page 163 +(void) SetDelegate :(id) object The methods yDeviceArrival yDeviceRemoval will be invoked while yUpdateDeviceList is running. You will have to call this function on a regular basis. Parameters : object YAPIDelegate an object that must follow the protocol , or www.yoctopuce.com...
  • Page 164 (not supported on Microsoft Internet Explorer). Returns : YAPI_SUCCESS when the call succeeds. On failure, throws an exception or returns a negative error code. www.yoctopuce.com...
  • Page 165 USB packets. A delay of 50 milliseconds is generally enough. In case of doubt, contact Yoctopuce support. To disable USB packets acknowledge, call this function with the value 0. Note: this feature is only available on Android.
  • Page 166 This function implements a passive waiting loop, meaning that it does not consume CPU cycles significantly. The processor is left available for other threads and processes. During the pause, the library nevertheless reads from time to time information from the Yoctopuce modules by calling , in order to stay up-to-date.
  • Page 167 "usb","callback" or the root URL of the hub to monitor mstimeout the number of millisecond available to test the connection. errmsg a string passed by reference to receive any error message. Returns : YAPI_SUCCESS when the call succeeds. On failure returns a negative error code. www.yoctopuce.com...
  • Page 168 Task<int> TriggerHubDiscovery( ) def TriggerHubDiscovery( errmsg=None) Parameters : 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...
  • Page 169 20. High-level API Reference YAPI.UnregisterHub() YAPI yUnregisterHub() Setup the Yoctopuce library to no more use modules connected on a previously registered machine with RegisterHub. function yUnregisterHub( url) function UnregisterHub( url) nodejs void yUnregisterHub( const string& url) +(void) UnregisterHub :(NSString *)
  • Page 170 20. High-level API Reference YAPI.UpdateDeviceList() YAPI yUpdateDeviceList() Triggers a (re)detection of connected Yoctopuce modules. function yUpdateDeviceList( errmsg) function UpdateDeviceList( errmsg) nodejs YRETCODE yUpdateDeviceList( string& errmsg) +(YRETCODE) UpdateDeviceList :(NSError**) errmsg function yUpdateDeviceList( var errmsg: string): integer function yUpdateDeviceList( ByRef errmsg As String) As YRETCODE...
  • Page 171 20. High-level API Reference YAPI.UpdateDeviceList_async() YAPI yUpdateDeviceList_async() Triggers a (re)detection of connected Yoctopuce modules. function yUpdateDeviceList_async( callback, context) function UpdateDeviceList_async( callback, context) nodejs The library searches the machines or USB ports previously registered using , and yRegisterHub() invokes any user-defined callback function in case a change in the list of connected devices is detected.
  • Page 172: Module Control Interface

    20. High-level API Reference 20.2. Module control interface This interface is identical for all Yoctopuce USB modules. It can be used to control the module global parameters, and to enumerate the functions provided by each module. In order to use the functions described here, you should include: <script type='text/javascript' src='yocto_api.js'></script>...
  • Page 173 Returns a list of all the modules that are plugged into the current module. module→get_upTime() Returns the number of milliseconds spent since the module was powered on. module→get_url() Returns the URL used to access the module. module→get_usbCurrent() Returns the current consumed by the module on the USB bus, in milli-amps. www.yoctopuce.com...
  • Page 174 Stores a user context provided as argument in the userData attribute of the function. module→set_userVar(newval) Stores a 32 bit value in the device RAM. module→triggerFirmwareUpdate(secBeforeReboot) Schedules a module reboot into special firmware update mode. module→updateFirmware(path) Prepares a firmware update of the module. module→updateFirmwareEx(path, force) www.yoctopuce.com...
  • Page 175 20. High-level API Reference Prepares a firmware update of the module. module→wait_async(callback, context) Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function. www.yoctopuce.com...
  • Page 176 The search is performed first by hardware name, then by logical name. Parameters : func a string containing either the serial number or the logical name of the desired module Returns : YModule object allowing you to drive the module or get additional information on the module. www.yoctopuce.com...
  • Page 177 The search is performed first by hardware name, then by logical name. Parameters : yctx a YAPI context func a string that uniquely characterizes the module Returns : YModule object allowing you to drive the module. www.yoctopuce.com...
  • Page 178 ) function FirstModule( ) Use the method YModule.nextModule() to iterate on the next modules. Returns : YModule null a pointer to a object, corresponding to the first module currently online, or a pointer if there are none. www.yoctopuce.com...
  • Page 179 Returns : the path of the byn file to use or a empty string if no byn files matches the requirement On failure, throws an exception or returns a string that start with "error:". www.yoctopuce.com...
  • Page 180 ) void clearCache( ) java def clearCache( ) function clearCache( ) function clearCache( ) Invalidates the cache of the module attributes. Forces the next call to get_xxx() or loadxxx() to use values that come from the device. www.yoctopuce.com...
  • Page 181 ) String describe( ) java def describe( ) function describe( ) function describe( ) The text may include either the logical name or the serial number of the module. Returns : a string that describes the module www.yoctopuce.com...
  • Page 182 $pathname) function download( pathname) YModule target download pathname Parameters : pathname name of the new file to load Returns : a binary buffer with the file content On failure, throws an exception or returns YAPI_INVALID_STRING www.yoctopuce.com...
  • Page 183 0 for the first function. Returns : a string corresponding to the base type of the function On failure, throws an exception or returns an empty string. www.yoctopuce.com...
  • Page 184 ) As Integer int functionCount( ) int functionCount( ) java def functionCount( ) function functionCount( ) function functionCount( ) Returns : the number of functions on the module On failure, throws an exception or returns a negative error code. www.yoctopuce.com...
  • Page 185 0 for the first function. Returns : a string corresponding to the unambiguous hardware identifier of the requested module function On failure, throws an exception or returns an empty string. www.yoctopuce.com...
  • Page 186 0 for the first function. Returns : a string corresponding to the logical name of the requested module function On failure, throws an exception or returns an empty string. www.yoctopuce.com...
  • Page 187 0 for the first function. Returns : a string corresponding to the type of the function On failure, throws an exception or returns an empty string. www.yoctopuce.com...
  • Page 188 0 for the first function. Returns : a short string (up to 6 characters) corresponding to the advertised value of the requested module function On failure, throws an exception or returns an empty string. www.yoctopuce.com...
  • Page 189 Useful to backup all the logical names, calibrations parameters, and uploaded files of a device. Returns : a binary buffer with all the settings. On failure, throws an exception or returns an binary object of size 0. www.yoctopuce.com...
  • Page 190 Task<int> get_beacon( ) def get_beacon( ) function get_beacon( ) function get_beacon( ) YModule target get_beacon Returns : Y_BEACON_OFF Y_BEACON_ON either , according to the state of the localization beacon On failure, throws an exception or returns Y_BEACON_INVALID www.yoctopuce.com...
  • Page 191 ) function get_errorMessage( ) function get_errorMessage( ) This method is mostly useful when using the Yoctopuce library with exceptions disabled. Returns : a string corresponding to the latest error message that occured while using this module object www.yoctopuce.com...
  • Page 192 ) function get_errorType( ) function get_errorType( ) This method is mostly useful when using the Yoctopuce library with exceptions disabled. Returns : a number corresponding to the code of the latest error that occurred while using this module object...
  • Page 193 Task<string> get_firmwareRelease( ) def get_firmwareRelease( ) function get_firmwareRelease( ) function get_firmwareRelease( ) YModule target get_firmwareRelease Returns : a string corresponding to the version of the firmware embedded in the module On failure, throws an exception or returns Y_FIRMWARERELEASE_INVALID www.yoctopuce.com...
  • Page 194 ArrayList<String> get_functionIds( String funType) java async Task<List<string>> get_functionIds( string funType) def get_functionIds( funType) function get_functionIds( $funType) function get_functionIds( funType) YModule target get_functionIds funType Parameters : funType The type of function (Relay, LightSensor, Voltage,...) Returns : an array of strings. www.yoctopuce.com...
  • Page 195 ) String get_hardwareId( ) java def get_hardwareId( ) function get_hardwareId( ) function get_hardwareId( ) The unique hardware identifier is made of the device serial number followed by string ".module". Returns : a string that uniquely identifies the module www.yoctopuce.com...
  • Page 196 ) function get_icon2d( ) YModule target get_icon2d The icon is a PNG image and does not exceeds 1536 bytes. Returns : a binary buffer with module icon, in png format. On failure, throws an exception or returns YAPI_INVALID_STRING www.yoctopuce.com...
  • Page 197 . O n f a i l u r e , t h r o w s a n e x c e p t i o n o r r e t u r n s YAPI_INVALID_STRING www.yoctopuce.com...
  • Page 198 String get_logicalName( ) java async Task<string> get_logicalName( ) def get_logicalName( ) function get_logicalName( ) function get_logicalName( ) YModule target get_logicalName Returns : a string corresponding to the logical name of the module On failure, throws an exception or returns Y_LOGICALNAME_INVALID www.yoctopuce.com...
  • Page 199 Task<int> get_luminosity( ) def get_luminosity( ) function get_luminosity( ) function get_luminosity( ) YModule target get_luminosity Returns : an integer corresponding to the luminosity of the module informative leds (from 0 to 100) On failure, throws an exception or returns Y_LUMINOSITY_INVALID www.yoctopuce.com...
  • Page 200 ) YModule target get_parentHub If the module is connected by USB, or if the module is the root YoctoHub, an empty string is returned. Returns : a string with the serial number of the YoctoHub or an empty string www.yoctopuce.com...
  • Page 201 Task<int> get_persistentSettings( ) def get_persistentSettings( ) function get_persistentSettings( ) function get_persistentSettings( ) YModule target get_persistentSettings Returns : Y_PERSISTENTSETTINGS_LOADED Y_PERSISTENTSETTINGS_SAVED a value among Y_PERSISTENTSETTINGS_MODIFIED corresponding to the current state of persistent module settings On failure, throws an exception or returns Y_PERSISTENTSETTINGS_INVALID www.yoctopuce.com...
  • Page 202 ) java async Task<int> get_productId( ) def get_productId( ) function get_productId( ) function get_productId( ) YModule target get_productId Returns : an integer corresponding to the USB device identifier of the module On failure, throws an exception or returns Y_PRODUCTID_INVALID www.yoctopuce.com...
  • Page 203 Task<string> get_productName( ) def get_productName( ) function get_productName( ) function get_productName( ) YModule target get_productName Returns : a string corresponding to the commercial name of the module, as set by the factory On failure, throws an exception or returns Y_PRODUCTNAME_INVALID www.yoctopuce.com...
  • Page 204 ) java async Task<int> get_productRelease( ) def get_productRelease( ) function get_productRelease( ) function get_productRelease( ) YModule target get_productRelease Returns : an integer corresponding to the hardware release version of the module On failure, throws an exception or returns Y_PRODUCTRELEASE_INVALID www.yoctopuce.com...
  • Page 205 ) function get_rebootCountdown( ) YModule target get_rebootCountdown Returns : an integer corresponding to the remaining number of seconds before the module restarts, or zero when no reboot has been scheduled On failure, throws an exception or returns Y_REBOOTCOUNTDOWN_INVALID www.yoctopuce.com...
  • Page 206 Task<string> get_serialNumber( ) def get_serialNumber( ) function get_serialNumber( ) function get_serialNumber( ) YModule target get_serialNumber Returns : a string corresponding to the serial number of the module, as set by the factory On failure, throws an exception or returns Y_SERIALNUMBER_INVALID www.yoctopuce.com...
  • Page 207 ArrayList<String> get_subDevices( ) java def get_subDevices( ) function get_subDevices( ) YModule target get_subDevices This method only makes sense when called for a YoctoHub/VirtualHub. Otherwise, an empty array will be returned. Returns : an array of strings containing the sub modules. www.yoctopuce.com...
  • Page 208 Task<long> get_upTime( ) def get_upTime( ) function get_upTime( ) function get_upTime( ) YModule target get_upTime Returns : an integer corresponding to the number of milliseconds spent since the module was powered on On failure, throws an exception or returns Y_UPTIME_INVALID www.yoctopuce.com...
  • Page 209 ) As String string get_url( ) String get_url( ) java def get_url( ) function get_url( ) YModule target get_url If the module is connected by USB, the string 'usb' is returned. Returns : a string with the URL of the module. www.yoctopuce.com...
  • Page 210 Task<int> get_usbCurrent( ) def get_usbCurrent( ) function get_usbCurrent( ) function get_usbCurrent( ) YModule target get_usbCurrent Returns : an integer corresponding to the current consumed by the module on the USB bus, in milli-amps On failure, throws an exception or returns Y_USBCURRENT_INVALID www.yoctopuce.com...
  • Page 211 ) function get_userData( ) function get_userData( ) This attribute is never touched directly by the API, and is at disposal of the caller to store a context. Returns : the object stored previously by the caller. www.yoctopuce.com...
  • Page 212 ) YModule target get_userVar On startup and after a device reboot, the value is always reset to zero. Returns : an integer corresponding to the value previously stored in this attribute On failure, throws an exception or returns Y_USERVAR_INVALID www.yoctopuce.com...
  • Page 213 $funcId) function hasFunction( funcId) YModule target hasFunction funcId This method takes a function identifier and returns a boolean. Parameters : funcId the requested function identifier Returns : true if the device has the function identifier www.yoctopuce.com...
  • Page 214 If there are valid cached values for the module, that have not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the requested module. Returns : true if the module can be reached, and false otherwise www.yoctopuce.com...
  • Page 215 The callback function receives three arguments: the caller-specific context object, the receiving module object and the boolean result context caller-specific object that is passed as-is to the callback function Returns : nothing : the result is provided to the callback. www.yoctopuce.com...
  • Page 216 Parameters : msValidity an integer corresponding to the validity attributed to the loaded module parameters, in milliseconds Returns : YAPI_SUCCESS when the call succeeds. On failure, throws an exception or returns a negative error code. www.yoctopuce.com...
  • Page 217 The callback function receives three arguments: the caller-specific context object, the receiving module object and the error code YAPI_SUCCESS context caller-specific object that is passed as-is to the callback function Returns : nothing : the result is provided to the callback. www.yoctopuce.com...
  • Page 218 This function is useful in particular to trace the execution of HTTP callbacks. If a newline is desired after the message, it must be included in the string. Parameters : text the string to append to the logs. Returns : YAPI_SUCCESS if the call succeeds. On failure, throws an exception or returns a negative error code. www.yoctopuce.com...
  • Page 219 YModule nextModule( ) def nextModule( ) function nextModule( ) function nextModule( ) Returns : a pointer to a YModule object, corresponding to the next module found, or a null pointer if there are no more modules to enumerate. www.yoctopuce.com...
  • Page 220 $secBeforeReboot) function reboot( secBeforeReboot) YModule target reboot secBeforeReboot Parameters : secBeforeReboot number of seconds before rebooting Returns : YAPI_SUCCESS when the call succeeds. On failure, throws an exception or returns a negative error code. www.yoctopuce.com...
  • Page 221 This callback will be called each time that a module sends a new log message. Mostly useful to debug a Yoctopuce module. Parameters : callback the callback function to call, or a null pointer. The callback function should take two arguments: the module object that emitted the log message, and the character string containing the log.
  • Page 222 ) int revertFromFlash( ) java async Task<int> revertFromFlash( ) def revertFromFlash( ) function revertFromFlash( ) function revertFromFlash( ) YModule target revertFromFlash Returns : YAPI_SUCCESS when the call succeeds. On failure, throws an exception or returns a negative error code. www.yoctopuce.com...
  • Page 223 Warning: the number of allowed save operations during a module life is limited (about 100000 cycles). Do not call this function within a loop. Returns : YAPI_SUCCESS when the call succeeds. On failure, throws an exception or returns a negative error code. www.yoctopuce.com...
  • Page 224 Parameters : settings a binary buffer with all the settings. Returns : YAPI_SUCCESS when the call succeeds. On failure, throws an exception or returns a negative error code. www.yoctopuce.com...
  • Page 225 Parameters : settings a binary buffer with all the settings. Returns : YAPI_SUCCESS when the call succeeds. On failure, throws an exception or returns a negative error code. www.yoctopuce.com...
  • Page 226 Task<int> set_beacon( int newval) def set_beacon( newval) function set_beacon( $newval) function set_beacon( newval) YModule target set_beacon newval Parameters : newval Y_BEACON_OFF Y_BEACON_ON either Returns : YAPI_SUCCESS if the call succeeds. On failure, throws an exception or returns a negative error code. www.yoctopuce.com...
  • Page 227 Parameters : newval a string corresponding to the logical name of the module Returns : YAPI_SUCCESS if the call succeeds. On failure, throws an exception or returns a negative error code. www.yoctopuce.com...
  • Page 228 Parameters : newval an integer corresponding to the luminosity of the module informative leds Returns : YAPI_SUCCESS if the call succeeds. On failure, throws an exception or returns a negative error code. www.yoctopuce.com...
  • Page 229 $data) function set_userData( data) This attribute is never touched by the API, and is at disposal of the caller to store a context. Parameters : data any kind of object to be stored www.yoctopuce.com...
  • Page 230 This attribute is at programmer disposal, should he need to store a state variable. On startup and after a device reboot, the value is always reset to zero. Parameters : newval an integer Returns : YAPI_SUCCESS if the call succeeds. On failure, throws an exception or returns a negative error code. www.yoctopuce.com...
  • Page 231 $secBeforeReboot) function triggerFirmwareUpdate( secBeforeReboot) YModule target triggerFirmwareUpdate secBeforeReboot Parameters : secBeforeReboot number of seconds before rebooting Returns : YAPI_SUCCESS when the call succeeds. On failure, throws an exception or returns a negative error code. www.yoctopuce.com...
  • Page 232 $path) function updateFirmware( path) YModule target updateFirmware path This method returns a object which handles the firmware update process. YFirmwareUpdate Parameters : path the path of the .byn file to use. Returns : YFirmwareUpdate object or NULL on error. www.yoctopuce.com...
  • Page 233 YFirmwareUpdate Parameters : path .byn the path of the file to use. force true to force the firmware update even if some prerequisites appear not to be met Returns : YFirmwareUpdate object or NULL on error. www.yoctopuce.com...
  • Page 234 The callback function receives two arguments: the caller-specific context object and the receiving function object. context caller-specific object that is passed as-is to the callback function Returns : nothing. www.yoctopuce.com...
  • Page 235: Gps Function Interface

    <script type='text/javascript' src='yocto_gps.js'></script> var yoctolib = require('yoctolib'); nodejs var YGps = yoctolib.YGps; #include "yocto_gps.h" #import "yocto_gps.h" uses yocto_gps; yocto_gps.vb yocto_gps.cs import com.yoctopuce.YoctoAPI.YGps; java import com.yoctopuce.YoctoAPI.YGps; from yocto_gps import * require_once('yocto_gps.php'); in HTML: <script src="../../lib/yocto_gps.js"></script> in node.js: require('yoctolib-es2017/yocto_gps.js'); Global functions yFindGps(func) Retrieves a GPS for a given identifier.
  • Page 236 Preloads the GPS cache with a specified validity duration. gps→loadAttribute(attrName) Returns the current value of a single function attribute, as a text string, as quickly as possible but without using the cached value. gps→load_async(msValidity, callback, context) Preloads the GPS cache with a specified validity duration (asynchronous version). www.yoctopuce.com...
  • Page 237 Changes the number of seconds between current time and UTC time (time zone). gps→unmuteValueCallbacks() Re-enables the propagation of every new advertised value to the parent hub. gps→wait_async(callback, context) Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function. www.yoctopuce.com...
  • Page 238 In case of ambiguity when looking for a GPS by logical name, no error is notified: the first instance found is returned. The search is performed first by hardware name, then by logical name. Parameters : func a string that uniquely characterizes the GPS Returns : YGps object allowing you to drive the GPS. www.yoctopuce.com...
  • Page 239 The search is performed first by hardware name, then by logical name. Parameters : yctx a YAPI context func a string that uniquely characterizes the GPS Returns : YGps object allowing you to drive the GPS. www.yoctopuce.com...
  • Page 240 FirstGps( ) function yFirstGps( ) function FirstGps( ) Use the method YGps.nextGps() to iterate on next GPS. Returns : YGps null a pointer to a object, corresponding to the first GPS currently online, or a pointer if there are none. www.yoctopuce.com...
  • Page 241 FirstGpsInContext( yctx) Use the method YGps.nextGps() to iterate on next GPS. Parameters : yctx a YAPI context. Returns : YGps null a pointer to a object, corresponding to the first GPS currently online, or a pointer if there are none. www.yoctopuce.com...
  • Page 242 ) void clearCache( ) java def clearCache( ) function clearCache( ) function clearCache( ) Invalidates the cache of the GPS attributes. Forces the next call to get_xxx() or loadxxx() to use values that come from the device. www.yoctopuce.com...
  • Page 243 Relay(BadCustomeName.relay1)=unresolved has not yet been connected. This method does not trigger any USB or TCP transaction and can therefore be used in a debugger. Returns : Relay(MyCustomName.relay1)=RELAYLO1- a string that describes the GPS (ex: 123456.relay1 www.yoctopuce.com...
  • Page 244 Task<string> get_advertisedValue( ) def get_advertisedValue( ) function get_advertisedValue( ) function get_advertisedValue( ) YGps target get_advertisedValue Returns : a string corresponding to the current value of the GPS (no more than 6 characters). On failure, throws an exception or returns Y_ADVERTISEDVALUE_INVALID www.yoctopuce.com...
  • Page 245 ) function get_altitude( ) function get_altitude( ) YGps target get_altitude Beware: GPS technology is very inaccurate regarding altitude. Returns : a floating point number corresponding to the current altitude On failure, throws an exception or returns Y_ALTITUDE_INVALID www.yoctopuce.com...
  • Page 246 Task<int> get_coordSystem( ) def get_coordSystem( ) function get_coordSystem( ) function get_coordSystem( ) YGps target get_coordSystem Returns : Y_COORDSYSTEM_GPS_DMS Y_COORDSYSTEM_GPS_DM value among Y_COORDSYSTEM_GPS_D corresponding to the representation system used for positioning data On failure, throws an exception or returns Y_COORDSYSTEM_INVALID www.yoctopuce.com...
  • Page 247 Task<string> get_dateTime( ) def get_dateTime( ) function get_dateTime( ) function get_dateTime( ) YGps target get_dateTime Returns : a string corresponding to the current time in the form "YYYY/MM/DD hh:mm:ss" On failure, throws an exception or returns Y_DATETIME_INVALID www.yoctopuce.com...
  • Page 248 ) function get_dilution( ) function get_dilution( ) YGps target get_dilution Returns : a floating point number corresponding to the current horizontal dilution of precision, the smaller that number is, the better On failure, throws an exception or returns Y_DILUTION_INVALID www.yoctopuce.com...
  • Page 249 ) function get_direction( ) function get_direction( ) YGps target get_direction Returns : a floating point number corresponding to the current move bearing in degrees, zero is the true (geographic) north On failure, throws an exception or returns Y_DIRECTION_INVALID www.yoctopuce.com...
  • Page 250 ) function get_errorMessage( ) function get_errorMessage( ) This method is mostly useful when using the Yoctopuce library with exceptions disabled. Returns : a string corresponding to the latest error message that occured while using the GPS object www.yoctopuce.com...
  • Page 251 ) function get_errorType( ) function get_errorType( ) This method is mostly useful when using the Yoctopuce library with exceptions disabled. Returns : a number corresponding to the code of the latest error that occurred while using the GPS object...
  • Page 252 The returned string uses the logical names of the module and of the GPS if they are defined, otherwise the serial number of the module and the hardware identifier of the GPS (for example: MyCustomName.relay1 Returns : a string that uniquely identifies the GPS using logical names (ex: MyCustomName.relay1 On failure, throws an exception or returns Y_FRIENDLYNAME_INVALID www.yoctopuce.com...
  • Page 253 , t h e r e t u r n e d v a l u e Y_FUNCTIONDESCRIPTOR_INVALID www.yoctopuce.com...
  • Page 254 ) As String string get_functionId( ) String get_functionId( ) java def get_functionId( ) function get_functionId( ) function get_functionId( ) For example relay1 Returns : relay1 a string that identifies the GPS (ex: On failure, throws an exception or returns Y_FUNCTIONID_INVALID www.yoctopuce.com...
  • Page 255 Task<double> get_groundSpeed( ) def get_groundSpeed( ) function get_groundSpeed( ) function get_groundSpeed( ) YGps target get_groundSpeed Returns : a floating point number corresponding to the current ground speed in Km/h On failure, throws an exception or returns Y_GROUNDSPEED_INVALID www.yoctopuce.com...
  • Page 256 The unique hardware identifier is composed of the device serial number and of the hardware identifier of the GPS (for example RELAYLO1-123456.relay1 Returns : RELAYLO1-123456.relay1 a string that uniquely identifies the GPS (ex: On failure, throws an exception or returns Y_HARDWAREID_INVALID www.yoctopuce.com...
  • Page 257 Task<int> get_isFixed( ) def get_isFixed( ) function get_isFixed( ) function get_isFixed( ) YGps target get_isFixed Returns : Y_ISFIXED_FALSE Y_ISFIXED_TRUE either , according to TRUE if the receiver has found enough satellites to work On failure, throws an exception or returns Y_ISFIXED_INVALID www.yoctopuce.com...
  • Page 258 ) String get_latitude( ) java async Task<string> get_latitude( ) def get_latitude( ) function get_latitude( ) function get_latitude( ) YGps target get_latitude Returns : a string corresponding to the current latitude On failure, throws an exception or returns Y_LATITUDE_INVALID www.yoctopuce.com...
  • Page 259 String get_logicalName( ) java async Task<string> get_logicalName( ) def get_logicalName( ) function get_logicalName( ) function get_logicalName( ) YGps target get_logicalName Returns : a string corresponding to the logical name of the GPS. On failure, throws an exception or returns Y_LOGICALNAME_INVALID www.yoctopuce.com...
  • Page 260 ) String get_longitude( ) java async Task<string> get_longitude( ) def get_longitude( ) function get_longitude( ) function get_longitude( ) YGps target get_longitude Returns : a string corresponding to the current longitude On failure, throws an exception or returns Y_LONGITUDE_INVALID www.yoctopuce.com...
  • Page 261 YModule get_module( ) java def get_module( ) function get_module( ) function get_module( ) If the function cannot be located on any module, the returned instance of is not shown as on- YModule line. Returns : YModule an instance of www.yoctopuce.com...
  • Page 262 The callback function receives three arguments: the caller-specific context object, the receiving function object and the requested YModule object context caller-specific object that is passed as-is to the callback function Returns : nothing : the result is provided to the callback. www.yoctopuce.com...
  • Page 263 ) java async Task<long> get_satCount( ) def get_satCount( ) function get_satCount( ) function get_satCount( ) YGps target get_satCount Returns : an integer corresponding to the count of visible satellites On failure, throws an exception or returns Y_SATCOUNT_INVALID www.yoctopuce.com...
  • Page 264 ) function get_unixTime( ) function get_unixTime( ) YGps target get_unixTime Returns : an integer corresponding to the current time in Unix format (number of seconds elapsed since Jan 1st, 1970) On failure, throws an exception or returns Y_UNIXTIME_INVALID www.yoctopuce.com...
  • Page 265 ) function get_userData( ) function get_userData( ) This attribute is never touched directly by the API, and is at disposal of the caller to store a context. Returns : the object stored previously by the caller. www.yoctopuce.com...
  • Page 266 Task<int> get_utcOffset( ) def get_utcOffset( ) function get_utcOffset( ) function get_utcOffset( ) YGps target get_utcOffset Returns : an integer corresponding to the number of seconds between current time and UTC time (time zone) On failure, throws an exception or returns Y_UTCOFFSET_INVALID www.yoctopuce.com...
  • Page 267 If there is a cached value for the GPS in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the GPS. Returns : true if the GPS can be reached, and false otherwise www.yoctopuce.com...
  • Page 268 The callback function receives three arguments: the caller-specific context object, the receiving function object and the boolean result context caller-specific object that is passed as-is to the callback function Returns : nothing : the result is provided to the callback. www.yoctopuce.com...
  • Page 269 Parameters : msValidity an integer corresponding to the validity attributed to the loaded function parameters, in milliseconds Returns : YAPI_SUCCESS when the call succeeds. On failure, throws an exception or returns a negative error code. www.yoctopuce.com...
  • Page 270 $attrName) function loadAttribute( attrName) Parameters : attrName the name of the requested attribute Returns : a string with the value of the the attribute On failure, throws an exception or returns an empty string. www.yoctopuce.com...
  • Page 271 The callback function receives three arguments: the caller-specific context object, the receiving function object and the error code YAPI_SUCCESS context caller-specific object that is passed as-is to the callback function Returns : nothing : the result is provided to the callback. www.yoctopuce.com...
  • Page 272 HTTP callback. Remember to call the method saveToFlash() of the module if the modification must be kept. Returns : YAPI_SUCCESS when the call succeeds. On failure, throws an exception or returns a negative error code. www.yoctopuce.com...
  • Page 273 YGps nextGps( ) def nextGps( ) function nextGps( ) function nextGps( ) Returns : a pointer to a YGps object, corresponding to a GPS currently online, or a null pointer if there are no more GPS to enumerate. www.yoctopuce.com...
  • Page 274 To unregister a callback, pass a null pointer as argument. Parameters : callback the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and the character string describing the new advertised value. www.yoctopuce.com...
  • Page 275 Parameters : newval Y_COORDSYSTEM_GPS_DMS Y_COORDSYSTEM_GPS_DM a value among Y_COORDSYSTEM_GPS_D corresponding to the representation system used for positioning data Returns : YAPI_SUCCESS if the call succeeds. On failure, throws an exception or returns a negative error code. www.yoctopuce.com...
  • Page 276 Parameters : newval a string corresponding to the logical name of the GPS. Returns : YAPI_SUCCESS if the call succeeds. On failure, throws an exception or returns a negative error code. www.yoctopuce.com...
  • Page 277 $data) function set_userData( data) This attribute is never touched by the API, and is at disposal of the caller to store a context. Parameters : data any kind of object to be stored www.yoctopuce.com...
  • Page 278 Parameters : newval an integer corresponding to the number of seconds between current time and UTC time (time zone) Returns : YAPI_SUCCESS if the call succeeds. On failure, throws an exception or returns a negative error code. www.yoctopuce.com...
  • Page 279 This function reverts the effect of a previous call to . Remember to call the muteValueCallbacks() method of the module if the modification must be kept. saveToFlash() Returns : YAPI_SUCCESS when the call succeeds. On failure, throws an exception or returns a negative error code. www.yoctopuce.com...
  • Page 280 The callback function receives two arguments: the caller-specific context object and the receiving function object. context caller-specific object that is passed as-is to the callback function Returns : nothing. www.yoctopuce.com...
  • Page 281: Latitude Function Interface

    20. High-level API Reference 20.4. Latitude function interface The Yoctopuce class YLatitude allows you to read the latitude from Yoctopuce geolocalization sensors. It inherits from the YSensor class the core functions to read measurements, to register callback functions, to access the autonomous datalogger.
  • Page 282 Checks if the latitude sensor is currently reachable, without raising any error (asynchronous version). latitude→isSensorReady() Checks if the sensor is currently able to provide an up-to-date measure. latitude→load(msValidity) Preloads the latitude sensor cache with a specified validity duration. latitude→loadAttribute(attrName) www.yoctopuce.com...
  • Page 283 Stops the datalogger on the device. latitude→unmuteValueCallbacks() Re-enables the propagation of every new advertised value to the parent hub. latitude→wait_async(callback, context) Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function. www.yoctopuce.com...
  • Page 284 The search is performed first by hardware name, then by logical name. Parameters : func a string that uniquely characterizes the latitude sensor Returns : YLatitude object allowing you to drive the latitude sensor. www.yoctopuce.com...
  • Page 285 The search is performed first by hardware name, then by logical name. Parameters : yctx a YAPI context func a string that uniquely characterizes the latitude sensor Returns : YLatitude object allowing you to drive the latitude sensor. www.yoctopuce.com...
  • Page 286 ) function FirstLatitude( ) Use the method YLatitude.nextLatitude() to iterate on next latitude sensors. Returns : YLatitude null a pointer to a object, corresponding to the first latitude sensor currently online, or a pointer if there are none. www.yoctopuce.com...
  • Page 287 Use the method YLatitude.nextLatitude() to iterate on next latitude sensors. Parameters : yctx a YAPI context. Returns : YLatitude null a pointer to a object, corresponding to the first latitude sensor currently online, or a pointer if there are none. www.yoctopuce.com...
  • Page 288 For more information on advanced capabilities to refine the calibration of sensors, please contact support@yoctopuce.com. Parameters : rawValues array of floating point numbers, corresponding to the raw values returned by the sensor for the correction points.
  • Page 289 ) void clearCache( ) java def clearCache( ) function clearCache( ) function clearCache( ) Invalidates the cache of the latitude sensor attributes. Forces the next call to get_xxx() or loadxxx() to use values that come from the device. www.yoctopuce.com...
  • Page 290 Relay(BadCustomeName.relay1)=unresolved has not yet been connected. This method does not trigger any USB or TCP transaction and can therefore be used in a debugger. Returns : Relay(MyCustomName.relay1)=RELAYLO1- a string that describes the latitude sensor (ex: 123456.relay1 www.yoctopuce.com...
  • Page 291 Task<string> get_advertisedValue( ) def get_advertisedValue( ) function get_advertisedValue( ) function get_advertisedValue( ) YLatitude target get_advertisedValue Returns : a string corresponding to the current value of the latitude sensor (no more than 6 characters). On failure, throws an exception or returns Y_ADVERTISEDVALUE_INVALID www.yoctopuce.com...
  • Page 292 ) function get_currentRawValue( ) YLatitude target get_currentRawValue Returns : a floating point number corresponding to the uncalibrated, unrounded raw value returned by the sensor, in deg/1000, as a floating point number On failure, throws an exception or returns Y_CURRENTRAWVALUE_INVALID www.yoctopuce.com...
  • Page 293 ) function get_currentValue( ) function get_currentValue( ) YLatitude target get_currentValue Returns : a floating point number corresponding to the current value of the latitude, in deg/1000, as a floating point number On failure, throws an exception or returns Y_CURRENTVALUE_INVALID www.yoctopuce.com...
  • Page 294 ) function get_errorMessage( ) function get_errorMessage( ) This method is mostly useful when using the Yoctopuce library with exceptions disabled. Returns : a string corresponding to the latest error message that occured while using the latitude sensor object...
  • Page 295 ) function get_errorType( ) function get_errorType( ) This method is mostly useful when using the Yoctopuce library with exceptions disabled. Returns : a number corresponding to the code of the latest error that occurred while using the latitude sensor object...
  • Page 296 (for example: MyCustomName.relay1 Returns : a string that uniquely identifies the latitude sensor using logical names (ex: MyCustomName.relay1 On failure, throws an exception or returns Y_FRIENDLYNAME_INVALID www.yoctopuce.com...
  • Page 297 , t h e r e t u r n e d v a l u e Y_FUNCTIONDESCRIPTOR_INVALID www.yoctopuce.com...
  • Page 298 ) As String string get_functionId( ) String get_functionId( ) java def get_functionId( ) function get_functionId( ) function get_functionId( ) For example relay1 Returns : relay1 a string that identifies the latitude sensor (ex: On failure, throws an exception or returns Y_FUNCTIONID_INVALID www.yoctopuce.com...
  • Page 299 The unique hardware identifier is composed of the device serial number and of the hardware identifier of the latitude sensor (for example RELAYLO1-123456.relay1 Returns : RELAYLO1-123456.relay1 a string that uniquely identifies the latitude sensor (ex: On failure, throws an exception or returns Y_HARDWAREID_INVALID www.yoctopuce.com...
  • Page 300 ) function get_highestValue( ) function get_highestValue( ) YLatitude target get_highestValue Returns : a floating point number corresponding to the maximal value observed for the latitude since the device was started On failure, throws an exception or returns Y_HIGHESTVALUE_INVALID www.yoctopuce.com...
  • Page 301 ) YLatitude target get_logFrequency Returns : a string corresponding to the datalogger recording frequency for this function, or "OFF" when measures are not stored in the data logger flash memory On failure, throws an exception or returns Y_LOGFREQUENCY_INVALID www.yoctopuce.com...
  • Page 302 String get_logicalName( ) java async Task<string> get_logicalName( ) def get_logicalName( ) function get_logicalName( ) function get_logicalName( ) YLatitude target get_logicalName Returns : a string corresponding to the logical name of the latitude sensor. On failure, throws an exception or returns Y_LOGICALNAME_INVALID www.yoctopuce.com...
  • Page 303 ) function get_lowestValue( ) function get_lowestValue( ) YLatitude target get_lowestValue Returns : a floating point number corresponding to the minimal value observed for the latitude since the device was started On failure, throws an exception or returns Y_LOWESTVALUE_INVALID www.yoctopuce.com...
  • Page 304 YModule get_module( ) java def get_module( ) function get_module( ) function get_module( ) If the function cannot be located on any module, the returned instance of is not shown as on- YModule line. Returns : YModule an instance of www.yoctopuce.com...
  • Page 305 The callback function receives three arguments: the caller-specific context object, the receiving function object and the requested YModule object context caller-specific object that is passed as-is to the callback function Returns : nothing : the result is provided to the callback. www.yoctopuce.com...
  • Page 306 January 1, 1970 UTC. The special value 0 can be used to include any meaasure, without ending limit. Returns : an instance of YDataSet, providing access to historical data. Past measures can be loaded progressively using methods from the YDataSet object. www.yoctopuce.com...
  • Page 307 ) function get_reportFrequency( ) YLatitude target get_reportFrequency Returns : a string corresponding to the timed value notification frequency, or "OFF" if timed value notifications are disabled for this function On failure, throws an exception or returns Y_REPORTFREQUENCY_INVALID www.yoctopuce.com...
  • Page 308 The resolution corresponds to the numerical precision of the measures, which is not always the same as the actual precision of the sensor. Returns : a floating point number corresponding to the resolution of the measured values On failure, throws an exception or returns Y_RESOLUTION_INVALID www.yoctopuce.com...
  • Page 309 On failure, throws an exception or returns Y_SENSORSTATE_INVALID www.yoctopuce.com...
  • Page 310 String get_unit( ) java async Task<string> get_unit( ) def get_unit( ) function get_unit( ) function get_unit( ) YLatitude target get_unit Returns : a string corresponding to the measuring unit for the latitude On failure, throws an exception or returns Y_UNIT_INVALID www.yoctopuce.com...
  • Page 311 ) function get_userData( ) function get_userData( ) This attribute is never touched directly by the API, and is at disposal of the caller to store a context. Returns : the object stored previously by the caller. www.yoctopuce.com...
  • Page 312 If there is a cached value for the latitude sensor in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the latitude sensor. Returns : true if the latitude sensor can be reached, and false otherwise www.yoctopuce.com...
  • Page 313 The callback function receives three arguments: the caller-specific context object, the receiving function object and the boolean result context caller-specific object that is passed as-is to the callback function Returns : nothing : the result is provided to the callback. www.yoctopuce.com...
  • Page 314 Returns false if the device is unreachable, or if the sensor does not have a current measure to transmit. No exception is raised if there is an error while trying to contact the device hosting $THEFUNCTION$. Returns : true if the sensor can provide an up-to-date measure, and false otherwise www.yoctopuce.com...
  • Page 315 Parameters : msValidity an integer corresponding to the validity attributed to the loaded function parameters, in milliseconds Returns : YAPI_SUCCESS when the call succeeds. On failure, throws an exception or returns a negative error code. www.yoctopuce.com...
  • Page 316 $attrName) function loadAttribute( attrName) Parameters : attrName the name of the requested attribute Returns : a string with the value of the the attribute On failure, throws an exception or returns an empty string. www.yoctopuce.com...
  • Page 317 Returns : YAPI_SUCCESS if the call succeeds. On failure, throws an exception or returns a negative error code. www.yoctopuce.com...
  • Page 318 The callback function receives three arguments: the caller-specific context object, the receiving function object and the error code YAPI_SUCCESS context caller-specific object that is passed as-is to the callback function Returns : nothing : the result is provided to the callback. www.yoctopuce.com...
  • Page 319 HTTP callback. Remember to call the method saveToFlash() of the module if the modification must be kept. Returns : YAPI_SUCCESS when the call succeeds. On failure, throws an exception or returns a negative error code. www.yoctopuce.com...
  • Page 320 YLatitude nextLatitude( ) def nextLatitude( ) function nextLatitude( ) function nextLatitude( ) Returns : a pointer to a YLatitude object, corresponding to a latitude sensor currently online, or a null pointer if there are no more latitude sensors to enumerate. www.yoctopuce.com...
  • Page 321 To unregister a callback, pass a null pointer as argument. Parameters : callback the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and an YMeasure object describing the new advertised value. www.yoctopuce.com...
  • Page 322 To unregister a callback, pass a null pointer as argument. Parameters : callback the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and the character string describing the new advertised value. www.yoctopuce.com...
  • Page 323 YLatitude target set_highestValue newval Parameters : newval a floating point number corresponding to the recorded maximal value observed Returns : YAPI_SUCCESS if the call succeeds. On failure, throws an exception or returns a negative error code. www.yoctopuce.com...
  • Page 324 (eg. "4/h"). To disable recording for this function, use the value "OFF". Parameters : newval a string corresponding to the datalogger recording frequency for this function Returns : YAPI_SUCCESS if the call succeeds. On failure, throws an exception or returns a negative error code. www.yoctopuce.com...
  • Page 325 Parameters : newval a string corresponding to the logical name of the latitude sensor. Returns : YAPI_SUCCESS if the call succeeds. On failure, throws an exception or returns a negative error code. www.yoctopuce.com...
  • Page 326 YLatitude target set_lowestValue newval Parameters : newval a floating point number corresponding to the recorded minimal value observed Returns : YAPI_SUCCESS if the call succeeds. On failure, throws an exception or returns a negative error code. www.yoctopuce.com...
  • Page 327 (eg. "4/h"). To disable timed value notifications for this function, use the value "OFF". Parameters : newval a string corresponding to the timed value notification frequency for this function Returns : YAPI_SUCCESS if the call succeeds. On failure, throws an exception or returns a negative error code. www.yoctopuce.com...
  • Page 328 Parameters : newval a floating point number corresponding to the resolution of the measured physical values Returns : YAPI_SUCCESS if the call succeeds. On failure, throws an exception or returns a negative error code. www.yoctopuce.com...
  • Page 329 $data) function set_userData( data) This attribute is never touched by the API, and is at disposal of the caller to store a context. Parameters : data any kind of object to be stored www.yoctopuce.com...
  • Page 330 ) function startDataLogger( ) function startDataLogger( ) YLatitude target startDataLogger Note that the data logger will only save the measures on this sensor if the logFrequency is not set to "OFF". Returns : YAPI_SUCCESS if the call succeeds. www.yoctopuce.com...
  • Page 331 ): LongInt function stopDataLogger( ) As Integer int stopDataLogger( ) int stopDataLogger( ) java async Task<int> stopDataLogger( ) def stopDataLogger( ) function stopDataLogger( ) function stopDataLogger( ) YLatitude target stopDataLogger Returns : YAPI_SUCCESS if the call succeeds. www.yoctopuce.com...
  • Page 332 This function reverts the effect of a previous call to . Remember to call the muteValueCallbacks() method of the module if the modification must be kept. saveToFlash() Returns : YAPI_SUCCESS when the call succeeds. On failure, throws an exception or returns a negative error code. www.yoctopuce.com...
  • Page 333 The callback function receives two arguments: the caller-specific context object and the receiving function object. context caller-specific object that is passed as-is to the callback function Returns : nothing. www.yoctopuce.com...
  • Page 334: Longitude Function Interface

    20. High-level API Reference 20.5. Longitude function interface The Yoctopuce class YLongitude allows you to read the longitude from Yoctopuce geolocalization sensors. It inherits from the YSensor class the core functions to read measurements, register callback functions, access the autonomous datalogger.
  • Page 335 Checks if the longitude sensor is currently reachable, without raising any error (asynchronous version). longitude→isSensorReady() Checks if the sensor is currently able to provide an up-to-date measure. longitude→load(msValidity) Preloads the longitude sensor cache with a specified validity duration. longitude→loadAttribute(attrName) www.yoctopuce.com...
  • Page 336 Stops the datalogger on the device. longitude→unmuteValueCallbacks() Re-enables the propagation of every new advertised value to the parent hub. longitude→wait_async(callback, context) Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function. www.yoctopuce.com...
  • Page 337 The search is performed first by hardware name, then by logical name. Parameters : func a string that uniquely characterizes the longitude sensor Returns : YLongitude object allowing you to drive the longitude sensor. www.yoctopuce.com...
  • Page 338 The search is performed first by hardware name, then by logical name. Parameters : yctx a YAPI context func a string that uniquely characterizes the longitude sensor Returns : YLongitude object allowing you to drive the longitude sensor. www.yoctopuce.com...
  • Page 339 ) function FirstLongitude( ) Use the method YLongitude.nextLongitude() to iterate on next longitude sensors. Returns : YLongitude null a pointer to a object, corresponding to the first longitude sensor currently online, or a pointer if there are none. www.yoctopuce.com...
  • Page 340 Use the method YLongitude.nextLongitude() to iterate on next longitude sensors. Parameters : yctx a YAPI context. Returns : YLongitude null a pointer to a object, corresponding to the first longitude sensor currently online, or a pointer if there are none. www.yoctopuce.com...
  • Page 341 For more information on advanced capabilities to refine the calibration of sensors, please contact support@yoctopuce.com. Parameters : rawValues array of floating point numbers, corresponding to the raw values returned by the sensor for the correction points.
  • Page 342 ) void clearCache( ) java def clearCache( ) function clearCache( ) function clearCache( ) Invalidates the cache of the longitude sensor attributes. Forces the next call to get_xxx() or loadxxx() to use values that come from the device. www.yoctopuce.com...
  • Page 343 Relay(BadCustomeName.relay1)=unresolved has not yet been connected. This method does not trigger any USB or TCP transaction and can therefore be used in a debugger. Returns : Relay(MyCustomName.relay1)=RELAYLO1- a string that describes the longitude sensor (ex: 123456.relay1 www.yoctopuce.com...
  • Page 344 Task<string> get_advertisedValue( ) def get_advertisedValue( ) function get_advertisedValue( ) function get_advertisedValue( ) YLongitude target get_advertisedValue Returns : a string corresponding to the current value of the longitude sensor (no more than 6 characters). On failure, throws an exception or returns Y_ADVERTISEDVALUE_INVALID www.yoctopuce.com...
  • Page 345 ) function get_currentRawValue( ) YLongitude target get_currentRawValue Returns : a floating point number corresponding to the uncalibrated, unrounded raw value returned by the sensor, in deg/1000, as a floating point number On failure, throws an exception or returns Y_CURRENTRAWVALUE_INVALID www.yoctopuce.com...
  • Page 346 ) function get_currentValue( ) function get_currentValue( ) YLongitude target get_currentValue Returns : a floating point number corresponding to the current value of the longitude, in deg/1000, as a floating point number On failure, throws an exception or returns Y_CURRENTVALUE_INVALID www.yoctopuce.com...
  • Page 347 ) function get_errorMessage( ) function get_errorMessage( ) This method is mostly useful when using the Yoctopuce library with exceptions disabled. Returns : a string corresponding to the latest error message that occured while using the longitude sensor object...
  • Page 348 ) function get_errorType( ) function get_errorType( ) This method is mostly useful when using the Yoctopuce library with exceptions disabled. Returns : a number corresponding to the code of the latest error that occurred while using the longitude sensor object...
  • Page 349 (for example: MyCustomName.relay1 Returns : a string that uniquely identifies the longitude sensor using logical names (ex: MyCustomName.relay1 On failure, throws an exception or returns Y_FRIENDLYNAME_INVALID www.yoctopuce.com...
  • Page 350 , t h e r e t u r n e d v a l u e Y_FUNCTIONDESCRIPTOR_INVALID www.yoctopuce.com...
  • Page 351 ) As String string get_functionId( ) String get_functionId( ) java def get_functionId( ) function get_functionId( ) function get_functionId( ) For example relay1 Returns : relay1 a string that identifies the longitude sensor (ex: On failure, throws an exception or returns Y_FUNCTIONID_INVALID www.yoctopuce.com...
  • Page 352 The unique hardware identifier is composed of the device serial number and of the hardware identifier of the longitude sensor (for example RELAYLO1-123456.relay1 Returns : RELAYLO1-123456.relay1 a string that uniquely identifies the longitude sensor (ex: On failure, throws an exception or returns Y_HARDWAREID_INVALID www.yoctopuce.com...
  • Page 353 ) function get_highestValue( ) function get_highestValue( ) YLongitude target get_highestValue Returns : a floating point number corresponding to the maximal value observed for the longitude since the device was started On failure, throws an exception or returns Y_HIGHESTVALUE_INVALID www.yoctopuce.com...
  • Page 354 ) YLongitude target get_logFrequency Returns : a string corresponding to the datalogger recording frequency for this function, or "OFF" when measures are not stored in the data logger flash memory On failure, throws an exception or returns Y_LOGFREQUENCY_INVALID www.yoctopuce.com...
  • Page 355 String get_logicalName( ) java async Task<string> get_logicalName( ) def get_logicalName( ) function get_logicalName( ) function get_logicalName( ) YLongitude target get_logicalName Returns : a string corresponding to the logical name of the longitude sensor. On failure, throws an exception or returns Y_LOGICALNAME_INVALID www.yoctopuce.com...
  • Page 356 ) function get_lowestValue( ) function get_lowestValue( ) YLongitude target get_lowestValue Returns : a floating point number corresponding to the minimal value observed for the longitude since the device was started On failure, throws an exception or returns Y_LOWESTVALUE_INVALID www.yoctopuce.com...
  • Page 357 YModule get_module( ) java def get_module( ) function get_module( ) function get_module( ) If the function cannot be located on any module, the returned instance of is not shown as on- YModule line. Returns : YModule an instance of www.yoctopuce.com...
  • Page 358 The callback function receives three arguments: the caller-specific context object, the receiving function object and the requested YModule object context caller-specific object that is passed as-is to the callback function Returns : nothing : the result is provided to the callback. www.yoctopuce.com...
  • Page 359 January 1, 1970 UTC. The special value 0 can be used to include any meaasure, without ending limit. Returns : an instance of YDataSet, providing access to historical data. Past measures can be loaded progressively using methods from the YDataSet object. www.yoctopuce.com...
  • Page 360 ) function get_reportFrequency( ) YLongitude target get_reportFrequency Returns : a string corresponding to the timed value notification frequency, or "OFF" if timed value notifications are disabled for this function On failure, throws an exception or returns Y_REPORTFREQUENCY_INVALID www.yoctopuce.com...
  • Page 361 The resolution corresponds to the numerical precision of the measures, which is not always the same as the actual precision of the sensor. Returns : a floating point number corresponding to the resolution of the measured values On failure, throws an exception or returns Y_RESOLUTION_INVALID www.yoctopuce.com...
  • Page 362 On failure, throws an exception or returns Y_SENSORSTATE_INVALID www.yoctopuce.com...
  • Page 363 String get_unit( ) java async Task<string> get_unit( ) def get_unit( ) function get_unit( ) function get_unit( ) YLongitude target get_unit Returns : a string corresponding to the measuring unit for the longitude On failure, throws an exception or returns Y_UNIT_INVALID www.yoctopuce.com...
  • Page 364 ) function get_userData( ) function get_userData( ) This attribute is never touched directly by the API, and is at disposal of the caller to store a context. Returns : the object stored previously by the caller. www.yoctopuce.com...
  • Page 365 If there is a cached value for the longitude sensor in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the longitude sensor. Returns : true if the longitude sensor can be reached, and false otherwise www.yoctopuce.com...
  • Page 366 The callback function receives three arguments: the caller-specific context object, the receiving function object and the boolean result context caller-specific object that is passed as-is to the callback function Returns : nothing : the result is provided to the callback. www.yoctopuce.com...
  • Page 367 Returns false if the device is unreachable, or if the sensor does not have a current measure to transmit. No exception is raised if there is an error while trying to contact the device hosting $THEFUNCTION$. Returns : true if the sensor can provide an up-to-date measure, and false otherwise www.yoctopuce.com...
  • Page 368 Parameters : msValidity an integer corresponding to the validity attributed to the loaded function parameters, in milliseconds Returns : YAPI_SUCCESS when the call succeeds. On failure, throws an exception or returns a negative error code. www.yoctopuce.com...
  • Page 369 $attrName) function loadAttribute( attrName) Parameters : attrName the name of the requested attribute Returns : a string with the value of the the attribute On failure, throws an exception or returns an empty string. www.yoctopuce.com...
  • Page 370 Returns : YAPI_SUCCESS if the call succeeds. On failure, throws an exception or returns a negative error code. www.yoctopuce.com...
  • Page 371 The callback function receives three arguments: the caller-specific context object, the receiving function object and the error code YAPI_SUCCESS context caller-specific object that is passed as-is to the callback function Returns : nothing : the result is provided to the callback. www.yoctopuce.com...
  • Page 372 HTTP callback. Remember to call the method saveToFlash() of the module if the modification must be kept. Returns : YAPI_SUCCESS when the call succeeds. On failure, throws an exception or returns a negative error code. www.yoctopuce.com...
  • Page 373 YLongitude nextLongitude( ) def nextLongitude( ) function nextLongitude( ) function nextLongitude( ) Returns : a pointer to a YLongitude object, corresponding to a longitude sensor currently online, or a null pointer if there are no more longitude sensors to enumerate. www.yoctopuce.com...
  • Page 374 To unregister a callback, pass a null pointer as argument. Parameters : callback the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and an YMeasure object describing the new advertised value. www.yoctopuce.com...
  • Page 375 To unregister a callback, pass a null pointer as argument. Parameters : callback the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and the character string describing the new advertised value. www.yoctopuce.com...
  • Page 376 YLongitude target set_highestValue newval Parameters : newval a floating point number corresponding to the recorded maximal value observed Returns : YAPI_SUCCESS if the call succeeds. On failure, throws an exception or returns a negative error code. www.yoctopuce.com...
  • Page 377 (eg. "4/h"). To disable recording for this function, use the value "OFF". Parameters : newval a string corresponding to the datalogger recording frequency for this function Returns : YAPI_SUCCESS if the call succeeds. On failure, throws an exception or returns a negative error code. www.yoctopuce.com...
  • Page 378 Parameters : newval a string corresponding to the logical name of the longitude sensor. Returns : YAPI_SUCCESS if the call succeeds. On failure, throws an exception or returns a negative error code. www.yoctopuce.com...
  • Page 379 YLongitude target set_lowestValue newval Parameters : newval a floating point number corresponding to the recorded minimal value observed Returns : YAPI_SUCCESS if the call succeeds. On failure, throws an exception or returns a negative error code. www.yoctopuce.com...
  • Page 380 (eg. "4/h"). To disable timed value notifications for this function, use the value "OFF". Parameters : newval a string corresponding to the timed value notification frequency for this function Returns : YAPI_SUCCESS if the call succeeds. On failure, throws an exception or returns a negative error code. www.yoctopuce.com...
  • Page 381 Parameters : newval a floating point number corresponding to the resolution of the measured physical values Returns : YAPI_SUCCESS if the call succeeds. On failure, throws an exception or returns a negative error code. www.yoctopuce.com...
  • Page 382 $data) function set_userData( data) This attribute is never touched by the API, and is at disposal of the caller to store a context. Parameters : data any kind of object to be stored www.yoctopuce.com...
  • Page 383 ) function startDataLogger( ) function startDataLogger( ) YLongitude target startDataLogger Note that the data logger will only save the measures on this sensor if the logFrequency is not set to "OFF". Returns : YAPI_SUCCESS if the call succeeds. www.yoctopuce.com...
  • Page 384 ): LongInt function stopDataLogger( ) As Integer int stopDataLogger( ) int stopDataLogger( ) java async Task<int> stopDataLogger( ) def stopDataLogger( ) function stopDataLogger( ) function stopDataLogger( ) YLongitude target stopDataLogger Returns : YAPI_SUCCESS if the call succeeds. www.yoctopuce.com...
  • Page 385 This function reverts the effect of a previous call to . Remember to call the muteValueCallbacks() method of the module if the modification must be kept. saveToFlash() Returns : YAPI_SUCCESS when the call succeeds. On failure, throws an exception or returns a negative error code. www.yoctopuce.com...
  • Page 386 The callback function receives two arguments: the caller-specific context object and the receiving function object. context caller-specific object that is passed as-is to the callback function Returns : nothing. www.yoctopuce.com...
  • Page 387: Altitude Function Interface

    20. High-level API Reference 20.6. Altitude function interface The Yoctopuce class YAltitude allows you to read and configure Yoctopuce altitude sensors. It inherits from the YSensor class the core functions to read measurements, to register callback functions, to access the autonomous datalogger. This class adds the ability to configure the barometric pressure adjusted to sea level (QNH) for barometric sensors.
  • Page 388 Returns the value of the userData attribute, as previously stored using method set_userData altitude→isOnline() Checks if the altimeter is currently reachable, without raising any error. altitude→isOnline_async(callback, context) Checks if the altimeter is currently reachable, without raising any error (asynchronous version). altitude→isSensorReady() www.yoctopuce.com...
  • Page 389 Stops the datalogger on the device. altitude→unmuteValueCallbacks() Re-enables the propagation of every new advertised value to the parent hub. altitude→wait_async(callback, context) Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function. www.yoctopuce.com...
  • Page 390 In case of ambiguity when looking for an altimeter by logical name, no error is notified: the first instance found is returned. The search is performed first by hardware name, then by logical name. Parameters : func a string that uniquely characterizes the altimeter Returns : YAltitude object allowing you to drive the altimeter. www.yoctopuce.com...
  • Page 391 The search is performed first by hardware name, then by logical name. Parameters : yctx a YAPI context func a string that uniquely characterizes the altimeter Returns : YAltitude object allowing you to drive the altimeter. www.yoctopuce.com...
  • Page 392 FirstAltitude( ) function yFirstAltitude( ) function FirstAltitude( ) Use the method YAltitude.nextAltitude() to iterate on next altimeters. Returns : YAltitude null a pointer to a object, corresponding to the first altimeter currently online, or a pointer if there are none. www.yoctopuce.com...
  • Page 393 FirstAltitudeInContext( yctx) Use the method YAltitude.nextAltitude() to iterate on next altimeters. Parameters : yctx a YAPI context. Returns : YAltitude null a pointer to a object, corresponding to the first altimeter currently online, or a pointer if there are none. www.yoctopuce.com...
  • Page 394 For more information on advanced capabilities to refine the calibration of sensors, please contact support@yoctopuce.com. Parameters : rawValues array of floating point numbers, corresponding to the raw values returned by the sensor for the correction points.
  • Page 395 ) void clearCache( ) java def clearCache( ) function clearCache( ) function clearCache( ) Invalidates the cache of the altimeter attributes. Forces the next call to get_xxx() or loadxxx() to use values that come from the device. www.yoctopuce.com...
  • Page 396 Relay(BadCustomeName.relay1)=unresolved has not yet been connected. This method does not trigger any USB or TCP transaction and can therefore be used in a debugger. Returns : Relay(MyCustomName.relay1)=RELAYLO1- a string that describes the altimeter (ex: 123456.relay1 www.yoctopuce.com...
  • Page 397 Task<string> get_advertisedValue( ) def get_advertisedValue( ) function get_advertisedValue( ) function get_advertisedValue( ) YAltitude target get_advertisedValue Returns : a string corresponding to the current value of the altimeter (no more than 6 characters). On failure, throws an exception or returns Y_ADVERTISEDVALUE_INVALID www.yoctopuce.com...
  • Page 398 ) function get_currentRawValue( ) YAltitude target get_currentRawValue Returns : a floating point number corresponding to the uncalibrated, unrounded raw value returned by the sensor, in meters, as a floating point number On failure, throws an exception or returns Y_CURRENTRAWVALUE_INVALID www.yoctopuce.com...
  • Page 399 ) function get_currentValue( ) function get_currentValue( ) YAltitude target get_currentValue Returns : a floating point number corresponding to the current value of the altitude, in meters, as a floating point number On failure, throws an exception or returns Y_CURRENTVALUE_INVALID www.yoctopuce.com...
  • Page 400 ) function get_errorMessage( ) function get_errorMessage( ) This method is mostly useful when using the Yoctopuce library with exceptions disabled. Returns : a string corresponding to the latest error message that occured while using the altimeter object www.yoctopuce.com...
  • Page 401 ) function get_errorType( ) function get_errorType( ) This method is mostly useful when using the Yoctopuce library with exceptions disabled. Returns : a number corresponding to the code of the latest error that occurred while using the altimeter object...
  • Page 402 (for example: MyCustomName.relay1 Returns : a string that uniquely identifies the altimeter using logical names (ex: MyCustomName.relay1 On failure, throws an exception or returns Y_FRIENDLYNAME_INVALID www.yoctopuce.com...
  • Page 403 , t h e r e t u r n e d v a l u e Y_FUNCTIONDESCRIPTOR_INVALID www.yoctopuce.com...
  • Page 404 ) As String string get_functionId( ) String get_functionId( ) java def get_functionId( ) function get_functionId( ) function get_functionId( ) For example relay1 Returns : relay1 a string that identifies the altimeter (ex: On failure, throws an exception or returns Y_FUNCTIONID_INVALID www.yoctopuce.com...
  • Page 405 The unique hardware identifier is composed of the device serial number and of the hardware identifier of the altimeter (for example RELAYLO1-123456.relay1 Returns : RELAYLO1-123456.relay1 a string that uniquely identifies the altimeter (ex: On failure, throws an exception or returns Y_HARDWAREID_INVALID www.yoctopuce.com...
  • Page 406 ) function get_highestValue( ) function get_highestValue( ) YAltitude target get_highestValue Returns : a floating point number corresponding to the maximal value observed for the altitude since the device was started On failure, throws an exception or returns Y_HIGHESTVALUE_INVALID www.yoctopuce.com...
  • Page 407 ) YAltitude target get_logFrequency Returns : a string corresponding to the datalogger recording frequency for this function, or "OFF" when measures are not stored in the data logger flash memory On failure, throws an exception or returns Y_LOGFREQUENCY_INVALID www.yoctopuce.com...
  • Page 408 String get_logicalName( ) java async Task<string> get_logicalName( ) def get_logicalName( ) function get_logicalName( ) function get_logicalName( ) YAltitude target get_logicalName Returns : a string corresponding to the logical name of the altimeter. On failure, throws an exception or returns Y_LOGICALNAME_INVALID www.yoctopuce.com...
  • Page 409 ) function get_lowestValue( ) function get_lowestValue( ) YAltitude target get_lowestValue Returns : a floating point number corresponding to the minimal value observed for the altitude since the device was started On failure, throws an exception or returns Y_LOWESTVALUE_INVALID www.yoctopuce.com...
  • Page 410 YModule get_module( ) java def get_module( ) function get_module( ) function get_module( ) If the function cannot be located on any module, the returned instance of is not shown as on- YModule line. Returns : YModule an instance of www.yoctopuce.com...
  • Page 411 The callback function receives three arguments: the caller-specific context object, the receiving function object and the requested YModule object context caller-specific object that is passed as-is to the callback function Returns : nothing : the result is provided to the callback. www.yoctopuce.com...
  • Page 412 ) function get_qnh( ) function get_qnh( ) YAltitude target get_qnh Returns : a floating point number corresponding to the barometric pressure adjusted to sea level used to compute the altitude (QNH) On failure, throws an exception or returns Y_QNH_INVALID www.yoctopuce.com...
  • Page 413 January 1, 1970 UTC. The special value 0 can be used to include any meaasure, without ending limit. Returns : an instance of YDataSet, providing access to historical data. Past measures can be loaded progressively using methods from the YDataSet object. www.yoctopuce.com...
  • Page 414 ) function get_reportFrequency( ) YAltitude target get_reportFrequency Returns : a string corresponding to the timed value notification frequency, or "OFF" if timed value notifications are disabled for this function On failure, throws an exception or returns Y_REPORTFREQUENCY_INVALID www.yoctopuce.com...
  • Page 415 The resolution corresponds to the numerical precision of the measures, which is not always the same as the actual precision of the sensor. Returns : a floating point number corresponding to the resolution of the measured values On failure, throws an exception or returns Y_RESOLUTION_INVALID www.yoctopuce.com...
  • Page 416 On failure, throws an exception or returns Y_SENSORSTATE_INVALID www.yoctopuce.com...
  • Page 417 ) function get_technology( ) function get_technology( ) YAltitude target get_technology Possibles values are "barometric" and "gps" Returns : a string corresponding to the technology used by the sesnor to compute altitude On failure, throws an exception or returns Y_TECHNOLOGY_INVALID www.yoctopuce.com...
  • Page 418 String get_unit( ) java async Task<string> get_unit( ) def get_unit( ) function get_unit( ) function get_unit( ) YAltitude target get_unit Returns : a string corresponding to the measuring unit for the altitude On failure, throws an exception or returns Y_UNIT_INVALID www.yoctopuce.com...
  • Page 419 ) function get_userData( ) function get_userData( ) This attribute is never touched directly by the API, and is at disposal of the caller to store a context. Returns : the object stored previously by the caller. www.yoctopuce.com...
  • Page 420 If there is a cached value for the altimeter in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the altimeter. Returns : true if the altimeter can be reached, and false otherwise www.yoctopuce.com...
  • Page 421 The callback function receives three arguments: the caller-specific context object, the receiving function object and the boolean result context caller-specific object that is passed as-is to the callback function Returns : nothing : the result is provided to the callback. www.yoctopuce.com...
  • Page 422 Returns false if the device is unreachable, or if the sensor does not have a current measure to transmit. No exception is raised if there is an error while trying to contact the device hosting $THEFUNCTION$. Returns : true if the sensor can provide an up-to-date measure, and false otherwise www.yoctopuce.com...
  • Page 423 Parameters : msValidity an integer corresponding to the validity attributed to the loaded function parameters, in milliseconds Returns : YAPI_SUCCESS when the call succeeds. On failure, throws an exception or returns a negative error code. www.yoctopuce.com...
  • Page 424 $attrName) function loadAttribute( attrName) Parameters : attrName the name of the requested attribute Returns : a string with the value of the the attribute On failure, throws an exception or returns an empty string. www.yoctopuce.com...
  • Page 425 Returns : YAPI_SUCCESS if the call succeeds. On failure, throws an exception or returns a negative error code. www.yoctopuce.com...
  • Page 426 The callback function receives three arguments: the caller-specific context object, the receiving function object and the error code YAPI_SUCCESS context caller-specific object that is passed as-is to the callback function Returns : nothing : the result is provided to the callback. www.yoctopuce.com...
  • Page 427 HTTP callback. Remember to call the method saveToFlash() of the module if the modification must be kept. Returns : YAPI_SUCCESS when the call succeeds. On failure, throws an exception or returns a negative error code. www.yoctopuce.com...
  • Page 428 YAltitude nextAltitude( ) def nextAltitude( ) function nextAltitude( ) function nextAltitude( ) Returns : a pointer to a YAltitude object, corresponding to an altimeter currently online, or a null pointer if there are no more altimeters to enumerate. www.yoctopuce.com...
  • Page 429 To unregister a callback, pass a null pointer as argument. Parameters : callback the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and an YMeasure object describing the new advertised value. www.yoctopuce.com...
  • Page 430 To unregister a callback, pass a null pointer as argument. Parameters : callback the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and the character string describing the new advertised value. www.yoctopuce.com...
  • Page 431 This allows to compensate for ambient pressure variations and to work in relative mode. Parameters : newval a floating point number corresponding to the current estimated altitude Returns : YAPI_SUCCESS if the call succeeds. On failure, throws an exception or returns a negative error code. www.yoctopuce.com...
  • Page 432 YAltitude target set_highestValue newval Parameters : newval a floating point number corresponding to the recorded maximal value observed Returns : YAPI_SUCCESS if the call succeeds. On failure, throws an exception or returns a negative error code. www.yoctopuce.com...
  • Page 433 (eg. "4/h"). To disable recording for this function, use the value "OFF". Parameters : newval a string corresponding to the datalogger recording frequency for this function Returns : YAPI_SUCCESS if the call succeeds. On failure, throws an exception or returns a negative error code. www.yoctopuce.com...
  • Page 434 Parameters : newval a string corresponding to the logical name of the altimeter. Returns : YAPI_SUCCESS if the call succeeds. On failure, throws an exception or returns a negative error code. www.yoctopuce.com...
  • Page 435 YAltitude target set_lowestValue newval Parameters : newval a floating point number corresponding to the recorded minimal value observed Returns : YAPI_SUCCESS if the call succeeds. On failure, throws an exception or returns a negative error code. www.yoctopuce.com...
  • Page 436 Parameters : newval a floating point number corresponding to the barometric pressure adjusted to sea level used to compute the altitude (QNH) Returns : YAPI_SUCCESS if the call succeeds. On failure, throws an exception or returns a negative error code. www.yoctopuce.com...
  • Page 437 (eg. "4/h"). To disable timed value notifications for this function, use the value "OFF". Parameters : newval a string corresponding to the timed value notification frequency for this function Returns : YAPI_SUCCESS if the call succeeds. On failure, throws an exception or returns a negative error code. www.yoctopuce.com...
  • Page 438 Parameters : newval a floating point number corresponding to the resolution of the measured physical values Returns : YAPI_SUCCESS if the call succeeds. On failure, throws an exception or returns a negative error code. www.yoctopuce.com...
  • Page 439 $data) function set_userData( data) This attribute is never touched by the API, and is at disposal of the caller to store a context. Parameters : data any kind of object to be stored www.yoctopuce.com...
  • Page 440 ) function startDataLogger( ) function startDataLogger( ) YAltitude target startDataLogger Note that the data logger will only save the measures on this sensor if the logFrequency is not set to "OFF". Returns : YAPI_SUCCESS if the call succeeds. www.yoctopuce.com...
  • Page 441 ): LongInt function stopDataLogger( ) As Integer int stopDataLogger( ) int stopDataLogger( ) java async Task<int> stopDataLogger( ) def stopDataLogger( ) function stopDataLogger( ) function stopDataLogger( ) YAltitude target stopDataLogger Returns : YAPI_SUCCESS if the call succeeds. www.yoctopuce.com...
  • Page 442 This function reverts the effect of a previous call to . Remember to call the muteValueCallbacks() method of the module if the modification must be kept. saveToFlash() Returns : YAPI_SUCCESS when the call succeeds. On failure, throws an exception or returns a negative error code. www.yoctopuce.com...
  • Page 443 The callback function receives two arguments: the caller-specific context object and the receiving function object. context caller-specific object that is passed as-is to the callback function Returns : nothing. www.yoctopuce.com...
  • Page 444: Groundspeed Function Interface

    20. High-level API Reference 20.7. GroundSpeed function interface The Yoctopuce class YGroundSpeed allows you to read the ground speed from Yoctopuce geolocalization sensors. It inherits from the YSensor class the core functions to read measurements, register callback functions, access the autonomous datalogger.
  • Page 445 Checks if the ground speed sensor is currently reachable, without raising any error (asynchronous version). groundspeed→isSensorReady() Checks if the sensor is currently able to provide an up-to-date measure. groundspeed→load(msValidity) Preloads the ground speed sensor cache with a specified validity duration. groundspeed→loadAttribute(attrName) www.yoctopuce.com...
  • Page 446 Stops the datalogger on the device. groundspeed→unmuteValueCallbacks() Re-enables the propagation of every new advertised value to the parent hub. groundspeed→wait_async(callback, context) Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function. www.yoctopuce.com...
  • Page 447 The search is performed first by hardware name, then by logical name. Parameters : func a string that uniquely characterizes the ground speed sensor Returns : YGroundSpeed object allowing you to drive the ground speed sensor. www.yoctopuce.com...
  • Page 448 The search is performed first by hardware name, then by logical name. Parameters : yctx a YAPI context func a string that uniquely characterizes the ground speed sensor Returns : YGroundSpeed object allowing you to drive the ground speed sensor. www.yoctopuce.com...
  • Page 449 ) function FirstGroundSpeed( ) Use the method YGroundSpeed.nextGroundSpeed() to iterate on next ground speed sensors. Returns : YGroundSpeed a pointer to a object, corresponding to the first ground speed sensor currently online, or null pointer if there are none. www.yoctopuce.com...
  • Page 450 Use the method YGroundSpeed.nextGroundSpeed() to iterate on next ground speed sensors. Parameters : yctx a YAPI context. Returns : YGroundSpeed a pointer to a object, corresponding to the first ground speed sensor currently online, or null pointer if there are none. www.yoctopuce.com...
  • Page 451 For more information on advanced capabilities to refine the calibration of sensors, please contact support@yoctopuce.com. Parameters : rawValues array of floating point numbers, corresponding to the raw values returned by the sensor for the correction points.
  • Page 452 ) void clearCache( ) java def clearCache( ) function clearCache( ) function clearCache( ) Invalidates the cache of the ground speed sensor attributes. Forces the next call to get_xxx() or loadxxx() to use values that come from the device. www.yoctopuce.com...
  • Page 453 ( e x : Relay(MyCustomName.relay1)=RELAYLO1-123456.relay1 www.yoctopuce.com...
  • Page 454 ) function get_advertisedValue( ) function get_advertisedValue( ) YGroundSpeed target get_advertisedValue Returns : a string corresponding to the current value of the ground speed sensor (no more than 6 characters). On failure, throws an exception or returns Y_ADVERTISEDVALUE_INVALID www.yoctopuce.com...
  • Page 455 ) function get_currentRawValue( ) YGroundSpeed target get_currentRawValue Returns : a floating point number corresponding to the uncalibrated, unrounded raw value returned by the sensor, in km/h, as a floating point number On failure, throws an exception or returns Y_CURRENTRAWVALUE_INVALID www.yoctopuce.com...
  • Page 456 ) function get_currentValue( ) YGroundSpeed target get_currentValue Returns : a floating point number corresponding to the current value of the ground speed, in km/h, as a floating point number On failure, throws an exception or returns Y_CURRENTVALUE_INVALID www.yoctopuce.com...
  • Page 457 ) function get_errorMessage( ) function get_errorMessage( ) This method is mostly useful when using the Yoctopuce library with exceptions disabled. Returns : a string corresponding to the latest error message that occured while using the ground speed sensor object...
  • Page 458 ) function get_errorType( ) function get_errorType( ) This method is mostly useful when using the Yoctopuce library with exceptions disabled. Returns : a number corresponding to the code of the latest error that occurred while using the ground speed sensor object www.yoctopuce.com...
  • Page 459 (for example: MyCustomName.relay1 Returns : a string that uniquely identifies the ground speed sensor using logical names (ex: MyCustomName.relay1 On failure, throws an exception or returns Y_FRIENDLYNAME_INVALID www.yoctopuce.com...
  • Page 460 , t h e r e t u r n e d v a l u e Y_FUNCTIONDESCRIPTOR_INVALID www.yoctopuce.com...
  • Page 461 ) String get_functionId( ) java def get_functionId( ) function get_functionId( ) function get_functionId( ) For example relay1 Returns : relay1 a string that identifies the ground speed sensor (ex: On failure, throws an exception or returns Y_FUNCTIONID_INVALID www.yoctopuce.com...
  • Page 462 The unique hardware identifier is composed of the device serial number and of the hardware identifier of the ground speed sensor (for example RELAYLO1-123456.relay1 Returns : a string that uniquely identifies the ground speed sensor (ex: RELAYLO1-123456.relay1 On failure, throws an exception or returns Y_HARDWAREID_INVALID www.yoctopuce.com...
  • Page 463 ) function get_highestValue( ) function get_highestValue( ) YGroundSpeed target get_highestValue Returns : a floating point number corresponding to the maximal value observed for the ground speed since the device was started On failure, throws an exception or returns Y_HIGHESTVALUE_INVALID www.yoctopuce.com...
  • Page 464 ) YGroundSpeed target get_logFrequency Returns : a string corresponding to the datalogger recording frequency for this function, or "OFF" when measures are not stored in the data logger flash memory On failure, throws an exception or returns Y_LOGFREQUENCY_INVALID www.yoctopuce.com...
  • Page 465 Task<string> get_logicalName( ) def get_logicalName( ) function get_logicalName( ) function get_logicalName( ) YGroundSpeed target get_logicalName Returns : a string corresponding to the logical name of the ground speed sensor. On failure, throws an exception or returns Y_LOGICALNAME_INVALID www.yoctopuce.com...
  • Page 466 ) function get_lowestValue( ) function get_lowestValue( ) YGroundSpeed target get_lowestValue Returns : a floating point number corresponding to the minimal value observed for the ground speed since the device was started On failure, throws an exception or returns Y_LOWESTVALUE_INVALID www.yoctopuce.com...
  • Page 467 YModule get_module( ) java def get_module( ) function get_module( ) function get_module( ) If the function cannot be located on any module, the returned instance of is not shown as on- YModule line. Returns : YModule an instance of www.yoctopuce.com...
  • Page 468 The callback function receives three arguments: the caller-specific context object, the receiving function object and the requested YModule object context caller-specific object that is passed as-is to the callback function Returns : nothing : the result is provided to the callback. www.yoctopuce.com...
  • Page 469 January 1, 1970 UTC. The special value 0 can be used to include any meaasure, without ending limit. Returns : an instance of YDataSet, providing access to historical data. Past measures can be loaded progressively using methods from the YDataSet object. www.yoctopuce.com...
  • Page 470 ) function get_reportFrequency( ) YGroundSpeed target get_reportFrequency Returns : a string corresponding to the timed value notification frequency, or "OFF" if timed value notifications are disabled for this function On failure, throws an exception or returns Y_REPORTFREQUENCY_INVALID www.yoctopuce.com...
  • Page 471 The resolution corresponds to the numerical precision of the measures, which is not always the same as the actual precision of the sensor. Returns : a floating point number corresponding to the resolution of the measured values On failure, throws an exception or returns Y_RESOLUTION_INVALID www.yoctopuce.com...
  • Page 472 On failure, throws an exception or returns Y_SENSORSTATE_INVALID www.yoctopuce.com...
  • Page 473 String get_unit( ) java async Task<string> get_unit( ) def get_unit( ) function get_unit( ) function get_unit( ) YGroundSpeed target get_unit Returns : a string corresponding to the measuring unit for the ground speed On failure, throws an exception or returns Y_UNIT_INVALID www.yoctopuce.com...
  • Page 474 ) function get_userData( ) function get_userData( ) This attribute is never touched directly by the API, and is at disposal of the caller to store a context. Returns : the object stored previously by the caller. www.yoctopuce.com...
  • Page 475 If there is a cached value for the ground speed sensor in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the ground speed sensor. Returns : true if the ground speed sensor can be reached, and false otherwise www.yoctopuce.com...
  • Page 476 The callback function receives three arguments: the caller-specific context object, the receiving function object and the boolean result context caller-specific object that is passed as-is to the callback function Returns : nothing : the result is provided to the callback. www.yoctopuce.com...
  • Page 477 Returns false if the device is unreachable, or if the sensor does not have a current measure to transmit. No exception is raised if there is an error while trying to contact the device hosting $THEFUNCTION$. Returns : true if the sensor can provide an up-to-date measure, and false otherwise www.yoctopuce.com...
  • Page 478 Parameters : msValidity an integer corresponding to the validity attributed to the loaded function parameters, in milliseconds Returns : YAPI_SUCCESS when the call succeeds. On failure, throws an exception or returns a negative error code. www.yoctopuce.com...
  • Page 479 $attrName) function loadAttribute( attrName) Parameters : attrName the name of the requested attribute Returns : a string with the value of the the attribute On failure, throws an exception or returns an empty string. www.yoctopuce.com...
  • Page 480 Returns : YAPI_SUCCESS if the call succeeds. On failure, throws an exception or returns a negative error code. www.yoctopuce.com...
  • Page 481 The callback function receives three arguments: the caller-specific context object, the receiving function object and the error code YAPI_SUCCESS context caller-specific object that is passed as-is to the callback function Returns : nothing : the result is provided to the callback. www.yoctopuce.com...
  • Page 482 HTTP callback. Remember to call the method saveToFlash() of the module if the modification must be kept. Returns : YAPI_SUCCESS when the call succeeds. On failure, throws an exception or returns a negative error code. www.yoctopuce.com...
  • Page 483 ) function nextGroundSpeed( ) function nextGroundSpeed( ) Returns : a pointer to a YGroundSpeed object, corresponding to a ground speed sensor currently online, or a null pointer if there are no more ground speed sensors to enumerate. www.yoctopuce.com...
  • Page 484 To unregister a callback, pass a null pointer as argument. Parameters : callback the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and an YMeasure object describing the new advertised value. www.yoctopuce.com...
  • Page 485 To unregister a callback, pass a null pointer as argument. Parameters : callback the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and the character string describing the new advertised value. www.yoctopuce.com...
  • Page 486 YGroundSpeed target set_highestValue newval Parameters : newval a floating point number corresponding to the recorded maximal value observed Returns : YAPI_SUCCESS if the call succeeds. On failure, throws an exception or returns a negative error code. www.yoctopuce.com...
  • Page 487 (eg. "4/h"). To disable recording for this function, use the value "OFF". Parameters : newval a string corresponding to the datalogger recording frequency for this function Returns : YAPI_SUCCESS if the call succeeds. On failure, throws an exception or returns a negative error code. www.yoctopuce.com...
  • Page 488 Parameters : newval a string corresponding to the logical name of the ground speed sensor. Returns : YAPI_SUCCESS if the call succeeds. On failure, throws an exception or returns a negative error code. www.yoctopuce.com...
  • Page 489 YGroundSpeed target set_lowestValue newval Parameters : newval a floating point number corresponding to the recorded minimal value observed Returns : YAPI_SUCCESS if the call succeeds. On failure, throws an exception or returns a negative error code. www.yoctopuce.com...
  • Page 490 (eg. "4/h"). To disable timed value notifications for this function, use the value "OFF". Parameters : newval a string corresponding to the timed value notification frequency for this function Returns : YAPI_SUCCESS if the call succeeds. On failure, throws an exception or returns a negative error code. www.yoctopuce.com...
  • Page 491 Parameters : newval a floating point number corresponding to the resolution of the measured physical values Returns : YAPI_SUCCESS if the call succeeds. On failure, throws an exception or returns a negative error code. www.yoctopuce.com...
  • Page 492 $data) function set_userData( data) This attribute is never touched by the API, and is at disposal of the caller to store a context. Parameters : data any kind of object to be stored www.yoctopuce.com...
  • Page 493 ) function startDataLogger( ) function startDataLogger( ) YGroundSpeed target startDataLogger Note that the data logger will only save the measures on this sensor if the logFrequency is not set to "OFF". Returns : YAPI_SUCCESS if the call succeeds. www.yoctopuce.com...
  • Page 494 ): LongInt function stopDataLogger( ) As Integer int stopDataLogger( ) int stopDataLogger( ) java async Task<int> stopDataLogger( ) def stopDataLogger( ) function stopDataLogger( ) function stopDataLogger( ) YGroundSpeed target stopDataLogger Returns : YAPI_SUCCESS if the call succeeds. www.yoctopuce.com...
  • Page 495 This function reverts the effect of a previous call to . Remember to call the muteValueCallbacks() method of the module if the modification must be kept. saveToFlash() Returns : YAPI_SUCCESS when the call succeeds. On failure, throws an exception or returns a negative error code. www.yoctopuce.com...
  • Page 496 The callback function receives two arguments: the caller-specific context object and the receiving function object. context caller-specific object that is passed as-is to the callback function Returns : nothing. www.yoctopuce.com...
  • Page 497: Datalogger Function Interface

    20. High-level API Reference 20.8. DataLogger function interface Yoctopuce sensors include a non-volatile memory capable of storing ongoing measured data automatically, without requiring a permanent connection to a computer. The DataLogger function controls the global parameters of the internal data logger.
  • Page 498 Preloads the data logger cache with a specified validity duration (asynchronous version). datalogger→muteValueCallbacks() Disables the propagation of every new advertised value to the parent hub. datalogger→nextDataLogger() yFirstDataLogger() Continues the enumeration of data loggers started using datalogger→registerValueCallback(callback) Registers the callback function that is invoked on every change of advertised value. datalogger→set_autoStart(newval) www.yoctopuce.com...
  • Page 499 Stores a user context provided as argument in the userData attribute of the function. datalogger→unmuteValueCallbacks() Re-enables the propagation of every new advertised value to the parent hub. datalogger→wait_async(callback, context) Waits for all pending asynchronous commands on the module to complete, and invoke the user-provided callback function. www.yoctopuce.com...
  • Page 500 The search is performed first by hardware name, then by logical name. Parameters : func a string that uniquely characterizes the data logger Returns : YDataLogger object allowing you to drive the data logger. www.yoctopuce.com...
  • Page 501 The search is performed first by hardware name, then by logical name. Parameters : yctx a YAPI context func a string that uniquely characterizes the data logger Returns : YDataLogger object allowing you to drive the data logger. www.yoctopuce.com...
  • Page 502 ) function FirstDataLogger( ) Use the method YDataLogger.nextDataLogger() to iterate on next data loggers. Returns : YDataLogger null a pointer to a object, corresponding to the first data logger currently online, or a pointer if there are none. www.yoctopuce.com...
  • Page 503 Use the method YDataLogger.nextDataLogger() to iterate on next data loggers. Parameters : yctx a YAPI context. Returns : YDataLogger null a pointer to a object, corresponding to the first data logger currently online, or a pointer if there are none. www.yoctopuce.com...
  • Page 504 ) void clearCache( ) java def clearCache( ) function clearCache( ) function clearCache( ) Invalidates the cache of the data logger attributes. Forces the next call to get_xxx() or loadxxx() to use values that come from the device. www.yoctopuce.com...
  • Page 505 Relay(BadCustomeName.relay1)=unresolved has not yet been connected. This method does not trigger any USB or TCP transaction and can therefore be used in a debugger. Returns : Relay(MyCustomName.relay1)=RELAYLO1- a string that describes the data logger (ex: 123456.relay1 www.yoctopuce.com...
  • Page 506 ) function forgetAllDataStreams( ) function forgetAllDataStreams( ) YDataLogger target forgetAllDataStreams This method also resets the current run index to zero. Returns : YAPI_SUCCESS if the call succeeds. On failure, throws an exception or returns a negative error code. www.yoctopuce.com...
  • Page 507 Task<string> get_advertisedValue( ) def get_advertisedValue( ) function get_advertisedValue( ) function get_advertisedValue( ) YDataLogger target get_advertisedValue Returns : a string corresponding to the current value of the data logger (no more than 6 characters). On failure, throws an exception or returns Y_ADVERTISEDVALUE_INVALID www.yoctopuce.com...
  • Page 508 ) function get_autoStart( ) function get_autoStart( ) YDataLogger target get_autoStart Returns : Y_AUTOSTART_OFF Y_AUTOSTART_ON either , according to the default activation state of the data logger on power up On failure, throws an exception or returns Y_AUTOSTART_INVALID www.yoctopuce.com...
  • Page 509 ) function get_beaconDriven( ) function get_beaconDriven( ) YDataLogger target get_beaconDriven Returns : Y_BEACONDRIVEN_OFF Y_BEACONDRIVEN_ON either , according to true if the data logger is synchronised with the localization beacon On failure, throws an exception or returns Y_BEACONDRIVEN_INVALID www.yoctopuce.com...
  • Page 510 YDataLogger target get_currentRunIndex Returns : an integer corresponding to the current run number, corresponding to the number of times the module was powered on with the dataLogger enabled at some point On failure, throws an exception or returns Y_CURRENTRUNINDEX_INVALID www.yoctopuce.com...
  • Page 511 This function only works if the device uses a recent firmware, as YDataSet objects are not supported by firmwares older than version 13000. Returns : a list of YDataSet object. On failure, throws an exception or returns an empty list. www.yoctopuce.com...
  • Page 512 Parameters : an array of YDataStream objects to be filled in Returns : YAPI_SUCCESS if the call succeeds. On failure, throws an exception or returns a negative error code. www.yoctopuce.com...
  • Page 513 ) function get_errorMessage( ) function get_errorMessage( ) This method is mostly useful when using the Yoctopuce library with exceptions disabled. Returns : a string corresponding to the latest error message that occured while using the data logger object...
  • Page 514 ) function get_errorType( ) function get_errorType( ) This method is mostly useful when using the Yoctopuce library with exceptions disabled. Returns : a number corresponding to the code of the latest error that occurred while using the data logger object...
  • Page 515 (for example: MyCustomName.relay1 Returns : a string that uniquely identifies the data logger using logical names (ex: MyCustomName.relay1 On failure, throws an exception or returns Y_FRIENDLYNAME_INVALID www.yoctopuce.com...
  • Page 516 , t h e r e t u r n e d v a l u e Y_FUNCTIONDESCRIPTOR_INVALID www.yoctopuce.com...
  • Page 517 ) As String string get_functionId( ) String get_functionId( ) java def get_functionId( ) function get_functionId( ) function get_functionId( ) For example relay1 Returns : relay1 a string that identifies the data logger (ex: On failure, throws an exception or returns Y_FUNCTIONID_INVALID www.yoctopuce.com...
  • Page 518 The unique hardware identifier is composed of the device serial number and of the hardware identifier of the data logger (for example RELAYLO1-123456.relay1 Returns : RELAYLO1-123456.relay1 a string that uniquely identifies the data logger (ex: On failure, throws an exception or returns Y_HARDWAREID_INVALID www.yoctopuce.com...
  • Page 519 String get_logicalName( ) java async Task<string> get_logicalName( ) def get_logicalName( ) function get_logicalName( ) function get_logicalName( ) YDataLogger target get_logicalName Returns : a string corresponding to the logical name of the data logger. On failure, throws an exception or returns Y_LOGICALNAME_INVALID www.yoctopuce.com...
  • Page 520 YModule get_module( ) java def get_module( ) function get_module( ) function get_module( ) If the function cannot be located on any module, the returned instance of is not shown as on- YModule line. Returns : YModule an instance of www.yoctopuce.com...
  • Page 521 The callback function receives three arguments: the caller-specific context object, the receiving function object and the requested YModule object context caller-specific object that is passed as-is to the callback function Returns : nothing : the result is provided to the callback. www.yoctopuce.com...
  • Page 522 Task<int> get_recording( ) def get_recording( ) function get_recording( ) function get_recording( ) YDataLogger target get_recording Returns : Y_RECORDING_OFF Y_RECORDING_ON Y_RECORDING_PENDING a value among corresponding to the current activation state of the data logger On failure, throws an exception or returns Y_RECORDING_INVALID www.yoctopuce.com...
  • Page 523 Task<long> get_timeUTC( ) def get_timeUTC( ) function get_timeUTC( ) function get_timeUTC( ) YDataLogger target get_timeUTC Returns : an integer corresponding to the Unix timestamp for current UTC time, if known On failure, throws an exception or returns Y_TIMEUTC_INVALID www.yoctopuce.com...
  • Page 524 ) function get_userData( ) function get_userData( ) This attribute is never touched directly by the API, and is at disposal of the caller to store a context. Returns : the object stored previously by the caller. www.yoctopuce.com...
  • Page 525 If there is a cached value for the data logger in cache, that has not yet expired, the device is considered reachable. No exception is raised if there is an error while trying to contact the device hosting the data logger. Returns : true if the data logger can be reached, and false otherwise www.yoctopuce.com...
  • Page 526 The callback function receives three arguments: the caller-specific context object, the receiving function object and the boolean result context caller-specific object that is passed as-is to the callback function Returns : nothing : the result is provided to the callback. www.yoctopuce.com...
  • Page 527 Parameters : msValidity an integer corresponding to the validity attributed to the loaded function parameters, in milliseconds Returns : YAPI_SUCCESS when the call succeeds. On failure, throws an exception or returns a negative error code. www.yoctopuce.com...
  • Page 528 $attrName) function loadAttribute( attrName) Parameters : attrName the name of the requested attribute Returns : a string with the value of the the attribute On failure, throws an exception or returns an empty string. www.yoctopuce.com...
  • Page 529 The callback function receives three arguments: the caller-specific context object, the receiving function object and the error code YAPI_SUCCESS context caller-specific object that is passed as-is to the callback function Returns : nothing : the result is provided to the callback. www.yoctopuce.com...
  • Page 530 HTTP callback. Remember to call the method saveToFlash() of the module if the modification must be kept. Returns : YAPI_SUCCESS when the call succeeds. On failure, throws an exception or returns a negative error code. www.yoctopuce.com...
  • Page 531 YDataLogger nextDataLogger( ) def nextDataLogger( ) function nextDataLogger( ) function nextDataLogger( ) Returns : a pointer to a YDataLogger object, corresponding to a data logger currently online, or a null pointer if there are no more data loggers to enumerate. www.yoctopuce.com...
  • Page 532 To unregister a callback, pass a null pointer as argument. Parameters : callback the callback function to call, or a null pointer. The callback function should take two arguments: the function object of which the value has changed, and the character string describing the new advertised value. www.yoctopuce.com...
  • Page 533 Parameters : newval Y_AUTOSTART_OFF Y_AUTOSTART_ON either , according to the default activation state of the data logger on power up Returns : YAPI_SUCCESS if the call succeeds. On failure, throws an exception or returns a negative error code. www.yoctopuce.com...
  • Page 534 Parameters : newval Y_BEACONDRIVEN_OFF Y_BEACONDRIVEN_ON either , according to the type of synchronisation of the data logger Returns : YAPI_SUCCESS if the call succeeds. On failure, throws an exception or returns a negative error code. www.yoctopuce.com...
  • Page 535 Parameters : newval a string corresponding to the logical name of the data logger. Returns : YAPI_SUCCESS if the call succeeds. On failure, throws an exception or returns a negative error code. www.yoctopuce.com...
  • Page 536 Y_RECORDING_PENDING corresponding to the activation state of the data logger to start/stop recording data Returns : YAPI_SUCCESS if the call succeeds. On failure, throws an exception or returns a negative error code. www.yoctopuce.com...
  • Page 537 YDataLogger target set_timeUTC newval Parameters : newval an integer corresponding to the current UTC time reference used for recorded data Returns : YAPI_SUCCESS if the call succeeds. On failure, throws an exception or returns a negative error code. www.yoctopuce.com...
  • Page 538 $data) function set_userData( data) This attribute is never touched by the API, and is at disposal of the caller to store a context. Parameters : data any kind of object to be stored www.yoctopuce.com...
  • Page 539 This function reverts the effect of a previous call to . Remember to call the muteValueCallbacks() method of the module if the modification must be kept. saveToFlash() Returns : YAPI_SUCCESS when the call succeeds. On failure, throws an exception or returns a negative error code. www.yoctopuce.com...
  • Page 540 The callback function receives two arguments: the caller-specific context object and the receiving function object. context caller-specific object that is passed as-is to the callback function Returns : nothing. www.yoctopuce.com...
  • Page 541: Recorded Data Sequence

    = require('yoctolib'); nodejs var YAPI = yoctolib.YAPI; var YModule = yoctolib.YModule; #include "yocto_api.h" #import "yocto_api.h" uses yocto_api; yocto_api.vb yocto_api.cs import com.yoctopuce.YoctoAPI.YModule; java import com.yoctopuce.YoctoAPI.YModule; from yocto_api import * require_once('yocto_api.php'); in HTML: <script src="../../lib/yocto_api.js"></script> in node.js: require('yoctolib-es2017/yocto_api.js'); YDataSet methods dataset→get_endTimeUTC()
  • Page 542 Returns an YMeasure object which summarizes the whole DataSet. dataset→get_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, context) Loads the the next block of measures from the dataLogger asynchronously. www.yoctopuce.com...
  • Page 543 Returns : an unsigned number corresponding to the number of seconds between the Jan 1, 1970 and the end of this data set (i.e. Unix time representation of the absolute time). www.yoctopuce.com...
  • Page 544 ): string function get_functionId( ) As String string get_functionId( ) String get_functionId( ) java async Task<string> get_functionId( ) def get_functionId( ) function get_functionId( ) function get_functionId( ) For example temperature1 Returns : temperature1 a string that identifies the function (ex: www.yoctopuce.com...
  • Page 545 The unique hardware identifier is composed of the device serial number and of the hardware identifier of the function (for example THRMCPL1-123456.temperature1 Returns : THRMCPL1-123456.temperature1 a string that uniquely identifies the function (ex: On failure, throws an exception or returns Y_HARDWAREID_INVALID www.yoctopuce.com...
  • Page 546 UTC clock. Returns : a table of records, where each record depicts the measured value for a given time interval On failure, throws an exception or returns an empty array. www.yoctopuce.com...
  • Page 547 Parameters : measure condensed measure from the list previously returned by get_preview() Returns : a table of records, where each record depicts the measured values during a time interval On failure, throws an exception or returns an empty array. www.yoctopuce.com...
  • Page 548 This preview is available as soon as has been called for the first time. loadMore() Returns : a table of records, where each record depicts the measured values during a time interval On failure, throws an exception or returns an empty array. www.yoctopuce.com...
  • Page 549 , the progress is zero. Each time get_dataSet loadMore() invoked, the progress is updated, to reach the value 100 only once all measures have been loaded. Returns : an integer in the range 0 to 100 (percentage of completion). www.yoctopuce.com...
  • Page 550 Returns : an unsigned number corresponding to the number of seconds between the Jan 1, 1970 and the beginning of this data set (i.e. Unix time representation of the absolute time). www.yoctopuce.com...
  • Page 551 - the average value observed during the time interval - the maximal value observed during the time interval This summary is available as soon as loadMore() has been called for the first time. Returns : an YMeasure object www.yoctopuce.com...
  • Page 552 ) As String string get_unit( ) String get_unit( ) java async Task<string> get_unit( ) def get_unit( ) function get_unit( ) function get_unit( ) Returns : a string that represents a physical unit. On failure, throws an exception or returns Y_UNIT_INVALID www.yoctopuce.com...
  • Page 553 ) function loadMore( ) Returns : an integer in the range 0 to 100 (percentage of completion), or a negative error code in case of failure. On failure, throws an exception or returns a negative error code. www.yoctopuce.com...
  • Page 554 - the YDataSet object whose loadMore_async was invoked - the load result: either the progress indicator (0...100), or a negative error code in case of failure. context user-specific object that is passed as-is to the callback function Returns : nothing. www.yoctopuce.com...
  • Page 555: Measured Value

    = require('yoctolib'); nodejs var YAPI = yoctolib.YAPI; var YModule = yoctolib.YModule; #include "yocto_api.h" #import "yocto_api.h" uses yocto_api; yocto_api.vb yocto_api.cs import com.yoctopuce.YoctoAPI.YModule; java import com.yoctopuce.YoctoAPI.YModule; from yocto_api import * require_once('yocto_api.php'); in HTML: <script src="../../lib/yocto_api.js"></script> in node.js: require('yoctolib-es2017/yocto_api.js'); methods YMeasure measure→get_averageValue()
  • Page 556 ): double function get_averageValue( ) As Double double get_averageValue( ) double get_averageValue( ) java double get_averageValue( ) def get_averageValue( ) function get_averageValue( ) function get_averageValue( ) Returns : a floating-point number corresponding to the average value observed. www.yoctopuce.com...
  • Page 557 When the recording rate is higher than 1 sample per second, the timestamp may have a fractional part. Returns : an floating point number corresponding to the number of seconds between the Jan 1, 1970 UTC and the end of this measure. www.yoctopuce.com...
  • Page 558 ): double function get_maxValue( ) As Double double get_maxValue( ) double get_maxValue( ) java double get_maxValue( ) def get_maxValue( ) function get_maxValue( ) function get_maxValue( ) Returns : a floating-point number corresponding to the largest value observed. www.yoctopuce.com...
  • Page 559 ): double function get_minValue( ) As Double double get_minValue( ) double get_minValue( ) java double get_minValue( ) def get_minValue( ) function get_minValue( ) function get_minValue( ) Returns : a floating-point number corresponding to the smallest value observed. www.yoctopuce.com...
  • Page 560 When the recording rate is higher then 1 sample per second, the timestamp may have a fractional part. Returns : an floating point number corresponding to the number of seconds between the Jan 1, 1970 UTC and the beginning of this measure. www.yoctopuce.com...
  • Page 561: Troubleshooting

    21. Troubleshooting 21.1. Linux and USB To work correctly under Linux, the the library needs to have write access to all the Yoctopuce USB peripherals. However, by default under Linux, USB privileges of the non-root users are limited to read access.
  • Page 562: Arm Platforms: Hf And El

    USB hub 21.6. Where to start? If it is the first time that you use a Yoctopuce module and you do not really know where to start, have a look at the Yoctopuce blog. There is a section dedicated to beginners see: http://www.yoctopuce.com/EN/article/error-message-another-process-is-already-using-yapi...
  • Page 563 22. Characteristics You can find below a summary of the main technical characteristics of your Yocto-GPS module. Resolution 10 cm Width 20 mm Length 60 mm Weight 21 g USB connector micro-B Channels Refresh rate 10 Hz Accuracy 1.5 m...
  • Page 564 22. Characteristics www.yoctopuce.com...
  • Page 567 Index describe, YGroundSpeed 446 describe, YLatitude 283 Access 105 describe, YLongitude 336 Accessories 3 describe, YModule 174 Activating 106 Description 33 Advanced 117 DisableExceptions, YAPI 140 Already 556 Disconnections 556 Altitude 25, 381 Distribution 14 Android 105, 106, 127 download, YModule 175 Another 556 Dynamic 93, 133 Antenna 13...
  • Page 568 functionBaseType, YModule 176 get_friendlyName, YLongitude 342 functionCount, YModule 177 get_functionDescriptor, YAltitude 396 functionId, YModule 178 get_functionDescriptor, YDataLogger 509 functionName, YModule 179 get_functionDescriptor, YGps 246 Functions 138 get_functionDescriptor, YGroundSpeed 453 functionType, YModule 180 get_functionDescriptor, YLatitude 290 functionValue, YModule 181 get_functionDescriptor, YLongitude 343 get_functionId, YAltitude 397 get_functionId, YDataLogger 510 get_functionId, YDataSet 537...
  • Page 569 get_module_async, YAltitude 404 GetTickCount, YAPI 145 get_module_async, YDataLogger 514 GroundSpeed 26, 438 get_module_async, YGps 255 get_module_async, YGroundSpeed 461 get_module_async, YLatitude 298 HandleEvents, YAPI 146 get_module_async, YLongitude 351 hasFunction, YModule 206 get_parentHub, YModule 193 High-level 137 get_persistentSettings, YModule 194 HTTP 54, 131 get_preview, YDataSet 541 get_productId, YModule 195 get_productName, YModule 196...
  • Page 570 load_async, YGps 264 Preparation 87 load_async, YGroundSpeed 474 PreregisterHub, YAPI 148 load_async, YLatitude 311 Prerequisites 1 load_async, YLongitude 364 Presentation 5 load_async, YModule 210 Process 556 loadAttribute, YAltitude 417 Programming 17, 31, 117, 128 loadAttribute, YDataLogger 521 Project 73, 79 loadAttribute, YGps 263 Python 93 loadAttribute, YGroundSpeed 472...
  • Page 571 set_logicalName, YLongitude 371 Update 127, 130 set_logicalName, YModule 220 UpdateDeviceList, YAPI 163 set_lowestValue, YAltitude 428 UpdateDeviceList_async, YAPI 164 set_lowestValue, YGroundSpeed 482 updateFirmware, YModule 225 set_lowestValue, YLatitude 319 updateFirmwareEx, YModule 226 set_lowestValue, YLongitude 372 Updating 128 set_luminosity, YModule 221 set_qnh, YAltitude 429 set_recording, YDataLogger 529 Value 549 set_reportFrequency, YAltitude 430...
  • Page 572 156 YLatitude 277-326 ySetTimeout 157 YLongitude 330-379 ySetUSBPacketAckMs 158 YMeasure 549-553 ySleep 159 YModule 169-227 yTestHub 160 Yocto-Firmware 127 yTriggerHubDiscovery 161 Yocto-GPS 19, 33, 37, 49, 59, 67, 73, 79, 87, 93, yUnregisterHub 162 99, 105 yUpdateDeviceList 163 yUpdateDeviceList_async 164...

Table of Contents