Last Updated on : 2026-01-29 03:17:34download
This topic describes the access point (AP) to pair devices. It is a connection capability for pairing over Wi-Fi. In the pairing process, a mobile phone connects to the AP of the smart device and broadcasts the Wi-Fi credentials and pairing token over the LAN to enable the smart device to get this information for network connection and pairing. With a high success rate and good reliability, this mode adapts to 2.4 GHz and 5 GHz dual-band routers. However, users need to manually switch between the Wi-Fi bands connected to the mobile phone.
Before pairing.
Get the pairing token and Wi-Fi network credentials.
Connect to AP.
Guide the user to connect their phone to the AP emitted by the device.
Start pairing.
The app calls the pairing method in the SDK to set the Wi-Fi network credentials (SSID and password) and the pairing token.
Finish pairing.
The device automatically turns off the AP. The app receives a callback from the SDK and finishes the pairing process.
For more information, see Device Pairing.
// Get a token.
this.activatorToken = await TSmartActivatorRequester.getActivatorToken(this.homeId)
activatorListener: ITSmartActivatorListener = {
onActiveSetpAndError: (step: TSmartActivatorStep, error?: Error, device?: TSmartDeviceModel) => {
// Implement the relevant logic.
},
onActiveSuccess: (deviceModel: TSmartDeviceModel) => {
// Handle the logic for successful pairing, such as updating the UI and navigating to the next page.
},
};
const activatorBuilder = TSmartActivator.buildApActivatorBuilder(
this.ssid,
this.password,
120 * 1000,
this.activatorToken,
this.activatorListener,
)
this.activator = TSmartActivator.createActivator(activatorBuilder);
this.activator.startActive()
this.activator.stopActive()
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback