|
@@ -305,6 +305,22 @@ func (a *Access) GetStatus(args rpcs.ArgsGetStatus, reply *rpcs.ReplyGetStatus)
|
|
return a.SendCommand(cmdArgs, &cmdReply)
|
|
return a.SendCommand(cmdArgs, &cmdReply)
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+func (a *Access) Upgrade(args rpcs.ArgsUpgrade4G, reply *rpcs.ReplyEmptyResult) error {
|
|
|
|
+ server.Log.Infof("4G模组OTA升级:%s", args.DeviceId)
|
|
|
|
+ cmdReply := rpcs.ReplySendCommand{}
|
|
|
|
+ cmdArgs := rpcs.ArgsSendCommand{
|
|
|
|
+ DeviceId: args.DeviceId,
|
|
|
|
+ WaitTime: 0,
|
|
|
|
+ Cmd: "devUpgrade",
|
|
|
|
+ Params: map[string]interface{}{
|
|
|
|
+ "fileId": args.FileId,
|
|
|
|
+ "fileSize": args.FileSize,
|
|
|
|
+ },
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return a.SendCommand(cmdArgs, &cmdReply)
|
|
|
|
+}
|
|
|
|
+
|
|
func chunkUpgrade(params rpcs.ChunkUpgrade) error {
|
|
func chunkUpgrade(params rpcs.ChunkUpgrade) error {
|
|
server.Log.Infof("4G模组OTA升级:%s", params.DeviceId)
|
|
server.Log.Infof("4G模组OTA升级:%s", params.DeviceId)
|
|
reply := new(rpcs.ReplyEmptyResult)
|
|
reply := new(rpcs.ReplyEmptyResult)
|