Last Updated on : 2023-12-19 08:36:58
A local area network (LAN) is formed using two or more interconnected computers. A home network is a small-scale LAN that connects computers, mobile phones, smart devices, and other devices to the same router. The LAN in this topic refers to the wireless network to which both mobile phones and Wi-Fi devices are connected.
The process of device control over LAN:
Discover the device.
Complete connection
Data exchange
Open tuya_iot_config.h
and check if the following macro is defined.
#define ENABLE_TUYA_LAN 1
The framework automatically manages the LAN process after the activated device is connected to the router. You do not need to care about the LAN process unless you have special requirements.
The framework enables the LAN feature by default. If you do not need LAN, you can manually disable it by using this API.
/**
* @brief Disable LAN service
*
* @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
*/
OPERATE_RET tuya_svc_lan_disable(VOID);
After you disable LAN, you can use this API to enable it again.
/**
* @brief Enable LAN service
*
* @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
*/
OPERATE_RET tuya_svc_lan_enable(VOID);
When the device is inactive for 30 seconds, the LAN socket will be disconnected.
Up to three clients.
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback