mirror of
https://gitee.com/XM-GO/PandaX.git
synced 2026-04-23 02:48:34 +08:00
【feat】添加tcp指令下发
This commit is contained in:
@@ -6,8 +6,8 @@ import (
|
||||
"github.com/gorilla/websocket"
|
||||
"net/http"
|
||||
"pandax/apps/device/entity"
|
||||
"pandax/iothub/client/mqttclient"
|
||||
"pandax/pkg/global"
|
||||
"pandax/pkg/mqtt"
|
||||
"strings"
|
||||
)
|
||||
|
||||
@@ -67,9 +67,9 @@ func OnMessage(ws *Websocket, message string) {
|
||||
//2. 根据设备下发属性更改
|
||||
//topic := fmt.Sprintf(global.AttributesTopic, vtsa.TwinId)
|
||||
content, _ := json.Marshal(vtsa.Attrs)
|
||||
var rpc = &mqtt.RpcRequest{Client: global.MqttClient, Mode: "single"}
|
||||
var rpc = &mqttclient.RpcRequest{Client: mqttclient.MqttClient, Mode: "single"}
|
||||
rpc.GetRequestId()
|
||||
err = rpc.RequestAttributes(mqtt.RpcPayload{Params: string(content)})
|
||||
err = rpc.RequestAttributes(mqttclient.RpcPayload{Params: string(content)})
|
||||
if err != nil {
|
||||
global.Log.Error("属性下发失败", err)
|
||||
sendMessages("02", "下发失败", screenId)
|
||||
|
||||
Reference in New Issue
Block a user