TuyaOS
|
Facility of DevOS definitions 更多...
#include "tuya_cloud_types.h"
#include "tuya_cloud_com_defs.h"
#include "tuya_base_utilities.h"
#include "tuya_iot_internal_api.h"
#include "tuya_error_code.h"
#include "tal_mutex.h"
#include "tuya_devos_utils.h"
结构体 | |
struct | DEV_RESET_S |
Definition of sub-device reset info 更多... | |
类型定义 | |
typedef struct dev_cntl_n_s | DEV_CNTL_N_S |
Definition of device control info | |
typedef BYTE_T | DP_ID_REPT_TYPE_E |
Definition of dp id report rule | |
typedef BYTE_T | DP_PV_STAT_E |
Definiton of DP status | |
typedef BYTE_T | GW_RESET_TP_T |
typedef BYTE_T | GW_WORK_STAT_T |
typedef DEV_CNTL_N_S *(* | subdev_dev_cntl_get_cb) (IN CHAR_T *id) |
Handler to get sub-device control info 更多... | |
枚举 | |
enum | TUYA_COUNTRY_CODE_E { TY_COUNTRY_CODE_CN , TY_COUNTRY_CODE_US , TY_COUNTRY_CODE_JP , TY_COUNTRY_CODE_EU } |
Definition Wi-Fi country code 更多... | |
函数 | |
DEV_CNTL_N_S * | get_dev_cntl (IN CHAR_T *id) |
Get device cntl 更多... | |
DP_CNTL_S * | get_dev_dp_cntl (IN CHAR_T *id, IN CONST BYTE_T dpid) |
Get DP cntl 更多... | |
GW_CNTL_S * | get_gw_cntl (VOID) |
Get gateway cntl 更多... | |
DEV_CNTL_N_S * | get_gw_dev_cntl (VOID) |
Get gateway device cntl 更多... | |
GW_DESC_IF_S * | get_gw_dev_if (VOID) |
Get gateway description 更多... | |
OPERATE_RET | gw_create_dev_cntl (IN CONST CHAR_T *dev_id, IN CONST CHAR_T *sch_json, OUT DEV_CNTL_N_S **dev_cnt_out) |
Create device cntl instance 更多... | |
OPERATE_RET | gw_destroy_dev_cntl (IN DEV_CNTL_N_S *dev_cnt) |
Destroy device cntl instance 更多... | |
OPERATE_RET | gw_dup_dev_cntl (IN DEV_CNTL_N_S *dev_cnt_src, OUT DEV_CNTL_N_S **dev_cnt_out) |
Duplicate device cntl 更多... | |
OPERATE_RET | gw_fast_unactive (IN CONST GW_RESET_S *rst_t) |
Faset reset device to register state 更多... | |
UINT_T | gw_get_ext_attribute (VOID) |
Get device extension attribute 更多... | |
OPERATE_RET | gw_get_gpd_type (IN CONST UINT_T type, OUT GW_PERMIT_DEV_TP_T *gpd) |
Get device ota channel 更多... | |
OPERATE_RET | gw_set_ext_attribute (UINT_T attr) |
Set device extension attribute 更多... | |
OPERATE_RET | gw_subdev_dev_cntl_get_register_cb (IN subdev_dev_cntl_get_cb cb) |
Register handler to get sub-device cntl 更多... | |
OPERATE_RET | gw_unactive (IN CONST GW_RESET_S *rst_t) |
Reset device to register state 更多... | |
OPERATE_RET | gw_unregister (IN CONST GW_RESET_S *rst_t) |
Reset device to unregister state 更多... | |
VOID_T | tuya_devos_enable_hot_reset (BOOL_T flag) |
Enable hot reset 更多... | |
BOOL_T | tuya_devos_is_hot_reset (VOID_T) |
Check devos is support hot reset 更多... | |
OPERATE_RET | tuya_get_dp_info (IN CONST CHAR_T *dev_id, INT_T *dp_num, DP_CNTL_S **dp_info) |
Get device dp info 更多... | |
CHAR_T * | tuya_get_schema (VOID) |
Get device schema info 更多... | |
Facility of DevOS definitions
typedef DEV_CNTL_N_S *(* subdev_dev_cntl_get_cb) (IN CHAR_T *id) |
Handler to get sub-device control info
[in] | id | Virtual id of sub-device |
enum TUYA_COUNTRY_CODE_E |
DEV_CNTL_N_S * get_dev_cntl | ( | IN CHAR_T * | id | ) |
Get device cntl
[in] | id | Device id, NULL indicates gateway |
DP_CNTL_S * get_dev_dp_cntl | ( | IN CHAR_T * | id, |
IN CONST BYTE_T | dpid | ||
) |
DEV_CNTL_N_S * get_gw_dev_cntl | ( | VOID | ) |
Get gateway device cntl
GW_DESC_IF_S * get_gw_dev_if | ( | VOID | ) |
Get gateway description
OPERATE_RET gw_create_dev_cntl | ( | IN CONST CHAR_T * | dev_id, |
IN CONST CHAR_T * | sch_json, | ||
OUT DEV_CNTL_N_S ** | dev_cnt_out | ||
) |
Create device cntl instance
[in] | dev_id | Device ID |
[in] | sch_json | Device schema |
[out] | dev_cnt | Device cntl |
OPERATE_RET gw_destroy_dev_cntl | ( | IN DEV_CNTL_N_S * | dev_cnt | ) |
Destroy device cntl instance
[in] | dev_cnt | Device cntl |
OPERATE_RET gw_dup_dev_cntl | ( | IN DEV_CNTL_N_S * | dev_cnt_src, |
OUT DEV_CNTL_N_S ** | dev_cnt_out | ||
) |
Duplicate device cntl
[in] | dev_cnt_src | Original device cntl |
[out] | dev_cnt_out | New device cntl |
OPERATE_RET gw_fast_unactive | ( | IN CONST GW_RESET_S * | rst_t | ) |
Faset reset device to register state
UINT_T gw_get_ext_attribute | ( | VOID | ) |
Get device extension attribute
OPERATE_RET gw_get_gpd_type | ( | IN CONST UINT_T | type, |
OUT GW_PERMIT_DEV_TP_T * | gpd | ||
) |
Get device ota channel
[in] | type | Device type |
[out] | gpd | Device ota channel |
OPERATE_RET gw_set_ext_attribute | ( | UINT_T | attr | ) |
Set device extension attribute
[in] | attr | Device extension attribute |
OPERATE_RET gw_subdev_dev_cntl_get_register_cb | ( | IN subdev_dev_cntl_get_cb | cb | ) |
Register handler to get sub-device cntl
[in] | cb | Callback to get sub-device cntl |
OPERATE_RET gw_unactive | ( | IN CONST GW_RESET_S * | rst_t | ) |
Reset device to register state
[in] | rst_t | Reset type, see GW_RESET_S |
OPERATE_RET gw_unregister | ( | IN CONST GW_RESET_S * | rst_t | ) |
Reset device to unregister state
[in] | rst_t | Reset type, see GW_RESET_S |
VOID_T tuya_devos_enable_hot_reset | ( | BOOL_T | flag | ) |
Enable hot reset
[in] | flag |
BOOL_T tuya_devos_is_hot_reset | ( | VOID_T | ) |
Check devos is support hot reset
[in] | VOID |
OPERATE_RET tuya_get_dp_info | ( | IN CONST CHAR_T * | dev_id, |
INT_T * | dp_num, | ||
DP_CNTL_S ** | dp_info | ||
) |
Get device dp info
[in] | dev_id | Device id |
[in] | dp_num | Count of dp |
[out] | dp_info | DP info |
CHAR_T * tuya_get_schema | ( | VOID | ) |
Get device schema info
[in] | dev_id | Device id |
[in] | dp_num | Count of dp |
[out] | dp_info | DP info |