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