Last Updated on : 2025-10-22 03:35:31download
The mobile app connects to the router and generates a QR code. The device scans the QR code, extracts information from it, and then connects to the router to complete cloud activation.
Set the pairing mode to wireless.
apps/tuya_demo_ipc/src/user_main.c
connect_mode = PARING_MODE_WIFI_AP
Set the connection mode to wireless.
TUYA_IPC_LINK_TYPE_E link_type = TUYA_IPC_LINK_WIFI;
ipc_sdk_run_var.net_info.link_type = link_type;
Adapt tkl_wifi.c.
The development framework provides a set of APIs for Linux. You need to adapt the implementation to your specific hardware.
Pass the QR code reading to the SDK.
OPERATE_RET tuya_ipc_direct_connect(IN CONST CHAR_T *p_str, IN CONST TUYA_IPC_DIRECT_CONNECT_TYPE_E source);
PARING_MODE_WIFI_AP and TUYA_IPC_LINK_WIFI respectively.tkl_wifi.c APIs are adapted.tkl_wifi_init(WIFI_EVENT_CB cb) proactively notifies the SDK of the current network status when the network changes.When the status of the status callback function TUYA_IPC_Status_Changed_cb is TUYA_IPC_STATUS_NETCFG_START, it indicates that the device requires network configuration, and the QR code recognition function can be enabled at this time.
Invoke gw_user_token_bind and pass in the recognized token.
tkl_wifi_station_connect 20 seconds after tuya_ipc_direct_connect is invoked?Check the TKL interface. If tkl_wifi_ioctl is not implemented, you can return OPRT_NOT_SUPPORTED directly.
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback