le_gnss_interface.h

Go to the documentation of this file.
1 
2 
3 /*
4  * ====================== WARNING ======================
5  *
6  * THE CONTENTS OF THIS FILE HAVE BEEN AUTO-GENERATED.
7  * DO NOT MODIFY IN ANY WAY.
8  *
9  * ====================== WARNING ======================
10  */
11 
12 /**
13  * @page c_gnss GNSS
14  *
15  * @ref le_gnss_interface.h "API Reference" <br>
16  * @ref platformConstraintsGnss <br>
17  * @ref howToGNSS "How To Use GNSS" <br>
18  * @ref toolsTarget_gnss "GNSS target tool" <br>
19  *
20  * <HR>
21  *
22  * This API provides access to the GNSS device.
23  *
24  * GNSS or Global Navigation Satellite System is a satellite navigation system with global coverage.
25  *
26  * This API provides function to configure the GNSS device and retrieve position information.
27  *
28  * @section le_gnss_binding IPC interfaces binding
29  *
30  * All the functions of this API are provided by the @b positioningService application service.
31  *
32  * Here's a code sample binding to Positioning services:
33  * @verbatim
34  bindings:
35  {
36  clientExe.clientComponent.le_gnss -> positioningService.le_gnss
37  }
38  @endverbatim
39  *
40  * @section le_gnss_ControlApi GNSS Control API
41  *
42  * @subsection le_gnss_EnableDisable Enable/Disable GNSS device
43  *
44  * The application can enable/disable the GNSS device with the le_gnss_Enable()
45  * / le_gnss_Disable() functions.
46  * By default the GNSS device is enabled for the positioningService application service.
47  * Also see @ref howToGNSS.
48  *
49  * A sample code can be seen in the following page:
50  * - @subpage c_gnssSampleCodeEnableDisable
51  *
52  * @subsection le_gnss_StartStop Start/Stop GNSS device
53  *
54  * The application can start/stop the GNSS device with the le_gnss_Start() / le_gnss_Stop()
55  * functions.
56  * The default "HOT" start condition is applied and all assistance data are used.
57  * Also see @ref howToGNSS.
58  *
59  * A sample code can be seen in the following page:
60  * - @subpage c_gnssSampleCodeStartStop
61  *
62  * @subsubsection le_gnss_StartingMode Starting mode
63  *
64  * Starting modes are used only for test purposes and allow start performance measurement.
65  * @note For more information about start performances, please refer to your specific
66  * platform documentation.
67  *
68  * @subsubsection SettingConfiguration Setting configuration
69  *
70  * @warning The GNSS setting configuration depends on the platform. Please refer to
71  * @ref platformConstraintsGnss_SettingConfiguration section for full details.
72  *
73  * @subsubsection le_gnss_Data GNSS data
74  * The following table describes the <b>minimum</b> required data for those starting modes:
75  *
76  * | GNSS Data / Starting mode | HOT | WARM | COLD | FACTORY |
77  *| -----------------------| -----| ------| ----- | ------- |
78  *| Broadcasted Ephemeris | Used | | | |
79  *| Extended Ephemeris | Used(1) | Used(2) | Used(2) | Removed (3) |
80  *| Approximate Time and Position | Used | Used | | |
81  *| Almanac | Used | Used | Used | Used (Factory) |
82  *
83  * For example, a requested HOT start without valid broadcasted ephemeris will be treated
84  * as a WARM start.
85  *
86  * @note (1) Extended Ephemeris can be used if Broadcasted Ephemeris are not valid.
87  * The Extended Ephemeris could be loaded using the le_gnss_LoadExtendedEphemerisFile()
88  * function.
89  * @note (2) Extended Ephemeris is used if the Extended Ephemeris file is loaded and valid.
90  * @note (3) Extended Ephemeris are removed when a FACTORY start is requested.
91  * The Extended Ephemeris could be loaded again using the le_gnss_LoadExtendedEphemerisFile()
92  * function.
93  *
94  * @subsubsection le_gnss_TTFF Time To First Fix (TTFF)
95  * The le_gnss_GetTtff() function provides the TTFF (first between 2-Dimensional or 3-Dimensional
96  * position fix) of the last position fix.
97  * The GNSS fix position is calculated by the GNSS engine. Its state can be retrieved by
98  * le_gnss_GetPositionState() function. The GNSS fix position states are given by le_gnss_FixState_t
99  * enum.
100  * @note The "estimated" fix is obtained when less than 3 Satellites Vehicle (SV) are used to
101  * establish the fix. It includes the case when no SVs are used.
102  *
103  * Please refer to @ref le_gnss_APIcallsRequirements. Also see @ref howToGNSS.
104  *
105  * A sample code can be seen in the following page:
106  * - @subpage c_gnssSampleCodeReStart
107  *
108  * @subsubsection le_gnss_InjectUtcTime Inject UTC time
109  * The le_gnss_InjectUtcTime() function injects the UTC time into the location engine. Providing an
110  * accurate UTC time reduces the time to find the first fix.
111  * @note It is mandatory to enable the 'Extended Ephemeris' file injection into the GNSS device with
112  * le_gnss_EnableExtendedEphemerisFile() before injecting time with le_gnss_InjectUtcTime API.
113  * @warning Your GNSS device may require a restart to take into account the enabling of the
114  * 'Extended Ephemeris' file injection.
115  * Please refer to your platform documentation @ref platformConstraintsGnss_SettingConfiguration for
116  * further details.
117  *
118  * @subsubsection le_gnss_ForceHotRestart Force HOT restart
119  * The le_gnss_ForceHotRestart() function performs a "HOT" restart of the GNSS device. The current
120  * GNSS session is stopped, then started using the available @ref le_gnss_Data.
121  * Please refer to @ref le_gnss_APIcallsRequirements. Also see @ref howToGNSS.
122  *
123  * @subsubsection le_gnss_ForceWarmRestart Force WARM restart
124  * The le_gnss_ForceWarmRestart() function performs a "WARM" restart of the GNSS device. The current
125  * GNSS session is stopped, then started using the available @ref le_gnss_Data.
126  * Please refer to @ref le_gnss_APIcallsRequirements. Also see @ref howToGNSS.
127  * @Note This API has a platform dependent feature. Please refer to
128  * @ref platformConstraintsGnss_WarmRestart for further details.
129  *
130  * @subsubsection le_gnss_ForceColdRestart Force COLD restart
131  * The le_gnss_ForceColdRestart() function performs a "COLD" restart of the GNSS device. The current
132  * GNSS session is stopped, then started using the available @ref le_gnss_Data.
133  * Please refer to @ref le_gnss_APIcallsRequirements. Also see @ref howToGNSS.
134  *
135  * @subsubsection le_gnss_ForceFactoryRestart Force FACTORY restart
136  * The le_gnss_ForceFactoryRestart() function performs a "FACTORY" restart of the GNSS device.
137  * The current GNSS session is stopped, then started using the available @ref le_gnss_Data.
138  * Please refer to @ref le_gnss_APIcallsRequirements. Also see @ref howToGNSS.
139  *
140  * @subsection le_gnss_AcquisitionRate Acquisition rate
141  * The GNSS position is computed and delivered each acquisition rate. The acquisition rate defines
142  * the time interval that must elapse between two final GPS positions calculation and reports.
143  * Its default value is 1 second.
144  * The application can configure/retreive the GNSS device acquisition rate with the
145  * le_gnss_SetAcquisitionRate() / le_gnss_GetAcquisitionRate() functions.
146  *
147  * Please refer to @ref le_gnss_APIcallsRequirements.
148  *
149  * A sample code can be seen in the following page:
150  * - @subpage c_gnssSampleCodeAcquisitionRate
151  *
152  * @subsection le_gnss_SetGetConstellation GNSS constellation selection
153  *
154  * The le_gnss_SetConstellation() function selects the GNSS constellation(s) used in solution.
155  * If all GNSS constellations are disabled, the GNSS engine is disabled.
156  *
157  * @warning Your GNSS device may require a restart to take into account this change.
158  * Please refer to your platform documentation @ref platformConstraintsGnss_SettingConfiguration for
159  * further details.
160  *
161  * Combinations of constellation for GPS, GLONASS, BDS, GALILEO and QZSS satellites are currently
162  * supported. Constellation for SBAS satellites is not supported.
163  *
164  * @warning Some constellation types are unsupported depending on the plateform. Please refer to
165  * @ref platformConstraintsGnss_ConstellationType section for full details.
166  *
167  * All supported GNSS constellations are enabled by default.
168  * The le_gnss_GetConstellation() function gets the GNSS constellation(s) enabled to be used
169  * in solution.
170  *
171  * le_gnss_SetConstellationArea sets the area for a GNSS constellation. le_gnss_GetConstellationArea
172  * gets the area for a GNSS constellation.
173  *
174  * A sample code can be seen in the following page:
175  * - @subpage c_gnssSampleCodeConstellation
176  *
177  * @subsection le_gnss_SetGetMinElevation GNSS minimum elevation selection
178  *
179  * The le_gnss_SetMinElevation() function sets the GNSS minimum elevation.
180  * Satellites with elevation lower than the minimum elevation will be ignored.
181  *
182  * The le_gnss_GetMinElevation() function gets the GNSS minimum elevation.
183  *
184  * A sample code can be seen in the following page:
185  * - @subpage c_gnssSampleCodeMinElevation
186  *
187  * @subsection le_gnss_NmeaSentences NMEA sentences selection
188  *
189  * The le_gnss_SetNmeaSentences() function selects the enabled NMEA sentences in the
190  * @ref le_gnss_NMEA with a bit mask. The supported values are listed in @ref le_gnss_NmeaBitMask_t.
191  *
192  * @note This function may be subject to limitations depending on the platform. Please refer to the
193  * @ref platformConstraintsGnss page.
194  *
195  * @warning Your GNSS device may require a restart to take into account this change.
196  * Please refer to your platform documentation @ref platformConstraintsGnss_SettingConfiguration for
197  * further details.
198  *
199  * @warning Some NMEA sentences are unsupported depending on the plateform. Please refer to
200  * @ref platformConstraintsGnss_nmeaMask section for full details.
201  *
202  * @note All supported NMEA sentences are enabled by default.
203  *
204  * The le_gnss_GetNmeaSentences() function gets the bit mask of the enabled NMEA sentences in the
205  * @ref le_gnss_NMEA.
206  *
207  * Please refer to @ref le_gnss_APIcallsRequirements.
208  *
209  * A sample code can be seen in the following page:
210  * - @subpage c_gnssSampleCodeNmeaSentences
211  *
212  * @subsection le_gnss_APIcallsRequirements API calls Requirements
213  * The following table shows the pre-requisites when using the GNSS service API function set.
214  * ''LE_OK or error code'' means the function is authorized in the corresponding state, the request
215  * is performed and the result is returned; otherwise the returned error is indicated for each state
216  *.
217  * | Function / GNSS state | UNINITIALIZED | READY | ACTIVE | DISABLED |
218  *| ----------------------------- | --------------------------- | -----------------------------| --------------------------- | --------------------------- |
219  *| le_gnss_Start() | LE_NOT_PERMITTED | LE_OK or error code | LE_DUPLICATE | LE_NOT_PERMITTED |
220  *| le_gnss_Stop() | LE_NOT_PERMITTED | LE_DUPLICATE | LE_OK or error code | LE_NOT_PERMITTED |
221  *| le_gnss_ForceHotRestart() | LE_NOT_PERMITTED | LE_NOT_PERMITTED | LE_OK or error code | LE_NOT_PERMITTED |
222  *| le_gnss_ForceWarmRestart() | LE_NOT_PERMITTED | LE_NOT_PERMITTED | LE_OK or error code | LE_NOT_PERMITTED |
223  *| le_gnss_ForceColdRestart() | LE_NOT_PERMITTED | LE_NOT_PERMITTED | LE_OK or error code | LE_NOT_PERMITTED |
224  *| le_gnss_ForceFactoryRestart() | LE_NOT_PERMITTED | LE_NOT_PERMITTED | LE_OK or error code | LE_NOT_PERMITTED |
225  *| le_gnss_Disable() | LE_NOT_PERMITTED | LE_OK or error code | LE_NOT_PERMITTED | LE_DUPLICATE |
226  *| le_gnss_Enable() | LE_NOT_PERMITTED | LE_DUPLICATE | LE_DUPLICATE | LE_OK or error code |
227  *| le_gnss_SetConstellation() | LE_NOT_PERMITTED | LE_OK or error code | LE_NOT_PERMITTED | LE_NOT_PERMITTED |
228  *| le_gnss_GetConstellation() | LE_NOT_PERMITTED | LE_OK or error code | LE_NOT_PERMITTED | LE_NOT_PERMITTED |
229  *| le_gnss_SetConstellationArea() | LE_NOT_PERMITTED | LE_OK or error code | LE_NOT_PERMITTED | LE_NOT_PERMITTED |
230  *| le_gnss_GetConstellationArea() | LE_NOT_PERMITTED | LE_OK or error code | LE_NOT_PERMITTED | LE_NOT_PERMITTED |
231  *| le_gnss_GetTtff() | LE_NOT_PERMITTED | LE_OK or error code | LE_OK or error code | LE_NOT_PERMITTED |
232  *| le_gnss_SetAcquisitionRate() | LE_NOT_PERMITTED | LE_OK or error code | LE_NOT_PERMITTED | LE_NOT_PERMITTED |
233  *| le_gnss_GetAcquisitionRate() | LE_NOT_PERMITTED | LE_OK or error code | LE_NOT_PERMITTED | LE_NOT_PERMITTED |
234  *| le_gnss_SetNmeaSentences() | LE_NOT_PERMITTED | LE_OK or error code | LE_NOT_PERMITTED | LE_NOT_PERMITTED |
235  *| le_gnss_GetNmeaSentences() | LE_NOT_PERMITTED | LE_OK or error code | LE_NOT_PERMITTED | LE_NOT_PERMITTED |
236  *
237  * Also see @ref howToGNSS.
238  *
239  * @section le_gnss_Information GNSS position information
240  * @ref le_gnss_NMEA
241  *
242  * @ref le_gnss_GetInfo
243  *
244  * @subsection le_gnss_NMEA NMEA Flow
245  * The National Marine Electronics Association (NMEA) standard defines an electrical interface
246  * and data protocol for communications between marine instrumentation.
247  *
248  * The NMEA-0183, scope of this document, defines a set of frame prefixed by
249  * $GP (concerning Global Positioning System),
250  * $GL (concerning GLONASS)
251  * and $GN (concerning combination of navigation systems).
252  * For more details about NMEA standards, please refer to http://www.nmea.org/.
253  *
254  * That NMEA frames flow can be retrieved from the "/dev/nmea" device folder, using for example
255  * the shell command $<EM> cat /dev/nmea | grep '$G'</EM>
256  *
257  * @subsection le_gnss_GetInfo Get position information
258  * The position information is referenced to a position sample object.
259  *
260  * An application can register a handler to be notified of the
261  * updated position each @ref le_gnss_AcquisitionRate, returning a position sample object.
262  *
263  * The GNSS information commonly used such as
264  * device state, position, time and date, satellites information and accuracy
265  * can be queried using the following functions:
266  * - le_gnss_GetState()
267  * - le_gnss_GetPositionState()
268  * - le_gnss_GetLocation()
269  * - le_gnss_GetAltitude()
270  * - le_gnss_GetDate()
271  * - le_gnss_GetTime()
272  * - le_gnss_GetGpsTime()
273  * - le_gnss_GetGpsLeapSeconds()
274  * - le_gnss_GetEpochTime()
275  * - le_gnss_GetTimeAccuracy()
276  * - le_gnss_GetHorizontalSpeed()
277  * - le_gnss_GetVerticalSpeed()
278  * - le_gnss_GetDirection()
279  * - le_gnss_GetSatellitesInfo()
280  * - le_gnss_GetSbasConstellationCategory()
281  * - le_gnss_GetSatellitesStatus()
282  * - le_gnss_GetDop()
283  * - le_gnss_GetDilutionOfPrecision()
284  * - le_gnss_GetAltitudeOnWgs84()
285  * - le_gnss_GetMagneticDeviation()
286  *
287  * le_gnss_GetDilutionOfPrecision() gets the DOP parameters (Dilution Of Precision) with a
288  * resolution of 3 decimal places by default. This resolution can be modified by calling the
289  * @c le_gnss_SetDopResolution() function first.
290  *
291  * As @c le_gnss_SetDopResolution() sets the resolution per client session,
292  * @c le_gnss_SetDopResolution() and @c le_gnss_GetDilutionOfPrecision() functions should be called
293  * in the same thread or client session.
294  *
295  * A sample code can be seen in the following page:
296  * - @subpage c_gnssSampleCodePosition
297  *
298  * The handler can be managed using le_gnss_AddPositionHandler()
299  * and le_gnss_RemovePositionHandler().
300  * When a position is computed, the handler is called.
301  *
302  * The application has to release each position sample object received by the handler,
303  * using the le_gnss_ReleaseSampleRef().
304  *
305  * A sample code can be seen in the following page:
306  * - @subpage c_gnssSampleCodePosition
307  *
308  * @section le_gnss_Assisted_GNSS Assisted GNSS
309  *
310  * @ref le_gnss_Assisted_GNSS_EE
311  * @ref le_gnss_Assisted_GNSS_UP
312  *
313  * @subsection le_gnss_Assisted_GNSS_EE Server based Extended Ephemeris
314  *
315  * @todo Add detailed documentation.
316  *
317  * With le_gnss_LoadExtendedEphemerisFile() , you can load an 'Extended Ephemeris' file into
318  * the GNSS device from the filesystem.
319  * You have to download the file before loading it.
320  * @warning Ensure to check that the downloaded file is supported for your specific platform.
321  *
322  * With le_gnss_GetExtendedEphemerisValidity(), you will to get the validity of the last injected
323  * Extended Ephemeris.
324  *
325  * You can enable/disable the use of the 'Extended Ephemeris' file into the GNSS device with
326  * le_gnss_EnableExtendedEphemerisFile() / le_gnss_DisableExtendedEphemerisFile() functions.
327  * @warning Ensure to check configuration capabilities for your specific platform.
328  * A reboot must be required if your platform doesn't allow run-time configuration.
329  *
330  * A sample code can be seen in the following page:
331  * - @subpage c_gnssSampleCodeXtra
332  *
333  * @subsection le_gnss_Assisted_GNSS_UP 3GPP User Plane (OMA SUPL)
334  *
335  * That 3GPP User Plane A-GNSS (Assisted GNSS) protocol is defined by two different standardization
336  * bodies, 3GPP and Open Mobile Alliance (OMA). For more information, please refer to the standard.
337  *
338  * Both MS-Assisted and MS-Based position determination methods are supported in the User Plane.
339  *
340  * In MS-Assisted mode, the MS (Mobile Station) measures the signals from the GNSS satellites
341  *, then returns the retrieved GNSS data to the SUPL (Secure User Plan Location) server, where the
342  * position calculation is performed.
343  *
344  * In MS-Based mode, the MS gets the assistance data from the SUPL (Secure User Plan Location)
345  * server. The MS measures the signals from the GNSS satellites and makes the position calculation.
346  *
347  * The data transport over User Plan is done using the TCP/IP protocol.
348  *
349  * The Assisted-GNSS mode can be configured thru the le_gnss_SetSuplAssistedMode() function.
350  *
351  * The supported modes are the following:
352  * - Standalone mode: That 3GPP User Plane A-GNSS feature is deactivated.
353  * - MS-Based mode
354  * - MS-Assisted mode
355  *
356  * Moreover, the le_gnss_GetSuplAssistedMode() function reads the configured Assisted-GNSS mode.
357  *
358  * The SUPL server is configured using the le_gnss_SetSuplServerUrl() function. That function sets
359  * the SUPL server URL and optionally the port number.
360  *
361  * The SUPL certificate to be used in A-GNSS sessions is injected through the
362  * le_gnss_InjectSuplCertificate() function and deleted through the le_gnss_DeleteSuplCertificate()
363  * function.
364  * The SUPL certificate lenght given as parameter to le_gnss_InjectSuplCertificate() must be less
365  * than LE_GNSS_SUPL_CERTIFICATE_MAX_LEN.
366  *
367  * <HR>
368  *
369  * Copyright (C) Sierra Wireless Inc.
370  */
371 /**
372  * @page c_gnssSampleCode Sample code for GNSS device
373  *
374  * @include "apps/test/positioning/gnssTest/gnssTest/gnssTest.c"
375  */
376 /**
377  * @page c_gnssSampleCodeEnableDisable Sample code for Enable/Disable GNSS device
378  *
379  * @snippet "apps/test/positioning/gnssTest/gnssTest/gnssTest.c" GnssEnable
380  */
381 /**
382  * @page c_gnssSampleCodeStartStop Sample code for Start/Stop GNSS device
383  *
384  * @snippet "apps/test/positioning/gnssTest/gnssTest/gnssTest.c" GnssControl
385  */
386 /**
387  * @page c_gnssSampleCodeReStart Sample code for restart GNSS device and get TTFF
388  *
389  * @snippet "apps/test/positioning/gnssTest/gnssTest/gnssTest.c" GnssReStart
390  */
391 /**
392  * @page c_gnssSampleCodeAcquisitionRate Sample code for GNSS acquisition rate configuration
393  *
394  * @snippet "apps/test/positioning/gnssTest/gnssTest/gnssTest.c" GnssControl
395  */
396 /**
397  * @page c_gnssSampleCodeConstellation Sample code for GNSS constellation selection
398  *
399  * @snippet "apps/test/positioning/gnssTest/gnssTest/gnssTest.c" GnssControl
400  */
401 /**
402  * @page c_gnssSampleCodeMinElevation Sample code for GNSS minimum elevation
403  *
404  * @snippet "apps/test/positioning/gnssTest/gnssTest/gnssTest.c" GnssControl
405  */
406 /**
407  * @page c_gnssSampleCodeNmeaSentences Sample code for GNSS NMEA sentences selection
408  *
409  * @snippet "apps/test/positioning/gnssTest/gnssTest/gnssTest.c" GnssControl
410  */
411 /**
412  * @page c_gnssSampleCodePosition Sample code for GNSS position information
413  *
414  * @snippet "apps/test/positioning/gnssTest/gnssTest/gnssTest.c" GnssPosition
415  */
416 /**
417  * @page c_gnssSampleCodeXtra Sample code for GNSS Server based Extended Ephemeris
418  *
419  * @include "apps/test/positioning/gnssXtraTest/gnssXtraTest/xtraTest.c"
420  */
421 /**
422  * @file le_gnss_interface.h
423  *
424  * Legato @ref c_gnss include file.
425  *
426  * Copyright (C) Sierra Wireless Inc.
427  */
428 
429 #ifndef LE_GNSS_INTERFACE_H_INCLUDE_GUARD
430 #define LE_GNSS_INTERFACE_H_INCLUDE_GUARD
431 
432 
433 #include "legato.h"
434 
435 
436 //--------------------------------------------------------------------------------------------------
437 /**
438  * Type for handler called when a server disconnects.
439  */
440 //--------------------------------------------------------------------------------------------------
441 typedef void (*le_gnss_DisconnectHandler_t)(void *);
442 
443 //--------------------------------------------------------------------------------------------------
444 /**
445  *
446  * Connect the current client thread to the service providing this API. Block until the service is
447  * available.
448  *
449  * For each thread that wants to use this API, either ConnectService or TryConnectService must be
450  * called before any other functions in this API. Normally, ConnectService is automatically called
451  * for the main thread, but not for any other thread. For details, see @ref apiFilesC_client.
452  *
453  * This function is created automatically.
454  */
455 //--------------------------------------------------------------------------------------------------
457 (
458  void
459 );
460 
461 //--------------------------------------------------------------------------------------------------
462 /**
463  *
464  * Try to connect the current client thread to the service providing this API. Return with an error
465  * if the service is not available.
466  *
467  * For each thread that wants to use this API, either ConnectService or TryConnectService must be
468  * called before any other functions in this API. Normally, ConnectService is automatically called
469  * for the main thread, but not for any other thread. For details, see @ref apiFilesC_client.
470  *
471  * This function is created automatically.
472  *
473  * @return
474  * - LE_OK if the client connected successfully to the service.
475  * - LE_UNAVAILABLE if the server is not currently offering the service to which the client is
476  * bound.
477  * - LE_NOT_PERMITTED if the client interface is not bound to any service (doesn't have a binding).
478  * - LE_COMM_ERROR if the Service Directory cannot be reached.
479  */
480 //--------------------------------------------------------------------------------------------------
482 (
483  void
484 );
485 
486 //--------------------------------------------------------------------------------------------------
487 /**
488  * Set handler called when server disconnection is detected.
489  *
490  * When a server connection is lost, call this handler then exit with LE_FATAL. If a program wants
491  * to continue without exiting, it should call longjmp() from inside the handler.
492  */
493 //--------------------------------------------------------------------------------------------------
495 (
496  le_gnss_DisconnectHandler_t disconnectHandler,
497  void *contextPtr
498 );
499 
500 //--------------------------------------------------------------------------------------------------
501 /**
502  *
503  * Disconnect the current client thread from the service providing this API.
504  *
505  * Normally, this function doesn't need to be called. After this function is called, there's no
506  * longer a connection to the service, and the functions in this API can't be used. For details, see
507  * @ref apiFilesC_client.
508  *
509  * This function is created automatically.
510  */
511 //--------------------------------------------------------------------------------------------------
513 (
514  void
515 );
516 
517 
518 //--------------------------------------------------------------------------------------------------
519 /**
520  * Maximum length of the SUP Server URL string.
521  */
522 //--------------------------------------------------------------------------------------------------
523 #define LE_GNSS_SUPL_SERVER_URL_MAX_LEN 256
524 
525 //--------------------------------------------------------------------------------------------------
526 /**
527  * Maximum length of the SUP Server URL string.
528  * One extra byte is added for the null character.
529  */
530 //--------------------------------------------------------------------------------------------------
531 #define LE_GNSS_SUPL_SERVER_URL_MAX_BYTES 257
532 
533 //--------------------------------------------------------------------------------------------------
534 /**
535  * Maximum SUPL certificate size.
536  */
537 //--------------------------------------------------------------------------------------------------
538 #define LE_GNSS_SUPL_CERTIFICATE_MAX_LEN 2000
539 
540 //--------------------------------------------------------------------------------------------------
541 /**
542  * Maximum SUPL certificate string size.
543  * One extra byte is added for the null character.
544  */
545 //--------------------------------------------------------------------------------------------------
546 #define LE_GNSS_SUPL_CERTIFICATE_MAX_BYTES 2001
547 
548 //--------------------------------------------------------------------------------------------------
549 /**
550  * Define the maximum length of the Satellites Vehicle information list
551  */
552 //--------------------------------------------------------------------------------------------------
553 #define LE_GNSS_SV_INFO_MAX_LEN 80
554 
555 //--------------------------------------------------------------------------------------------------
556 /**
557  * Define the maximal bit mask for enabled NMEA sentences
558  *
559  * @note This maximal value should be coherent with @ref le_gnss_NmeaBitMask_t
560  */
561 //--------------------------------------------------------------------------------------------------
562 #define LE_GNSS_NMEA_SENTENCES_MAX 4194303
563 
564 //--------------------------------------------------------------------------------------------------
565 /**
566  * @deprecated LE_GNSS_NMEA_MASK_PQXFI is deprecated. LE_GNSS_NMEA_MASK_PTYPE is to be used instead.
567  * Setting LE_GNSS_NMEA_MASK_PTYPE will also set LE_GNSS_NMEA_MASK_PQXFI.
568  * LE_GNSS_NMEA_MASK_PTYPE supports all Proprietary type masks: PQXFI, PQGSA and PQGSV.
569  */
570 //--------------------------------------------------------------------------------------------------
571 #define LE_GNSS_NMEA_MASK_PQXFI 16384
572 
573 //--------------------------------------------------------------------------------------------------
574 /**
575  * Define the maximal degree for the minimal elevation
576  */
577 //--------------------------------------------------------------------------------------------------
578 #define LE_GNSS_MIN_ELEVATION_MAX_DEGREE 90
579 
580 //--------------------------------------------------------------------------------------------------
581 /**
582  * Satellite Vehicle (SV) ID to PRN offset definitions
583  *
584  * @note SV ID is given both in le_gnss_GetSatellitesInfo() API and NMEA flow. Its corresponding
585  * PRN code can be computed adding the following offset according to its constellation.
586  */
587 //--------------------------------------------------------------------------------------------------
588 #define LE_GNSS_PRN_OFFSET_GPS 0
589 
590 //--------------------------------------------------------------------------------------------------
591 /**
592  */
593 //--------------------------------------------------------------------------------------------------
594 #define LE_GNSS_PRN_OFFSET_SBAS 87
595 
596 //--------------------------------------------------------------------------------------------------
597 /**
598  */
599 //--------------------------------------------------------------------------------------------------
600 #define LE_GNSS_PRN_OFFSET_GLONASS -64
601 
602 //--------------------------------------------------------------------------------------------------
603 /**
604  */
605 //--------------------------------------------------------------------------------------------------
606 #define LE_GNSS_PRN_OFFSET_GALILEO -300
607 
608 //--------------------------------------------------------------------------------------------------
609 /**
610  */
611 //--------------------------------------------------------------------------------------------------
612 #define LE_GNSS_PRN_OFFSET_BEIDOU -200
613 
614 //--------------------------------------------------------------------------------------------------
615 /**
616  */
617 //--------------------------------------------------------------------------------------------------
618 #define LE_GNSS_PRN_OFFSET_QZSS 0
619 
620 //--------------------------------------------------------------------------------------------------
621 /**
622  * Reference type for dealing with GNSS position samples.
623  */
624 //--------------------------------------------------------------------------------------------------
625 typedef struct le_gnss_Sample* le_gnss_SampleRef_t;
626 
627 
628 //--------------------------------------------------------------------------------------------------
629 /**
630  * Enumeration for GNSS device state
631  */
632 //--------------------------------------------------------------------------------------------------
633 typedef enum
634 {
636  ///< The GNSS device is not initialized
638  ///< The GNSS device is ready
640  ///< The GNSS device is active
642  ///< The GNSS device is disabled
644  ///< Do not use
645 }
647 
648 
649 //--------------------------------------------------------------------------------------------------
650 /**
651  * GNSS fix position states.
652  */
653 //--------------------------------------------------------------------------------------------------
654 typedef enum
655 {
657  ///< The GNSS fix position is not fixed.
659  ///< 2-Dimensional position fix.
661  ///< 3-Dimensional position fix.
663  ///< Estimated (i.e. forward predicted) position fix.
664 }
666 
667 
668 //--------------------------------------------------------------------------------------------------
669 /**
670  * Resolutions values.
671  */
672 //--------------------------------------------------------------------------------------------------
673 typedef enum
674 {
676  ///< Resolution of 0 decimal place.
678  ///< Resolution of 1 decimal place.
680  ///< Resolution of 2 decimal places.
682  ///< Resolution of 3 decimal places (default).
684  ///< Unknown resolution.
685 }
687 
688 
689 //--------------------------------------------------------------------------------------------------
690 /**
691  * SBAS constellation category
692  */
693 //--------------------------------------------------------------------------------------------------
694 typedef enum
695 {
697  ///< Satellite Vehicle of Satellite-based augmentation system
698  ///< (SBAS) EGNOS constellation.
700  ///< Satellite Vehicle of Satellite-based augmentation system
701  ///< (SBAS) WAAS constellation.
703  ///< Satellite Vehicle of Satellite-based augmentation system
704  ///< (SBAS) GAGAN constellation.
706  ///< Satellite Vehicle of Satellite-based augmentation system
707  ///< (SBAS) MSAS constellation.
709  ///< Satellite Vehicle of Satellite-based augmentation system
710  ///< (SBAS) SDCM constellation.
712  ///< Satellite Vehicle of Satellite-based augmentation system
713  ///< (SBAS) unknown constellation.
714 }
716 
717 
718 //--------------------------------------------------------------------------------------------------
719 /**
720  * GNSS constellation type.
721  */
722 //--------------------------------------------------------------------------------------------------
723 typedef enum
724 {
726  ///< GNSS constellation field not defined.
728  ///< Satellite Vehicle of GPS constellation.
729  ///< North American satellite navigation system
731  ///< Satellite Vehicle of SBAS constellation.
732  ///< Satellite-based augmentation system
734  ///< Satellite Vehicle of Glonass constellation.
735  ///< Russian satellite navigation system
737  ///< Satellite Vehicle of Galileo constellation.
738  ///< European Union satellite navigation system
740  ///< Satellite Vehicle of Beidou constellation.
741  ///< Chinese satellite navigation system
743  ///< Satellite Vehicle of QZSS constellation.
744  ///< Japanese satellite navigation system
746  ///< Maximum value.
747 }
749 
750 
751 //--------------------------------------------------------------------------------------------------
752 /**
753  * Assisted-GNSS mode
754  */
755 //--------------------------------------------------------------------------------------------------
756 typedef enum
757 {
759  ///< Standalone mode.
761  ///< MS-Based mode.
763  ///< MS-Assisted mode.
764 }
766 
767 
768 //--------------------------------------------------------------------------------------------------
769 /**
770  * Dilution of precision type
771  */
772 //--------------------------------------------------------------------------------------------------
773 typedef enum
774 {
776  ///< Position dilution of precision.
778  ///< Horizontal dilution of precision.
780  ///< Vertical dilution of precision.
782  ///< Geometric dilution of precision.
784  ///< Time dilution of precision.
785  LE_GNSS_DOP_LAST = 5
786  ///<
787 }
789 
790 
791 //--------------------------------------------------------------------------------------------------
792 /**
793  * GNSS constellation area type
794  */
795 //--------------------------------------------------------------------------------------------------
796 typedef enum
797 {
799  ///< Unset area.
801  ///< Worldwide area.
803  ///< Outside US area.
804 }
806 
807 
808 //--------------------------------------------------------------------------------------------------
809 /**
810  * GNSS constellation Bit Mask (8 bits) indicating the GNSS constellation(s)
811  * used in solution.
812  *
813  */
814 //--------------------------------------------------------------------------------------------------
815 typedef enum
816 {
817  LE_GNSS_CONSTELLATION_GPS = 0x1, ///< GPS constellation used in solution.
818  ///< North American satellite navigation system
819  LE_GNSS_CONSTELLATION_GLONASS = 0x2, ///< GLONASS constellation used in solution.
820  ///< Russian satellite navigation system
821  LE_GNSS_CONSTELLATION_BEIDOU = 0x4, ///< BEIDOU constellation used in solution.
822  ///< Chinese satellite navigation system
823  LE_GNSS_CONSTELLATION_GALILEO = 0x8, ///< GALILEO constellation used in solution.
824  ///< European Union satellite navigation system
825  LE_GNSS_CONSTELLATION_SBAS = 0x10, ///< SBAS constellation used in solution.
826  LE_GNSS_CONSTELLATION_QZSS = 0x20 ///< QZSS constellation used in solution.
827  ///< Japanese satellite navigation system
828 }
830 
831 
832 //--------------------------------------------------------------------------------------------------
833 /**
834  * NMEA sentences Bit Mask indicating the NMEA sentences enabled in the NMEA flow.
835  *
836  * @warning The supported NMEA sentences depend on the platform. Please refer to your platform
837  * documentation for further details.
838  *
839  * @note The bit mask values should be coherent with @ref LE_GNSS_NMEA_SENTENCES_MAX
840  */
841 //--------------------------------------------------------------------------------------------------
842 typedef enum
843 {
844  LE_GNSS_NMEA_MASK_GPGGA = 0x1, ///< GPGGA type enabled: GPS fix data.
845  LE_GNSS_NMEA_MASK_GPGSA = 0x2, ///< GPGSA type enabled: GPS DOP and active satellites.
846  LE_GNSS_NMEA_MASK_GPGSV = 0x4, ///< GPGSV type enabled: GPS satellites in view.
847  LE_GNSS_NMEA_MASK_GPRMC = 0x8, ///< GPRMC type enabled: GPS recommended minimum data.
848  LE_GNSS_NMEA_MASK_GPVTG = 0x10, ///< GPVTG type enabled: GPS vector track and speed over the ground.
849  LE_GNSS_NMEA_MASK_GLGSV = 0x20, ///< GLGSV type enabled: GLONASS satellites in view.
850  LE_GNSS_NMEA_MASK_GNGNS = 0x40, ///< GNGNS type enabled: GNSS fix data.
851  LE_GNSS_NMEA_MASK_GNGSA = 0x80, ///< GNGSA type enabled: GNSS DOP and active satellites.
852  LE_GNSS_NMEA_MASK_GAGGA = 0x100, ///< GAGGA type enabled: Galileo fix data.
853  LE_GNSS_NMEA_MASK_GAGSA = 0x200, ///< GAGSA type enabled: Galileo DOP and active satellites.
854  LE_GNSS_NMEA_MASK_GAGSV = 0x400, ///< GAGSV type enabled: Galileo satellites in view.
855  LE_GNSS_NMEA_MASK_GARMC = 0x800, ///< GARMC type enabled: Galileo recommended minimum data.
856  LE_GNSS_NMEA_MASK_GAVTG = 0x1000, ///< GAVTG type enabled: Galileo vector track and speed over the ground.
857  LE_GNSS_NMEA_MASK_PSTIS = 0x2000, ///< PSTIS type enabled: GPS session start indication.
858  LE_GNSS_NMEA_MASK_REMOVED = 0x4000, ///<
859  LE_GNSS_NMEA_MASK_PTYPE = 0x8000, ///< PTYPE type enabled: Proprietary Type mask.
860  LE_GNSS_NMEA_MASK_GPGRS = 0x10000, ///< GPGRS type enabled: GPS Range residuals.
861  LE_GNSS_NMEA_MASK_GPGLL = 0x20000, ///< GPGLL type enabled: GPS Geographic position, latitude / longitude.
862  LE_GNSS_NMEA_MASK_DEBUG = 0x40000, ///< DEBUG type enabled: Debug NMEA indication.
863  LE_GNSS_NMEA_MASK_GPDTM = 0x80000, ///< GPDTM type enabled: Local geodetic datum and datum offset from
864  LE_GNSS_NMEA_MASK_GAGNS = 0x100000 ///< GAGNS type enabled: Fix data for Galileo.
865 }
867 
868 
869 //--------------------------------------------------------------------------------------------------
870 /**
871  * Reference type used by Add/Remove functions for EVENT 'le_gnss_Position'
872  */
873 //--------------------------------------------------------------------------------------------------
874 typedef struct le_gnss_PositionHandler* le_gnss_PositionHandlerRef_t;
875 
876 
877 //--------------------------------------------------------------------------------------------------
878 /**
879  * Handler for position information.
880  *
881  */
882 //--------------------------------------------------------------------------------------------------
883 typedef void (*le_gnss_PositionHandlerFunc_t)
884 (
885  le_gnss_SampleRef_t positionSampleRef,
886  ///< Position's sample reference
887  void* contextPtr
888  ///<
889 );
890 
891 //--------------------------------------------------------------------------------------------------
892 /**
893  * Set the GNSS constellation bit mask
894  *
895  * @return
896  * - LE_FAULT The function failed.
897  * - LE_UNSUPPORTED If the request is not supported.
898  * - LE_NOT_PERMITTED If the GNSS device is not initialized, disabled or active.
899  * - LE_OK The function succeeded.
900  *
901  * @warning Some constellation types are unsupported depending on the plateform. Please refer to
902  * @ref platformConstraintsGnss_ConstellationType section for full details.
903  *
904  * @warning The settings are platform dependent. Please refer to
905  * @ref platformConstraintsGnss_SettingConfiguration section for full details.
906  *
907  */
908 //--------------------------------------------------------------------------------------------------
910 (
911  le_gnss_ConstellationBitMask_t constellationMask
912  ///< [IN] GNSS constellation used in solution.
913 );
914 
915 //--------------------------------------------------------------------------------------------------
916 /**
917  * Get the GNSS constellation bit mask
918  *
919  * @return
920  * - LE_OK on success
921  * - LE_FAULT on failure
922  */
923 //--------------------------------------------------------------------------------------------------
925 (
926  le_gnss_ConstellationBitMask_t* constellationMaskPtr
927  ///< [OUT] GNSS constellation used in solution.
928 );
929 
930 //--------------------------------------------------------------------------------------------------
931 /**
932  * Set the area for the GNSS constellation
933  *
934  * @return
935  * - LE_OK The function succeeded.
936  * - LE_FAULT The function failed.
937  * - LE_UNSUPPORTED If the request is not supported.
938  * - LE_NOT_PERMITTED If the GNSS device is not initialized, disabled or active.
939  * - LE_BAD_PARAMETER Invalid constellation area.
940  *
941  * @warning The settings are platform dependent. Please refer to
942  * @ref platformConstraintsGnss_SettingConfiguration section for full details.
943  */
944 //--------------------------------------------------------------------------------------------------
946 (
947  le_gnss_Constellation_t satConstellation,
948  ///< [IN] GNSS constellation type.
949  le_gnss_ConstellationArea_t constellationArea
950  ///< [IN] GNSS constellation area.
951 );
952 
953 //--------------------------------------------------------------------------------------------------
954 /**
955  * Get the area for the GNSS constellation
956  *
957  * @return
958  * - LE_OK On success
959  * - LE_FAULT On failure
960  * - LE_UNSUPPORTED Request not supported
961  * - LE_NOT_PERMITTED If the GNSS device is not initialized, disabled or active.
962  */
963 //--------------------------------------------------------------------------------------------------
965 (
966  le_gnss_Constellation_t satConstellation,
967  ///< [IN] GNSS constellation type.
968  le_gnss_ConstellationArea_t* constellationAreaPtr
969  ///< [OUT] GNSS constellation area.
970 );
971 
972 //--------------------------------------------------------------------------------------------------
973 /**
974  * This function enables the use of the 'Extended Ephemeris' file into the GNSS device.
975  *
976  * @return
977  * - LE_FAULT The function failed.
978  * - LE_OK The function succeeded.
979  *
980  * @warning The settings are platform dependent. Please refer to
981  * @ref platformConstraintsGnss_SettingConfiguration section for full details.
982  */
983 //--------------------------------------------------------------------------------------------------
985 (
986  void
987 );
988 
989 //--------------------------------------------------------------------------------------------------
990 /**
991  * This function disables the use of the 'Extended Ephemeris' file into the GNSS device.
992  *
993  * @return
994  * - LE_FAULT The function failed.
995  * - LE_OK The function succeeded.
996  *
997  * @warning The settings are platform dependent. Please refer to
998  * @ref platformConstraintsGnss_SettingConfiguration section for full details.
999  */
1000 //--------------------------------------------------------------------------------------------------
1002 (
1003  void
1004 );
1005 
1006 //--------------------------------------------------------------------------------------------------
1007 /**
1008  * This function must be called to load an 'Extended Ephemeris' file into the GNSS device.
1009  *
1010  * @return
1011  * - LE_FAULT The function failed to inject the 'Extended Ephemeris' file.
1012  * - LE_TIMEOUT A time-out occurred.
1013  * - LE_FORMAT_ERROR 'Extended Ephemeris' file format error.
1014  * - LE_OK The function succeeded.
1015  *
1016  */
1017 //--------------------------------------------------------------------------------------------------
1019 (
1020  int fd
1021  ///< [IN] Extended ephemeris file descriptor
1022 );
1023 
1024 //--------------------------------------------------------------------------------------------------
1025 /**
1026  * This function must be called to get the validity of the last injected Extended Ephemeris.
1027  *
1028  * @return
1029  * - LE_FAULT The function failed to get the validity
1030  * - LE_OK The function succeeded.
1031  *
1032  */
1033 //--------------------------------------------------------------------------------------------------
1035 (
1036  uint64_t* startTimePtr,
1037  ///< [OUT] Start time in seconds (since Jan. 1, 1970)
1038  uint64_t* stopTimePtr
1039  ///< [OUT] Stop time in seconds (since Jan. 1, 1970)
1040 );
1041 
1042 //--------------------------------------------------------------------------------------------------
1043 /**
1044  * This function must be called to inject the UTC time into the GNSS device.
1045  *
1046  * @return
1047  * - LE_OK The function succeeded.
1048  * - LE_FAULT The function failed to inject the UTC time.
1049  * - LE_TIMEOUT A time-out occurred.
1050  *
1051  * @note It is mandatory to enable the 'Extended Ephemeris' file injection into the GNSS device with
1052  * le_gnss_EnableExtendedEphemerisFile() before injecting time with this API.
1053  */
1054 //--------------------------------------------------------------------------------------------------
1056 (
1057  uint64_t timeUtc,
1058  ///< [IN] [IN] UTC time since Jan. 1, 1970 in milliseconds
1059  uint32_t timeUnc
1060  ///< [IN] [IN] Time uncertainty in milliseconds
1061 );
1062 
1063 //--------------------------------------------------------------------------------------------------
1064 /**
1065  * This function starts the GNSS device.
1066  *
1067  * @return
1068  * - LE_FAULT The function failed.
1069  * - LE_DUPLICATE If the GNSS device is already started.
1070  * - LE_NOT_PERMITTED If the GNSS device is not initialized or disabled.
1071  * - LE_OK The function succeeded.
1072  *
1073  */
1074 //--------------------------------------------------------------------------------------------------
1076 (
1077  void
1078 );
1079 
1080 //--------------------------------------------------------------------------------------------------
1081 /**
1082  * This function stops the GNSS device.
1083  *
1084  * @return
1085  * - LE_FAULT The function failed.
1086  * - LE_DUPLICATE If the GNSS device is already stopped.
1087  * - LE_NOT_PERMITTED If the GNSS device is not initialized or disabled.
1088  * - LE_OK The function succeeded.
1089  *
1090  */
1091 //--------------------------------------------------------------------------------------------------
1093 (
1094  void
1095 );
1096 
1097 //--------------------------------------------------------------------------------------------------
1098 /**
1099  * This function performs a "HOT" restart of the GNSS device.
1100  *
1101  * @return
1102  * - LE_FAULT The function failed.
1103  * - LE_NOT_PERMITTED If the GNSS device is not enabled or not started.
1104  * - LE_OK The function succeeded.
1105  *
1106  */
1107 //--------------------------------------------------------------------------------------------------
1109 (
1110  void
1111 );
1112 
1113 //--------------------------------------------------------------------------------------------------
1114 /**
1115  * This function performs a "WARM" restart of the GNSS device.
1116  *
1117  * @return
1118  * - LE_FAULT The function failed.
1119  * - LE_NOT_PERMITTED If the GNSS device is not enabled or not started.
1120  * - LE_OK The function succeeded.
1121  *
1122  * @Note This API has a platform dependent feature. Please refer to
1123  * @ref platformConstraintsGnss_WarmRestart for further details.
1124  */
1125 //--------------------------------------------------------------------------------------------------
1127 (
1128  void
1129 );
1130 
1131 //--------------------------------------------------------------------------------------------------
1132 /**
1133  * This function performs a "COLD" restart of the GNSS device.
1134  *
1135  * @return
1136  * - LE_FAULT The function failed.
1137  * - LE_NOT_PERMITTED If the GNSS device is not enabled or not started.
1138  * - LE_OK The function succeeded.
1139  *
1140  */
1141 //--------------------------------------------------------------------------------------------------
1143 (
1144  void
1145 );
1146 
1147 //--------------------------------------------------------------------------------------------------
1148 /**
1149  * This function performs a "FACTORY" restart of the GNSS device.
1150  *
1151  * @return
1152  * - LE_FAULT The function failed.
1153  * - LE_NOT_PERMITTED If the GNSS device is not enabled or not started.
1154  * - LE_OK The function succeeded.
1155  *
1156  */
1157 //--------------------------------------------------------------------------------------------------
1159 (
1160  void
1161 );
1162 
1163 //--------------------------------------------------------------------------------------------------
1164 /**
1165  * Get the TTFF in milliseconds
1166  *
1167  * @return
1168  * - LE_BUSY The position is not fixed and TTFF can't be measured.
1169  * - LE_NOT_PERMITTED If the GNSS device is not enabled or not started.
1170  * - LE_OK Function succeeded.
1171  * - LE_FAULT If there are some other errors.
1172  *
1173  */
1174 //--------------------------------------------------------------------------------------------------
1176 (
1177  uint32_t* ttffPtr
1178  ///< [OUT] TTFF in milliseconds
1179 );
1180 
1181 //--------------------------------------------------------------------------------------------------
1182 /**
1183  * This function enables the GNSS device.
1184  *
1185  * @return
1186  * - LE_FAULT The function failed.
1187  * - LE_DUPLICATE If the GNSS device is already enabled.
1188  * - LE_NOT_PERMITTED If the GNSS device is not initialized.
1189  * - LE_OK The function succeeded.
1190  *
1191  * @warning The settings are platform dependent. Please refer to
1192  * @ref platformConstraintsGnss_SettingConfiguration section for full details.
1193  */
1194 //--------------------------------------------------------------------------------------------------
1196 (
1197  void
1198 );
1199 
1200 //--------------------------------------------------------------------------------------------------
1201 /**
1202  * This function disables the GNSS device.
1203  *
1204  * @return
1205  * - LE_FAULT The function failed.
1206  * - LE_DUPLICATE If the GNSS device is already disabled.
1207  * - LE_NOT_PERMITTED If the GNSS device is not initialized or started.
1208  * - LE_OK The function succeeded.
1209  *
1210  * @warning The settings are platform dependent. Please refer to
1211  * @ref platformConstraintsGnss_SettingConfiguration section for full details.
1212  */
1213 //--------------------------------------------------------------------------------------------------
1215 (
1216  void
1217 );
1218 
1219 //--------------------------------------------------------------------------------------------------
1220 /**
1221  * This function sets the GNSS device acquisition rate.
1222  *
1223  * @return
1224  * - LE_OK on success
1225  * - LE_FAULT on failure
1226  * - LE_UNSUPPORTED request not supported
1227  * - LE_TIMEOUT a time-out occurred
1228  * - LE_NOT_PERMITTED If the GNSS device is not in "ready" state.
1229  * - LE_OUT_OF_RANGE if acquisition rate value is equal to zero
1230  *
1231  * @warning This function may be subject to limitations depending on the platform. Please refer to
1232  * the @ref platformConstraintsGnss page.
1233  *
1234  * @warning The settings are platform dependent. Please refer to
1235  * @ref platformConstraintsGnss_SettingConfiguration section for full details.
1236  */
1237 //--------------------------------------------------------------------------------------------------
1239 (
1240  uint32_t rate
1241  ///< [IN] Acquisition rate in milliseconds.
1242 );
1243 
1244 //--------------------------------------------------------------------------------------------------
1245 /**
1246  * This function gets the GNSS device acquisition rate.
1247  *
1248  * @return
1249  * - LE_OK on success
1250  * - LE_FAULT on failure
1251  * - LE_NOT_PERMITTED If the GNSS device is not in "ready" state.
1252  */
1253 //--------------------------------------------------------------------------------------------------
1255 (
1256  uint32_t* ratePtr
1257  ///< [OUT] Acquisition rate in milliseconds.
1258 );
1259 
1260 //--------------------------------------------------------------------------------------------------
1261 /**
1262  * Add handler function for EVENT 'le_gnss_Position'
1263  *
1264  * This event provides information on position.
1265  *
1266  * - A handler reference, which is only needed for later removal of the handler.
1267  *
1268  * @note Doesn't return on failure, so there's no need to check the return value for errors.
1269  */
1270 //--------------------------------------------------------------------------------------------------
1272 (
1273  le_gnss_PositionHandlerFunc_t handlerPtr,
1274  ///< [IN]
1275  void* contextPtr
1276  ///< [IN]
1277 );
1278 
1279 //--------------------------------------------------------------------------------------------------
1280 /**
1281  * Remove handler function for EVENT 'le_gnss_Position'
1282  */
1283 //--------------------------------------------------------------------------------------------------
1285 (
1286  le_gnss_PositionHandlerRef_t handlerRef
1287  ///< [IN]
1288 );
1289 
1290 //--------------------------------------------------------------------------------------------------
1291 /**
1292  * This function gets the position sample's fix state
1293  *
1294  * - LE_OK on success
1295  * - LE_FAULT on failure
1296  *
1297  * @note If the caller is passing an invalid Position sample reference into this function,
1298  * it is a fatal error, the function will not return.
1299  */
1300 //--------------------------------------------------------------------------------------------------
1302 (
1303  le_gnss_SampleRef_t positionSampleRef,
1304  ///< [IN] Position sample's reference.
1305  le_gnss_FixState_t* statePtr
1306  ///< [OUT] Position fix state.
1307 );
1308 
1309 //--------------------------------------------------------------------------------------------------
1310 /**
1311  * Get the location's data (Latitude, Longitude, Horizontal accuracy).
1312  *
1313  * @return
1314  * - LE_FAULT Function failed to get the location's data
1315  * - LE_OUT_OF_RANGE One of the retrieved parameter is invalid (set to INT32_MAX).
1316  * - LE_OK Function succeeded.
1317  *
1318  * @note latitudePtr, longitudePtr and hAccuracyPtr can be set to NULL if not needed.
1319  *
1320  * @note The latitude and longitude values are based on the WGS84 standard coordinate system.
1321  *
1322  * @note The latitude and longitude values are given in degrees with 6 decimal places like:
1323  * Latitude +48858300 = 48.858300 degrees North
1324  * Longitude +2294400 = 2.294400 degrees East
1325  * (The latitude and longitude values are given in degrees, minutes, seconds in NMEA frame)
1326  *
1327  * @note If the caller is passing an invalid Position sample reference into this function,
1328  * it is a fatal error, the function will not return.
1329  */
1330 //--------------------------------------------------------------------------------------------------
1332 (
1333  le_gnss_SampleRef_t positionSampleRef,
1334  ///< [IN] Position sample's reference.
1335  int32_t* latitudePtr,
1336  ///< [OUT] WGS84 Latitude in degrees, positive North [resolution 1e-6].
1337  int32_t* longitudePtr,
1338  ///< [OUT] WGS84 Longitude in degrees, positive East [resolution 1e-6].
1339  int32_t* hAccuracyPtr
1340  ///< [OUT] Horizontal position's accuracy in meters [resolution 1e-2].
1341 );
1342 
1343 //--------------------------------------------------------------------------------------------------
1344 /**
1345  * Get the position sample's altitude.
1346  *
1347  * @return
1348  * - LE_FAULT Function failed to get the altitude. Invalid Position reference provided.
1349  * - LE_OUT_OF_RANGE One of the retrieved parameter is invalid (set to INT32_MAX).
1350  * - LE_OK Function succeeded.
1351  *
1352  * @note Altitude is in meters, above Mean Sea Level, with 3 decimal places (3047 = 3.047 meters).
1353  *
1354  * @note For a 2D position fix, the altitude will be indicated as invalid and set to INT32_MAX
1355  *
1356  * @note Vertical position accuracy is in meters with 1 decimal places (3047 = 3.0 meters).
1357  *
1358  * @note If the caller is passing an invalid Position reference into this function,
1359  * it is a fatal error, the function will not return.
1360  *
1361  * @note altitudePtr, altitudeAccuracyPtr can be set to NULL if not needed.
1362  */
1363 //--------------------------------------------------------------------------------------------------
1365 (
1366  le_gnss_SampleRef_t positionSampleRef,
1367  ///< [IN] Position sample's reference.
1368  int32_t* altitudePtr,
1369  ///< [OUT] Altitude in meters, above Mean Sea Level [resolution 1e-3].
1370  int32_t* vAccuracyPtr
1371  ///< [OUT] Vertical position's accuracy in meters [resolution 1e-1].
1372 );
1373 
1374 //--------------------------------------------------------------------------------------------------
1375 /**
1376  * Get the position sample's time.
1377  *
1378  * @return
1379  * - LE_FAULT Function failed to get the time.
1380  * - LE_OUT_OF_RANGE The retrieved time is invalid (all fields are set to 0).
1381  * - LE_OK Function succeeded.
1382  *
1383  * @note If the caller is passing an invalid Position sample reference into this function,
1384  * it is a fatal error, the function will not return.
1385  */
1386 //--------------------------------------------------------------------------------------------------
1388 (
1389  le_gnss_SampleRef_t positionSampleRef,
1390  ///< [IN] Position sample's reference.
1391  uint16_t* hoursPtr,
1392  ///< [OUT] UTC Hours into the day [range 0..23].
1393  uint16_t* minutesPtr,
1394  ///< [OUT] UTC Minutes into the hour [range 0..59].
1395  uint16_t* secondsPtr,
1396  ///< [OUT] UTC Seconds into the minute [range 0..59].
1397  uint16_t* millisecondsPtr
1398  ///< [OUT] UTC Milliseconds into the second [range 0..999].
1399 );
1400 
1401 //--------------------------------------------------------------------------------------------------
1402 /**
1403  * Get the position sample's GPS time.
1404  *
1405  * @return
1406  * - LE_FAULT Function failed to get the time.
1407  * - LE_OUT_OF_RANGE The retrieved time is invalid (all fields are set to 0).
1408  * - LE_OK Function succeeded.
1409  *
1410  * @note If the caller is passing an invalid Position sample reference into this function,
1411  * it is a fatal error, the function will not return.
1412  */
1413 //--------------------------------------------------------------------------------------------------
1415 (
1416  le_gnss_SampleRef_t positionSampleRef,
1417  ///< [IN] Position sample's reference.
1418  uint32_t* gpsWeekPtr,
1419  ///< [OUT] GPS week number from midnight, Jan. 6, 1980.
1420  uint32_t* gpsTimeOfWeekPtr
1421  ///< [OUT] Amount of time in milliseconds into the GPS week.
1422 );
1423 
1424 //--------------------------------------------------------------------------------------------------
1425 /**
1426  * Get the position sample's epoch time.
1427  *
1428  * @return
1429  * - LE_FAULT Function failed to acquire the epoch time.
1430  * - LE_OK Function succeeded.
1431  * - LE_OUT_OF_RANGE The retrieved time is invalid (all fields are set to 0).
1432  *
1433  * @note The epoch time is the number of seconds elapsed since January 1, 1970
1434  * (midnight UTC/GMT), not counting leaps seconds.
1435  *
1436  * @note If the caller is passing an invalid position sample reference into this function,
1437  * it is a fatal error, the function will not return.
1438  */
1439 //--------------------------------------------------------------------------------------------------
1441 (
1442  le_gnss_SampleRef_t positionSampleRef,
1443  ///< [IN] Position sample's reference.
1444  uint64_t* millisecondsPtr
1445  ///< [OUT] Milliseconds since Jan. 1, 1970.
1446 );
1447 
1448 //--------------------------------------------------------------------------------------------------
1449 /**
1450  * Get the position sample's time accurary.
1451  *
1452  * @return
1453  * - LE_FAULT Function failed to get the time.
1454  * - LE_OUT_OF_RANGE The retrieved time accuracy is invalid (set to UINT16_MAX).
1455  * - LE_OK Function succeeded.
1456  *
1457  * @note If the caller is passing an invalid Position sample reference into this function,
1458  * it is a fatal error, the function will not return.
1459  */
1460 //--------------------------------------------------------------------------------------------------
1462 (
1463  le_gnss_SampleRef_t positionSampleRef,
1464  ///< [IN] Position sample's reference.
1465  uint32_t* timeAccuracyPtr
1466  ///< [OUT] Estimated time accuracy in nanoseconds
1467 );
1468 
1469 //--------------------------------------------------------------------------------------------------
1470 /**
1471  * Get the position sample's UTC leap seconds in advance
1472  *
1473  * @return
1474  * - LE_FAULT Function failed to get the leap seconds.
1475  * - LE_OUT_OF_RANGE The retrieved time accuracy is invalid (set to UINT8_MAX).
1476  * - LE_OK Function succeeded.
1477  *
1478  * @note The leap seconds in advance is the accumulated time in seconds since the start of GPS Epoch
1479  * time (Jan 6, 1980). This value has to be added to the UTC time (since Jan. 1, 1970)
1480  *
1481  * @note Insertion of each UTC leap second is usually decided about six months in advance by the
1482  * International Earth Rotation and Reference Systems Service (IERS).
1483  *
1484  * @note If the caller is passing an invalid position sample reference or a null pointer into this
1485  * function, it is a fatal error, the function will not return.
1486  */
1487 //--------------------------------------------------------------------------------------------------
1489 (
1490  le_gnss_SampleRef_t positionSampleRef,
1491  ///< [IN] Position sample's reference.
1492  uint8_t* leapSecondsPtr
1493  ///< [OUT] UTC leap seconds in advance in seconds
1494 );
1495 
1496 //--------------------------------------------------------------------------------------------------
1497 /**
1498  * Get the position sample's date.
1499  *
1500  * @return
1501  * - LE_FAULT Function failed to get the date.
1502  * - LE_OUT_OF_RANGE The retrieved date is invalid (all fields are set to 0).
1503  * - LE_OK Function succeeded.
1504  *
1505  * @note If the caller is passing an invalid Position sample reference into this function,
1506  * it is a fatal error, the function will not return.
1507  */
1508 //--------------------------------------------------------------------------------------------------
1510 (
1511  le_gnss_SampleRef_t positionSampleRef,
1512  ///< [IN] Position sample's reference.
1513  uint16_t* yearPtr,
1514  ///< [OUT] UTC Year A.D. [e.g. 2014].
1515  uint16_t* monthPtr,
1516  ///< [OUT] UTC Month into the year [range 1...12].
1517  uint16_t* dayPtr
1518  ///< [OUT] UTC Days into the month [range 1...31].
1519 );
1520 
1521 //--------------------------------------------------------------------------------------------------
1522 /**
1523  * Get the position sample's horizontal speed.
1524  *
1525  * - LE_FAULT Function failed to find the positionSample.
1526  * - LE_OUT_OF_RANGE One of the retrieved parameter is invalid (set to UINT32_MAX).
1527  * - LE_OK Function succeeded.
1528  *
1529  * @note hSpeedPtr, hSpeedAccuracyPtr can be set to NULL if not needed.
1530  *
1531  * @note Horizontal speed is in meters/second with 2 decimal places (3047 = 30.47 meters/second).
1532  *
1533  * @note Horizontal speed accuracy estimate is in meters/second with 1 decimal place
1534  * (304 = 30.4 meters/second).
1535  *
1536  * @note If the caller is passing an invalid Position sample reference into this function,
1537  * it is a fatal error, the function will not return.
1538  *
1539  * @warning The Horizontal speed accuracy is platform dependent. Please refer to
1540  * @ref platformConstraintsGnss_speedAccuracies section for full details.
1541  */
1542 //--------------------------------------------------------------------------------------------------
1544 (
1545  le_gnss_SampleRef_t positionSampleRef,
1546  ///< [IN] Position sample's reference.
1547  uint32_t* hspeedPtr,
1548  ///< [OUT] Horizontal speed in meters/second [resolution 1e-2].
1549  uint32_t* hspeedAccuracyPtr
1550  ///< [OUT] Horizontal speed's accuracy estimate
1551  ///< in meters/second [resolution 1e-1].
1552 );
1553 
1554 //--------------------------------------------------------------------------------------------------
1555 /**
1556  * Get the position sample's vertical speed.
1557  *
1558  * @return
1559  * - LE_FAULT The function failed to find the positionSample.
1560  * - LE_OUT_OF_RANGE One of the retrieved parameter is not valid (set to INT32_MAX).
1561  * - LE_OK The function succeeded.
1562  *
1563  * @note vSpeedPtr, vSpeedAccuracyPtr can be set to NULL if not needed.
1564  *
1565  * @note For a 2D position Fix, the vertical speed will be indicated as invalid
1566  * and set to INT32_MAX.
1567  *
1568  * @note If the caller is passing an invalid Position sample reference into this function,
1569  * it is a fatal error, the function will not return.
1570  *
1571  * @warning The Vertical speed accuracy is platform dependent. Please refer to
1572  * @ref platformConstraintsGnss_speedAccuracies section for full details.
1573  */
1574 //--------------------------------------------------------------------------------------------------
1576 (
1577  le_gnss_SampleRef_t positionSampleRef,
1578  ///< [IN] Position sample's reference.
1579  int32_t* vspeedPtr,
1580  ///< [OUT] Vertical speed in meters/second [resolution 1e-2],
1581  ///< positive up.
1582  int32_t* vspeedAccuracyPtr
1583  ///< [OUT] Vertical speed's accuracy estimate
1584  ///< in meters/second [resolution 1e-1].
1585 );
1586 
1587 //--------------------------------------------------------------------------------------------------
1588 /**
1589  * Get the position sample's direction. Direction of movement is the direction that the vehicle or
1590  * person is actually moving.
1591  *
1592  * @return
1593  * - LE_FAULT Function failed to find the positionSample.
1594  * - LE_OUT_OF_RANGE One of the retrieved parameter is invalid (set to UINT32_MAX).
1595  * - LE_OK Function succeeded.
1596  *
1597  * @note Direction and direction accuracy are given in degrees with 1 decimal place: 1755 = 175.5
1598  * degrees.
1599  * Direction ranges from 0 to 359.9 degrees, where 0 is True North.
1600  *
1601  * @note directionPtr, directionAccuracyPtr can be set to NULL if not needed.
1602  *
1603  * @note If the caller is passing an invalid Position sample reference into this function,
1604  * it is a fatal error, the function will not return.
1605  */
1606 //--------------------------------------------------------------------------------------------------
1608 (
1609  le_gnss_SampleRef_t positionSampleRef,
1610  ///< [IN] Position sample's reference.
1611  uint32_t* directionPtr,
1612  ///< [OUT] Direction in degrees [resolution 1e-1].
1613  ///< Range: 0 to 359.9, where 0 is True North
1614  uint32_t* directionAccuracyPtr
1615  ///< [OUT] Direction's accuracy estimate
1616  ///< in degrees [resolution 1e-1].
1617 );
1618 
1619 //--------------------------------------------------------------------------------------------------
1620 /**
1621  * Get the Satellites Vehicle information.
1622  *
1623  * @return
1624  * - LE_FAULT Function failed to find the positionSample.
1625  * - LE_OUT_OF_RANGE One of the retrieved parameter is invalid.
1626  * - LE_OK Function succeeded.
1627  *
1628  * @note satId[] can be set to 0 if that information list index is not configured, so
1629  * all satellite parameters (satConst[], satSnr[],satAzim[], satElev[]) are fixed to 0.
1630  *
1631  * @note For LE_OUT_OF_RANGE returned code, invalid value depends on field type:
1632  * UINT16_MAX for satId, LE_GNSS_SV_CONSTELLATION_UNDEFINED for satConst, false for satUsed,
1633  * UINT8_MAX for satSnr, UINT16_MAX for satAzim, UINT8_MAX for satElev.
1634  *
1635  * @note If the caller is passing an invalid Position sample reference into this function,
1636  * it is a fatal error, the function will not return.
1637  */
1638 //--------------------------------------------------------------------------------------------------
1640 (
1641  le_gnss_SampleRef_t positionSampleRef,
1642  ///< [IN] Position sample's reference.
1643  uint16_t* satIdPtr,
1644  ///< [OUT] Satellites in View ID number, referring
1645  ///< to NMEA standard.
1646  size_t* satIdSizePtr,
1647  ///< [INOUT]
1648  le_gnss_Constellation_t* satConstPtr,
1649  ///< [OUT] GNSS constellation type.
1650  size_t* satConstSizePtr,
1651  ///< [INOUT]
1652  bool* satUsedPtr,
1653  ///< [OUT] TRUE if satellite in View Used
1654  ///< for Navigation.
1655  size_t* satUsedSizePtr,
1656  ///< [INOUT]
1657  uint8_t* satSnrPtr,
1658  ///< [OUT] Satellites in View Signal To
1659  ///< Noise Ratio [dBHz].
1660  size_t* satSnrSizePtr,
1661  ///< [INOUT]
1662  uint16_t* satAzimPtr,
1663  ///< [OUT] Satellites in View Azimuth [degrees].
1664  ///< Range: 0 to 360
1665  ///< If Azimuth angle is currently unknown,
1666  ///< the value is set to UINT16_MAX.
1667  size_t* satAzimSizePtr,
1668  ///< [INOUT]
1669  uint8_t* satElevPtr,
1670  ///< [OUT] Satellites in View Elevation [degrees].
1671  ///< Range: 0 to 90
1672  ///< If Elevation angle is currently unknown,
1673  ///< the value is set to UINT8_MAX.
1674  size_t* satElevSizePtr
1675  ///< [INOUT]
1676 );
1677 
1678 //--------------------------------------------------------------------------------------------------
1679 /**
1680  * Get the SBAS constellation category given the SBAS satellite number ID.
1681  *
1682  */
1683 //--------------------------------------------------------------------------------------------------
1685 (
1686  uint16_t satId
1687  ///< [IN] SBAS satellite number ID, referring to NMEA standard.
1688 );
1689 
1690 //--------------------------------------------------------------------------------------------------
1691 /**
1692  * Get the Satellites Vehicle status.
1693  *
1694  * @return
1695  * - LE_FAULT Function failed to find the positionSample.
1696  * - LE_OUT_OF_RANGE One of the retrieved parameter is invalid.
1697  * - LE_OK Function succeeded.
1698  *
1699  * @note If the caller is passing an invalid Position sample reference into this function,
1700  * it is a fatal error, the function will not return.
1701  */
1702 //--------------------------------------------------------------------------------------------------
1704 (
1705  le_gnss_SampleRef_t positionSampleRef,
1706  ///< [IN] Position sample's reference.
1707  uint8_t* satsInViewCountPtr,
1708  ///< [OUT] Number of satellites expected to be in view.
1709  uint8_t* satsTrackingCountPtr,
1710  ///< [OUT] Number of satellites in view, when tracking.
1711  uint8_t* satsUsedCountPtr
1712  ///< [OUT] Number of satellites in view used for Navigation.
1713 );
1714 
1715 //--------------------------------------------------------------------------------------------------
1716 /**
1717  * Get the DOP parameters (Dilution Of Precision) for the fixed position.
1718  *
1719  * @return
1720  * - LE_FAULT Function failed to find the positionSample.
1721  * - LE_OUT_OF_RANGE One of the retrieved parameter is invalid (set to UINT16_MAX).
1722  * - LE_OK Function succeeded.
1723  *
1724  * @deprecated This function is deprecated, le_gnss_GetDilutionOfPrecision() should be used for
1725  * new code.
1726  *
1727  * @note The DOP values are given with 3 decimal places like: DOP value 2200 = 2.200
1728  *
1729  * @note If the caller is passing an invalid Position sample reference into this function,
1730  * it is a fatal error, the function will not return.
1731  */
1732 //--------------------------------------------------------------------------------------------------
1734 (
1735  le_gnss_SampleRef_t positionSampleRef,
1736  ///< [IN] Position sample's reference.
1737  uint16_t* hdopPtr,
1738  ///< [OUT] Horizontal Dilution of Precision [resolution 1e-3].
1739  uint16_t* vdopPtr,
1740  ///< [OUT] Vertical Dilution of Precision [resolution 1e-3].
1741  uint16_t* pdopPtr
1742  ///< [OUT] Position Dilution of Precision [resolution 1e-3].
1743 );
1744 
1745 //--------------------------------------------------------------------------------------------------
1746 /**
1747  * Get the DOP parameter (Dilution Of Precision) for the fixed position.
1748  *
1749  * @return
1750  * - LE_FAULT Function failed to find the DOP value.
1751  * - LE_OUT_OF_RANGE The retrieved parameter is invalid (set to UINT16_MAX).
1752  * - LE_OK Function succeeded.
1753  *
1754  * @note This function replaces the deprecated function le_gnss_GetDop().
1755  *
1756  * @note The DOP value is given with 3 decimal places by default like: DOP value 2200 = 2.200
1757  * The resolution can be modified by calling the @c le_gnss_SetDopResolution() function.
1758  *
1759  * @note If the caller is passing an invalid Position sample reference into this function,
1760  * it is a fatal error, the function will not return.
1761  */
1762 //--------------------------------------------------------------------------------------------------
1764 (
1765  le_gnss_SampleRef_t positionSampleRef,
1766  ///< [IN] Position sample's reference.
1767  le_gnss_DopType_t dopType,
1768  ///< [IN] Dilution of Precision type.
1769  uint16_t* dopPtr
1770  ///< [OUT] Dilution of Precision corresponding to the dopType
1771 );
1772 
1773 //--------------------------------------------------------------------------------------------------
1774 /**
1775  * Get the position sample's altitude with respect to the WGS-84 ellipsoid
1776  *
1777  * @return
1778  * - LE_FAULT Function failed to get the altitude.
1779  * - LE_OUT_OF_RANGE One of the retrieved parameter is invalid (set to INT32_MAX).
1780  * - LE_OK Function succeeded.
1781  *
1782  * @note altitudeOnWgs84 is in meters, with respect to the WGS-84 ellipsoid with 3 decimal
1783  * places (3047 = 3.047 meters).
1784  *
1785  * @note For a 2D position fix, the altitude with respect to the WGS-84 ellipsoid will be indicated
1786  * as invalid and set to INT32_MAX.
1787  *
1788  * @note If the caller is passing an invalid Position reference into this function,
1789  * it is a fatal error, the function will not return.
1790  */
1791 //--------------------------------------------------------------------------------------------------
1793 (
1794  le_gnss_SampleRef_t positionSampleRef,
1795  ///< [IN] Position sample's reference.
1796  int32_t* altitudeOnWgs84Ptr
1797  ///< [OUT] Altitude in meters, between WGS-84 earth ellipsoid
1798  ///< and mean sea level [resolution 1e-3].
1799 );
1800 
1801 //--------------------------------------------------------------------------------------------------
1802 /**
1803  * Get the position sample's magnetic deviation. It is the difference between the bearing to
1804  * true north and the bearing shown on a magnetic compass. The deviation is positive when the
1805  * magnetic north is east of true north.
1806  *
1807  * @return
1808  * - LE_FAULT Function failed to find the positionSample.
1809  * - LE_OUT_OF_RANGE One of the retrieved parameter is invalid (set to INT32_MAX).
1810  * - LE_OK Function succeeded.
1811  *
1812  * @note magneticDeviation is in degrees, with 1 decimal places (47 = 4.7 degree).
1813  *
1814  * @note If the caller is passing an invalid Position sample reference into this function,
1815  * it is a fatal error, the function will not return.
1816  */
1817 //--------------------------------------------------------------------------------------------------
1819 (
1820  le_gnss_SampleRef_t positionSampleRef,
1821  ///< [IN] Position sample's reference.
1822  int32_t* magneticDeviationPtr
1823  ///< [OUT] MagneticDeviation in degrees [resolution 1e-1].
1824 );
1825 
1826 //--------------------------------------------------------------------------------------------------
1827 /**
1828  * This function gets the last updated position sample object reference.
1829  *
1830  * @return A reference to last Position's sample.
1831  *
1832  * @note
1833  * On failure, the process exits, so you don't have to worry about checking the returned
1834  * reference for validity.
1835  */
1836 //--------------------------------------------------------------------------------------------------
1838 (
1839  void
1840 );
1841 
1842 //--------------------------------------------------------------------------------------------------
1843 /**
1844  * This function must be called to release the position sample.
1845  *
1846  * @note If the caller is passing an invalid Position sample reference into this function,
1847  * it is a fatal error, the function will not return.
1848  */
1849 //--------------------------------------------------------------------------------------------------
1851 (
1852  le_gnss_SampleRef_t positionSampleRef
1853  ///< [IN] Position sample's reference.
1854 );
1855 
1856 //--------------------------------------------------------------------------------------------------
1857 /**
1858  * This function sets the SUPL Assisted-GNSS mode.
1859  *
1860  * @return
1861  * - LE_OK on success
1862  * - LE_FAULT on failure
1863  * - LE_UNSUPPORTED request not supported
1864  * - LE_TIMEOUT a time-out occurred
1865  *
1866  * @warning The settings are platform dependent. Please refer to
1867  * @ref platformConstraintsGnss_SettingConfiguration section for full details.
1868  */
1869 //--------------------------------------------------------------------------------------------------
1871 (
1872  le_gnss_AssistedMode_t assistedMode
1873  ///< [IN] Assisted-GNSS mode.
1874 );
1875 
1876 //--------------------------------------------------------------------------------------------------
1877 /**
1878  * This function gets the SUPL Assisted-GNSS mode.
1879  *
1880  * @return
1881  * - LE_OK on success
1882  * - LE_FAULT on failure
1883  */
1884 //--------------------------------------------------------------------------------------------------
1886 (
1887  le_gnss_AssistedMode_t* assistedModePtr
1888  ///< [OUT] Assisted-GNSS mode.
1889 );
1890 
1891 //--------------------------------------------------------------------------------------------------
1892 /**
1893  * This function sets the SUPL server URL.
1894  * That server URL is a NULL-terminated string with a maximum string length (including NULL
1895  * terminator) equal to 256. Optionally the port number is specified after a colon.
1896  *
1897  * @return
1898  * - LE_OK on success
1899  * - LE_FAULT on failure
1900  * - LE_BUSY service is busy
1901  * - LE_TIMEOUT a time-out occurred
1902  *
1903  * @note If the SUPL server URL size is bigger than the maximum string length (including NULL
1904  * terminator) size, it is a fatal error, the function will not return.
1905  *
1906  * @warning The settings are platform dependent. Please refer to
1907  * @ref platformConstraintsGnss_SettingConfiguration section for full details.
1908  */
1909 //--------------------------------------------------------------------------------------------------
1911 (
1912  const char* LE_NONNULL suplServerUrl
1913  ///< [IN] SUPL server URL.
1914 );
1915 
1916 //--------------------------------------------------------------------------------------------------
1917 /**
1918  * This function injects the SUPL certificate to be used in A-GNSS sessions. Certificates must
1919  * be encoded in DER. Other certificate encryptions (e.g., PEM, CER and CRT)
1920  * aren't supported.
1921  *
1922  * @return
1923  * - LE_OK on success
1924  * - LE_BAD_PARAMETER on invalid parameter
1925  * - LE_FAULT on failure
1926  * - LE_BUSY service is busy
1927  * - LE_TIMEOUT a time-out occurred
1928  *
1929  * @note If the SUPL certificate size is bigger than the Maximum SUPL certificate size,
1930  * it is a fatal error, the function will not return.
1931  */
1932 //--------------------------------------------------------------------------------------------------
1934 (
1935  uint8_t suplCertificateId,
1936  ///< [IN] ID of the SUPL certificate.
1937  ///< Certificate ID range is 0 to 9
1938  uint16_t suplCertificateLen,
1939  ///< [IN] SUPL certificate size in Bytes.
1940  const char* LE_NONNULL suplCertificate
1941  ///< [IN] SUPL certificate contents.
1942 );
1943 
1944 //--------------------------------------------------------------------------------------------------
1945 /**
1946  * This function deletes the SUPL certificate.
1947  *
1948  * @return
1949  * - LE_OK on success
1950  * - LE_BAD_PARAMETER on invalid parameter
1951  * - LE_FAULT on failure
1952  * - LE_BUSY service is busy
1953  * - LE_TIMEOUT a time-out occurred
1954  */
1955 //--------------------------------------------------------------------------------------------------
1957 (
1958  uint8_t suplCertificateId
1959  ///< [IN] ID of the SUPL certificate.
1960  ///< Certificate ID range is 0 to 9
1961 );
1962 
1963 //--------------------------------------------------------------------------------------------------
1964 /**
1965  * This function sets the enabled NMEA sentences using a bit mask.
1966  *
1967  * @return
1968  * - LE_OK Success
1969  * - LE_BAD_PARAMETER Bit mask exceeds the maximal value
1970  * - LE_FAULT Failure
1971  * - LE_BUSY Service is busy
1972  * - LE_TIMEOUT Timeout occurred
1973  * - LE_NOT_PERMITTED GNSS device is not in "ready" state
1974  *
1975  * @warning This function may be subject to limitations depending on the platform. Please refer to
1976  * the @ref platformConstraintsGnss page.
1977  *
1978  * @note Some NMEA sentences are unsupported depending on the plateform. Please refer to
1979  * @ref platformConstraintsGnss_nmeaMask section for full details. Setting an unsuported NMEA
1980  * sentence won't report an error.
1981  *
1982  * @warning The settings are platform dependent. Please refer to
1983  * @ref platformConstraintsGnss_SettingConfiguration section for full details.
1984  *
1985  * @deprecated LE_GNSS_NMEA_MASK_PQXFI is deprecated. LE_GNSS_NMEA_MASK_PTYPE should be used
1986  * instead. Setting LE_GNSS_NMEA_MASK_PTYPE will also set LE_GNSS_NMEA_MASK_PQXFI.
1987  */
1988 //--------------------------------------------------------------------------------------------------
1990 (
1991  le_gnss_NmeaBitMask_t nmeaMask
1992  ///< [IN] Bit mask for enabled NMEA sentences.
1993 );
1994 
1995 //--------------------------------------------------------------------------------------------------
1996 /**
1997  * This function gets the bit mask for the enabled NMEA sentences.
1998  *
1999  * @return
2000  * - LE_OK Success
2001  * - LE_FAULT Failure
2002  * - LE_BUSY Service is busy
2003  * - LE_TIMEOUT Timeout occurred
2004  * - LE_NOT_PERMITTED GNSS device is not in "ready" state
2005  *
2006  * @note If the caller is passing an null pointer to this function, it is a fatal error
2007  * and the function will not return.
2008  *
2009  * @note Some NMEA sentences are unsupported depending on the plateform. Please refer to
2010  * @ref platformConstraintsGnss_nmeaMask section for full details. The bit mask for an unset
2011  * or unsupported NMEA sentence is zero.
2012  */
2013 //--------------------------------------------------------------------------------------------------
2015 (
2016  le_gnss_NmeaBitMask_t* nmeaMaskPtrPtr
2017  ///< [OUT] Bit mask for enabled NMEA sentences.
2018 );
2019 
2020 //--------------------------------------------------------------------------------------------------
2021 /**
2022  * This function returns the status of the GNSS device.
2023  *
2024  */
2025 //--------------------------------------------------------------------------------------------------
2027 (
2028  void
2029 );
2030 
2031 //--------------------------------------------------------------------------------------------------
2032 /**
2033  * This function sets the GNSS minimum elevation.
2034  *
2035  * @return
2036  * - LE_OK on success
2037  * - LE_FAULT on failure
2038  * - LE_OUT_OF_RANGE if the minimum elevation is above range
2039  * - LE_UNSUPPORTED request not supported
2040  *
2041  * @warning The settings are platform dependent. Please refer to
2042  * @ref platformConstraintsGnss_SettingConfiguration section for full details.
2043  */
2044 //--------------------------------------------------------------------------------------------------
2046 (
2047  uint8_t minElevation
2048  ///< [IN] Minimum elevation in degrees [range 0..90].
2049 );
2050 
2051 //--------------------------------------------------------------------------------------------------
2052 /**
2053  * This function gets the GNSS minimum elevation.
2054  *
2055  * @return
2056  * - LE_OK on success
2057  * - LE_FAULT on failure
2058  * - LE_UNSUPPORTED request not supported
2059  *
2060  * @note If the caller is passing an null pointer to this function, it is a fatal error
2061  * and the function will not return.
2062  */
2063 //--------------------------------------------------------------------------------------------------
2065 (
2066  uint8_t* minElevationPtrPtr
2067  ///< [OUT] Minimum elevation in degrees [range 0..90].
2068 );
2069 
2070 //--------------------------------------------------------------------------------------------------
2071 /**
2072  * Set the resolution for the DOP parameters
2073  *
2074  * @return LE_OK Function succeeded.
2075  * @return LE_BAD_PARAMETER Invalid parameter provided.
2076  * @return LE_FAULT Function failed.
2077  *
2078  * @note The function sets the same resolution to all DOP values returned by
2079  * le_gnss_GetDilutionOfPrecision() API. The resolution setting takes effect immediately.
2080  *
2081  * @note The resolution setting is done per client session.
2082  */
2083 //--------------------------------------------------------------------------------------------------
2085 (
2086  le_gnss_Resolution_t resolution
2087  ///< [IN] Resolution.
2088 );
2089 
2090 #endif // LE_GNSS_INTERFACE_H_INCLUDE_GUARD
Definition: le_gnss_interface.h:696
le_gnss_AssistedMode_t
Definition: le_gnss_interface.h:756
le_result_t le_gnss_GetDirection(le_gnss_SampleRef_t positionSampleRef, uint32_t *directionPtr, uint32_t *directionAccuracyPtr)
le_gnss_DopType_t
Definition: le_gnss_interface.h:773
le_result_t le_gnss_GetAltitude(le_gnss_SampleRef_t positionSampleRef, int32_t *altitudePtr, int32_t *vAccuracyPtr)
The GNSS device is not initialized.
Definition: le_gnss_interface.h:635
le_gnss_SbasConstellationCategory_t le_gnss_GetSbasConstellationCategory(uint16_t satId)
le_result_t le_gnss_InjectSuplCertificate(uint8_t suplCertificateId, uint16_t suplCertificateLen, const char *LE_NONNULL suplCertificate)
Do not use.
Definition: le_gnss_interface.h:643
le_result_t le_gnss_GetSatellitesInfo(le_gnss_SampleRef_t positionSampleRef, uint16_t *satIdPtr, size_t *satIdSizePtr, le_gnss_Constellation_t *satConstPtr, size_t *satConstSizePtr, bool *satUsedPtr, size_t *satUsedSizePtr, uint8_t *satSnrPtr, size_t *satSnrSizePtr, uint16_t *satAzimPtr, size_t *satAzimSizePtr, uint8_t *satElevPtr, size_t *satElevSizePtr)
Resolution of 3 decimal places (default).
Definition: le_gnss_interface.h:681
Definition: le_gnss_interface.h:736
le_result_t le_gnss_GetExtendedEphemerisValidity(uint64_t *startTimePtr, uint64_t *stopTimePtr)
GNGSA type enabled: GNSS DOP and active satellites.
Definition: le_gnss_interface.h:851
le_result_t
Definition: le_basics.h:35
Vertical dilution of precision.
Definition: le_gnss_interface.h:779
le_result_t le_gnss_Start(void)
Standalone mode.
Definition: le_gnss_interface.h:758
le_gnss_PositionHandlerRef_t le_gnss_AddPositionHandler(le_gnss_PositionHandlerFunc_t handlerPtr, void *contextPtr)
Russian satellite navigation system.
Definition: le_gnss_interface.h:819
le_result_t le_gnss_GetEpochTime(le_gnss_SampleRef_t positionSampleRef, uint64_t *millisecondsPtr)
le_result_t le_gnss_ForceFactoryRestart(void)
struct le_gnss_Sample * le_gnss_SampleRef_t
Definition: le_gnss_interface.h:625
le_result_t le_gnss_LoadExtendedEphemerisFile(int fd)
PSTIS type enabled: GPS session start indication.
Definition: le_gnss_interface.h:857
le_result_t le_gnss_GetAcquisitionRate(uint32_t *ratePtr)
void le_gnss_DisconnectService(void)
Definition: le_gnss_interface.h:705
GAGNS type enabled: Fix data for Galileo.
Definition: le_gnss_interface.h:864
Definition: le_gnss_interface.h:727
PTYPE type enabled: Proprietary Type mask.
Definition: le_gnss_interface.h:859
Definition: le_gnss_interface.h:739
Chinese satellite navigation system.
Definition: le_gnss_interface.h:821
Resolution of 2 decimal places.
Definition: le_gnss_interface.h:679
GNGNS type enabled: GNSS fix data.
Definition: le_gnss_interface.h:850
Position dilution of precision.
Definition: le_gnss_interface.h:775
GAGGA type enabled: Galileo fix data.
Definition: le_gnss_interface.h:852
le_result_t le_gnss_ForceColdRestart(void)
Unknown resolution.
Definition: le_gnss_interface.h:683
GAGSA type enabled: Galileo DOP and active satellites.
Definition: le_gnss_interface.h:853
Estimated (i.e. forward predicted) position fix.
Definition: le_gnss_interface.h:662
le_result_t le_gnss_ForceWarmRestart(void)
le_gnss_State_t
Definition: le_gnss_interface.h:633
le_result_t le_gnss_InjectUtcTime(uint64_t timeUtc, uint32_t timeUnc)
GPGSV type enabled: GPS satellites in view.
Definition: le_gnss_interface.h:846
GPGRS type enabled: GPS Range residuals.
Definition: le_gnss_interface.h:860
Outside US area.
Definition: le_gnss_interface.h:802
Definition: le_gnss_interface.h:708
Definition: le_gnss_interface.h:733
Japanese satellite navigation system.
Definition: le_gnss_interface.h:826
le_result_t le_gnss_SetConstellationArea(le_gnss_Constellation_t satConstellation, le_gnss_ConstellationArea_t constellationArea)
le_result_t le_gnss_GetTtff(uint32_t *ttffPtr)
le_result_t le_gnss_GetConstellation(le_gnss_ConstellationBitMask_t *constellationMaskPtr)
Resolution of 0 decimal place.
Definition: le_gnss_interface.h:675
The GNSS device is active.
Definition: le_gnss_interface.h:639
void le_gnss_RemovePositionHandler(le_gnss_PositionHandlerRef_t handlerRef)
le_result_t le_gnss_SetSuplServerUrl(const char *LE_NONNULL suplServerUrl)
Maximum value.
Definition: le_gnss_interface.h:745
le_result_t le_gnss_EnableExtendedEphemerisFile(void)
Unset area.
Definition: le_gnss_interface.h:798
3-Dimensional position fix.
Definition: le_gnss_interface.h:660
le_result_t le_gnss_GetAltitudeOnWgs84(le_gnss_SampleRef_t positionSampleRef, int32_t *altitudeOnWgs84Ptr)
le_result_t le_gnss_GetTime(le_gnss_SampleRef_t positionSampleRef, uint16_t *hoursPtr, uint16_t *minutesPtr, uint16_t *secondsPtr, uint16_t *millisecondsPtr)
le_result_t le_gnss_GetSuplAssistedMode(le_gnss_AssistedMode_t *assistedModePtr)
le_result_t le_gnss_GetLocation(le_gnss_SampleRef_t positionSampleRef, int32_t *latitudePtr, int32_t *longitudePtr, int32_t *hAccuracyPtr)
le_result_t le_gnss_DisableExtendedEphemerisFile(void)
Time dilution of precision.
Definition: le_gnss_interface.h:783
GAVTG type enabled: Galileo vector track and speed over the ground.
Definition: le_gnss_interface.h:856
le_result_t le_gnss_TryConnectService(void)
le_result_t le_gnss_SetAcquisitionRate(uint32_t rate)
le_result_t le_gnss_SetMinElevation(uint8_t minElevation)
Definition: le_gnss_interface.h:699
le_gnss_NmeaBitMask_t
Definition: le_gnss_interface.h:842
le_result_t le_gnss_GetDilutionOfPrecision(le_gnss_SampleRef_t positionSampleRef, le_gnss_DopType_t dopType, uint16_t *dopPtr)
le_result_t le_gnss_DeleteSuplCertificate(uint8_t suplCertificateId)
North American satellite navigation system.
Definition: le_gnss_interface.h:817
le_gnss_FixState_t
Definition: le_gnss_interface.h:654
2-Dimensional position fix.
Definition: le_gnss_interface.h:658
le_result_t le_gnss_GetMagneticDeviation(le_gnss_SampleRef_t positionSampleRef, int32_t *magneticDeviationPtr)
Definition: le_gnss_interface.h:742
void le_gnss_ReleaseSampleRef(le_gnss_SampleRef_t positionSampleRef)
Definition: le_gnss_interface.h:730
le_result_t le_gnss_GetNmeaSentences(le_gnss_NmeaBitMask_t *nmeaMaskPtrPtr)
DEBUG type enabled: Debug NMEA indication.
Definition: le_gnss_interface.h:862
GPGLL type enabled: GPS Geographic position, latitude / longitude.
Definition: le_gnss_interface.h:861
The GNSS device is disabled.
Definition: le_gnss_interface.h:641
le_result_t le_gnss_GetVerticalSpeed(le_gnss_SampleRef_t positionSampleRef, int32_t *vspeedPtr, int32_t *vspeedAccuracyPtr)
MS-Assisted mode.
Definition: le_gnss_interface.h:762
le_result_t le_gnss_SetSuplAssistedMode(le_gnss_AssistedMode_t assistedMode)
le_result_t le_gnss_GetDate(le_gnss_SampleRef_t positionSampleRef, uint16_t *yearPtr, uint16_t *monthPtr, uint16_t *dayPtr)
le_gnss_ConstellationBitMask_t
Definition: le_gnss_interface.h:815
le_result_t le_gnss_SetDopResolution(le_gnss_Resolution_t resolution)
GPVTG type enabled: GPS vector track and speed over the ground.
Definition: le_gnss_interface.h:848
void le_gnss_ConnectService(void)
GPRMC type enabled: GPS recommended minimum data.
Definition: le_gnss_interface.h:847
le_result_t le_gnss_GetSatellitesStatus(le_gnss_SampleRef_t positionSampleRef, uint8_t *satsInViewCountPtr, uint8_t *satsTrackingCountPtr, uint8_t *satsUsedCountPtr)
European Union satellite navigation system.
Definition: le_gnss_interface.h:823
le_result_t le_gnss_Stop(void)
Definition: le_gnss_interface.h:711
Worldwide area.
Definition: le_gnss_interface.h:800
le_gnss_State_t le_gnss_GetState(void)
le_result_t le_gnss_SetNmeaSentences(le_gnss_NmeaBitMask_t nmeaMask)
Horizontal dilution of precision.
Definition: le_gnss_interface.h:777
le_gnss_ConstellationArea_t
Definition: le_gnss_interface.h:796
le_result_t le_gnss_GetPositionState(le_gnss_SampleRef_t positionSampleRef, le_gnss_FixState_t *statePtr)
le_result_t le_gnss_GetMinElevation(uint8_t *minElevationPtrPtr)
le_result_t le_gnss_Disable(void)
GPGGA type enabled: GPS fix data.
Definition: le_gnss_interface.h:844
void le_gnss_SetServerDisconnectHandler(le_gnss_DisconnectHandler_t disconnectHandler, void *contextPtr)
Definition: le_gnss_interface.h:702
le_result_t le_gnss_GetHorizontalSpeed(le_gnss_SampleRef_t positionSampleRef, uint32_t *hspeedPtr, uint32_t *hspeedAccuracyPtr)
void(* le_gnss_PositionHandlerFunc_t)(le_gnss_SampleRef_t positionSampleRef, void *contextPtr)
Definition: le_gnss_interface.h:884
le_gnss_SampleRef_t le_gnss_GetLastSampleRef(void)
le_result_t le_gnss_SetConstellation(le_gnss_ConstellationBitMask_t constellationMask)
le_gnss_Resolution_t
Definition: le_gnss_interface.h:673
GNSS constellation field not defined.
Definition: le_gnss_interface.h:725
le_result_t le_gnss_ForceHotRestart(void)
SBAS constellation used in solution.
Definition: le_gnss_interface.h:825
MS-Based mode.
Definition: le_gnss_interface.h:760
le_result_t le_gnss_Enable(void)
void(* le_gnss_DisconnectHandler_t)(void *)
Definition: le_gnss_interface.h:441
le_result_t le_gnss_GetGpsTime(le_gnss_SampleRef_t positionSampleRef, uint32_t *gpsWeekPtr, uint32_t *gpsTimeOfWeekPtr)
GPDTM type enabled: Local geodetic datum and datum offset from.
Definition: le_gnss_interface.h:863
GPGSA type enabled: GPS DOP and active satellites.
Definition: le_gnss_interface.h:845
le_gnss_SbasConstellationCategory_t
Definition: le_gnss_interface.h:694
le_result_t le_gnss_GetConstellationArea(le_gnss_Constellation_t satConstellation, le_gnss_ConstellationArea_t *constellationAreaPtr)
le_result_t le_gnss_GetGpsLeapSeconds(le_gnss_SampleRef_t positionSampleRef, uint8_t *leapSecondsPtr)
The GNSS device is ready.
Definition: le_gnss_interface.h:637
Resolution of 1 decimal place.
Definition: le_gnss_interface.h:677
The GNSS fix position is not fixed.
Definition: le_gnss_interface.h:656
Geometric dilution of precision.
Definition: le_gnss_interface.h:781
GLGSV type enabled: GLONASS satellites in view.
Definition: le_gnss_interface.h:849
GAGSV type enabled: Galileo satellites in view.
Definition: le_gnss_interface.h:854
le_result_t le_gnss_GetTimeAccuracy(le_gnss_SampleRef_t positionSampleRef, uint32_t *timeAccuracyPtr)
struct le_gnss_PositionHandler * le_gnss_PositionHandlerRef_t
Definition: le_gnss_interface.h:874
GARMC type enabled: Galileo recommended minimum data.
Definition: le_gnss_interface.h:855
le_gnss_Constellation_t
Definition: le_gnss_interface.h:723
le_result_t le_gnss_GetDop(le_gnss_SampleRef_t positionSampleRef, uint16_t *hdopPtr, uint16_t *vdopPtr, uint16_t *pdopPtr)