parent
fad3d3ad55
commit
172e5cb894
|
|
@ -477,7 +477,7 @@ export default {
|
||||||
this.value=1;
|
this.value=1;
|
||||||
}
|
}
|
||||||
this.reset();
|
this.reset();
|
||||||
this.disconnectMqtt();
|
// this.disconnectMqtt();
|
||||||
},
|
},
|
||||||
|
|
||||||
reset() {
|
reset() {
|
||||||
|
|
@ -581,7 +581,7 @@ export default {
|
||||||
|
|
||||||
this.client.on('connect', () => {
|
this.client.on('connect', () => {
|
||||||
this.connected = true
|
this.connected = true
|
||||||
this.client.subscribe(this.mqttConfig.subscribeTopic, { qos: 0 })
|
this.client.subscribe('dtu/+/up', { qos: 0 })
|
||||||
this.addMessage('已连接到MQTT服务器')
|
this.addMessage('已连接到MQTT服务器')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
@ -633,7 +633,7 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
ackMessage(topic, payload) {
|
ackMessage(topic, payload) {
|
||||||
console.info("处理回执消息")
|
|
||||||
|
|
||||||
// console.info("消息解析:"+topic,payload)
|
// console.info("消息解析:"+topic,payload)
|
||||||
// 1. 先判断是否是目标订阅主题(如dtu/xxx/up)
|
// 1. 先判断是否是目标订阅主题(如dtu/xxx/up)
|
||||||
|
|
@ -650,6 +650,7 @@ export default {
|
||||||
// console.info("回执消息:"+msgData)
|
// console.info("回执消息:"+msgData)
|
||||||
// 3. 区分“回执”和“其他内容”
|
// 3. 区分“回执”和“其他内容”
|
||||||
if (msgData.prop && "suc" in msgData) {
|
if (msgData.prop && "suc" in msgData) {
|
||||||
|
console.info("处理回执消息")
|
||||||
// 👉 这是“指令回执”
|
// 👉 这是“指令回执”
|
||||||
this.handleCommandAck(msgData,this.deviceType);
|
this.handleCommandAck(msgData,this.deviceType);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue