TuyaOS
|
Common process - Initialization 更多...
结构体 | |
struct | TY_RAW_DP_REPT_S |
dp data report information for raw type 更多... | |
类型定义 | |
typedef struct msg_data_s | MSG_DATA_S |
info of dp message data | |
typedef OPERATE_RET(* | sf_special_dp_cb) (IN CONST UINT16_T dpid, IN CONST ty_cJSON *dp_obj) |
typedef OPERATE_RET(* | sf_subdev_dev_cntl_traversal_cb) (subdev_dev_cntl_cb, VOID *param) |
typedef BOOL_T(* | sf_subdev_reliable_transfer_check_cb) (IN CHAR_T *id) |
typedef UINT_T(* | sf_subdev_reliable_transfer_time_get_cb) (IN CHAR_T *id) |
typedef BOOL_T(* | sf_subdev_report_check_cb) (IN CHAR_T *id) |
typedef OPERATE_RET(* | sf_trans_type_cb) (IN CONST UINT16_T dpid, IN CONST ty_cJSON *data_js) |
typedef OPERATE_RET(* | subdev_dev_cntl_cb) (IN DEV_CNTL_N_S *subdev_cntl, VOID *param) |
函数 | |
DP_CNTL_S * | sf_dp_data_get (IN CHAR_T *id, IN CONST uint8_t dp_id) |
Get dp control information 更多... | |
BOOL_T | sf_dp_data_is_equl (IN ty_cJSON *dp_cmd) |
Check the dp data is same 更多... | |
OPERATE_RET | sf_dp_low_power_query (IN CONST UCHAR_T *dps, IN CONST UINT_T cnt, OUT TY_RECV_OBJ_DP_S **obj_dps, OUT TY_RECV_MULTI_RAW_DP_S **raw_dps) |
Query dp for low power 更多... | |
OPERATE_RET | sf_dp_set_delete_null_dp (BOOL_T enable) |
Set enable switch for deleting null dp 更多... | |
OPERATE_RET | sf_dp_set_report_timeout (UINT_T timeout_s) |
Set default dp report timeout 更多... | |
UINT_T | sf_get_serial_no (VOID) |
Get serial number for dp report 更多... | |
CHAR_T * | sf_pack_local_obj_dp_data (IN DEV_CNTL_N_S *dev_cntl, IN CONST UINT_T max_len, IN CONST BOOL_T addDevId, OUT BOOL_T *p_all_data_packed, BOOL_T reset_flow_ctl, IN CONST BOOL_T is_lan, OUT CHAR_T **time_str) |
Packed the local dp data as string in json format 更多... | |
OPERATE_RET | sf_regist_dp_rept_cb (IN DP_REPT_HADLE_CB_S *dp_rept_cbs) |
Register callback function for dp report 更多... | |
OPERATE_RET | sf_respone_obj_dp_query (IN UINT_T cmd_tp, IN CONST ty_cJSON *pCidArr, IN CONST ty_cJSON *pDpIdArr) |
Response for dp query 更多... | |
OPERATE_RET | sf_send_gw_dev_cmd (IN SF_GW_DEV_CMD_S *gd_cmd) |
Send dp command 更多... | |
OPERATE_RET | sf_special_dp_register_cb (IN sf_special_dp_cb handler) |
Register special dp callback function 更多... | |
VOID | sf_start_sync_obj_dp (VOID) |
Start to synchronize dp data 更多... | |
OPERATE_RET | sf_subdev_register_cb (IN SF_SUBDEV_HANDLE_CB_S *cbs) |
Register callback function for subdevice 更多... | |
OPERATE_RET | sf_trans_type_register_cb (IN CONST DP_TRANS_TYPE_T trans, IN sf_trans_type_cb handler) |
Register callback function for different kind of transport type 更多... | |
OPERATE_RET | smart_frame_init (VOID) |
Smart frame init 更多... | |
BOOL_T | ty_check_dpid_need_rept (CHAR_T *dev_id, BYTE_T dpid, DP_CMD_TYPE_E type, DP_DESC_IF_S *dp_desc) |
check dp id need report 更多... | |
OPERATE_RET | ty_dp_report (IN CONST DP_REPT_TYPE_E dp_rept_type, IN VOID_T *dp_rept) |
Report dp data 更多... | |
VOID_T | ty_free_obj_dp_data (TY_OBJ_DP_S *dp_data, UINT_T cnt) |
ty_free_obj_dp_data @desc free memory of object dp 更多... | |
UINT8_T | ty_get_dpid_rept_rule (VOID_T) |
get dp id report rule 更多... | |
OPERATE_RET | ty_get_obj_dp_from_json (IN CHAR_T *dev_id, IN CONST CHAR_T *json_str, OUT TY_OBJ_DP_S **dp_data, OUT UINT_T *cnt) |
ty_dp_json_to_obj @desc transfer json format dp to object 更多... | |
VOID_T | ty_print_dp_time (VOID_T) |
Print the key time for dp report 更多... | |
VOID | ty_set_dpid_rept_rule (UINT8_T rept_rule) |
set dp id report rule 更多... | |
Common process - Initialization
DP_CNTL_S * sf_dp_data_get | ( | IN CHAR_T * | id, |
IN CONST uint8_t | dp_id | ||
) |
Get dp control information
[in] | id | device id |
[in] | dp_id | dp id |
BOOL_T sf_dp_data_is_equl | ( | IN ty_cJSON * | dp_cmd | ) |
Check the dp data is same
[in] | dp_cmd | dp information in josn format |
OPERATE_RET sf_dp_low_power_query | ( | IN CONST UCHAR_T * | dps, |
IN CONST UINT_T | cnt, | ||
OUT TY_RECV_OBJ_DP_S ** | obj_dps, | ||
OUT TY_RECV_MULTI_RAW_DP_S ** | raw_dps | ||
) |
Query dp for low power
[in] | dps | dp string |
[in] | cnt | dp count |
[out] | obj_dps | dp in object format |
[out] | raw_dps | dp in raw format |
OPERATE_RET sf_dp_set_delete_null_dp | ( | BOOL_T | enable | ) |
Set enable switch for deleting null dp
[in] | enable | enable switch |
OPERATE_RET sf_dp_set_report_timeout | ( | UINT_T | timeout_s | ) |
Set default dp report timeout
[in] | timeout_s | in second |
UINT_T sf_get_serial_no | ( | VOID | ) |
Get serial number for dp report
VOID |
CHAR_T * sf_pack_local_obj_dp_data | ( | IN DEV_CNTL_N_S * | dev_cntl, |
IN CONST UINT_T | max_len, | ||
IN CONST BOOL_T | addDevId, | ||
OUT BOOL_T * | p_all_data_packed, | ||
BOOL_T | reset_flow_ctl, | ||
IN CONST BOOL_T | is_lan, | ||
OUT CHAR_T ** | time_str | ||
) |
Packed the local dp data as string in json format
[in] | dev_cntl | device control handle |
[in] | max_len | max lenth of the dp string |
[in] | addDevId | if add devid or not |
[out] | p_all_data_packed | if all dp is packed or not |
[in] | reset_flow_ctl | if need reset flow control or not |
[in] | is_lan | if be lan or not |
OPERATE_RET sf_regist_dp_rept_cb | ( | IN DP_REPT_HADLE_CB_S * | dp_rept_cbs | ) |
Register callback function for dp report
[in] | dp_rept_cbs | callback functions |
OPERATE_RET sf_respone_obj_dp_query | ( | IN UINT_T | cmd_tp, |
IN CONST ty_cJSON * | pCidArr, | ||
IN CONST ty_cJSON * | pDpIdArr | ||
) |
Response for dp query
[in] | pCidArr | cid in json format |
[in] | pDpIdArr | dp id in json format |
OPERATE_RET sf_send_gw_dev_cmd | ( | IN SF_GW_DEV_CMD_S * | gd_cmd | ) |
Send dp command
[in] | gd_cmd | dp command information |
OPERATE_RET sf_special_dp_register_cb | ( | IN sf_special_dp_cb | handler | ) |
Register special dp callback function
[in] | handler | special dp callback function |
VOID sf_start_sync_obj_dp | ( | VOID | ) |
Start to synchronize dp data
VOID |
OPERATE_RET sf_subdev_register_cb | ( | IN SF_SUBDEV_HANDLE_CB_S * | cbs | ) |
Register callback function for subdevice
[in] | cbs | callback functions |
OPERATE_RET sf_trans_type_register_cb | ( | IN CONST DP_TRANS_TYPE_T | trans, |
IN sf_trans_type_cb | handler | ||
) |
Register callback function for different kind of transport type
[in] | trans | transport type |
[in] | handler | callback function |
OPERATE_RET smart_frame_init | ( | VOID | ) |
Smart frame init
VOID |
BOOL_T ty_check_dpid_need_rept | ( | CHAR_T * | dev_id, |
BYTE_T | dpid, | ||
DP_CMD_TYPE_E | type, | ||
DP_DESC_IF_S * | dp_desc | ||
) |
check dp id need report
[in] | dev_id | dev id |
[in] | dpid | dp id |
[in] | type | ref type DP_CMD_TYPE_E |
[in] | DP_DESC_IF_S | dp desc info |
OPERATE_RET ty_dp_report | ( | IN CONST DP_REPT_TYPE_E | dp_rept_type, |
IN VOID_T * | dp_rept | ||
) |
Report dp data
[in] | dp_rept_type | dp report type |
[in] | dp_rept | dp report data |
VOID_T ty_free_obj_dp_data | ( | TY_OBJ_DP_S * | dp_data, |
UINT_T | cnt | ||
) |
ty_free_obj_dp_data @desc free memory of object dp
[in] | dp_data | dp data |
[in] | cnt | dp count |
UINT8_T ty_get_dpid_rept_rule | ( | VOID_T | ) |
get dp id report rule
OPERATE_RET ty_get_obj_dp_from_json | ( | IN CHAR_T * | dev_id, |
IN CONST CHAR_T * | json_str, | ||
OUT TY_OBJ_DP_S ** | dp_data, | ||
OUT UINT_T * | cnt | ||
) |
ty_dp_json_to_obj @desc transfer json format dp to object
[in] | dev_id | if sub-device, then devid = sub-device_id if gateway/soc/mcu, then devid = NULL |
[in] | json_str | string in json format |
[OUT] | dp_data: dp array header | |
[OUT] | cnt: dp array count |
VOID_T ty_print_dp_time | ( | VOID_T | ) |
Print the key time for dp report
VOID |
VOID ty_set_dpid_rept_rule | ( | UINT8_T | rept_rule | ) |
set dp id report rule
[in] | rept_rule | ref to DP_ID_REPT_TYPE_E |