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_hms_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_hms_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_hms_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_hms_SetServerDisconnectHandler | ( | taf_hms_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_hms_SetNonExitServerDisconnectHandler | ( | taf_hms_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_hms_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.
le_result_t taf_hms_GetCpuLoad | ( | double * | cpuCurrentLoadPtr | ) |
Gets the total CPU usage from " /proc/stat ".
[out] | cpuCurrentLoadPtr | CPU Total Usage. |
uint32_t taf_hms_GetCpuCoreNum | ( | void | ) |
Gets number of CPU core from " /proc/cpuinfo ".
le_result_t taf_hms_GetIndvCoreUsage | ( | uint32_t | coreID, |
double * | cpuUsagePtr | ||
) |
Gets the CPU usage of each core from " /proc/stat ". The API provides total CPU usage of each core ranging from 0 to 100 %. The coreID range can be 0 - (cpuCoreNum-1), the result value can be LE_OK.
[in] | coreID | Core ID |
[out] | cpuUsagePtr | cpuUsage |
le_result_t taf_hms_GetRamMemInfo | ( | uint32_t * | ramTotalMemPtr, |
uint32_t * | ramUsedMemPtr, | ||
uint32_t * | ramFreeMemPtr | ||
) |
Gets the meminfo value from " /proc/meminfo ".
[out] | ramTotalMemPtr | Total Memory in kB. |
[out] | ramUsedMemPtr | Used Memory in kB. |
[out] | ramFreeMemPtr | Free memory in kB. |
taf_hms_UbiDevInfoListRef_t taf_hms_GetUbiDevInfoList | ( | void | ) |
Gets the list of available UBI device information.
taf_hms_UbiDevInfoRef_t taf_hms_GetFirstUbiDevInfo | ( | taf_hms_UbiDevInfoListRef_t | ubiDevInfoListRef | ) |
Gets the first UBI device Info object reference in the list of the UbiDevInfoList retrieved with taf_hms_GetUbiDevInfoList().
[in] | ubiDevInfoListRef | UBI device list reference |
le_result_t taf_hms_DeleteUbiDevInfoList | ( | taf_hms_UbiDevInfoListRef_t | ubiDevInfoListRef | ) |
Deletes the UbiDevInfoList list retrieved with taf_hms_GetUbiDevInfoList().
[in] | ubiDevInfoListRef | UBI device list reference |
taf_hms_UbiDevInfoRef_t taf_hms_GetNextUbiDevInfo | ( | taf_hms_UbiDevInfoListRef_t | ubiDevInfoListRef | ) |
Gets the next UBI device Info object reference in the list of the UBIInfoList retrieved with taf_hms_GetUBIInfoList().
[in] | ubiDevInfoListRef | UBI device list reference |
le_result_t taf_hms_GetUbiDevId | ( | taf_hms_UbiDevInfoRef_t | ubiDevInfoRef, |
uint32_t * | ubiDevIdPtr | ||
) |
Gets UBI device ID
[in] | ubiDevInfoRef | UBI device Info reference. |
[out] | ubiDevIdPtr | UBI device ID |
le_result_t taf_hms_GetUbiDevMaxEraseCnt | ( | taf_hms_UbiDevInfoRef_t | ubiDevInfoRef, |
uint32_t * | ubiEraseCntPtr | ||
) |
Gets UBI information for current maximum erase count from " /sys/class/ubi/ubi%d/ ".
[in] | ubiDevInfoRef | UBI device Info reference. |
[out] | ubiEraseCntPtr | Erase count. |
le_result_t taf_hms_GetUbiDevBadBlkCnt | ( | taf_hms_UbiDevInfoRef_t | ubiDevInfoRef, |
uint32_t * | ubiBbCntPtr | ||
) |
Gets UBI information for bad block count from " /sys/class/ubi/ubi%d/ ".
[in] | ubiDevInfoRef | UBI device Info reference. |
[out] | ubiBbCntPtr | Bad Block count. |
taf_hms_UbiVolInfoRef_t taf_hms_GetFirstUbiVolInfo | ( | taf_hms_UbiDevInfoRef_t | ubiDevInfoRef | ) |
Gets the first UBI volume Info object reference in the list of the UbiVolInfoList retrieved with taf_hms_GetUbiDevInfoList().
[in] | ubiDevInfoRef | UBI device Info reference. |
taf_hms_UbiVolInfoRef_t taf_hms_GetNextUbiVolInfo | ( | taf_hms_UbiDevInfoRef_t | ubiDevInfoRef | ) |
Gets the next UBI volume Info object reference in the list of the UbiVolInfoList retrieved with taf_hms_GetUbiDevInfoList().
[in] | ubiDevInfoRef | UBI device Info reference. |
le_result_t taf_hms_GetUbiVolId | ( | taf_hms_UbiVolInfoRef_t | ubiVolInfoRef, |
uint32_t * | ubiVolIdPtr | ||
) |
Gets UBI volume ID.
[in] | ubiVolInfoRef | |
[out] | ubiVolIdPtr |
le_result_t taf_hms_GetUbiVolName | ( | taf_hms_UbiVolInfoRef_t | ubiVolInfoRef, |
char * | ubiVolName, | ||
size_t | ubiVolNameSize | ||
) |
Gets name of UBI volume.
[in] | ubiVolInfoRef | UBI device Info reference. |
[out] | ubiVolName | UBI volume name. |
[in] | ubiVolNameSize |
le_result_t taf_hms_GetUbiVolSize | ( | taf_hms_UbiVolInfoRef_t | ubiVolInfoRef, |
uint32_t * | ubiVolSizePtr | ||
) |
Gets size of UBI volume in bytes.
[in] | ubiVolInfoRef | UBI device Info reference. |
[out] | ubiVolSizePtr | UBI volume size. |
taf_hms_MtdDevInfoListRef_t taf_hms_GetMtdDevInfoList | ( | void | ) |
Gets the list of available MTD Node.
le_result_t taf_hms_DeleteMtdDevInfoList | ( | taf_hms_MtdDevInfoListRef_t | mtdDevInfoListRef | ) |
Deletes the MtdInfoList list retrieved with taf_hms_GetMtdInfoList().
[in] | mtdDevInfoListRef | MTD device list reference |
taf_hms_MtdDevInfoRef_t taf_hms_GetFirstMtdDevInfo | ( | taf_hms_MtdDevInfoListRef_t | mtdDevInfoListRef | ) |
Gets the first MtdInfo object reference in the list of the MtdInfoList retrieved with taf_hms_GetMtdInfoList().
[in] | mtdDevInfoListRef | MTD node list reference |
taf_hms_MtdDevInfoRef_t taf_hms_GetNextMtdDevInfo | ( | taf_hms_MtdDevInfoListRef_t | mtdDevInfoListRef | ) |
Gets the next MtdInfo object reference in the list of the MtdInfoList retrieved with taf_hms_GetMtdInfoList().
[in] | mtdDevInfoListRef | MTD node list reference |
le_result_t taf_hms_GetMtdDevName | ( | taf_hms_MtdDevInfoRef_t | mtdDevInfoRef, |
char * | mtdName, | ||
size_t | mtdNameSize | ||
) |
Gets MTD information for name from " /sys/class/mtd/mtd%d/ ".
[in] | mtdDevInfoRef | MTD Info reference. |
[out] | mtdName | MTD name. |
[in] | mtdNameSize |
le_result_t taf_hms_GetMtdDevBlkSize | ( | taf_hms_MtdDevInfoRef_t | mtdDevInfoRef, |
uint32_t * | mtdBlkSizePtr | ||
) |
Gets MTD information for block size in bytes.
[in] | mtdDevInfoRef | MTD Info reference. |
[out] | mtdBlkSizePtr | Bad block size. |
le_result_t taf_hms_GetMtdDevId | ( | taf_hms_MtdDevInfoRef_t | mtdDevInfoRef, |
uint32_t * | mtdDevIdPtr | ||
) |
Gets MTD information for device ID.
[in] | mtdDevInfoRef | MTD Info reference. |
[out] | mtdDevIdPtr | Device ID. |
le_result_t taf_hms_GetMtdDevBlkCnt | ( | taf_hms_MtdDevInfoRef_t | mtdDevInfoRef, |
uint32_t * | mtdBlkCntPtr | ||
) |
Gets MTD information for block count.
[in] | mtdDevInfoRef | MTD Info reference. |
[out] | mtdBlkCntPtr | Block count. |
|
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.