From b33bba3dd2c426de67e6495e1e5dbcff2425d6b0 Mon Sep 17 00:00:00 2001 From: AIR Date: Wed, 5 Jul 2023 15:29:07 +0800 Subject: [PATCH] bug --- FoodDelivery.ino | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/FoodDelivery.ino b/FoodDelivery.ino index 7a1b615..93e45ac 100644 --- a/FoodDelivery.ino +++ b/FoodDelivery.ino @@ -21,10 +21,10 @@ String topicSub[] = { "questAss", "setPlaneState", "getPlaneState", "resetState" int topicSubCount = sizeof(topicSub) / sizeof(topicSub[0]); //订阅主题总数 /*有更新主动发送 主题*/ //0:心跳信息 1:电压信息 2:电流信息 3:电池电量 4:高度信息 5:对地速度 6:卫星数量 7:纬度 8:经度 9:定位状态 10:飞机状态 11:网速测试 12:飞机模式 13:重量 14:钩子状态 15:飞机海拔高度 -String topicPub[] = { "heartBeat", "voltagBattery", "currentBattery", "batteryRemaining", "positionAlt", "groundSpeed", "satCount", "latitude", "longitude", "fixType", "planeState", "pingNet", "getPlaneMode","loadweight","hookstatus","altitude" }; -int topicPubCount = sizeof(topicPub) / sizeof(topicPub[0]);  //发送主题总数 -String topicPubMsg[16];                                      //发送数据存放 对应topicPub -String oldMsg[16];                                           //记录旧的数据 用来对比有没有更新 +String topicPub[] = { "heartBeat", "voltagBattery", "currentBattery", "batteryRemaining", "positionAlt", "groundSpeed", "satCount", "latitude", "longitude", "fixType", "planeState", "pingNet", "getPlaneMode", "loadweight", "hookstatus", "altitude" }; +int topicPubCount = sizeof(topicPub) / sizeof(topicPub[0]); //发送主题总数 +String topicPubMsg[16]; //发送数据存放 对应topicPub +String oldMsg[16]; //记录旧的数据 用来对比有没有更新 /*触发发送 主题*/ //0:对频信息 String topicHandle[] = { "crosFrequency" }; @@ -163,10 +163,10 @@ void mqtt_receiveCallback(char* topic, byte* payload, unsigned int length) { DynamicJsonDocument doc(0x2FFF); deserializeJson(doc, topicStr); JsonObject obj = doc.as(); - int8_t item=obj["item"]; - int8_t val=obj["val"]; - int8_t pitch=obj["pitch"]; - int8_t yaw=obj["yaw"]; + int8_t item = obj["item"]; + int8_t val = obj["val"]; + int8_t pitch = obj["pitch"]; + int8_t yaw = obj["yaw"]; //相机控制 if (item == 0) { //0:一键回中 uint8_t command[] = { 0x55, 0x66, 0x01, 0x01, 0x00, 0x00, 0x00, 0x08, 0x01 }; @@ -245,7 +245,7 @@ void writeRoute(String topicStr) { double y = obj["tasks"][fc.writeSeq]["y"]; double z = obj["tasks"][fc.writeSeq]["z"]; String str = obj["tasks"][fc.writeSeq]["sound"]; - if(str != "" ){ + if (str != "") { fc.questVoiceStr = str; } fc.logln("frame--");