le_gnss_interface.h
Go to the documentation of this file.
24 * GNSS or Global Navigation Satellite System is a satellite navigation system with global coverage.98 * le_gnss_GetPositionState() function. The GNSS fix position states are given by le_gnss_FixState_t109 * The le_gnss_InjectUtcTime() function injects the UTC time into the location engine. Providing an111 * @note It is mandatory to enable the 'Extended Ephemeris' file injection into the GNSS device with115 * Please refer to your platform documentation @ref platformConstraintsGnss_SettingConfiguration for119 * The le_gnss_ForceHotRestart() function performs a "HOT" restart of the GNSS device. The current124 * The le_gnss_ForceWarmRestart() function performs a "WARM" restart of the GNSS device. The current131 * The le_gnss_ForceColdRestart() function performs a "COLD" restart of the GNSS device. The current141 * The GNSS position is computed and delivered each acquisition rate. The acquisition rate defines158 * Please refer to your platform documentation @ref platformConstraintsGnss_SettingConfiguration for161 * Combinations of constellation for GPS, GLONASS, BDS, GALILEO and QZSS satellites are currently171 * le_gnss_SetConstellationArea sets the area for a GNSS constellation. le_gnss_GetConstellationArea190 * @ref le_gnss_NMEA with a bit mask. The supported values are listed in @ref le_gnss_NmeaBitMask_t.192 * @note This function may be subject to limitations depending on the platform. Please refer to the196 * Please refer to your platform documentation @ref platformConstraintsGnss_SettingConfiguration for204 * The le_gnss_GetNmeaSentences() function gets the bit mask of the enabled NMEA sentences in the214 * ''LE_OK or error code'' means the function is authorized in the corresponding state, the request215 * is performed and the result is returned; otherwise the returned error is indicated for each state218 *| ----------------------------- | --------------------------- | -----------------------------| --------------------------- | --------------------------- |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 |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 |289 * le_gnss_SetDataResolution() function can be called to configure the resolution of position data297 * le_gnss_SetDataResolution() function is called with vertical position accuracy set as data type300 * @note If le_gnss_SetDataResolution() function is not called, the position data types are received319 * A sample code using le_gnss_ConvertDataCoordinate() function can be seen in the following page:327 * @c le_gnss_SetDopResolution() and @c le_gnss_GetDilutionOfPrecision() functions should be called365 * With le_gnss_GetExtendedEphemerisValidity(), you will to get the validity of the last injected378 * That 3GPP User Plane A-GNSS (Assisted GNSS) protocol is defined by two different standardization379 * bodies, 3GPP and Open Mobile Alliance (OMA). For more information, please refer to the standard.384 *, then returns the retrieved GNSS data to the SUPL (Secure User Plan Location) server, where the388 * server. The MS measures the signals from the GNSS satellites and makes the position calculation.401 * The SUPL server is configured using the le_gnss_SetSuplServerUrl() function. That function sets405 * le_gnss_InjectSuplCertificate() function and deleted through the le_gnss_DeleteSuplCertificate()407 * The SUPL certificate lenght given as parameter to le_gnss_InjectSuplCertificate() must be less480 //--------------------------------------------------------------------------------------------------484 //--------------------------------------------------------------------------------------------------487 //--------------------------------------------------------------------------------------------------490 * Connect the current client thread to the service providing this API. Block until the service is493 * For each thread that wants to use this API, either ConnectService or TryConnectService must be494 * called before any other functions in this API. Normally, ConnectService is automatically called499 //--------------------------------------------------------------------------------------------------505 //--------------------------------------------------------------------------------------------------508 * Try to connect the current client thread to the service providing this API. Return with an error511 * For each thread that wants to use this API, either ConnectService or TryConnectService must be512 * called before any other functions in this API. Normally, ConnectService is automatically called521 * - LE_NOT_PERMITTED if the client interface is not bound to any service (doesn't have a binding).524 //--------------------------------------------------------------------------------------------------530 //--------------------------------------------------------------------------------------------------534 * When a server connection is lost, call this handler then exit with LE_FATAL. If a program wants537 //--------------------------------------------------------------------------------------------------544 //--------------------------------------------------------------------------------------------------550 * longer a connection to the service, and the functions in this API can't be used. For details, see555 //--------------------------------------------------------------------------------------------------562 //--------------------------------------------------------------------------------------------------566 //--------------------------------------------------------------------------------------------------569 //--------------------------------------------------------------------------------------------------573 //--------------------------------------------------------------------------------------------------576 //--------------------------------------------------------------------------------------------------580 //--------------------------------------------------------------------------------------------------583 //--------------------------------------------------------------------------------------------------587 //--------------------------------------------------------------------------------------------------590 //--------------------------------------------------------------------------------------------------594 //--------------------------------------------------------------------------------------------------597 //--------------------------------------------------------------------------------------------------601 //--------------------------------------------------------------------------------------------------604 //--------------------------------------------------------------------------------------------------608 //--------------------------------------------------------------------------------------------------611 //--------------------------------------------------------------------------------------------------615 //--------------------------------------------------------------------------------------------------618 //--------------------------------------------------------------------------------------------------622 //--------------------------------------------------------------------------------------------------625 //--------------------------------------------------------------------------------------------------629 //--------------------------------------------------------------------------------------------------632 //--------------------------------------------------------------------------------------------------638 //--------------------------------------------------------------------------------------------------641 //--------------------------------------------------------------------------------------------------650 //--------------------------------------------------------------------------------------------------653 //--------------------------------------------------------------------------------------------------657 //--------------------------------------------------------------------------------------------------660 //--------------------------------------------------------------------------------------------------664 //--------------------------------------------------------------------------------------------------667 //--------------------------------------------------------------------------------------------------672 //--------------------------------------------------------------------------------------------------675 //--------------------------------------------------------------------------------------------------679 //--------------------------------------------------------------------------------------------------682 //--------------------------------------------------------------------------------------------------698 //--------------------------------------------------------------------------------------------------705 //--------------------------------------------------------------------------------------------------716 //--------------------------------------------------------------------------------------------------723 //--------------------------------------------------------------------------------------------------737 //--------------------------------------------------------------------------------------------------746 //--------------------------------------------------------------------------------------------------759 //--------------------------------------------------------------------------------------------------768 //--------------------------------------------------------------------------------------------------779 //--------------------------------------------------------------------------------------------------785 //--------------------------------------------------------------------------------------------------796 //--------------------------------------------------------------------------------------------------802 //--------------------------------------------------------------------------------------------------813 //--------------------------------------------------------------------------------------------------820 //--------------------------------------------------------------------------------------------------828 * @note If the caller is passing an invalid Position sample reference or null pointers into this831 //--------------------------------------------------------------------------------------------------840 //--------------------------------------------------------------------------------------------------849 * @note It is mandatory to enable the 'Extended Ephemeris' file injection into the GNSS device with852 //--------------------------------------------------------------------------------------------------861 //--------------------------------------------------------------------------------------------------872 //--------------------------------------------------------------------------------------------------878 //--------------------------------------------------------------------------------------------------889 //--------------------------------------------------------------------------------------------------895 //--------------------------------------------------------------------------------------------------905 //--------------------------------------------------------------------------------------------------911 //--------------------------------------------------------------------------------------------------923 //--------------------------------------------------------------------------------------------------929 //--------------------------------------------------------------------------------------------------939 //--------------------------------------------------------------------------------------------------945 //--------------------------------------------------------------------------------------------------955 //--------------------------------------------------------------------------------------------------961 //--------------------------------------------------------------------------------------------------974 //--------------------------------------------------------------------------------------------------981 //--------------------------------------------------------------------------------------------------994 //--------------------------------------------------------------------------------------------------1000 //--------------------------------------------------------------------------------------------------1013 //--------------------------------------------------------------------------------------------------1019 //--------------------------------------------------------------------------------------------------1031 * @warning This function may be subject to limitations depending on the platform. Please refer to1037 //--------------------------------------------------------------------------------------------------1044 //--------------------------------------------------------------------------------------------------1056 //--------------------------------------------------------------------------------------------------1063 //--------------------------------------------------------------------------------------------------1073 //--------------------------------------------------------------------------------------------------1082 //--------------------------------------------------------------------------------------------------1086 //--------------------------------------------------------------------------------------------------1093 //--------------------------------------------------------------------------------------------------1100 * @note If the caller is passing an invalid Position sample reference or a null pointer into this1103 //--------------------------------------------------------------------------------------------------1112 //--------------------------------------------------------------------------------------------------1136 //--------------------------------------------------------------------------------------------------1149 //--------------------------------------------------------------------------------------------------1158 * @note Altitude is in meters, above Mean Sea Level, with 3 decimal places (3047 = 3.047 meters).1175 //--------------------------------------------------------------------------------------------------1186 //--------------------------------------------------------------------------------------------------1195 * @note If the caller is passing an invalid Position sample reference or null pointers into this1199 //--------------------------------------------------------------------------------------------------1214 //--------------------------------------------------------------------------------------------------1223 * @note If the caller is passing an invalid Position sample reference or null pointers into this1226 //--------------------------------------------------------------------------------------------------1237 //--------------------------------------------------------------------------------------------------1249 * @note If the caller is passing an invalid position sample reference or a null pointer into this1252 //--------------------------------------------------------------------------------------------------1261 //--------------------------------------------------------------------------------------------------1270 * @note If the caller is passing an invalid position sample reference or a null pointer into this1273 //--------------------------------------------------------------------------------------------------1282 //--------------------------------------------------------------------------------------------------1291 * @note The leap seconds in advance is the accumulated time in seconds since the start of GPS Epoch1294 * @note Insertion of each UTC leap second is usually decided about six months in advance by the1297 * @note If the caller is passing an invalid position sample reference or a null pointer into this1302 //--------------------------------------------------------------------------------------------------1311 //--------------------------------------------------------------------------------------------------1321 * @note Insertion of each UTC leap second is usually decided about six months in advance by the1327 * @note If the return value of a parameter is INT32_MAX/UINT64_MAX, the parameter is not valid.1329 //--------------------------------------------------------------------------------------------------1345 //--------------------------------------------------------------------------------------------------1354 * @note If the caller is passing an invalid Position sample reference or null pointers into this1357 //--------------------------------------------------------------------------------------------------1370 //--------------------------------------------------------------------------------------------------1380 * @note Horizontal speed is in meters/second with 2 decimal places (3047 = 30.47 meters/second).1382 * @note Horizontal speed accuracy estimate is default set to meters/second with 1 decimal place1396 //--------------------------------------------------------------------------------------------------1407 //--------------------------------------------------------------------------------------------------1435 //--------------------------------------------------------------------------------------------------1447 //--------------------------------------------------------------------------------------------------1449 * Get the position sample's direction. Direction of movement is the direction that the vehicle or1457 * @note Direction and direction accuracy are given in degrees with 1 decimal place: 1755 = 175.51469 //--------------------------------------------------------------------------------------------------1482 //--------------------------------------------------------------------------------------------------1504 //--------------------------------------------------------------------------------------------------1544 //--------------------------------------------------------------------------------------------------1549 //--------------------------------------------------------------------------------------------------1556 //--------------------------------------------------------------------------------------------------1571 //--------------------------------------------------------------------------------------------------1584 //--------------------------------------------------------------------------------------------------1604 //--------------------------------------------------------------------------------------------------1617 //--------------------------------------------------------------------------------------------------1634 //--------------------------------------------------------------------------------------------------1645 //--------------------------------------------------------------------------------------------------1657 * @note For a 2D position fix, the altitude with respect to the WGS-84 ellipsoid will be indicated1663 //--------------------------------------------------------------------------------------------------1673 //--------------------------------------------------------------------------------------------------1689 //--------------------------------------------------------------------------------------------------1698 //--------------------------------------------------------------------------------------------------1708 //--------------------------------------------------------------------------------------------------1714 //--------------------------------------------------------------------------------------------------1721 //--------------------------------------------------------------------------------------------------1728 //--------------------------------------------------------------------------------------------------1741 //--------------------------------------------------------------------------------------------------1748 //--------------------------------------------------------------------------------------------------1759 //--------------------------------------------------------------------------------------------------1766 //--------------------------------------------------------------------------------------------------1784 //--------------------------------------------------------------------------------------------------1791 //--------------------------------------------------------------------------------------------------1807 //--------------------------------------------------------------------------------------------------1819 //--------------------------------------------------------------------------------------------------1830 //--------------------------------------------------------------------------------------------------1838 //--------------------------------------------------------------------------------------------------1850 * @warning This function may be subject to limitations depending on the platform. Please refer to1863 //--------------------------------------------------------------------------------------------------1870 //--------------------------------------------------------------------------------------------------1888 //--------------------------------------------------------------------------------------------------1895 //--------------------------------------------------------------------------------------------------1900 //--------------------------------------------------------------------------------------------------1906 //--------------------------------------------------------------------------------------------------1919 //--------------------------------------------------------------------------------------------------1926 //--------------------------------------------------------------------------------------------------1938 //--------------------------------------------------------------------------------------------------1945 //--------------------------------------------------------------------------------------------------1958 //--------------------------------------------------------------------------------------------------1965 //--------------------------------------------------------------------------------------------------1977 //--------------------------------------------------------------------------------------------------1986 //--------------------------------------------------------------------------------------------------1998 //--------------------------------------------------------------------------------------------------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 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)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:485le_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)