le_pos_interface.h File Reference

#include "legato.h"

Go to the source code of this file.

Typedefs

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)
 

Functions

void le_pos_ConnectService (void)
 
le_result_t le_pos_TryConnectService (void)
 
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 addHandlerRef)
 
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 *hSpeedPtrPtr, int32_t *hSpeedAccuracyPtrPtr, int32_t *vSpeedPtrPtr, int32_t *vSpeedAccuracyPtrPtr)
 
le_result_t le_pos_GetHeading (int32_t *headingPtr, int32_t *headingAccuracyPtr)
 
le_result_t le_pos_GetDirection (int32_t *directionPtr, int32_t *directionAccuracyPtr)
 
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, int32_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, int32_t *headingPtr, int32_t *headingAccuracyPtr)
 
le_result_t le_pos_sample_GetDirection (le_pos_SampleRef_t positionSampleRef, int32_t *directionPtr, int32_t *directionAccuracyPtr)
 
void le_pos_sample_Release (le_pos_SampleRef_t positionSampleRef)
 

Detailed Description

Legato Positioning include file.

Typedef Documentation

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

Handler for Movement changes.

Parameters
positionSampleRefPosition's sample reference
contextPtr
typedef struct le_pos_MovementHandler* le_pos_MovementHandlerRef_t

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

typedef struct le_pos_Sample* le_pos_SampleRef_t

Reference type for dealing with Position samples.

Function Documentation

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 metres. 0 means that I don't care about changes in the latitude and longitude.
[in]verticalMagnitudeVertical magnitude in metres. 0 means that I don't care about changes in the altitude.
[in]handlerPtr
[in]contextPtr
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.

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_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]latitudePtrLatitude in degrees, positive North.
[out]longitudePtrLongitude in degrees, positive East.
[out]hAccuracyPtrHorizontal position's accuracy in metres.
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]latitudePtrLatitude in degrees, positive North.
[out]longitudePtrLongitude in degrees, positive East.
[out]hAccuracyPtrHorizontal position's accuracy in metres.
[out]altitudePtrAltitude in meters, above Mean Sea Level.
[out]vAccuracyPtrVertical position's accuracy in metres.
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_result_t le_pos_GetDirection ( int32_t *  directionPtr,
int32_t *  directionAccuracyPtr 
)

Get the direction indication. Direction of movement is the direction that the vehicle/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 INT32_MAX).
LE_OK Function succeeded.
Note
directionPtr, directionAccuracyPtr can be set to NULL if not needed.
Parameters
[out]directionPtrDirection indication in degrees (where 0 is True North).
[out]directionAccuracyPtrDirection's accuracy in degrees.
le_result_t le_pos_GetHeading ( int32_t *  headingPtr,
int32_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 INT32_MAX).
LE_OK Function succeeded.
Note
headingPtr, headingAccuracyPtr can be set to NULL if not needed.
Parameters
[out]headingPtrHeading in degrees (where 0 is True North).
[out]headingAccuracyPtrHeading's accuracy in degrees.
le_result_t le_pos_GetMotion ( uint32_t *  hSpeedPtrPtr,
int32_t *  hSpeedAccuracyPtrPtr,
int32_t *  vSpeedPtrPtr,
int32_t *  vSpeedAccuracyPtrPtr 
)

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]hSpeedPtrPtrHorizontal Speed in m/sec.
[out]hSpeedAccuracyPtrPtrHorizontal Speed's accuracy in m/sec.
[out]vSpeedPtrPtrVertical Speed in m/sec, positive up.
[out]vSpeedAccuracyPtrPtrVertical Speed's accuracy in m/sec.
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].
void le_pos_RemoveMovementHandler ( le_pos_MovementHandlerRef_t  addHandlerRef)

Remove handler function for EVENT 'le_pos_Movement'

Parameters
[in]addHandlerRef
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]latitudePtrLatitude in degrees.
[out]longitudePtrLongitude in degrees.
[out]horizontalAccuracyPtrHorizontal's accuracy estimate in metres.
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 in meters.
[out]altitudeAccuracyPtrAltitude's accuracy estimate in metres.
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_result_t le_pos_sample_GetDirection ( le_pos_SampleRef_t  positionSampleRef,
int32_t *  directionPtr,
int32_t *  directionAccuracyPtr 
)

Get the position sample's direction. Direction of movement is the direction that the vehicle/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 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.
directionPtr, directionAccuracyPtr can be set to NULL if not needed.
Parameters
[in]positionSampleRefPosition sample's reference.
[out]directionPtrDirection in degrees (where 0 is True North).
[out]directionAccuracyPtrDirection's accuracy estimate in degrees.
le_result_t le_pos_sample_GetHeading ( le_pos_SampleRef_t  positionSampleRef,
int32_t *  headingPtr,
int32_t *  headingAccuracyPtr 
)

Get the position sample's heading. Heading is the direction that the vehicle/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 INT32_MAX).
LE_OK TFunction succeeded.
Note
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 (where 0 is True North).
[out]headingAccuracyPtrHeading's accuracy estimate in degrees.
le_result_t le_pos_sample_GetHorizontalSpeed ( le_pos_SampleRef_t  positionSampleRef,
uint32_t *  hspeedPtr,
int32_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]hspeedPtrHorizontal speed.
[out]hspeedAccuracyPtrHorizontal speed's accuracy estimate.
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_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]vspeedPtrVertical speed.
[out]vspeedAccuracyPtrVertical speed's accuracy estimate.
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_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.