Browse Source

test topic

lijian 1 year ago
parent
commit
fe0bf3659d
1 changed files with 4 additions and 1 deletions
  1. 4 1
      pkg/protocol/topic.go

+ 4 - 1
pkg/protocol/topic.go

@@ -2,6 +2,7 @@ package protocol
 
 import (
 	"errors"
+	"fmt"
 	"strings"
 )
 
@@ -110,7 +111,9 @@ func parseLast(topics []string) (topicInfo *TopicInfo, err error) {
 }
 
 func GetCommandTopic(deviceCode, productKey string) string {
-	return strings.Join([]string{TopicHeadThing, "down", "command", productKey, deviceCode}, "/")
+	topic := strings.Join([]string{TopicHeadThing, "down", "command", productKey, deviceCode}, "/")
+	fmt.Printf("topic:%s", topic)
+	return topic
 }
 
 func getDirection(dir string) Direction {