Device Reset

Last Updated on : 2024-01-19 09:38:44download

Reset a device to restore it to factory settings or pair it again.

Description

A device reset can be initiated locally through hardware operation or remotely using a mobile app.

Feature Description
Local reset Reset a device by pressing buttons or power cycling.
Remote reset Remove a device from the mobile app to trigger a reset.

API description

Local reset

/**
 * @berief:Factory reset and leave the network
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */
OPERATE_RET tal_matter_reset_factory_new(VOID_T); //clear all fabrics and leave

Reset callback

After a reset is triggered, this API is called.

VOID_T tal_factory_reset_callback(VOID_T);

if network_data.power_on_start_pairing is set to TRUE in the initialization function VOID_T tal_device_network_config(NETWORK_CONFIG_T* network_data);, the device will clear the configuration information and restart in pairing mode after a reset.

Support and help

If you have any problems with TuyaOS development, you can post your questions in the Tuya Developer Forum.