BK_TEMPERATURE
BK_TEMPERATURE API Status
API |
|---|
BK_TEMPERATURE API Reference
Header File
Functions
-
uint32_t bk_temp_open(uint32_t dev_index)
beken temperature open.
使用之前需要先open,参数是设备index,从0开始
- 参数:
dev_index – [in] device index, from 0(the first device)
- 返回值:
0 – fail
other – success
- 返回:
handle
-
int32_t bk_temp_close(uint32_t handle)
beken temperature close.
使用 temperature 结束后需要close,和 bk_temp_open() 是配对的
- 参数:
handle – [in] return value of bk_temp_open()
- 返回值:
0 – success [BK_RET_OK]
other – fail
- 返回:
result
-
int32_t bk_temp_get(uint32_t handle, bool smoothing, pfunc_bk_temp_cb_t pfn_cb, void *pv_arg)
beken temperature get data.
获取一次当前的温度信息,该函数是一个异步函数,温度结果是 pfunc_bk_temp_cb_t 的参数temp
- 参数:
handle – [in] return value of bk_temp_open()
smoothing – [in] 是否做平滑处理
pfn_cb – [in] 通知结果的callback
pv_arg – [in] callback的参数
- 返回值:
0 – success [BK_RET_OK]
other – fail
- 返回:
result
Type Definitions
-
typedef void (*pfunc_bk_temp_cb_t)(uint32_t handle, uint16_t temp, void *pv_arg)