【feat】添加tcp指令下发

This commit is contained in:
XM-GO
2023-09-27 17:30:11 +08:00
parent 9eff841b81
commit 0dc58c0d18
19 changed files with 481 additions and 83 deletions

View File

@@ -1,8 +1,7 @@
package nodes
import (
"pandax/pkg/global"
"pandax/pkg/mqtt"
"pandax/iothub/client/mqttclient"
"pandax/pkg/rule_engine/message"
)
@@ -30,11 +29,11 @@ func (n *rpcRespondNode) Handle(msg *message.Message) error {
if RequestId == 0 {
RequestId = int(msg.Metadata.GetValue("requestId").(float64))
}
var datas = mqtt.RpcPayload{
var datas = mqttclient.RpcPayload{
Method: msg.Msg.GetValue("method").(string),
Params: msg.Msg.GetValue("params"),
}
rpc := &mqtt.RpcRequest{Client: global.MqttClient, RequestId: RequestId}
rpc := &mqttclient.RpcRequest{Client: mqttclient.MqttClient, RequestId: RequestId}
err := rpc.RespondTpc(datas)
if err != nil {
if failureLableNode != nil {