#include "legato.h"
#include "taf_hms_common.h"
Go to the source code of this file.
|
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) |
|
◆ taf_hms_DisconnectHandler_t
typedef void(* taf_hms_DisconnectHandler_t) (void *) |
Type for handler called when a server disconnects.
◆ 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()
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()
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()
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] | cpuCurrentLoadPtr | CPU 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] | coreID | Core ID |
[out] | cpuUsagePtr | cpuUsage |
◆ 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] | ramTotalMemPtr | Total Memory in kB. |
[out] | ramUsedMemPtr | Used Memory in kB. |
[out] | ramFreeMemPtr | Free memory in kB. |
◆ taf_hms_GetUbiDevInfoList()
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()
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] | ubiDevInfoListRef | UBI device list reference |
◆ taf_hms_DeleteUbiDevInfoList()
Deletes the UbiDevInfoList list retrieved with taf_hms_GetUbiDevInfoList().
- Returns
- LE_BAD_PARAMETER – Bad parameters.
- LE_OK – Succeeded.
- Parameters
-
[in] | ubiDevInfoListRef | UBI device list reference |
◆ taf_hms_GetNextUbiDevInfo()
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] | ubiDevInfoListRef | UBI device list reference |
◆ taf_hms_GetUbiDevId()
Gets UBI device ID
- Returns
- LE_FAULT Failed.
- LE_OK Succeeded.
- Parameters
-
[in] | ubiDevInfoRef | UBI device Info reference. |
[out] | ubiDevIdPtr | UBI device ID |
◆ taf_hms_GetUbiDevMaxEraseCnt()
Gets UBI information for current maximum erase count from " /sys/class/ubi/ubi%d/ ".
- Returns
- LE_FAULT Failed.
- LE_OK Succeeded.
- Parameters
-
[in] | ubiDevInfoRef | UBI device Info reference. |
[out] | ubiEraseCntPtr | Erase count. |
◆ taf_hms_GetUbiDevBadBlkCnt()
Gets UBI information for bad block count from " /sys/class/ubi/ubi%d/ ".
- Returns
- LE_FAULT Failed.
- LE_OK Succeeded.
- Parameters
-
[in] | ubiDevInfoRef | UBI device Info reference. |
[out] | ubiBbCntPtr | Bad Block count. |
◆ taf_hms_GetFirstUbiVolInfo()
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] | ubiDevInfoRef | UBI device Info reference. |
◆ taf_hms_GetNextUbiVolInfo()
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] | ubiDevInfoRef | UBI device Info reference. |
◆ taf_hms_GetUbiVolId()
Gets UBI volume ID.
- Returns
- LE_FAULT Failed.
- LE_OK Succeeded.
- Parameters
-
[in] | ubiVolInfoRef | |
[out] | ubiVolIdPtr | |
◆ taf_hms_GetUbiVolName()
Gets name of UBI volume.
- Returns
- LE_FAULT Failed.
- LE_OK Succeeded.
- Parameters
-
[in] | ubiVolInfoRef | UBI device Info reference. |
[out] | ubiVolName | UBI volume name. |
[in] | ubiVolNameSize | |
◆ taf_hms_GetUbiVolSize()
Gets size of UBI volume in bytes.
- Returns
- LE_FAULT Failed.
- LE_OK Succeeded.
- Parameters
-
[in] | ubiVolInfoRef | UBI device Info reference. |
[out] | ubiVolSizePtr | UBI volume size. |
◆ taf_hms_GetMtdDevInfoList()
Gets the list of available MTD Node.
- Returns
- NULL No information found.
- taf_hms_MtdInfoListRef The MtdInfo list object reference.
◆ taf_hms_DeleteMtdDevInfoList()
Deletes the MtdInfoList list retrieved with taf_hms_GetMtdInfoList().
- Returns
- LE_BAD_PARAMETER – Bad parameters.
- LE_OK – Succeeded.
- Parameters
-
[in] | mtdDevInfoListRef | MTD device list reference |
◆ taf_hms_GetFirstMtdDevInfo()
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] | mtdDevInfoListRef | MTD node list reference |
◆ taf_hms_GetNextMtdDevInfo()
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] | mtdDevInfoListRef | MTD node list reference |
◆ taf_hms_GetMtdDevName()
Gets MTD information for name from " /sys/class/mtd/mtd%d/ ".
- Returns
- LE_FAULT Failed.
- LE_OK Succeeded.
- Parameters
-
[in] | mtdDevInfoRef | MTD Info reference. |
[out] | mtdName | MTD name. |
[in] | mtdNameSize | |
◆ taf_hms_GetMtdDevBlkSize()
Gets MTD information for block size in bytes.
- Returns
- LE_FAULT Failed.
- LE_OK Succeeded.
- Parameters
-
[in] | mtdDevInfoRef | MTD Info reference. |
[out] | mtdBlkSizePtr | Bad block size. |
◆ taf_hms_GetMtdDevId()
Gets MTD information for device ID.
- Returns
- LE_FAULT Failed.
- LE_OK Succeeded.
- Parameters
-
[in] | mtdDevInfoRef | MTD Info reference. |
[out] | mtdDevIdPtr | Device ID. |
◆ taf_hms_GetMtdDevBlkCnt()
Gets MTD information for block count.
- Returns
- LE_FAULT Failed.
- LE_OK Succeeded.
- Parameters
-
[in] | mtdDevInfoRef | MTD Info reference. |
[out] | mtdBlkCntPtr | Block count. |