Snapdragon® Telematics Application Framework (TelAF) Interface Specification
taf_locPos_interface.h File Reference
#include "legato.h"
#include "taf_locGnss_interface.h"
#include "taf_locPos_common.h"

Go to the source code of this file.

Typedefs

typedef void(* taf_locPos_DisconnectHandler_t) (void *)
 

Functions

void taf_locPos_ConnectService (void)
 
le_result_t taf_locPos_TryConnectService (void)
 
LE_FULL_API void taf_locPos_SetServerDisconnectHandler (taf_locPos_DisconnectHandler_t disconnectHandler, void *contextPtr)
 
LE_FULL_API void taf_locPos_SetNonExitServerDisconnectHandler (taf_locPos_DisconnectHandler_t disconnectHandler, void *contextPtr)
 
void taf_locPos_DisconnectService (void)
 
taf_locPos_MovementHandlerRef_t taf_locPos_AddMovementHandler (uint32_t horizontalMagnitude, uint32_t verticalMagnitude, taf_locPos_MovementHandlerFunc_t handlerPtr, void *contextPtr)
 
void taf_locPos_RemoveMovementHandler (taf_locPos_MovementHandlerRef_t handlerRef)
 
le_result_t taf_locPos_Get2DLocation (int32_t *latitudePtr, int32_t *longitudePtr, int32_t *hAccuracyPtr)
 
le_result_t taf_locPos_GetDate (uint16_t *yearPtr, uint16_t *monthPtr, uint16_t *dayPtr)
 
le_result_t taf_locPos_GetFixState (taf_locGnss_FixState_t *statePtr)
 
le_result_t taf_locPos_GetMotion (uint32_t *hSpeedPtr, uint32_t *hSpeedAccuracyPtr, int32_t *vSpeedPtr, int32_t *vSpeedAccuracyPtr)
 
le_result_t taf_locPos_GetDirection (uint32_t *directionPtr, uint32_t *directionAccuracyPtr)
 
le_result_t taf_locPos_GetTime (uint16_t *hoursPtr, uint16_t *minutesPtr, uint16_t *secondsPtr, uint16_t *millisecondsPtr)
 
le_result_t taf_locPos_SetAcquisitionRate (uint32_t acquisitionRate)
 
uint32_t taf_locPos_GetAcquisitionRate (void)
 
void taf_locPos_sample_Release (taf_locPos_SampleRef_t positionSampleRef)
 
le_result_t taf_locPos_Get3DLocation (int32_t *latitudePtr, int32_t *longitudePtr, int32_t *hAccuracyPtr, int32_t *altitudePtr, int32_t *vAccuracyPtr)
 
le_result_t taf_locPos_sample_Get2DLocation (taf_locPos_SampleRef_t positionSampleRef, int32_t *latitudePtr, int32_t *longitudePtr, int32_t *horizontalAccuracyPtr)
 
le_result_t taf_locPos_sample_GetAltitude (taf_locPos_SampleRef_t positionSampleRef, int32_t *altitudePtr, int32_t *altitudeAccuracyPtr)
 
le_result_t taf_locPos_sample_GetTime (taf_locPos_SampleRef_t positionSampleRef, uint16_t *hoursPtr, uint16_t *minutesPtr, uint16_t *secondsPtr, uint16_t *millisecondsPtr)
 
le_result_t taf_locPos_sample_GetHorizontalSpeed (taf_locPos_SampleRef_t positionSampleRef, uint32_t *hSpeedPtr, uint32_t *hSpeedAccuracyPtr)
 
le_result_t taf_locPos_sample_GetDirection (taf_locPos_SampleRef_t positionSampleRef, uint32_t *directionPtr, uint32_t *directionAccuracyPtr)
 
le_result_t taf_locPos_sample_GetVerticalSpeed (taf_locPos_SampleRef_t positionSampleRef, int32_t *vspeedPtr, int32_t *vspeedAccuracyPtr)
 
le_result_t taf_locPos_SetDistanceResolution (taf_locPos_Resolution_t resolution)
 
le_result_t taf_locPos_sample_GetFixState (taf_locPos_SampleRef_t positionSampleRef, taf_locGnss_FixState_t *statePtr)
 
le_result_t taf_locPos_sample_GetDate (taf_locPos_SampleRef_t positionSampleRef, uint16_t *yearPtr, uint16_t *monthPtr, uint16_t *dayPtr)
 

Typedef Documentation

◆ taf_locPos_DisconnectHandler_t

typedef void(* taf_locPos_DisconnectHandler_t) (void *)

Type for handler called when a server disconnects.

Function Documentation

◆ taf_locPos_ConnectService()

void taf_locPos_ConnectService ( void  )

Connect the current client thread to the service providing this API. Block until the service is available.

For each thread that wants to use this API, either ConnectService or TryConnectService must be called before any other functions in this API. Normally, ConnectService is automatically called for the main thread, but not for any other thread. For details, see apiFilesC_client.

This function is created automatically.

◆ taf_locPos_TryConnectService()

le_result_t taf_locPos_TryConnectService ( void  )

Try to connect the current client thread to the service providing this API. Return with an error if the service is not available.

For each thread that wants to use this API, either ConnectService or TryConnectService must be called before any other functions in this API. Normally, ConnectService is automatically called for the main thread, but not for any other thread. For details, see apiFilesC_client.

This function is created automatically.

Returns
  • LE_OK if the client connected successfully to the service.
  • LE_UNAVAILABLE if the server is not currently offering the service to which the client is bound.
  • LE_NOT_PERMITTED if the client interface is not bound to any service (doesn't have a binding).
  • LE_COMM_ERROR if the Service Directory cannot be reached.

◆ taf_locPos_SetServerDisconnectHandler()

LE_FULL_API void taf_locPos_SetServerDisconnectHandler ( taf_locPos_DisconnectHandler_t  disconnectHandler,
void *  contextPtr 
)

Set handler called when server disconnection is detected.

When a server connection is lost, call this handler then exit with LE_FATAL. If a program wants to continue without exiting, it should call longjmp() from inside the handler.

◆ taf_locPos_SetNonExitServerDisconnectHandler()

LE_FULL_API void taf_locPos_SetNonExitServerDisconnectHandler ( taf_locPos_DisconnectHandler_t  disconnectHandler,
void *  contextPtr 
)

Set handler called when server disconnection is detected without exiting.

When a server connection is lost, call this handler without exit.

Warning
When using the API, it needs the application developer to handle some cases like re-connecting and recycling the resources. For most of cases, it is safe to use SetServerDisconnectHandler.

◆ taf_locPos_DisconnectService()

void taf_locPos_DisconnectService ( void  )

Disconnect the current client thread from the service providing this API.

Normally, this function doesn't need to be called. After this function is called, there's no longer a connection to the service, and the functions in this API can't be used. For details, see apiFilesC_client.

This function is created automatically.

◆ taf_locPos_AddMovementHandler()

taf_locPos_MovementHandlerRef_t taf_locPos_AddMovementHandler ( uint32_t  horizontalMagnitude,
uint32_t  verticalMagnitude,
taf_locPos_MovementHandlerFunc_t  handlerPtr,
void *  contextPtr 
)

Add handler function for EVENT 'taf_locPos_Movement'

This event provides information on movement changes.

Parameters
[in]horizontalMagnitudeHorizontal magnitude in meters.
[in]verticalMagnitudeVertical magnitude in meters.
[in]handlerPtr
[in]contextPtr

◆ taf_locPos_RemoveMovementHandler()

void taf_locPos_RemoveMovementHandler ( taf_locPos_MovementHandlerRef_t  handlerRef)

Remove handler function for EVENT 'taf_locPos_Movement'

Parameters
[in]handlerRef

◆ taf_locPos_Get2DLocation()

le_result_t taf_locPos_Get2DLocation ( int32_t *  latitudePtr,
int32_t *  longitudePtr,
int32_t *  hAccuracyPtr 
)

Gets the 2D location data (latitude, longitude, horizontal accuracy).

Returns
  • LE_FAULT Failed to get the 2D location data.
  • LE_OUT_OF_RANGE One, or more, retrieved parameters is invalid.
  • LE_OK Succeeded.
Note
latitudePtr, longitudePtr, hAccuracyPtr can be set to NULL if not needed.
Parameters
[out]latitudePtrWGS84 latitude in degrees.
[out]longitudePtrWGS84 longitude in degrees.
[out]hAccuracyPtrHorizontal accuracy in meters by default.

◆ taf_locPos_GetDate()

le_result_t taf_locPos_GetDate ( uint16_t *  yearPtr,
uint16_t *  monthPtr,
uint16_t *  dayPtr 
)

Gets the date of the last updated location.

Returns
  • LE_FAULT Failed to get the date.
  • LE_OUT_OF_RANGE The retrieved date is invalid.
  • LE_OK Succeeded.
Note
Currently the API implementation is in progress.
Parameters
[out]yearPtrUTC Year A.D., e.g. 2014.
[out]monthPtrUTC Month into the year; range is 1 to 12.
[out]dayPtrUTC Days into the month; range is 1 to 31.

◆ taf_locPos_GetFixState()

le_result_t taf_locPos_GetFixState ( taf_locGnss_FixState_t statePtr)

Gets the position fix state.

Returns
  • LE_FAULT Failed to get the position fix state.
  • LE_OK Succeeded.
Note
In case the function fails to get the position fix state, a fatal error occurs, the function will not return.
Parameters
[out]statePtrPosition fix state.

◆ taf_locPos_GetMotion()

le_result_t taf_locPos_GetMotion ( uint32_t *  hSpeedPtr,
uint32_t *  hSpeedAccuracyPtr,
int32_t *  vSpeedPtr,
int32_t *  vSpeedAccuracyPtr 
)

Gets the motion data (horizontal speed, horizontal speed accuracy, vertical speed, and vertical speed accuracy).

Returns
  • LE_FAULT Failed to get the motion data.
  • LE_OUT_OF_RANGE One, or more, of the retrieved parameters is invalid (set to INT32_MAX, UINT32_MAX).
  • LE_OK Succeeded.
Note
hSpeedPtr, hSpeedAccuracyPtr, vSpeedPtr, and vSpeedAccuracyPtr can be set to NULL if not needed.
Parameters
[out]hSpeedPtrHorizontal speed in m/sec.
[out]hSpeedAccuracyPtrHorizontal speed accuracy in m/sec.
[out]vSpeedPtrVertical speed in m/sec.
[out]vSpeedAccuracyPtrVertical speed accuracy in m/sec.

◆ taf_locPos_GetDirection()

le_result_t taf_locPos_GetDirection ( uint32_t *  directionPtr,
uint32_t *  directionAccuracyPtr 
)

Gets the position sample's direction. Direction of movement is the direction that the vehicle or person is actually moving.

Returns
  • LE_FAULT Failed to get the direction indication.
  • LE_OUT_OF_RANGE One, or more, of the retrieved parameters is invalid.
  • LE_OK Succeeded.
Note
Direction is given in degrees. Direction ranges from 0 to 359 degrees, where 0 is true North degree.
directionPtr and directionAccuracyPtr can be set to NULL if not needed.
Parameters
[out]directionPtrDirection indication in degrees; range is 0 to 359.
[out]directionAccuracyPtrDirection's accuracy estimation in degrees.

◆ taf_locPos_GetTime()

le_result_t taf_locPos_GetTime ( uint16_t *  hoursPtr,
uint16_t *  minutesPtr,
uint16_t *  secondsPtr,
uint16_t *  millisecondsPtr 
)

Gets the position sample's time.

Returns
  • LE_FAULT Failed to get the time.
  • LE_OUT_OF_RANGE The retrieved time is invalid.
  • LE_OK Succeeded.
Parameters
[out]hoursPtrUTC Hours of the day; range is 0 to 23.
[out]minutesPtrUTC Minutes of the hour; range is 0 to 59.
[out]secondsPtrUTC Seconds of the minute; range is 0 to 59.
[out]millisecondsPtrUTC Milliseconds of the second; range is 0 to 999.

◆ taf_locPos_SetAcquisitionRate()

le_result_t taf_locPos_SetAcquisitionRate ( uint32_t  acquisitionRate)

Sets the acquisition rate.

Returns
  • LE_OUT_OF_RANGE Acquisition rate is invalid.
  • LE_OK Succeeded.
Parameters
[in]acquisitionRateAcquisition Rate in milliseconds.

◆ taf_locPos_GetAcquisitionRate()

uint32_t taf_locPos_GetAcquisitionRate ( void  )

Retrieves the acquisition rate in milliseconds.

Returns
Acquisition rate in milliseconds.

◆ taf_locPos_sample_Release()

void taf_locPos_sample_Release ( taf_locPos_SampleRef_t  positionSampleRef)

Releases the position sample.

Note
If the caller is passing an invalid position reference to this function, it is a fatal error and the function will not return.
Parameters
[in]positionSampleRefPosition sample reference.

◆ taf_locPos_Get3DLocation()

le_result_t taf_locPos_Get3DLocation ( int32_t *  latitudePtr,
int32_t *  longitudePtr,
int32_t *  hAccuracyPtr,
int32_t *  altitudePtr,
int32_t *  vAccuracyPtr 
)

Gets the 3D location data (latitude, longitude, altitude, horizontal accuracy, vertical accuracy)

Returns
  • LE_FAULT Failed to get the 3D location data.
  • LE_OUT_OF_RANGE One, or more, of the retrieved parameters is invalid.
  • LE_OK Succeeded.
Note
latitudePtr, longitudePtr,hAccuracyPtr, altitudePtr, and vAccuracyPtr can be set to NULL if not needed.
Parameters
[out]latitudePtrWGS84 Latitude in degrees.
[out]longitudePtrWGS84 Longitude in degrees.
[out]hAccuracyPtrHorizontal accuracy in meters by default.
[out]altitudePtrAltitude above mean sea level in meters by default.
[out]vAccuracyPtrVertical accuracy in meters by default.

◆ taf_locPos_sample_Get2DLocation()

le_result_t taf_locPos_sample_Get2DLocation ( taf_locPos_SampleRef_t  positionSampleRef,
int32_t *  latitudePtr,
int32_t *  longitudePtr,
int32_t *  horizontalAccuracyPtr 
)

Gets the position sample's 2D location (latitude, longitude, horizontal accuracy)

Returns
  • LE_FAULT Failed to find the positionSample.
  • LE_OUT_OF_RANGE One, or more, of the retrieved parameters is invalid.
  • LE_OK Suceeded.
Note
If the caller passes an invalid position reference to this function, it is a fatal error and the function will not return.
latitudePtr, longitudePtr, and horizontalAccuracyPtr can be set to NULL if not needed.
Parameters
[in]positionSampleRefPosition sample reference.
[out]latitudePtrWGS84 latitude in degrees.
[out]longitudePtrWGS84 longitude in degrees.
[out]horizontalAccuracyPtrHorizontal accuracy in meters by default.

◆ taf_locPos_sample_GetAltitude()

le_result_t taf_locPos_sample_GetAltitude ( taf_locPos_SampleRef_t  positionSampleRef,
int32_t *  altitudePtr,
int32_t *  altitudeAccuracyPtr 
)

Gets the position sample's altitude.

Returns
  • LE_FAULT Failed to find the positionSample.
  • LE_OUT_OF_RANGE One, or more, of the retrieved parameters is invalid.
  • LE_OK Suceeded.
Note
If the caller passes an invalid position reference to this function, it is a fatal error and the function will not return.
altitudePtr and altitudeAccuracyPtr can be set to NULL if not needed.
Parameters
[in]positionSampleRefPosition sample reference.
[out]altitudePtrAltitude above mean sea level in meters by default.
[out]altitudeAccuracyPtrVertical accuracy in meters by default.

◆ taf_locPos_sample_GetTime()

le_result_t taf_locPos_sample_GetTime ( taf_locPos_SampleRef_t  positionSampleRef,
uint16_t *  hoursPtr,
uint16_t *  minutesPtr,
uint16_t *  secondsPtr,
uint16_t *  millisecondsPtr 
)

Gets the position sample's time.

Returns
  • LE_FAULT Failed to get the time.
  • LE_OUT_OF_RANGE The retrieved time is invalid.
  • LE_OK Succeeded.
Parameters
[in]positionSampleRefPosition sample reference.
[out]hoursPtrUTC hours of the day; range is 0 to 23.
[out]minutesPtrUTC minutes of the hour; range is 0 to 59.
[out]secondsPtrUTC seconds of the minute; range is 0 to 59.
[out]millisecondsPtrUTC milliseconds of the second; range is 0 to 999.

◆ taf_locPos_sample_GetHorizontalSpeed()

le_result_t taf_locPos_sample_GetHorizontalSpeed ( taf_locPos_SampleRef_t  positionSampleRef,
uint32_t *  hSpeedPtr,
uint32_t *  hSpeedAccuracyPtr 
)

Gets the position sample's horizontal speed.

Returns
  • LE_FAULT Failed to find the positionSample.
  • LE_OUT_OF_RANGE One, or more, of the retrieved parameters is invalid.
  • LE_OK Suceeded.
Note
If the caller passes an invalid position reference to this function, it is a fatal error and the function will not return.
hSpeedPtr and hSpeedAccuracyPtr can be set to NULL if not needed.
Parameters
[in]positionSampleRefPosition sample reference.
[out]hSpeedPtrThe horizontal speed in m/sec.
[out]hSpeedAccuracyPtrThe horizontal accuracy in m/sec.

◆ taf_locPos_sample_GetDirection()

le_result_t taf_locPos_sample_GetDirection ( taf_locPos_SampleRef_t  positionSampleRef,
uint32_t *  directionPtr,
uint32_t *  directionAccuracyPtr 
)

Get the position sample's direction

Returns
  • LE_FAULT Failed to find the positionSample.
  • LE_OUT_OF_RANGE One of the retrieved parameter is invalid.
  • LE_OK Suceeded.
Note
Direction is given in degrees. Direction ranges from 0 to 359 degrees, where 0 is true North.
If the caller passed an invalid position reference to this function, it is a fatal error and the function will not return.
directionPtr and directionAccuracyPtr can be set to NULL if not needed.
Parameters
[in]positionSampleRefPosition sample reference.
[out]directionPtrDirection indication in degrees.
[out]directionAccuracyPtrDirection's accuracy estimation in degrees.

◆ taf_locPos_sample_GetVerticalSpeed()

le_result_t taf_locPos_sample_GetVerticalSpeed ( taf_locPos_SampleRef_t  positionSampleRef,
int32_t *  vspeedPtr,
int32_t *  vspeedAccuracyPtr 
)

Gets the position sample's vertical speed.

Returns
  • LE_FAULT Failed to find the positionSample.
  • LE_OUT_OF_RANGE One, or more, of the retrieved parameters is not valid.
  • LE_OK Suceeded.
Note
If the caller passes an invalid position reference to this function, it is a fatal error and the function will not return.
vSpeedPtr and vSpeedAccuracyPtr can be set to NULL if not needed.
Parameters
[in]positionSampleRefPosition sample reference
[out]vspeedPtrThe vertical speed in m/sec.
[out]vspeedAccuracyPtrThe vertical speed's accuracy in m/sec.

◆ taf_locPos_SetDistanceResolution()

le_result_t taf_locPos_SetDistanceResolution ( taf_locPos_Resolution_t  resolution)

Sets the resolution for the positioning distance values.

Returns
  • LE_OK Suceeded.
  • LE_BAD_PARAMETER Invalid parameter provided.
Note
The positioning distance values are: the altitude above sea level, the horizontal position accuracy and the vertical position accuracy. The API sets the same resolution to all distance values. The resolution change request takes effect immediately.
Parameters
[in]resolutionResolution.

◆ taf_locPos_sample_GetFixState()

le_result_t taf_locPos_sample_GetFixState ( taf_locPos_SampleRef_t  positionSampleRef,
taf_locGnss_FixState_t statePtr 
)

Gets the position sample's fix state.

Returns
  • LE_FAULT Failed to get the position sample's fix state.
  • LE_OK Suceeded.
Note
If the caller passes an invalid position reference to this function, it is a fatal error and the function will not return.
Parameters
[in]positionSampleRefPosition sample reference.
[out]statePtrPosition fix state.

◆ taf_locPos_sample_GetDate()

le_result_t taf_locPos_sample_GetDate ( taf_locPos_SampleRef_t  positionSampleRef,
uint16_t *  yearPtr,
uint16_t *  monthPtr,
uint16_t *  dayPtr 
)

Gets the position sample date.

Returns
  • LE_FAULT Failed to get the date.
  • LE_OUT_OF_RANGE The retrieved date is invalid.
  • LE_OK Suceeded.
Parameters
[in]positionSampleRefPosition sample reference.
[out]yearPtrUTC year
[out]monthPtrUTC month of the year; range is 1 to 12.
[out]dayPtrUTC day of the month; range is 1 to 31.