Snapdragon® Telematics Application Framework (TelAF) Interface Specification
taf_hms_interface.h File Reference
#include "legato.h"
#include "taf_hms_common.h"

Go to the source code of this file.

Typedefs

typedef void(* taf_hms_DisconnectHandler_t) (void *)
 

Functions

void taf_hms_ConnectService (void)
 
le_result_t taf_hms_TryConnectService (void)
 
LE_FULL_API void taf_hms_SetServerDisconnectHandler (taf_hms_DisconnectHandler_t disconnectHandler, void *contextPtr)
 
LE_FULL_API void taf_hms_SetNonExitServerDisconnectHandler (taf_hms_DisconnectHandler_t disconnectHandler, void *contextPtr)
 
void taf_hms_DisconnectService (void)
 
le_result_t taf_hms_GetCpuLoad (double *cpuCurrentLoadPtr)
 
uint32_t taf_hms_GetCpuCoreNum (void)
 
le_result_t taf_hms_GetIndvCoreUsage (uint32_t coreID, double *cpuUsagePtr)
 
le_result_t taf_hms_GetRamMemInfo (uint32_t *ramTotalMemPtr, uint32_t *ramUsedMemPtr, uint32_t *ramFreeMemPtr)
 
taf_hms_UbiDevInfoListRef_t taf_hms_GetUbiDevInfoList (void)
 
taf_hms_UbiDevInfoRef_t taf_hms_GetFirstUbiDevInfo (taf_hms_UbiDevInfoListRef_t ubiDevInfoListRef)
 
le_result_t taf_hms_DeleteUbiDevInfoList (taf_hms_UbiDevInfoListRef_t ubiDevInfoListRef)
 
taf_hms_UbiDevInfoRef_t taf_hms_GetNextUbiDevInfo (taf_hms_UbiDevInfoListRef_t ubiDevInfoListRef)
 
le_result_t taf_hms_GetUbiDevId (taf_hms_UbiDevInfoRef_t ubiDevInfoRef, uint32_t *ubiDevIdPtr)
 
le_result_t taf_hms_GetUbiDevMaxEraseCnt (taf_hms_UbiDevInfoRef_t ubiDevInfoRef, uint32_t *ubiEraseCntPtr)
 
le_result_t taf_hms_GetUbiDevBadBlkCnt (taf_hms_UbiDevInfoRef_t ubiDevInfoRef, uint32_t *ubiBbCntPtr)
 
taf_hms_UbiVolInfoRef_t taf_hms_GetFirstUbiVolInfo (taf_hms_UbiDevInfoRef_t ubiDevInfoRef)
 
taf_hms_UbiVolInfoRef_t taf_hms_GetNextUbiVolInfo (taf_hms_UbiDevInfoRef_t ubiDevInfoRef)
 
le_result_t taf_hms_GetUbiVolId (taf_hms_UbiVolInfoRef_t ubiVolInfoRef, uint32_t *ubiVolIdPtr)
 
le_result_t taf_hms_GetUbiVolName (taf_hms_UbiVolInfoRef_t ubiVolInfoRef, char *ubiVolName, size_t ubiVolNameSize)
 
le_result_t taf_hms_GetUbiVolSize (taf_hms_UbiVolInfoRef_t ubiVolInfoRef, uint32_t *ubiVolSizePtr)
 
taf_hms_MtdDevInfoListRef_t taf_hms_GetMtdDevInfoList (void)
 
le_result_t taf_hms_DeleteMtdDevInfoList (taf_hms_MtdDevInfoListRef_t mtdDevInfoListRef)
 
taf_hms_MtdDevInfoRef_t taf_hms_GetFirstMtdDevInfo (taf_hms_MtdDevInfoListRef_t mtdDevInfoListRef)
 
taf_hms_MtdDevInfoRef_t taf_hms_GetNextMtdDevInfo (taf_hms_MtdDevInfoListRef_t mtdDevInfoListRef)
 
le_result_t taf_hms_GetMtdDevName (taf_hms_MtdDevInfoRef_t mtdDevInfoRef, char *mtdName, size_t mtdNameSize)
 
le_result_t taf_hms_GetMtdDevBlkSize (taf_hms_MtdDevInfoRef_t mtdDevInfoRef, uint32_t *mtdBlkSizePtr)
 
le_result_t taf_hms_GetMtdDevId (taf_hms_MtdDevInfoRef_t mtdDevInfoRef, uint32_t *mtdDevIdPtr)
 
le_result_t taf_hms_GetMtdDevBlkCnt (taf_hms_MtdDevInfoRef_t mtdDevInfoRef, uint32_t *mtdBlkCntPtr)
 

Typedef Documentation

◆ taf_hms_DisconnectHandler_t

typedef void(* taf_hms_DisconnectHandler_t) (void *)

Type for handler called when a server disconnects.

Function Documentation

◆ taf_hms_ConnectService()

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.

◆ taf_hms_TryConnectService()

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.

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.

◆ taf_hms_SetServerDisconnectHandler()

LE_FULL_API 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.

◆ taf_hms_SetNonExitServerDisconnectHandler()

LE_FULL_API 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.

Warning
When using the API, it needs the application developer to handle some cases like re-connecting and recycling the resources. For most of cases, it is safe to use SetServerDisconnectHandler.

◆ taf_hms_DisconnectService()

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.

◆ taf_hms_GetCpuLoad()

le_result_t taf_hms_GetCpuLoad ( double *  cpuCurrentLoadPtr)

Gets the total CPU usage from " /proc/stat ".

Returns
  • LE_FAULT Failed.
  • LE_OK Succeeded.
Parameters
[out]cpuCurrentLoadPtrCPU Total Usage.

◆ taf_hms_GetCpuCoreNum()

uint32_t taf_hms_GetCpuCoreNum ( void  )

Gets number of CPU core from " /proc/cpuinfo ".

Returns
  • LE_FAULT Failed.
  • LE_OK Succeeded.

◆ taf_hms_GetIndvCoreUsage()

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.

Returns
  • LE_FAULT Failed.
  • LE_OK Succeeded.
Parameters
[in]coreIDCore ID
[out]cpuUsagePtrcpuUsage

◆ taf_hms_GetRamMemInfo()

le_result_t taf_hms_GetRamMemInfo ( uint32_t *  ramTotalMemPtr,
uint32_t *  ramUsedMemPtr,
uint32_t *  ramFreeMemPtr 
)

Gets the meminfo value from " /proc/meminfo ".

Returns
  • LE_FAULT Failed.
  • LE_OK Succeeded.
Parameters
[out]ramTotalMemPtrTotal Memory in kB.
[out]ramUsedMemPtrUsed Memory in kB.
[out]ramFreeMemPtrFree memory in kB.

◆ taf_hms_GetUbiDevInfoList()

taf_hms_UbiDevInfoListRef_t taf_hms_GetUbiDevInfoList ( void  )

Gets the list of available UBI device information.

Returns
  • NULL No information found.
  • taf_hms_UbiDevInfoListRef The UBI device Info list object reference.

◆ taf_hms_GetFirstUbiDevInfo()

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().

Returns
  • NULL No information found.
  • taf_hms_UbiDevInfoListRef The UBI device Info object reference.
Parameters
[in]ubiDevInfoListRefUBI device list reference

◆ taf_hms_DeleteUbiDevInfoList()

le_result_t taf_hms_DeleteUbiDevInfoList ( taf_hms_UbiDevInfoListRef_t  ubiDevInfoListRef)

Deletes the UbiDevInfoList list retrieved with taf_hms_GetUbiDevInfoList().

Returns
  • LE_BAD_PARAMETER – Bad parameters.
  • LE_OK – Succeeded.
Parameters
[in]ubiDevInfoListRefUBI device list reference

◆ taf_hms_GetNextUbiDevInfo()

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().

Returns
  • NULL No information found.
  • taf_hms_UbiDevInfoListRef The UBI device Info object reference.
Parameters
[in]ubiDevInfoListRefUBI device list reference

◆ taf_hms_GetUbiDevId()

le_result_t taf_hms_GetUbiDevId ( taf_hms_UbiDevInfoRef_t  ubiDevInfoRef,
uint32_t *  ubiDevIdPtr 
)

Gets UBI device ID

Returns
  • LE_FAULT Failed.
  • LE_OK Succeeded.
Parameters
[in]ubiDevInfoRefUBI device Info reference.
[out]ubiDevIdPtrUBI device ID

◆ taf_hms_GetUbiDevMaxEraseCnt()

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/ ".

Returns
  • LE_FAULT Failed.
  • LE_OK Succeeded.
Parameters
[in]ubiDevInfoRefUBI device Info reference.
[out]ubiEraseCntPtrErase count.

◆ taf_hms_GetUbiDevBadBlkCnt()

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/ ".

Returns
  • LE_FAULT Failed.
  • LE_OK Succeeded.
Parameters
[in]ubiDevInfoRefUBI device Info reference.
[out]ubiBbCntPtrBad Block count.

◆ taf_hms_GetFirstUbiVolInfo()

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().

Returns
  • NULL No information found.
  • taf_hms_UbiVolInfoListRef The UBI device Info object reference.
Parameters
[in]ubiDevInfoRefUBI device Info reference.

◆ taf_hms_GetNextUbiVolInfo()

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().

Returns
  • NULL No information found.
  • taf_hms_UbiVolInfoListRef The UBI volume Info object reference.
Parameters
[in]ubiDevInfoRefUBI device Info reference.

◆ taf_hms_GetUbiVolId()

le_result_t taf_hms_GetUbiVolId ( taf_hms_UbiVolInfoRef_t  ubiVolInfoRef,
uint32_t *  ubiVolIdPtr 
)

Gets UBI volume ID.

Returns
  • LE_FAULT Failed.
  • LE_OK Succeeded.
Parameters
[in]ubiVolInfoRef
[out]ubiVolIdPtr

◆ taf_hms_GetUbiVolName()

le_result_t taf_hms_GetUbiVolName ( taf_hms_UbiVolInfoRef_t  ubiVolInfoRef,
char *  ubiVolName,
size_t  ubiVolNameSize 
)

Gets name of UBI volume.

Returns
  • LE_FAULT Failed.
  • LE_OK Succeeded.
Parameters
[in]ubiVolInfoRefUBI device Info reference.
[out]ubiVolNameUBI volume name.
[in]ubiVolNameSize

◆ taf_hms_GetUbiVolSize()

le_result_t taf_hms_GetUbiVolSize ( taf_hms_UbiVolInfoRef_t  ubiVolInfoRef,
uint32_t *  ubiVolSizePtr 
)

Gets size of UBI volume in bytes.

Returns
  • LE_FAULT Failed.
  • LE_OK Succeeded.
Parameters
[in]ubiVolInfoRefUBI device Info reference.
[out]ubiVolSizePtrUBI volume size.

◆ taf_hms_GetMtdDevInfoList()

taf_hms_MtdDevInfoListRef_t taf_hms_GetMtdDevInfoList ( void  )

Gets the list of available MTD Node.

Returns
  • NULL No information found.
  • taf_hms_MtdInfoListRef The MtdInfo list object reference.

◆ taf_hms_DeleteMtdDevInfoList()

le_result_t taf_hms_DeleteMtdDevInfoList ( taf_hms_MtdDevInfoListRef_t  mtdDevInfoListRef)

Deletes the MtdInfoList list retrieved with taf_hms_GetMtdInfoList().

Returns
  • LE_BAD_PARAMETER – Bad parameters.
  • LE_OK – Succeeded.
Parameters
[in]mtdDevInfoListRefMTD device list reference

◆ taf_hms_GetFirstMtdDevInfo()

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().

Returns
  • NULL No information found.
  • taf_hms_MtdInfoListRef The MtdInfo object reference.
Parameters
[in]mtdDevInfoListRefMTD node list reference

◆ taf_hms_GetNextMtdDevInfo()

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().

Returns
  • NULL No information found.
  • taf_hms_MtdInfoListRef The MtdInfo object reference.
Parameters
[in]mtdDevInfoListRefMTD node list reference

◆ taf_hms_GetMtdDevName()

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/ ".

Returns
  • LE_FAULT Failed.
  • LE_OK Succeeded.
Parameters
[in]mtdDevInfoRefMTD Info reference.
[out]mtdNameMTD name.
[in]mtdNameSize

◆ taf_hms_GetMtdDevBlkSize()

le_result_t taf_hms_GetMtdDevBlkSize ( taf_hms_MtdDevInfoRef_t  mtdDevInfoRef,
uint32_t *  mtdBlkSizePtr 
)

Gets MTD information for block size in bytes.

Returns
  • LE_FAULT Failed.
  • LE_OK Succeeded.
Parameters
[in]mtdDevInfoRefMTD Info reference.
[out]mtdBlkSizePtrBad block size.

◆ taf_hms_GetMtdDevId()

le_result_t taf_hms_GetMtdDevId ( taf_hms_MtdDevInfoRef_t  mtdDevInfoRef,
uint32_t *  mtdDevIdPtr 
)

Gets MTD information for device ID.

Returns
  • LE_FAULT Failed.
  • LE_OK Succeeded.
Parameters
[in]mtdDevInfoRefMTD Info reference.
[out]mtdDevIdPtrDevice ID.

◆ taf_hms_GetMtdDevBlkCnt()

le_result_t taf_hms_GetMtdDevBlkCnt ( taf_hms_MtdDevInfoRef_t  mtdDevInfoRef,
uint32_t *  mtdBlkCntPtr 
)

Gets MTD information for block count.

Returns
  • LE_FAULT Failed.
  • LE_OK Succeeded.
Parameters
[in]mtdDevInfoRefMTD Info reference.
[out]mtdBlkCntPtrBlock count.