Skip to content

Latest commit

 

History

History
executable file
·
26 lines (19 loc) · 1.01 KB

File metadata and controls

executable file
·
26 lines (19 loc) · 1.01 KB

清除控制

本文主要描述设备下发清除控制的指令。

发布清除控制的 Topic

运行示例程序,在数据模板模块上点击设备上线按钮且设备成功上线后,点击清除控制按钮,拼接设备信息参数,发布属性类型的 Topic: $thing/up/property/{ProductID}/{DeviceName}

示例代码如下:

if(Status.OK !=  mDataTemplateSample.propertyClearControl()){
    mParent.printLogInfo(TAG, "clear control failed!", mLogInfoText, TXLog.LEVEL_ERROR);
}

观察Logcat日志。

I/com.tencent.iot.hub.device.java.core.mqtt.TXMqttConnection: Starting publish topic: $thing/up/property/LWVUL5SZ2L/light1 Message: {"method":"clear_control","clientToken":"LWVUL5SZ2Llight14"}
D/TXDataTemplateFragment: onPublishCompleted, status[OK], topics[[$thing/up/property/LWVUL5SZ2L/light1]],  userContext[], errMsg[publish success]

以上是成功发布清除控制Topic的日志。