TuyaOS
结构体 | 宏定义 | 类型定义 | 枚举 | 函数
gw_intf.h 文件参考

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"
gw_intf.h 的引用(Include)关系图:
此图展示该文件直接或间接的被哪些文件引用了:

浏览源代码.

结构体

struct  DEV_RESET_S
 Definition of sub-device reset info 更多...
 

宏定义

#define ACTIVATED   2
 
#define CLOUD_CAPABILITY_BLEMESH   11
 
#define CLOUD_CAPABILITY_BLUETOOTH   10
 
#define CLOUD_CAPABILITY_CABLE   1
 
#define CLOUD_CAPABILITY_GPRS   2
 
#define CLOUD_CAPABILITY_INFRARED   13
 
#define CLOUD_CAPABILITY_MCU   16
 
#define CLOUD_CAPABILITY_NBIOT   3
 
#define CLOUD_CAPABILITY_SIGMESH   15
 
#define CLOUD_CAPABILITY_SUBPIECES   14
 
#define CLOUD_CAPABILITY_WIFI   0
 Denifition of capability in cloud
 
#define CLOUD_CAPABILITY_ZIGBEE   12
 
#define DP_ID_REPT_RULE_ROUTE   (0x1)
 
#define GET_ACCESS_TOKEN_INTERVAL   (300 * 1000)
 
#define GRP_LMT   64
 
#define GRT_LOCAL   0
 
#define GRT_REMOTE   1
 
#define INVALID   0
 
#define LOG_PHAT_MAX_LEN   64
 
#define PROXY_ACTIVATED   (4)
 
#define PROXY_ACTIVING   (3)
 
#define REGISTERED   1
 
#define SCENE_LMT   64
 
#define SERIAL_NO_STR_LEN   32
 
#define UNREGISTERED   0
 
#define VALID_CLOUD   3
 
#define VALID_LC   1
 
#define VALID_ULING   2
 

类型定义

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_Sget_dev_cntl (IN CHAR_T *id)
 Get device cntl 更多...
 
DP_CNTL_Sget_dev_dp_cntl (IN CHAR_T *id, IN CONST BYTE_T dpid)
 Get DP cntl 更多...
 
GW_CNTL_Sget_gw_cntl (VOID)
 Get gateway cntl 更多...
 
DEV_CNTL_N_Sget_gw_dev_cntl (VOID)
 Get gateway device cntl 更多...
 
GW_DESC_IF_Sget_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

版本
0.1
日期
2015-08-22

类型定义说明

◆ subdev_dev_cntl_get_cb

typedef DEV_CNTL_N_S *(* subdev_dev_cntl_get_cb) (IN CHAR_T *id)

Handler to get sub-device control info

参数
[in]idVirtual id of sub-device
返回
See DEV_CNTL_N_S, NULL on error

枚举类型说明

◆ TUYA_COUNTRY_CODE_E

Definition Wi-Fi country code

枚举值
TY_COUNTRY_CODE_CN 

China

TY_COUNTRY_CODE_US 

USA

TY_COUNTRY_CODE_JP 

Japan

TY_COUNTRY_CODE_EU 

Europe

函数说明

◆ get_dev_cntl()

DEV_CNTL_N_S * get_dev_cntl ( IN CHAR_T *  id)

Get device cntl

参数
[in]idDevice id, NULL indicates gateway
返回
Device cntl, see DEV_CNTL_N_S

◆ get_dev_dp_cntl()

DP_CNTL_S * get_dev_dp_cntl ( IN CHAR_T *  id,
IN CONST BYTE_T  dpid 
)

Get DP cntl

参数
[in]idDevice id
[in]dpidDP id
返回
DP cntl, see DP_CNTL_S

◆ get_gw_cntl()

GW_CNTL_S * get_gw_cntl ( VOID  )

Get gateway cntl

返回
Gateway cntl, see GW_CNTL_S

◆ get_gw_dev_cntl()

DEV_CNTL_N_S * get_gw_dev_cntl ( VOID  )

Get gateway device cntl

返回
Gateway device cntl, see DEV_CNTL_N_S

◆ get_gw_dev_if()

GW_DESC_IF_S * get_gw_dev_if ( VOID  )

Get gateway description

返回
Gateway description, see GW_DESC_IF_S

◆ gw_create_dev_cntl()

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_idDevice ID
[in]sch_jsonDevice schema
[out]dev_cntDevice cntl
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ gw_destroy_dev_cntl()

OPERATE_RET gw_destroy_dev_cntl ( IN DEV_CNTL_N_S dev_cnt)

Destroy device cntl instance

参数
[in]dev_cntDevice cntl
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ gw_dup_dev_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_srcOriginal device cntl
[out]dev_cnt_outNew device cntl
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ gw_fast_unactive()

OPERATE_RET gw_fast_unactive ( IN CONST GW_RESET_S rst_t)

Faset reset device to register state

返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ gw_get_ext_attribute()

UINT_T gw_get_ext_attribute ( VOID  )

Get device extension attribute

返回
Device extension attribute

◆ gw_get_gpd_type()

OPERATE_RET gw_get_gpd_type ( IN CONST UINT_T  type,
OUT GW_PERMIT_DEV_TP_T *  gpd 
)

Get device ota channel

参数
[in]typeDevice type
[out]gpdDevice ota channel
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ gw_set_ext_attribute()

OPERATE_RET gw_set_ext_attribute ( UINT_T  attr)

Set device extension attribute

参数
[in]attrDevice extension attribute
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ gw_subdev_dev_cntl_get_register_cb()

OPERATE_RET gw_subdev_dev_cntl_get_register_cb ( IN subdev_dev_cntl_get_cb  cb)

Register handler to get sub-device cntl

参数
[in]cbCallback to get sub-device cntl
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ gw_unactive()

OPERATE_RET gw_unactive ( IN CONST GW_RESET_S rst_t)

Reset device to register state

参数
[in]rst_tReset type, see GW_RESET_S
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ gw_unregister()

OPERATE_RET gw_unregister ( IN CONST GW_RESET_S rst_t)

Reset device to unregister state

参数
[in]rst_tReset type, see GW_RESET_S
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ tuya_devos_enable_hot_reset()

VOID_T tuya_devos_enable_hot_reset ( BOOL_T  flag)

Enable hot reset

参数
[in]flag
返回
VOID

◆ tuya_devos_is_hot_reset()

BOOL_T tuya_devos_is_hot_reset ( VOID_T  )

Check devos is support hot reset

参数
[in]VOID
返回
BOOL_T

◆ tuya_get_dp_info()

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_idDevice id
[in]dp_numCount of dp
[out]dp_infoDP info
注解
Caller shall free the memory of dp_info explictly
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ tuya_get_schema()

CHAR_T * tuya_get_schema ( VOID  )

Get device schema info

参数
[in]dev_idDevice id
[in]dp_numCount of dp
[out]dp_infoDP info
注解
Caller shall free the returned memory explictly
返回
Schema info, NULL on fail