le_gnss_interface.h

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