liuxiulin 4 ay önce
ebeveyn
işleme
71ceba36b5
1 değiştirilmiş dosya ile 5 ekleme ve 5 silme
  1. 5 5
      services/emqx-agent/sub_dev.go

+ 5 - 5
services/emqx-agent/sub_dev.go

@@ -97,11 +97,11 @@ func (d *MqttClient) SubDevMsg(handle Handle) error {
 }
 
 func (d *MqttClient) subDevMsg(cli mqtt.Client, handle Handle) error {
-	//err := d.subscribeWithFunc(cli, TopicConnectStatus, d.subConnectStatus(handle))
-	//if err != nil {
-	//	return err
-	//}
-	err := d.subscribeWithFunc(cli, TopicThing, func(ctx context.Context, topic string, payload []byte) error {
+	err := d.subscribeWithFunc(cli, TopicConnectStatus, d.subConnectStatus(handle))
+	if err != nil {
+		return err
+	}
+	err = d.subscribeWithFunc(cli, TopicThing, func(ctx context.Context, topic string, payload []byte) error {
 		return handle(ctx).Message(topic, payload)
 	})
 	if err != nil {