From c8cbb8205d69b4120122a7d0923edcca611399ef Mon Sep 17 00:00:00 2001
From: yincheng.zhong <634916154@qq.com>
Date: 星期二, 12 十一月 2024 10:13:18 +0800
Subject: [PATCH] V2.3 测试版本,最多上传20个基站,电量显示总测距基站数量。

---
 Src/application/dw_mbx_tag.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/Src/application/dw_mbx_tag.c b/Src/application/dw_mbx_tag.c
index e077358..cfb5003 100644
--- a/Src/application/dw_mbx_tag.c
+++ b/Src/application/dw_mbx_tag.c
@@ -243,7 +243,7 @@
 u8 lora_jianting_flag = 1;
 void LoraReportFreqPoll(void)
 {
-    if(wg_lost_count++>WG_LOST_NOUWB_COUNT)
+    if(wg_lost_count++>WG_LOST_NOUWB_COUNT) //网关60秒没有通讯,就不开启UWB测距lora监听
     {
         lora_jianting_flag = 0;
     } else {
@@ -283,7 +283,7 @@
 uint16_t heatbeat_count = 3600;
 int16_t intheight;
 #define HEATBEAT_UPDATE_TIME   3600
-#define LORA_REPORT_MAXANC_NUM  7
+#define LORA_REPORT_MAXANC_NUM 20
 extern float Height;
 u8 tarray[20]= {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20};
 void LoraReportPoll(void)
@@ -326,6 +326,7 @@
             }
         }
     }
+    lora_sendbuffer[BAT_IDX] = report_ancnum;//测距基站数量
     if(report_ancnum>LORA_REPORT_MAXANC_NUM)    //考虑lora传输时间,最多发送10个基站数据。
         report_ancnum = LORA_REPORT_MAXANC_NUM;
 #ifdef USE_GPS
@@ -338,7 +339,7 @@
     memcpy(&lora_sendbuffer[SOURCE_ID_IDX],&g_com_map[DEV_ID],2);
     memcpy(&lora_sendbuffer[DEST_ID_IDX],&wg_report_id,2);
     lora_sendbuffer[SEQNUM_IDX] = seq_num++;
-    lora_sendbuffer[BAT_IDX] = bat_percent;
+    //lora_sendbuffer[BAT_IDX] = bat_percent;
     lora_sendbuffer[STATE_IDX] = !GET_USERKEY|stationary_flag<<1;
 #ifdef USE_GPS
     memcpy(&lora_sendbuffer[GPS_JINGDU_IDX],&gps_jingdu,8);
@@ -349,7 +350,7 @@
     lora_sendbuffer[GPS_SPOWER_IDX] = gps_signalpower;
     lora_sendbuffer[GPS_CHAFENLINGQI] = gps_chafenlingqi;
 #endif
-    memcpy(&lora_sendbuffer[BAR_HEIGHT_IDX],&bar_height,2);
+  //  memcpy(&lora_sendbuffer[BAR_HEIGHT_IDX],&bar_height,2);
     lora_sendbuffer[ANCNUM_IDX] = report_ancnum;
     memcpy(&lora_sendbuffer[ANCID_IDX],report_ancid,report_ancnum*2);
     memcpy(&lora_sendbuffer[ANCID_IDX+report_ancnum*2],report_ancdist,report_ancnum*2);

--
Gitblit v1.9.3