English
English
简体中文
Register
Log In
English
English
简体中文
Register
Log In
Language
English
English
简体中文
Register
Log In

How to distinguish between unbinding and unbinding apps and clearing data in TuyaOS?

Last Updated on2025-04-17 07:15:18
Removing a device from the app will enter the gw_deset_cb callback. Unbinding, unbinding, and clearing data can be distinguished by resetting the type. The corresponding TYPE for unbinding is: GW_REMOTE_UNACTIVE, Unbind and clear data corresponding to TYPE: GW_REMOTE_RESET_FACTORY.
//The complete definition of reset type is as follows
/* tuya sdk gateway reset type */
typedefenum {
    GW_LOCAL_RESET_FACTORY =0,//(cb/event)
    GW_REMOTE_UNACTIVE,//(cb/event)
    GW_LOCAL_UNACTIVE,//(cb/event)
    GW_REMOTE_RESET_FACTORY,//(cb/event)
    GW_RESET_DATA_FACTORY, //need clear local data when active(cb/event)
    GW_REMOTE_RESET_DATA_FACTORY, //need clear local data when active(event only)
} GW_RESET_TYPE_E;

Click for services and help

Help Center