Snapdragon® Telematics Application Framework (TelAF) Interface Specification
|
Data Structures | |
struct | _ClientThreadData_t |
Macros | |
#define | LOCK_INIT le_mutex_Lock(le_ifgen_InitMutexRef); |
Locks the mutex. More... | |
#define | UNLOCK_INIT le_mutex_Unlock(le_ifgen_InitMutexRef); |
Unlocks the mutex. More... | |
Variables | |
static le_mem_PoolRef_t | _ClientThreadDataPool |
static pthread_key_t | _ThreadDataKey |
static bool | CommonDataInitialized = false |
le_mutex_Ref_t | le_ifgen_InitMutexRef |
#define LOCK_INIT le_mutex_Lock(le_ifgen_InitMutexRef); |
Locks the mutex.
#define UNLOCK_INIT le_mutex_Unlock(le_ifgen_InitMutexRef); |
Unlocks the mutex.
LE_MEM_DEFINE_STATIC_POOL | ( | taf_pm_ClientThreadData | , |
LE_CDATA_COMPONENT_COUNT | , | ||
sizeof(_ClientThreadData_t) | |||
) |
Static pool for client threads.
|
static |
Initialize thread specific data, and connect to the service for the current thread.
|
static |
Get a pointer to the client thread data for the current thread.
If the current thread does not have client data, then NULL is returned
__attribute__ | ( | (unused) | ) |
Return the sessionRef for the current thread.
If the current thread does not have a session ref, then this is a fatal error.
|
static |
Destructor function for client thread objects.
|
static |
Init data that is common across all threads.
|
static |
Connect to the service, using either blocking or non-blocking calls.
This function implements the details of the public ConnectService functions.
void taf_pm_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.
le_result_t taf_pm_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.
|
static |
void taf_pm_SetServerDisconnectHandler | ( | taf_pm_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.
|
static |
void taf_pm_SetNonExitServerDisconnectHandler | ( | taf_pm_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.
void taf_pm_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_pm_StateChangeHandlerRef_t taf_pm_AddStateChangeHandler | ( | taf_pm_StateChangeHandlerFunc_t | handlerPtr, |
void * | contextPtr | ||
) |
Add handler function for EVENT 'taf_pm_StateChange'
TCU state change event of the local process.
[in] | handlerPtr | The state change handler. |
[in] | contextPtr |
void taf_pm_RemoveStateChangeHandler | ( | taf_pm_StateChangeHandlerRef_t | handlerRef | ) |
Remove handler function for EVENT 'taf_pm_StateChange'
[in] | handlerRef |
taf_pm_StateChangeExHandlerRef_t taf_pm_AddStateChangeExHandler | ( | taf_pm_StateChangeExHandlerFunc_t | handlerPtr, |
void * | contextPtr | ||
) |
Add handler function for EVENT 'taf_pm_StateChangeEx'
TCU state change event of the local process.
[in] | handlerPtr | The PmMasterWake source change handler. |
[in] | contextPtr |
void taf_pm_RemoveStateChangeExHandler | ( | taf_pm_StateChangeExHandlerRef_t | handlerRef | ) |
Remove handler function for EVENT 'taf_pm_StateChangeEx'
[in] | handlerRef |
taf_pm_WakeupSourceRef_t taf_pm_NewWakeupSource | ( | uint32_t | createOpts, |
const char *LE_NONNULL | wsTag | ||
) |
Creates a new wakeup source.
[in] | createOpts | Wakeup source options. |
[in] | wsTag | Context-specific wakeup source tag. |
le_result_t taf_pm_StayAwake | ( | taf_pm_WakeupSourceRef_t | wsRef | ) |
Acquires a passed wakeup source reference.
[in] | wsRef | Reference to the wakeup source to be acquired. |
le_result_t taf_pm_Relax | ( | taf_pm_WakeupSourceRef_t | wsRef | ) |
Releases a previously acquired wakeup source.
[in] | wsRef | Reference to the wakeup source to be released. |
taf_pm_State_t taf_pm_GetPowerState | ( | void | ) |
Gets the current system state of the local process.
le_result_t taf_pm_SetAllVMPowerState | ( | taf_pm_State_t | state | ) |
Sets the power state to all the Virtual Machines.
[in] | state | State to be set. |
le_result_t taf_pm_SetVMPowerState | ( | taf_pm_State_t | state, |
const char *LE_NONNULL | machineName | ||
) |
Sets the power state to the respective Virtual Machine.
[in] | state | State to be set. |
[in] | machineName | Virtual Machine name of the state to be changed. |
taf_pm_VMListRef_t taf_pm_GetMachineList | ( | void | ) |
Gets the list of available Virtual Machines.
le_result_t taf_pm_GetFirstMachineName | ( | taf_pm_VMListRef_t | vmListRef, |
char * | name, | ||
size_t | nameSize | ||
) |
Gets the first Virtual Machine name.
[in] | vmListRef | Virtual Machine list reference. |
[out] | name | The name of the Virtual Machine. |
[in] | nameSize |
le_result_t taf_pm_GetNextMachineName | ( | taf_pm_VMListRef_t | vmListRef, |
char * | name, | ||
size_t | nameSize | ||
) |
Gets the next Virtual Machine name based on the current position in the list.
[in] | vmListRef | Virtual Machine list reference. |
[out] | name | The name of the Virtual Machine. |
[in] | nameSize |
le_result_t taf_pm_DeleteMachineList | ( | taf_pm_VMListRef_t | vmLsitRef | ) |
Deletes the Vitual Machine list.
[in] | vmLsitRef | Virtual Machine list reference. |
void taf_pm_SendStateChangeAck | ( | taf_pm_PowerStateRef_t | powerStateRef, |
taf_pm_State_t | state, | ||
taf_pm_NadVm_t | vm, | ||
taf_pm_ClientAck_t | ack | ||
) |
Receives the acknowledgement from clients for state change.
[in] | powerStateRef | Power state reference for statechangehandler. |
[in] | state | The system state. |
[in] | vm | The VM ID of the machine. |
[in] | ack | The acknowledgement type. |
|
static |
The memory pool for client thread objects
|
static |
Key under which the pointer to the Thread Object (_ClientThreadData_t) will be kept in thread-local storage. This allows a thread to quickly get a pointer to its own Thread Object.
|
static |
This global flag is shared by all client threads, and is used to indicate whether the common data has been initialized.
le_mutex_Ref_t le_ifgen_InitMutexRef |
Mutex and associated macros for use with the above CommonDataInitialized.