Last Updated on : 2023-05-25 06:23:51
Sub-device pairing can be initiated only when a gateway is online in the cloud, and the sub-device stays in the pairing state. This topic describes the process to pair a sub-device that is connected through a Zigbee gateway.
API description
ThingGwSubDevActivatorBuilder builder = new ThingGwSubDevActivatorBuilder()
.setDevId(mDevId)
.setTimeOut(timeout)
.setListener(new IThingSmartActivatorListener() {
@Override
public void onError(String errorCode, String errorMsg) {
}
@Override
public void onActiveSuccess(DeviceBean devResp) {
}
@Override
public void onStep(String step, Object data) {
}
}
));
Parameters
Parameter | Description |
---|---|
mDevId | The gateway ID. |
timeout | The timeout value of a pairing task. Default value: 100 . Unit: seconds. |
IThingActivator mThingGWSubActivator = ThingHomeSdk.getActivatorInstance().newGwSubDevActivator(builder);
// Starts pairing.
mThingGWSubActivator.start();
// Stops pairing.
mThingGWSubActivator.stop();
// Destroys the pairing task.
mThingGWSubActivator.onDestory();
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback