All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
le_ecall_interface.h File Reference
#include "legato.h"

Go to the source code of this file.

Macros

#define LE_ECALL_MSD_MAX_LEN   282
 

Typedefs

typedef struct le_ecall_Obj * le_ecall_ObjRef_t
 
typedef struct
le_ecall_StateChangeHandler * 
le_ecall_StateChangeHandlerRef_t
 
typedef void(* le_ecall_StateChangeHandlerFunc_t )(le_ecall_State_t state, void *contextPtr)
 

Enumerations

enum  le_ecall_State_t {
  LE_ECALL_STATE_UNKNOWN, LE_ECALL_STATE_CONNECTED, LE_ECALL_STATE_MSD_TX_COMPLETED, LE_ECALL_STATE_MSD_TX_FAILED,
  LE_ECALL_STATE_STOPPED, LE_ECALL_STATE_RESET, LE_ECALL_STATE_COMPLETED, LE_ECALL_STATE_FAILED
}
 

Functions

void le_ecall_ConnectService (void)
 
void le_ecall_DisconnectService (void)
 
le_ecall_StateChangeHandlerRef_t le_ecall_AddStateChangeHandler (le_ecall_StateChangeHandlerFunc_t handlerPtr, void *contextPtr)
 
void le_ecall_RemoveStateChangeHandler (le_ecall_StateChangeHandlerRef_t addHandlerRef)
 
le_ecall_ObjRef_t le_ecall_Create (void)
 
void le_ecall_Delete (le_ecall_ObjRef_t ecallRef)
 
le_result_t le_ecall_SetMsdPosition (le_ecall_ObjRef_t ecallRef, bool isTrusted, int32_t latitude, int32_t longitude, int32_t direction)
 
le_result_t le_ecall_SetMsdPassengersCount (le_ecall_ObjRef_t ecallRef, uint32_t paxCount)
 
le_result_t le_ecall_ImportMsd (le_ecall_ObjRef_t ecallRef, const uint8_t *msdPtr, size_t msdNumElements)
 
le_result_t le_ecall_StartAutomatic (le_ecall_ObjRef_t ecallRef)
 
le_result_t le_ecall_StartManual (le_ecall_ObjRef_t ecallRef)
 
le_result_t le_ecall_StartTest (le_ecall_ObjRef_t ecallRef)
 
le_result_t le_ecall_End (le_ecall_ObjRef_t ecallRef)
 
le_ecall_State_t le_ecall_GetState (le_ecall_ObjRef_t ecallRef)
 

Detailed Description

Legato eCall include file.

Copyright (C) Sierra Wireless, Inc. 2014. All rights reserved. Use of this work is subject to license.

Macro Definition Documentation

#define LE_ECALL_MSD_MAX_LEN   282

MSD message length in bytes.

Typedef Documentation

typedef struct le_ecall_Obj* le_ecall_ObjRef_t

Reference returned by Create function and used by other functions

typedef void(* le_ecall_StateChangeHandlerFunc_t)(le_ecall_State_t state, void *contextPtr)

Handler for eCall state changes.

Parameters
stateeCall state
contextPtr
typedef struct le_ecall_StateChangeHandler* le_ecall_StateChangeHandlerRef_t

Reference type for le_ecall_StateChangeHandler handler ADD/REMOVE functions

Enumeration Type Documentation

eCall session states.

Enumerator
LE_ECALL_STATE_UNKNOWN 

Unknown state.

LE_ECALL_STATE_CONNECTED 

Emergency call is established.

LE_ECALL_STATE_MSD_TX_COMPLETED 

MSD transmission is complete.

LE_ECALL_STATE_MSD_TX_FAILED 

MSD transmission has failed.

LE_ECALL_STATE_STOPPED 

eCall session has been stopped by the PSAP.

LE_ECALL_STATE_RESET 

eCall session has lost synchronization and starts over.

LE_ECALL_STATE_COMPLETED 

Successful eCall session.

LE_ECALL_STATE_FAILED 

Unsuccessful eCall session.

Function Documentation

le_ecall_StateChangeHandlerRef_t le_ecall_AddStateChangeHandler ( le_ecall_StateChangeHandlerFunc_t  handlerPtr,
void *  contextPtr 
)

le_ecall_StateChangeHandler handler ADD function

Parameters
[in]handlerPtr
[in]contextPtr
void le_ecall_ConnectService ( void  )

Connect the client to the service

le_ecall_ObjRef_t le_ecall_Create ( void  )

Create a new eCall object

The eCall is not actually established at this point. It is still up to the caller to call le_ecall_Start() when ready.

Returns
A reference to the new Call object.
Note
On failure, the process exits, so you don't have to worry about checking the returned reference for validity.
void le_ecall_Delete ( le_ecall_ObjRef_t  ecallRef)

Call to free up a call reference.

Note
This will free the reference, but not necessarily stop an active eCall. If there are other holders of this reference then the eCall will remain active.
Parameters
[in]ecallRefeCall reference
void le_ecall_DisconnectService ( void  )

Disconnect the client from the service

le_result_t le_ecall_End ( le_ecall_ObjRef_t  ecallRef)

End the current eCall session

Returns
LE_OK on success
LE_DUPLICATE the eCall session was started by another application
LE_FAULT for other failures
Parameters
[in]ecallRefeCall reference
le_ecall_State_t le_ecall_GetState ( le_ecall_ObjRef_t  ecallRef)

Get the current state for the given eCall

Returns
The current state for the given eCall
Note
The process exits, if an invalid eCall reference is given
Parameters
[in]ecallRefeCall reference
le_result_t le_ecall_ImportMsd ( le_ecall_ObjRef_t  ecallRef,
const uint8_t *  msdPtr,
size_t  msdNumElements 
)

Import an already prepared MSD.

MSD is transmitted only after an emergency call has been established.

Returns
LE_OK on success
LE_DUPLICATE an MSD has been already imported
LE_FAULT for other failures
Note
On failure, the process exits, so you don't have to worry about checking the returned reference for validity.
Parameters
[in]ecallRefeCall reference
[in]msdPtrthe prepared MSD
[in]msdNumElements
void le_ecall_RemoveStateChangeHandler ( le_ecall_StateChangeHandlerRef_t  addHandlerRef)

le_ecall_StateChangeHandler handler REMOVE function

Parameters
[in]addHandlerRef
le_result_t le_ecall_SetMsdPassengersCount ( le_ecall_ObjRef_t  ecallRef,
uint32_t  paxCount 
)

Set the number of passengers transmitted by the MSD.

MSD is transmitted only after an emergency call has been established.

Returns
LE_OK on success
LE_DUPLICATE an MSD has been already imported
LE_FAULT for other failures
Note
The process exits, if an invalid eCall reference is given
Parameters
[in]ecallRefeCall reference
[in]paxCountnumber of passengers
le_result_t le_ecall_SetMsdPosition ( le_ecall_ObjRef_t  ecallRef,
bool  isTrusted,
int32_t  latitude,
int32_t  longitude,
int32_t  direction 
)

Set the position transmitted by the MSD.

MSD is transmitted only after an emergency call has been established.

Returns
LE_OK on success
LE_DUPLICATE an MSD has been already imported
LE_FAULT for other failures
Note
The process exits, if an invalid eCall reference is given
Parameters
[in]ecallRefeCall reference
[in]isTrustedtrue if the position is accurate, false otherwise
[in]latitudelatitude in degrees with 6 decimal places, positive North
[in]longitudelongitude in degrees with 6 decimal places, positive East
[in]directiondirection in degrees (where 0 is True North)
le_result_t le_ecall_StartAutomatic ( le_ecall_ObjRef_t  ecallRef)

Start an automatic eCall session

Returns
LE_OK on success
LE_DUPLICATE an eCall session is already in progress
LE_FAULT for other failures
Note
The process exits, if an invalid eCall reference is given
Parameters
[in]ecallRefeCall reference
le_result_t le_ecall_StartManual ( le_ecall_ObjRef_t  ecallRef)

Start a manual eCall session

Returns
LE_OK on success
LE_DUPLICATE an eCall session is already in progress
LE_FAULT for other failures
Note
The process exits, if an invalid eCall reference is given
Parameters
[in]ecallRefeCall reference
le_result_t le_ecall_StartTest ( le_ecall_ObjRef_t  ecallRef)

Start a test eCall session

Returns
LE_OK on success
LE_DUPLICATE an eCall session is already in progress
LE_FAULT for other failures
Note
The process exits, if an invalid eCall reference is given
Parameters
[in]ecallRefeCall reference