Documentation

Documentation

Includes

tuya_cloud_com_defs.h

#include "tuya_cloud_com_defs.h"
#include "tuya_cloud_com_defs.h"

Macros

Marco __TUYA_DEVOS_ENTRY_H__

#define __TUYA_DEVOS_ENTRY_H__

      

Functions

Func tuya_iot_dev_activated

OPERATE_RET tuya_iot_dev_activated(VOID);
/**
 * @brief Device is activated, and begin to launch
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_iot_dev_update_attachs

OPERATE_RET tuya_iot_dev_update_attachs(UINT_T attr_num, GW_ATTACH_ATTR_T *attrs);
/**
 * @brief Update versions of all attach modules.
 *
 * @param[in] attr_num Count of attach modules
 * @param[in] attrs Attributes of attach modules
 *
 * @note 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.
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_iot_dev_set_attach_attr

OPERATE_RET tuya_iot_dev_set_attach_attr(GW_PERMIT_DEV_TP_T tp, GW_ATTACH_ATTR_T * attr);


      

Func tuya_iot_dev_get_attach_attr

OPERATE_RET tuya_iot_dev_get_attach_attr(GW_PERMIT_DEV_TP_T tp, GW_ATTACH_ATTR_T * attr);


      

Func gw_upload_rst_log_set

VOID gw_upload_rst_log_set(IN CONST BOOL_T upload);
/**
 * @brief Enable reset log upload or not
 *
 * @param[in] upload Enable or not
 */

Func gw_oem_set

VOID gw_oem_set(IN CONST BOOL_T oem);
/**
 * @brief Enable oem or not
 *
 * @param[in] oem Enable or not
 */

Func is_gw_oem

BOOL_T is_gw_oem(VOID);
/**
 * @brief Whether oem is enabled or not
 *
 * @return TRUE on positive, FALSE on negative
 */

Func gw_update_versions

OPERATE_RET gw_update_versions(VOID);
/**
 * @brief Force to upload all versions
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func gw_ctrl_write_stride

VOID gw_ctrl_write_stride(VOID);
/**
 * @brief Write stride info
 */

Func gw_ctrl_reset_stride

VOID gw_ctrl_reset_stride(VOID);
/**
 * @brief reset stride info
 */

Func gw_ctrl_update_stride

VOID gw_ctrl_update_stride(VOID);
/**
 * @brief Update stride info
 */

Vars

Variable GW_STRIDE_UPDATE_S

GW_STRIDE_UPDATE_S* gw_get_new_pid_key(VOID);
/**
 * @brief Get stride info
 *
 * @return NULL on faile, others see GW_STRIDE_UPDATE_S
 */

Consts

Types

Typedefs

Typedef tuya_dev_init_t;

typedef struct {
   /** The key of firmware, assigned by TUYA */
   CHAR_T *firmware_key;
   /** The key of product, assigned by TUYA */
   CHAR_T *product_key;
   /** The version of firmware, format is "x.y.z" */
   CHAR_T *sw_ver;
 
   /** The count of attach modules */
   UINT_T attr_num;
   /** The attributes of attach modules */
   GW_ATTACH_ATTR_T *attrs;
}tuya_dev_init_t;
/**
 * @brief Init param of IoT device
 */