Przeglądaj źródła

修改远程调用某些函数的名称

niujiuru 10 miesięcy temu
rodzic
commit
ef509cd62a
1 zmienionych plików z 4 dodań i 4 usunięć
  1. 4 4
      reporter/reporter.go

+ 4 - 4
reporter/reporter.go

@@ -402,13 +402,13 @@ func (r *MQTTReporter) execOneCmd(msg mqtt.Message) {
 		case 0: /// 光控
 			if cfgParams.LightDuration < 1 || cfgParams.LightDuration > 10 ||
 				cfgParams.TakePhotoInterval > cfgParams.LightDuration*60 {
-				resp = jsonrpc2.BuildError(req, -32700, "配置光控错误")
+				resp = jsonrpc2.BuildError(req, -32700, "光控参数错误")
 				goto retp
 			}
 		case 1: /// 时控
 			if cfgParams.StartHour < 0 || cfgParams.StartHour > 23 || cfgParams.EndHour < 0 || cfgParams.EndHour > 23 ||
 				cfgParams.StartHour > cfgParams.EndHour || cfgParams.TakePhotoInterval > (cfgParams.EndHour-cfgParams.StartHour)*60 {
-				resp = jsonrpc2.BuildError(req, -32700, "配置时控错误")
+				resp = jsonrpc2.BuildError(req, -32700, "时控参数错误")
 				goto retp
 			}
 		default: // 无效
@@ -442,11 +442,11 @@ func (r *MQTTReporter) execOneCmd(msg mqtt.Message) {
 		lat, lon, err := gps.Get2DPosition()
 		resp = buildResp(req, map[string]string{"lat": lat, "lon": lon}, err)
 	// Call-5: 同步执行相机拍照, 比较耗时,需等待
-	case "take_photo":
+	case "takephoto":
 		rf, err := r.takePhotoAndUpToFtp()
 		resp = buildResp(req, map[string]string{"filename": rf}, err)
 	// Call-6: 升级RTU固件, 升级后程序会自动退出, 靠守护进程重新拉起, 替换新程序
-	case "upgrade_app":
+	case "upgradeApp":
 		func() { // 使用闭包, 避免defer影响范围扩大
 			mcu.MCBSetMNTStateBit(mcu.AppUpgrading)
 			defer mcu.MCBSetMNTStateBit(mcu.Idle)