TuyaOS
函数
tuya_devos_utils.h 文件参考

Utilities of DevOS 更多...

#include "tuya_cloud_com_defs.h"
#include "ty_cJSON.h"
#include "gw_intf.h"
tuya_devos_utils.h 的引用(Include)关系图:
此图展示该文件直接或间接的被哪些文件引用了:

浏览源代码.

函数

DP_REPT_FLOW_CTRL_UNITget_all_dp_flow_ctrl_rule (VOID)
 Get DP flow control rules 更多...
 
GW_WORK_STAT_T get_gw_active (VOID)
 Get activation state 更多...
 
BOOL_T get_gw_auth_status (VOID)
 Get gateway's authentication status 更多...
 
BOOL_T get_gw_bind_status (VOID)
 Get gateway's dp bind status 更多...
 
CONST CHAR_T * get_gw_country_code (VOID)
 Get gateway country code 更多...
 
CONST CHAR_T * get_gw_dev_id (VOID)
 Get gateway's device id 更多...
 
GW_EXT_STAT_T get_gw_ext_stat (VOID)
 Get DevOS extension state 更多...
 
GW_NW_STAT_T get_gw_nw_status (VOID)
 Get device network linkage state 更多...
 
CONST CHAR_T * get_gw_region (VOID)
 Get gateway region 更多...
 
CONST CHAR_T * get_gw_ssid (VOID)
 Get gateway's ssid 更多...
 
CONST CHAR_T * get_gw_sw_ver (GW_PERMIT_DEV_TP_T tp)
 Get gateway's mcu software version 更多...
 
VOID_T gw_active_free_options (VOID_T)
 Free all saved gw active options(internal api)
 
CHAR_T * gw_active_get_ext_param (VOID)
 Get extension params for activation 更多...
 
CHAR_T * gw_active_get_options (VOID_T)
 Get gw active options 更多...
 
BOOL_T gw_active_get_support_election (VOID)
 Get election enable or not 更多...
 
OPERATE_RET gw_active_set_ext_param (IN CHAR_T *param)
 Set extension params for activation 更多...
 
OPERATE_RET gw_active_set_options (CHAR_T *op)
 Set gw active option 更多...
 
OPERATE_RET gw_active_set_support_election (BOOL_T enable)
 Set election enable or not 更多...
 
OPERATE_RET gw_cad_ver_update (CHAR_T *old_ver, CHAR_T *new_ver, IN CONST DEV_TYPE_T tp, IN CONST GW_ATTACH_ATTR_T *attr, IN CONST UINT_T attr_num)
 
CHAR_T * gw_dp_flow_ctrl_cfg_proc (ty_cJSON *result)
 Parse DP flow control rules 更多...
 
OPERATE_RET gw_ext_active_start (ty_cJSON *root)
 
TY_EXT_AUTH_INFOgw_get_ext_auth_info (VOID_T)
 
OPERATE_RET gw_get_ip (NW_IP_S *p_ip)
 Get device IP 更多...
 
OPERATE_RET gw_get_mac (NW_MAC_S *p_mac)
 Get device MAC 更多...
 
GW_STRIDE_UPDATE_Sgw_get_new_pid_key (VOID)
 Get stride info 更多...
 
OPERATE_RET gw_get_rssi (SCHAR_T *p_rssi)
 Get device RSSI level 更多...
 
CHAR_T * gw_get_udf (VOID)
 Get user defined features(udf) for activation 更多...
 
OPERATE_RET gw_init_auth_info (ty_cJSON *auth_info)
 
OPERATE_RET gw_load_sum_time_zone_tbl (IN CONST CHAR_T *tm_zone)
 Load summer timezone talbe 更多...
 
VOID gw_oem_set (IN CONST BOOL_T oem)
 Enable oem or not 更多...
 
VOID gw_register_cbs (IN CONST TY_IOT_CBS_S *cbs)
 Set DevOS event handlers 更多...
 
OPERATE_RET gw_save_auth_token (IN CONST CHAR_T *token, IN CONST CHAR_T *region, IN CONST CHAR_T *regist_key)
 Save network configuration token 更多...
 
VOID gw_set_psk30_cfg (BOOL_T flag)
 set psk30 cfg flag 更多...
 
OPERATE_RET gw_set_udf (IN CONST CHAR_T *udf)
 Set user defined features(udf) for activation 更多...
 
OPERATE_RET gw_update_versions (VOID)
 Force to upload all versions 更多...
 
BOOL_T gw_upload_rst_log_get (VOID)
 Enable reset log upload or not
 
VOID gw_upload_rst_log_set (IN CONST BOOL_T upload)
 Enable reset log upload or not 更多...
 
OPERATE_RET gw_user_token_bind (IN CONST CHAR_T *token)
 Set network configuration token 更多...
 
BOOL_T is_gw_oem (VOID)
 Whether oem is enabled or not 更多...
 
VOID set_gw_active (GW_WORK_STAT_T stat)
 Set activation state 更多...
 
VOID set_gw_ext_stat (IN CONST GW_EXT_STAT_T ext_stat)
 Set DevOS extension state 更多...
 
CHAR_T * tuya_get_serialno (VOID)
 Get serial number 更多...
 
OPERATE_RET tuya_iot_dev_enable_attach_update (BOOL_T enable)
 
OPERATE_RET tuya_iot_dev_get_attach_attr (GW_PERMIT_DEV_TP_T tp, GW_ATTACH_ATTR_T *attr)
 
BOOL_T tuya_iot_dev_get_attach_update_enable (VOID)
 
OPERATE_RET tuya_iot_dev_set_attach_attr (GW_PERMIT_DEV_TP_T tp, GW_ATTACH_ATTR_T *attr)
 
OPERATE_RET tuya_iot_dev_update_attachs (UINT_T attr_num, GW_ATTACH_ATTR_T *attrs)
 Update versions of all attach modules. 更多...
 
OPERATE_RET ty_init_rtc (INT_T timeval)
 Initialize rtc module 更多...
 

详细描述

Utilities of DevOS

版本
0.1
日期
2020-11-09

函数说明

◆ get_all_dp_flow_ctrl_rule()

DP_REPT_FLOW_CTRL_UNIT * get_all_dp_flow_ctrl_rule ( VOID  )

Get DP flow control rules

返回
See DP_REPT_FLOW_CTRL_UNIT, NULL on error

◆ get_gw_active()

GW_WORK_STAT_T get_gw_active ( VOID  )

Get activation state

返回
Work state, see GW_WORK_STAT_T

◆ get_gw_auth_status()

BOOL_T get_gw_auth_status ( VOID  )

Get gateway's authentication status

返回
TRUE if authorized, otherwise return FALSE

◆ get_gw_bind_status()

BOOL_T get_gw_bind_status ( VOID  )

Get gateway's dp bind status

返回
Dp bind status, return FALSE if not exist

◆ get_gw_country_code()

CONST CHAR_T * get_gw_country_code ( VOID  )

Get gateway country code

返回
Country code as a string, return NULL if not exist

◆ get_gw_dev_id()

CONST CHAR_T * get_gw_dev_id ( VOID  )

Get gateway's device id

返回
Device id as a string, return NULL if not exist

◆ get_gw_ext_stat()

GW_EXT_STAT_T get_gw_ext_stat ( VOID  )

Get DevOS extension state

返回
Extension state, see GW_EXT_STAT_T

◆ get_gw_nw_status()

GW_NW_STAT_T get_gw_nw_status ( VOID  )

Get device network linkage state

参数
[out]nw_statLinkage state, see GW_NW_STAT_T
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ get_gw_region()

CONST CHAR_T * get_gw_region ( VOID  )

Get gateway region

返回
Region as a string, return NULL if not exist

◆ get_gw_ssid()

CONST CHAR_T * get_gw_ssid ( VOID  )

Get gateway's ssid

返回
SSID as a string, return NULL if not exist

◆ get_gw_sw_ver()

CONST CHAR_T * get_gw_sw_ver ( GW_PERMIT_DEV_TP_T  tp)

Get gateway's mcu software version

参数
[in]tpdevice type
返回
Version as a string, return NULL if not exist

◆ gw_active_get_ext_param()

CHAR_T * gw_active_get_ext_param ( VOID  )

Get extension params for activation

返回
NULL on error

◆ gw_active_get_options()

CHAR_T * gw_active_get_options ( VOID_T  )

Get gw active options

返回
buffer of options array

◆ gw_active_get_support_election()

BOOL_T gw_active_get_support_election ( VOID  )

Get election enable or not

返回
TRUE on enable, False on disable

◆ gw_active_set_ext_param()

OPERATE_RET gw_active_set_ext_param ( IN CHAR_T *  param)

Set extension params for activation

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

◆ gw_active_set_options()

OPERATE_RET gw_active_set_options ( CHAR_T *  op)

Set gw active option

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

◆ gw_active_set_support_election()

OPERATE_RET gw_active_set_support_election ( BOOL_T  enable)

Set election enable or not

参数
[in]enableelection is supported or not
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ gw_dp_flow_ctrl_cfg_proc()

CHAR_T * gw_dp_flow_ctrl_cfg_proc ( ty_cJSON result)

Parse DP flow control rules

参数
[in]resultJson encoded flow control rules
返回
Buffer of flow control rules, NULL on error

◆ gw_get_ip()

OPERATE_RET gw_get_ip ( NW_IP_S *  p_ip)

Get device IP

参数
[out]p_ipDevice IP, see NW_IP_S
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ gw_get_mac()

OPERATE_RET gw_get_mac ( NW_MAC_S *  p_mac)

Get device MAC

参数
[out]p_macDevice MAC, see NW_MAC_S
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ gw_get_new_pid_key()

GW_STRIDE_UPDATE_S * gw_get_new_pid_key ( VOID  )

Get stride info

返回
NULL on faile, others see GW_STRIDE_UPDATE_S

◆ gw_get_rssi()

OPERATE_RET gw_get_rssi ( SCHAR_T *  p_rssi)

Get device RSSI level

参数
[out]p_rssiDevice RSSI level, if(*p_rssi == 99) then do't support get RSSI
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ gw_get_udf()

CHAR_T * gw_get_udf ( VOID  )

Get user defined features(udf) for activation

返回
NULL on error

◆ gw_load_sum_time_zone_tbl()

OPERATE_RET gw_load_sum_time_zone_tbl ( IN CONST CHAR_T *  tm_zone)

Load summer timezone talbe

参数
[in]tm_zoneSummer timezone table
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ gw_oem_set()

VOID gw_oem_set ( IN CONST BOOL_T  oem)

Enable oem or not

参数
[in]oemEnable or not

◆ gw_register_cbs()

VOID gw_register_cbs ( IN CONST TY_IOT_CBS_S cbs)

Set DevOS event handlers

参数
[in]cbsHandler of event, see TY_IOT_CBS_S

◆ gw_save_auth_token()

OPERATE_RET gw_save_auth_token ( IN CONST CHAR_T *  token,
IN CONST CHAR_T *  region,
IN CONST CHAR_T *  regist_key 
)

Save network configuration token

参数
[in]tokenToken got from network configuration
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ gw_set_psk30_cfg()

VOID gw_set_psk30_cfg ( BOOL_T  flag)

set psk30 cfg flag

参数
[in]flagTRUE or FALSE

◆ gw_set_udf()

OPERATE_RET gw_set_udf ( IN CONST CHAR_T *  udf)

Set user defined features(udf) for activation

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

◆ gw_update_versions()

OPERATE_RET gw_update_versions ( VOID  )

Force to upload all versions

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

◆ gw_upload_rst_log_set()

VOID gw_upload_rst_log_set ( IN CONST BOOL_T  upload)

Enable reset log upload or not

参数
[in]uploadEnable or not

◆ gw_user_token_bind()

OPERATE_RET gw_user_token_bind ( IN CONST CHAR_T *  token)

Set network configuration token

参数
[in]tokenToken got from network configuration
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ is_gw_oem()

BOOL_T is_gw_oem ( VOID  )

Whether oem is enabled or not

返回
TRUE on positive, FALSE on negative

◆ set_gw_active()

VOID set_gw_active ( GW_WORK_STAT_T  stat)

Set activation state

参数
[in]statWork state, see GW_WORK_STAT_T

◆ set_gw_ext_stat()

VOID set_gw_ext_stat ( IN CONST GW_EXT_STAT_T  ext_stat)

Set DevOS extension state

参数
[in]ext_statExtension state, see GW_EXT_STAT_T

◆ tuya_get_serialno()

CHAR_T * tuya_get_serialno ( VOID  )

Get serial number

返回
Buffer of serial number, NULL on error

◆ tuya_iot_dev_update_attachs()

OPERATE_RET tuya_iot_dev_update_attachs ( UINT_T  attr_num,
GW_ATTACH_ATTR_T attrs 
)

Update versions of all attach modules.

参数
[in]attr_numCount of attach modules
[in]attrsAttributes of attach modules
注解
This API is used for attach modules updating in case of dynamic add/remove/update. Info of main netlink module will also be included when upload.
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ ty_init_rtc()

OPERATE_RET ty_init_rtc ( INT_T  timeval)

Initialize rtc module

参数
[in]timevalTime interval to update local time
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h