|
@@ -295,6 +295,15 @@ func (c *Controller) SendCommand(args rpcs.ArgsSendCommand, reply *rpcs.ReplySen
|
|
return server.RPCCallByHost(rpchost, "Access.SendCommand", args, reply)
|
|
return server.RPCCallByHost(rpchost, "Access.SendCommand", args, reply)
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+// SendCommandV2 下发设备控制指令适配emqx
|
|
|
|
+func (c *Controller) SendCommandV2(args rpcs.ArgsSendCommand, reply *rpcs.ReplySendCommand) error {
|
|
|
|
+ rpchost, err := getAccessRPCHost(args.DeviceId)
|
|
|
|
+ if err != nil {
|
|
|
|
+ return err
|
|
|
|
+ }
|
|
|
|
+ return server.RPCCallByHost(rpchost, "Agent.SendCommand", args, reply)
|
|
|
|
+}
|
|
|
|
+
|
|
func getAccessRPCHost(deviceid string) (string, error) {
|
|
func getAccessRPCHost(deviceid string) (string, error) {
|
|
args := rpcs.ArgsGetDeviceOnlineStatus{
|
|
args := rpcs.ArgsGetDeviceOnlineStatus{
|
|
Id: deviceid,
|
|
Id: deviceid,
|