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