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