aboutsummaryrefslogtreecommitdiffstats
path: root/api/gps-service-geolocation.html
blob: 1191c9fea38320542af6d55e90deba8aff95b325 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<html>
<body>
<h1>Documentation of gps</h1>

<h2>Service for geolocation</h2>

GPS service reports current WGS84 coordinates from GNSS devices via the gpsd application.


<table>
<tr><td>Version:</td><td>0.1</td></tr>
<tr><td>Author:</td><td>AGL</td></tr>
<tr><td>Maintainer:</td><td>Scott Rifenbark</td></tr>
<tr><td>Site:</td><td>https://doc.automotivelinux.org/...</td></tr>
</table>


<h2>Verbs</h2>

<ul>
 <li><a href="#verb-subscribe">subscribe</a></li>
 <li><a href="#verb-unsubscribe">unsubscribe</a></li>
 <li><a href="#verb-location">location</a></li>
 <li><a href="#verb-record">record</a></li>

</ul>


<h2>Events</h2>
<ul>
 <li><a href="#event-location">location</a></li>

</ul>



<h2>Events</h2>
<ul>
 <li><a href="#SM-listening">listening</a></li>
 <li><a href="#SM-recording">recording</a></li>

</ul>



<a id="verb-subscribe"></a><h2>Verb subscribe</h2>

<p>subscribe to gps/gnss events</p>

<p><b>request:</b> { "title": "Description of the event subscribed or unsubscribed", "type": "object", "properties": { "value": { "enum": [ "location" ] } }, "required": [ "value" ] }</p>


<p><b>reply success:</b> { "schema": { "title": "no value, just null", "const": null }, "set-state": { "listening": true } }</p>



<a id="verb-unsubscribe"></a><h2>Verb unsubscribe</h2>

<p>unsubscribe to gps/gnss events</p>

<p><b>request:</b> { "title": "Description of the event subscribed or unsubscribed", "type": "object", "properties": { "value": { "enum": [ "location" ] } }, "required": [ "value" ] }</p>


<p><b>reply success:</b> { "schema": { "title": "no value, just null", "const": null }, "set-state": { "listening": false } }</p>



<a id="verb-location"></a><h2>Verb location</h2>

<p>get current gps/gnss coordinates</p>

<p><b>request:</b> { "title": "no value, just null", "const": null }</p>


<p><b>reply success:</b> { "title": "the location", "type": "object", "properties": { "altitude": { "title": "the altitude in meters above the normal geoide", "type": "number", "minimum": -20000, "maximum": 20000 }, "latitude": { "title": "the latitude in degrees", "type": "number", "minimum": -90, "maximum": 90 }, "longitude": { "title": "the longitude in degrees", "type": "number", "minimum": -180, "maximum": 180 }, "speed": { "title": "the speed in meter per seconds m\/s", "type": "number", "minimum": 0, "maximum": 6000 }, "track": { "title": "the heading in degrees", "type": "number", "minimum": 0, "maximum": 360 }, "timestamp": { "title": "time stamp of the location as a ISO8601 date", "type": "string", "pattern": "\\d{4,}-[01][0-9]-[0-3][0-9]T[012][0-9]:[0-5][0-9]:[0-5][0-9].*" } } }</p>

<p><b>reply _:</b> An error can be returned when the service isn't ready</p>



<a id="verb-record"></a><h2>Verb record</h2>

<p>Entering *record* mode you must send **{"state": "on"}** with the **record**
verb which will have a JSON response of **{"filename": "gps_YYYYMMDD_hhmm.log"}**
pointing to log under *app-data/agl-service-gps*

Now to enter *replaying* mode you must symlink or copy a GPS dump to
*app-data/agl-service-gps/recording.log* and restart the service.
From then on out the previously recorded GPS data will loop infinitely
which is useful for testing or demonstration purposes.
</p>

<p><b>request:</b> { "type": "object", "properties": { "state": { "const": "on" } }, "required": [ "state" ] }</p>


<p><b>reply success:</b> { "schema": { "type": "object", "properties": { "filename": { "title": "the name of the file that records the data of format gps_YYYYMMDD_hhmm.log", "type": "string", "pattern": "gps_\\d{4}\\d{2}\\d{2}_\\d{2}\\d{2}.log" } }, "required": [ "filename" ] }, "set-state": { "recording": true } }</p>

<p><b>reply _:</b> An error can be returned when the service isn't ready</p>





<a id="event-location"></a><h2>Event location</h2>



<a id="SM-listening"></a><h2>State Machine listening</h2>

<a id="SM-recording"></a><h2>State Machine recording</h2>