![Yoctopuce Yocto-GPS User Manual Download Page 138](http://html1.mh-extra.com/html/yoctopuce/yocto-gps/yocto-gps_user-manual_3415557138.webp)
Note that the result is displayed as text, but if you request
whitePages.xml
, you obtain an XML result.
Likewise,
whitePages.json
allows you to obtain a JSON result. The
html
extension even allows you to
display a rough interface where you can modify values in real time. The whole REST API is available
in these different formats.
Driving a module through the REST interface
Each Yoctopuce module has its own REST interface, available in several variants. Let us imagine a
Yocto-GPS with the
YGNSSMK1-12345
serial number and the
myModule
logical name. The
following URL allows you to know the state of the module.
http://127.0.0.1:4444/bySerial/YGNSSMK1-12345/api/module.txt
You can naturally also use the module logical name rather than its serial number.
http://127.0.0.1:4444/byName/myModule/api/module.txt
To retrieve the value of a module property, simply add the name of the property below
module
. For
example, if you want to know the signposting led luminosity, send the following request:
http://127.0.0.1:4444/bySerial/YGNSSMK1-12345/api/module/luminosity
To change the value of a property, modify the corresponding attribute. Thus, to modify the luminosity,
send the following request:
http://127.0.0.1:4444/bySerial/YGNSSMK1-12345/api/module?luminosity=100
Driving the module functions through the REST interface
The module functions can be manipulated in the same way. To know the state of the latitude
function, build the following URL:
http://127.0.0.1:4444/bySerial/YGNSSMK1-12345/api/latitude.txt
Note that if you can use logical names for the modules instead of their serial number, you cannot use
logical names for functions. Only hardware names are authorized to access functions.
You can retrieve a module function attribute in a way rather similar to that used with the modules. For
example:
http://127.0.0.1:4444/bySerial/YGNSSMK1-12345/api/latitude/logicalName
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.
The preview of all recorded data streams can be retrieved in JSON format using the following URL:
http://127.0.0.1:4444/bySerial/YGNSSMK1-12345/dataLogger.json
Individual measures for any given stream can be obtained by appending the desired function
identifier as well as start time of the stream:
19. Using with unsupported languages
132
www.yoctopuce.com
Summary of Contents for Yocto-GPS
Page 1: ...Yocto GPS User s guide...
Page 2: ......
Page 6: ...22 Characteristics 557 Blueprint 559 Index 561...
Page 10: ...4 www yoctopuce com...
Page 14: ...8 www yoctopuce com...
Page 18: ...12 www yoctopuce com...
Page 22: ...16 www yoctopuce com...
Page 38: ...32 www yoctopuce com...
Page 42: ...36 www yoctopuce com...
Page 54: ...48 www yoctopuce com...
Page 72: ...66 www yoctopuce com...
Page 92: ...86 www yoctopuce com...
Page 122: ...116 www yoctopuce com...
Page 132: ...126 www yoctopuce com...
Page 564: ...22 Characteristics 558 www yoctopuce com...
Page 565: ......
Page 566: ......