le_pos_interface.h File Reference

#include "legato.h"

Go to the source code of this file.

Typedefs

typedef void(* le_pos_DisconnectHandler_t) (void *)
 
typedef struct le_pos_Sample * le_pos_SampleRef_t
 
typedef struct le_pos_MovementHandler * le_pos_MovementHandlerRef_t
 
typedef void(* le_pos_MovementHandlerFunc_t) (le_pos_SampleRef_t positionSampleRef, void *contextPtr)
 

Enumerations

enum  le_pos_FixState_t {
  LE_POS_STATE_NO_FIX = 0, LE_POS_STATE_FIX_2D = 1, LE_POS_STATE_FIX_3D = 2, LE_POS_STATE_FIX_ESTIMATED = 3,
  LE_POS_STATE_UNKNOWN = 4
}
 
enum  le_pos_Resolution_t {
  LE_POS_RES_METER = 0, LE_POS_RES_DECIMETER = 1, LE_POS_RES_CENTIMETER = 2, LE_POS_RES_MILLIMETER = 3,
  LE_POS_RES_UNKNOWN = 4
}
 

Functions

void le_pos_ConnectService (void)
 
le_result_t le_pos_TryConnectService (void)
 
void le_pos_SetServerDisconnectHandler (le_pos_DisconnectHandler_t disconnectHandler, void *contextPtr)
 
void le_pos_DisconnectService (void)
 
le_pos_MovementHandlerRef_t le_pos_AddMovementHandler (uint32_t horizontalMagnitude, uint32_t verticalMagnitude, le_pos_MovementHandlerFunc_t handlerPtr, void *contextPtr)
 
void le_pos_RemoveMovementHandler (le_pos_MovementHandlerRef_t handlerRef)
 
le_result_t le_pos_Get2DLocation (int32_t *latitudePtr, int32_t *longitudePtr, int32_t *hAccuracyPtr)
 
le_result_t le_pos_Get3DLocation (int32_t *latitudePtr, int32_t *longitudePtr, int32_t *hAccuracyPtr, int32_t *altitudePtr, int32_t *vAccuracyPtr)
 
le_result_t le_pos_GetTime (uint16_t *hoursPtr, uint16_t *minutesPtr, uint16_t *secondsPtr, uint16_t *millisecondsPtr)
 
le_result_t le_pos_GetDate (uint16_t *yearPtr, uint16_t *monthPtr, uint16_t *dayPtr)
 
le_result_t le_pos_GetMotion (uint32_t *hSpeedPtr, uint32_t *hSpeedAccuracyPtr, int32_t *vSpeedPtr, int32_t *vSpeedAccuracyPtr)
 
le_result_t le_pos_GetHeading (uint32_t *headingPtr, uint32_t *headingAccuracyPtr)
 
le_result_t le_pos_GetDirection (uint32_t *directionPtr, uint32_t *directionAccuracyPtr)
 
le_result_t le_pos_GetFixState (le_pos_FixState_t *statePtr)
 
le_result_t le_pos_sample_Get2DLocation (le_pos_SampleRef_t positionSampleRef, int32_t *latitudePtr, int32_t *longitudePtr, int32_t *horizontalAccuracyPtr)
 
le_result_t le_pos_sample_GetTime (le_pos_SampleRef_t positionSampleRef, uint16_t *hoursPtr, uint16_t *minutesPtr, uint16_t *secondsPtr, uint16_t *millisecondsPtr)
 
le_result_t le_pos_sample_GetDate (le_pos_SampleRef_t positionSampleRef, uint16_t *yearPtr, uint16_t *monthPtr, uint16_t *dayPtr)
 
le_result_t le_pos_sample_GetAltitude (le_pos_SampleRef_t positionSampleRef, int32_t *altitudePtr, int32_t *altitudeAccuracyPtr)
 
le_result_t le_pos_sample_GetHorizontalSpeed (le_pos_SampleRef_t positionSampleRef, uint32_t *hSpeedPtr, uint32_t *hSpeedAccuracyPtr)
 
le_result_t le_pos_sample_GetVerticalSpeed (le_pos_SampleRef_t positionSampleRef, int32_t *vspeedPtr, int32_t *vspeedAccuracyPtr)
 
le_result_t le_pos_sample_GetHeading (le_pos_SampleRef_t positionSampleRef, uint32_t *headingPtr, uint32_t *headingAccuracyPtr)
 
le_result_t le_pos_sample_GetDirection (le_pos_SampleRef_t positionSampleRef, uint32_t *directionPtr, uint32_t *directionAccuracyPtr)
 
le_result_t le_pos_sample_GetFixState (le_pos_SampleRef_t positionSampleRef, le_pos_FixState_t *statePtr)
 
void le_pos_sample_Release (le_pos_SampleRef_t positionSampleRef)
 
le_result_t le_pos_SetAcquisitionRate (uint32_t acquisitionRate)
 
uint32_t le_pos_GetAcquisitionRate (void)
 
le_result_t le_pos_SetDistanceResolution (le_pos_Resolution_t resolution)
 

Detailed Description

Legato Positioning include file.

Typedef Documentation

◆ le_pos_DisconnectHandler_t

typedef void(* le_pos_DisconnectHandler_t) (void *)

Type for handler called when a server disconnects.

◆ le_pos_MovementHandlerFunc_t

typedef void(* le_pos_MovementHandlerFunc_t) (le_pos_SampleRef_t positionSampleRef, void *contextPtr)

Handler for Movement changes.

◆ le_pos_MovementHandlerRef_t

typedef struct le_pos_MovementHandler* le_pos_MovementHandlerRef_t

Reference type used by Add/Remove functions for EVENT 'le_pos_Movement'

◆ le_pos_SampleRef_t

typedef struct le_pos_Sample* le_pos_SampleRef_t

Reference type for dealing with Position samples.

Enumeration Type Documentation

◆ le_pos_FixState_t

Fix position states.

Enumerator
LE_POS_STATE_NO_FIX 

The position is not fixed.

LE_POS_STATE_FIX_2D 

2-Dimensional position fix.

LE_POS_STATE_FIX_3D 

3-Dimensional position fix.

LE_POS_STATE_FIX_ESTIMATED 

Estimated (i.e. forward predicted) position fix.

LE_POS_STATE_UNKNOWN 

Unknown state.

◆ le_pos_Resolution_t

Resolution values.

Enumerator
LE_POS_RES_METER 

Resolution in meter.

LE_POS_RES_DECIMETER 

Resolution in decimeter.

LE_POS_RES_CENTIMETER 

Resolution in centimeter.

LE_POS_RES_MILLIMETER 

Resolution in millimeter.

LE_POS_RES_UNKNOWN 

Unknown resolution.

Function Documentation

◆ le_pos_AddMovementHandler()

le_pos_MovementHandlerRef_t le_pos_AddMovementHandler ( uint32_t  horizontalMagnitude,
uint32_t  verticalMagnitude,
le_pos_MovementHandlerFunc_t  handlerPtr,
void *  contextPtr 
)

Add handler function for EVENT 'le_pos_Movement'

This event provides information on movement changes.

Parameters
[in]horizontalMagnitudeHorizontal magnitude in meters. 0 means that I don't care about changes in the latitude and longitude.
[in]verticalMagnitudeVertical magnitude in meters. 0 means that I don't care about changes in the altitude.
[in]handlerPtr
[in]contextPtr

◆ le_pos_ConnectService()

void le_pos_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 Client-specific Functions.

This function is created automatically.

◆ le_pos_DisconnectService()

void le_pos_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 Client-specific Functions.

This function is created automatically.

◆ le_pos_Get2DLocation()

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

Get the 2D location's data (Latitude, Longitude, Horizontal accuracy).

Returns
LE_FAULT Function failed to get the 2D location's data
LE_OUT_OF_RANGE One of the retrieved parameter is invalid (set to INT32_MAX).
LE_OK Function succeeded.
Note
latitudePtr, longitudePtr, hAccuracyPtr can be set to NULL if not needed.
Parameters
[out]latitudePtrWGS84 Latitude in degrees, positive North [resolution 1e-6].
[out]longitudePtrWGS84 Longitude in degrees, positive East [resolution 1e-6].
[out]hAccuracyPtrHorizontal position's accuracy in meters by default.

◆ le_pos_Get3DLocation()

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

Get the 3D location's data (Latitude, Longitude, Altitude, Horizontal accuracy, Vertical accuracy).

Returns
LE_FAULT Function failed to get the 3D location's data
LE_OUT_OF_RANGE One of the retrieved parameter is invalid (set to INT32_MAX).
LE_OK Function succeeded.
Note
latitudePtr, longitudePtr,hAccuracyPtr, altitudePtr, vAccuracyPtr can be set to NULL if not needed.
Parameters
[out]latitudePtrWGS84 Latitude in degrees, positive North [resolution 1e-6].
[out]longitudePtrWGS84 Longitude in degrees, positive East [resolution 1e-6].
[out]hAccuracyPtrHorizontal position's accuracy in meters by default.
[out]altitudePtrAltitude above Mean Sea Level in meters by default.
[out]vAccuracyPtrVertical position's accuracy in meters by default.

◆ le_pos_GetAcquisitionRate()

uint32_t le_pos_GetAcquisitionRate ( void  )

Retrieve the acquisition rate.

Returns
Acquisition rate in milliseconds.

◆ le_pos_GetDate()

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

Get the date of the last updated location

Returns
LE_FAULT Function failed to get the date.
LE_OUT_OF_RANGE The retrieved date is invalid (all fields are set to 0).
LE_OK Function succeeded.
Parameters
[out]yearPtrUTC Year A.D. [e.g. 2014].
[out]monthPtrUTC Month into the year [range 1...12].
[out]dayPtrUTC Days into the month [range 1...31].

◆ le_pos_GetDirection()

le_result_t le_pos_GetDirection ( uint32_t *  directionPtr,
uint32_t *  directionAccuracyPtr 
)

Get the direction indication. Direction of movement is the direction that the vehicle or person is actually moving.

Returns
LE_FAULT Function failed to get the direction indication.
LE_OUT_OF_RANGE One of the retrieved parameter is invalid (set to UINT32_MAX).
LE_OK Function succeeded.
Note
Direction is given in degrees. Direction ranges from 0 to 359 degrees, where 0 is True North.
directionPtr, directionAccuracyPtr can be set to NULL if not needed.
Parameters
[out]directionPtrDirection indication in degrees. Range: 0 to 359, where 0 is True North.
[out]directionAccuracyPtrDirection's accuracy estimate in degrees.

◆ le_pos_GetFixState()

le_result_t le_pos_GetFixState ( le_pos_FixState_t statePtr)

Get the position fix state

Returns
LE_FAULT Function failed to get the position fix state.
LE_OK Function 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.

◆ le_pos_GetHeading()

le_result_t le_pos_GetHeading ( uint32_t *  headingPtr,
uint32_t *  headingAccuracyPtr 
)

Get the heading indication.

Returns
LE_FAULT Function failed to get the heading indication.
LE_OUT_OF_RANGE One of the retrieved parameter is invalid (set to UINT32_MAX).
LE_OK Function succeeded.
Note
Heading is given in degrees. Heading ranges from 0 to 359 degrees, where 0 is True North.
headingPtr, headingAccuracyPtr can be set to NULL if not needed.
Parameters
[out]headingPtrHeading in degrees. Range: 0 to 359, where 0 is True North.
[out]headingAccuracyPtrHeading's accuracy in degrees.

◆ le_pos_GetMotion()

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

Get the motion's data (Horizontal Speed, Horizontal Speed's accuracy, Vertical Speed, Vertical Speed's accuracy).

Returns
LE_FAULT Function failed to get the motion's data.
LE_OUT_OF_RANGE One of the retrieved parameter is invalid (set to INT32_MAX, UINT32_MAX).
LE_OK Function succeeded.
Note
hSpeedPtr, hSpeedAccuracyPtr, vSpeedPtr, vSpeedAccuracyPtr can be set to NULL if not needed.
Parameters
[out]hSpeedPtrHorizontal Speed in m/sec.
[out]hSpeedAccuracyPtrHorizontal Speed's accuracy in m/sec.
[out]vSpeedPtrVertical Speed in m/sec, positive up.
[out]vSpeedAccuracyPtrVertical Speed's accuracy in m/sec.

◆ le_pos_GetTime()

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

Get the time of the last updated location

Returns
LE_FAULT Function failed to get the time.
LE_OUT_OF_RANGE The retrieved time is invalid (all fields are set to 0).
LE_OK Function succeeded.
Parameters
[out]hoursPtrUTC Hours into the day [range 0..23].
[out]minutesPtrUTC Minutes into the hour [range 0..59].
[out]secondsPtrUTC Seconds into the minute [range 0..59].
[out]millisecondsPtrUTC Milliseconds into the second [range 0..999].

◆ le_pos_RemoveMovementHandler()

void le_pos_RemoveMovementHandler ( le_pos_MovementHandlerRef_t  handlerRef)

Remove handler function for EVENT 'le_pos_Movement'

Parameters
[in]handlerRef

◆ le_pos_sample_Get2DLocation()

le_result_t le_pos_sample_Get2DLocation ( le_pos_SampleRef_t  positionSampleRef,
int32_t *  latitudePtr,
int32_t *  longitudePtr,
int32_t *  horizontalAccuracyPtr 
)

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

Returns
LE_FAULT Function failed to find the positionSample.
LE_OUT_OF_RANGE One of the retrieved parameter is invalid (set to INT32_MAX).
LE_OK Function succeeded.
Note
If the caller is passing an invalid Position reference into this function, it is a fatal error, the function will not return.
latitudePtr, longitudePtr, horizontalAccuracyPtr can be set to NULL if not needed.
Parameters
[in]positionSampleRefPosition sample's reference.
[out]latitudePtrWGS84 Latitude in degrees, positive North [resolution 1e-6].
[out]longitudePtrWGS84 Longitude in degrees, positive East [resolution 1e-6].
[out]horizontalAccuracyPtrHorizontal position's accuracy in meters by default.

◆ le_pos_sample_GetAltitude()

le_result_t le_pos_sample_GetAltitude ( le_pos_SampleRef_t  positionSampleRef,
int32_t *  altitudePtr,
int32_t *  altitudeAccuracyPtr 
)

Get the position sample's altitude.

Returns
LE_FAULT Function failed to find the positionSample.
LE_OUT_OF_RANGE One of the retrieved parameter is invalid (set to INT32_MAX).
LE_OK Function succeeded.
Note
If the caller is passing an invalid Position reference into this function, it is a fatal error, the function will not return.
altitudePtr, altitudeAccuracyPtr can be set to NULL if not needed.
Parameters
[in]positionSampleRefPosition sample's reference.
[out]altitudePtrAltitude above Mean Sea Level in meters by default.
[out]altitudeAccuracyPtrVertical position's accuracy in meters by default.

◆ le_pos_sample_GetDate()

le_result_t le_pos_sample_GetDate ( le_pos_SampleRef_t  positionSampleRef,
uint16_t *  yearPtr,
uint16_t *  monthPtr,
uint16_t *  dayPtr 
)

Get the position sample's date.

Returns
LE_FAULT Function failed to get the date.
LE_OUT_OF_RANGE The retrieved date is invalid (all fields are set to 0).
LE_OK Function succeeded.
Parameters
[in]positionSampleRefPosition sample's reference.
[out]yearPtrUTC Year A.D. [e.g. 2014].
[out]monthPtrUTC Month into the year [range 1...12].
[out]dayPtrUTC Days into the month [range 1...31].

◆ le_pos_sample_GetDirection()

le_result_t le_pos_sample_GetDirection ( le_pos_SampleRef_t  positionSampleRef,
uint32_t *  directionPtr,
uint32_t *  directionAccuracyPtr 
)

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

Returns
LE_FAULT Function failed to find the positionSample.
LE_OUT_OF_RANGE One of the retrieved parameter is invalid (set to UINT32_MAX).
LE_OK Function succeeded.
Note
Direction is given in degrees. Direction ranges from 0 to 359 degrees, where 0 is True North.
If the caller is passing an invalid Position reference into this function, it is a fatal error, the function will not return.
directionPtr, directionAccuracyPtr can be set to NULL if not needed.
Parameters
[in]positionSampleRefPosition sample's reference.
[out]directionPtrDirection indication in degrees. Range: 0 to 359, where 0 is True North.
[out]directionAccuracyPtrDirection's accuracy estimate in degrees.

◆ le_pos_sample_GetFixState()

le_result_t le_pos_sample_GetFixState ( le_pos_SampleRef_t  positionSampleRef,
le_pos_FixState_t statePtr 
)

Get the position sample's fix state.

Returns
LE_FAULT Function failed to get the position sample's fix state.
LE_OK Function succeeded.
Note
If the caller is passing an invalid Position reference into this function, it is a fatal error, the function will not return.
Parameters
[in]positionSampleRefPosition sample's reference.
[out]statePtrPosition fix state.

◆ le_pos_sample_GetHeading()

le_result_t le_pos_sample_GetHeading ( le_pos_SampleRef_t  positionSampleRef,
uint32_t *  headingPtr,
uint32_t *  headingAccuracyPtr 
)

Get the position sample's heading. Heading is the direction that the vehicle or person is facing.

Returns
LE_FAULT Function failed to find the positionSample.
LE_OUT_OF_RANGE One of the retrieved parameter is invalid (set to UINT32_MAX).
LE_OK TFunction succeeded.
Note
Heading is given in degrees. Heading ranges from 0 to 359 degrees, where 0 is True North.
If the caller is passing an invalid Position reference into this function, it is a fatal error, the function will not return.
headingPtr, headingAccuracyPtr can be set to NULL if not needed.
Parameters
[in]positionSampleRefPosition sample's reference.
[out]headingPtrHeading in degrees. Range: 0 to 359, where 0 is True North.
[out]headingAccuracyPtrHeading's accuracy estimate in degrees.

◆ le_pos_sample_GetHorizontalSpeed()

le_result_t le_pos_sample_GetHorizontalSpeed ( le_pos_SampleRef_t  positionSampleRef,
uint32_t *  hSpeedPtr,
uint32_t *  hSpeedAccuracyPtr 
)

Get the position sample's horizontal speed.

Returns
LE_FAULT Function failed to find the positionSample.
LE_OUT_OF_RANGE One of the retrieved parameter is invalid (set to INT32_MAX, UINT32_MAX).
LE_OK Function succeeded.
Note
If the caller is passing an invalid Position reference into this function, it is a fatal error, the function will not return.
hSpeedPtr, hSpeedAccuracyPtr can be set to NULL if not needed.
Parameters
[in]positionSampleRefPosition sample's reference.
[out]hSpeedPtrThe Horizontal Speed in m/sec.
[out]hSpeedAccuracyPtrThe Horizontal Speed's accuracy in m/sec.

◆ le_pos_sample_GetTime()

le_result_t le_pos_sample_GetTime ( le_pos_SampleRef_t  positionSampleRef,
uint16_t *  hoursPtr,
uint16_t *  minutesPtr,
uint16_t *  secondsPtr,
uint16_t *  millisecondsPtr 
)

Get the position sample's time.

Returns
LE_FAULT Function failed to get the time.
LE_OUT_OF_RANGE The retrieved time is invalid (all fields are set to 0).
LE_OK Function succeeded.
Parameters
[in]positionSampleRefPosition sample's reference.
[out]hoursPtrUTC Hours into the day [range 0..23].
[out]minutesPtrUTC Minutes into the hour [range 0..59].
[out]secondsPtrUTC Seconds into the minute [range 0..59].
[out]millisecondsPtrUTC Milliseconds into the second [range 0..999].

◆ le_pos_sample_GetVerticalSpeed()

le_result_t le_pos_sample_GetVerticalSpeed ( le_pos_SampleRef_t  positionSampleRef,
int32_t *  vspeedPtr,
int32_t *  vspeedAccuracyPtr 
)

Get the position sample's vertical speed.

Returns
LE_FAULT The function failed to find the positionSample.
LE_OUT_OF_RANGE One of the retrieved parameter is not valid (set to INT32_MAX).
LE_OK The function succeeded.
Note
If the caller is passing an invalid Position reference into this function, it is a fatal error, the function will not return.
vSpeedPtr, vSpeedAccuracyPtr can be set to NULL if not needed.
Parameters
[in]positionSampleRefPosition sample's reference.
[out]vspeedPtrThe Vertical Speed in m/sec, positive up.
[out]vspeedAccuracyPtrThe Vertical Speed's accuracy in m/sec.

◆ le_pos_sample_Release()

void le_pos_sample_Release ( le_pos_SampleRef_t  positionSampleRef)

Release the position sample.

Note
If the caller is passing an invalid Position reference into this function, it is a fatal error, the function will not return.
Parameters
[in]positionSampleRefPosition sample's reference.

◆ le_pos_SetAcquisitionRate()

le_result_t le_pos_SetAcquisitionRate ( uint32_t  acquisitionRate)

Set the acquisition rate.

Returns
LE_OUT_OF_RANGE Invalid acquisition rate. LE_OK The function succeeded.
Parameters
[in]acquisitionRateAcquisition rate in milliseconds.

◆ le_pos_SetDistanceResolution()

le_result_t le_pos_SetDistanceResolution ( le_pos_Resolution_t  resolution)

Set the resolution for the positioning distance values.

Returns
LE_OK Function succeeded.
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.
Warning
The positioning distance values resolutions are platform dependent. Please refer to Distance values resolution section for full details.
Parameters
[in]resolutionResolution.

◆ le_pos_SetServerDisconnectHandler()

void le_pos_SetServerDisconnectHandler ( le_pos_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.

◆ le_pos_TryConnectService()

le_result_t le_pos_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 Client-specific Functions.

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.