Documentation

Documentation

Includes

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

tuya_error_code.h

#include "tuya_error_code.h"
#include "tuya_error_code.h"

Macros

Marco __TUYA_SVC_SCHEMA_UPGRADE_H__

#define __TUYA_SVC_SCHEMA_UPGRADE_H__


      

Marco EVT_DEV_SCHEMA_UPGRADE

#define EVT_DEV_SCHEMA_UPGRADE "schema.ug.cid"

      

Functions

Func ty_schema_upgrade_init

OPERATE_RET ty_schema_upgrade_init(VOID);
/**
 * @brief Initilize schema upgrade framework
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func ty_schema_upgrade_active

OPERATE_RET ty_schema_upgrade_active(VOID);
/**
 * @brief Run schema upgrade framework, workloads registered will be executed
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func ty_schema_upgrade_notify

OPERATE_RET ty_schema_upgrade_notify(CHAR_T *dev_id);
/**
 * @brief Schema upgrade is triggered by MQTT msg
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func ty_schema_upgrade_register

OPERATE_RET ty_schema_upgrade_register(ACTION_CB cb_update, ACTION_CB cb_get);
/**
 * @brief Register schema upgrade workload
 * 
 * @param[in] cb_update Callback to upload schema upload status
 * @param[in] cb_get Callback to retrieve schema from cloud
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Vars

Consts

Types

Typedefs

Typedef Action_e;

typedef enum tagAction_e {
   /** this action will redo */
   ACTION_CONTINUE,
   /** switch to next action */
   ACTION_NEXT,
   /** action list is complete */
   ACTION_COMPLETE,
   ACTION_MAX
}Action_e;
/**
 * @brief Definition of schema upgrade action
 */

Typedef Action_e

typedef Action_e (*ACTION_CB)(OUT VOID *data);
/**
 * @brief Schema upgrade action
 * 
 * @param[in] data ID of sub-device, or NULL for GW
 * 
 * @return see Action_e
 */