zhangbo
2025-05-16 39842cc2707c7ceb890bd963d1d226cc7542bc91
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
//#include "lora_3029.h"
//#include "mk_spi.h"
//#include "global_param.h"
//#include "pan_port.h"
//#include "pan_rf.h"
//#include "dw_app_anchor.h"
//#include "HIDO_TypeDef.h"
////#include "WS2812.h"
////#include "pan_port.h"
////#include "pan_param.h"
////#include "pan_rf.h"
////#define RX_TIMEOUT_VALUE                            1000
////extern LPTIM_HandleTypeDef hlptim1;
///***lora½ÓÊÕ£¬·¢ËͱäÁ¿¶¨Òå******/
 
 
//extern uint32_t current_count;
 
//extern uint32_t dev_id;
//uint8_t  yuyin_no_sleep_flag,no_rx_flag;
//uint8_t lora_up_rec_flag;
//static uint16_t source_id;
///***lora½ÓÊÕ£¬·¢ËͱäÁ¿¶¨Òå******/
//uint32_t wg_lost_count = 10;
//static uint8_t tx_buf[10] = {0x55, 0x44, 0x33, 0x22, 0x11};
//static uint8_t rx_buf[10] = {0x00};
////extern uint32_t uwbled,gpsled,loraled,powerled;
//extern uint8_t bat_percent,taglist_num;
////uint8_t report_ancnum;
////uint16_t report_ancdist[ANC_MAX_NUM],report_ancid[ANC_MAX_NUM];
//extern void spi_transfer_callback(void *dev, uint32_t err_code);
//extern uint16_t ancidlist_rec[TAG_NUM_IN_SYS],ancidlist_send[TAG_NUM_IN_SYS],rec_ancidlist[TAG_NUM_IN_SYS];
//extern uint8_t report_ancnum;
//extern uint16_t report_ancdist[ANC_MAX_NUM],report_ancid[ANC_MAX_NUM];
////extern u8 active_flag;
////void LoraInit(void)
////{
////    RadioEvents.TxDone = OnTxDone;
////    RadioEvents.RxDone = OnRxDone;
////    RadioEvents.TxTimeout = OnTxTimeout;
////    RadioEvents.RxTimeout = OnRxTimeout;
////    RadioEvents.RxError = OnRxError;
 
////    Radio.Init( &RadioEvents );
////    SwitchLoraSettings(UWB_CHANNEL_FRQ+group_id,UWB_CHANNEL_SF,0); //Çл»lora½ÓÊÕÆµµã  
////    if(active_flag)
////    {
////    Radio.Rx( 0 ); 
////    }else{
////        Radio.Sleep();
////    }        
//////        Radio.SetRxDutyCycle(RxDutyCycle_RX_time,RxDutyCycle_SLEEP_time);
////                                   
////}
//void Lora_init(void)
//{
////    rf_write_reg(0x04, 0x55);
////    rf_port.spi_readwrite(0x09);
////    uint8_t rx_data = 0;  // ÓÃÓÚ´æ´¢½ÓÊÕµÄÊý¾Ý
////    spi_transfer(SPI_ID0, 0x09, rx_buf, 1, spi_transfer_callback);
//     uint32_t ret = 0;
//   uint32_t cnt = 0;
//     ret=rf_init();
//   
//     set_test_mode1_reg();
//           if(ret== 1)
//    {
//        //printf("LORA Init Fail");
//        while(1);
//    }
//        else
//    {
//                //printf("LORA Init OK\r\n");
//    }
 
//}
 
 
////void TagListUpdate(void)
////{
////    uint16_t i,j=0,k=0,temp[TAG_NUM_IN_SYS];
////    for(i=0; i<taglist_num; i++)
////    {
////        if(tagofflinetime[i]++<REPORT_TAG_KEEPTIMES)
////        {
////            report_ancid[k]=tagid_list[i];
////            report_ancdist[k++]=tagdist_list[i];
////        }
////        if(tagofflinetime[i]++<TAG_KEEPTIMES)
////        {
////            tagid_list[j]=tagid_list[i];
////            tagdist_list[j] = tagdist_list[i];
////            tagofflinetime[j++]=tagofflinetime[i];
////        }
////    }
////    report_ancnum = k;
////    taglist_num=j;
////}
//extern wg_state_enum wg_state;
//uint8_t lora_sendbuffer[200];
//uint8_t seq_num;
//extern uint16_t lora_up_uwb_flag;
////extern uint8_t wg_lost_count;
//uint16_t wg_report_freq,wg_report_id;
//uint8_t wg_report_sf;
//#define WG_LOST_SWITCH_THRES   3
//#define WG_LOST_NOUWB_COUNT    60
//#define DEFAULT_WG_ID       0xFFFF
//#define DEFAULT_LR_WG_ID    0xFFFE
//uint8_t lora_jianting_flag = 1;
//void LoraReportFreqPoll(void)
//{
//  //  wg_state = WG_Lost;
//    if(wg_lost_count++>WG_LOST_NOUWB_COUNT)
//    {
//     lora_jianting_flag = 0;
//    } else {
//     lora_jianting_flag = 1;
//    }
//    if(wg_state==WG_Lost)
//    {
//            static uint8_t channel_switch_count = 0;
//      //  channel_switch_count = 10;
//        if(channel_switch_count++>1)
//        {
////            channel_switch_count = 0;
////            wg_report_id = DEFAULT_LR_WG_ID;
////            wg_report_freq = LR_DATA_CHANNEL_FRQ; //Èç¹û¶ªÊ§Á´½Ó¾Í½øÈëWG¹ÜÀíÐŵÀ¡£
////            wg_report_sf = LR_DATA_CHANNEL_SF;
//        }
//                else
//                {
//            wg_report_id = DEFAULT_WG_ID;
//            wg_report_freq = REPORT_MANGE_CHANNEL_FRQ; //Èç¹û¶ªÊ§Á´½Ó¾Í½øÈëWG¹ÜÀíÐŵÀ¡£
//            wg_report_sf = REPORT_CHANNEL_SF;
////                        wg_report_freq = TEST_MANAGE_CHANNEL_FRQ;
////                      wg_report_sf = TEST_MANAGE_CHANNEL_SF;
//                }
//    } else {
//        if(wg_lost_count>WG_LOST_SWITCH_THRES)
//        {
//            wg_state = WG_Lost;
//        }
//    }
//}
//static uint16_t checksum;
 
////uint16_t wg_report_freq,wg_report_id;
//uint8_t lora_sendbuffer[200];
//void LoraHeartBeartPoll(void)
//{
 
////    lora_up_uwb_flag=2;
////  rf_set_default_para();
 
///*****************************ÐÄÌø°üÉÏ´«ÄÚÈÝ************************************/        
//    lora_sendbuffer[MSG_TYPE_IDX] = LORA_MSGTYPE_TAGHEARTBEAT;
//    lora_sendbuffer[MSG_LENGTH] = 14;
//    memcpy(&lora_sendbuffer[SOURCE_ID_IDX],&g_com_map[DEV_ID],2);
//    memcpy(&lora_sendbuffer[DEST_ID_IDX],&wg_report_id,2);
//    memcpy(&lora_sendbuffer[HB_VERSION_IDX],&g_com_map[VERSION],2);
//    lora_sendbuffer[HB_UWBPOWER_IDX] = g_com_map[POWER];
//    lora_sendbuffer[HB_LORAPOWER_IDX] = g_com_map[LORA_POWER];
//    checksum = Checksum_u16(lora_sendbuffer,14);
//    memcpy(&lora_sendbuffer[14],&checksum,2);    
//    LORA_3029_SINGLE_SEND(lora_sendbuffer,16,0);
//        
///*****************************ÐÄÌø°üÉÏ´«ÄÚÈÝ*************************************/    
//        
//}
//#define HEATBEAT_UPDATE_TIME   100
//uint16_t heatbeat_count = HEATBEAT_UPDATE_TIME-1 ;
//uint16_t flag_getwgresp = 0;
//uint16_t test_temp[10]={0x1306,9688,1000};
//uint16_t test_temp2[10]={0xff,0xcd,0x19};
//int16_t intheight;            //ÆøÑ¹
//extern uint32_t dangqian_frqe;
//extern uint16_t recnum[3];
//extern uint32_t freq_list[4];
//extern uint8_t DMA_RXBuf_BT[200];
//extern uint8_t report_ancnum;
//extern uint8_t report_ancnum_bt;
//uint32_t BT_SEND_flag=0;
//uint8_t BT_NUM=0;
//void LoraReportPoll(void)
//{
//    // delay_ms(100);
 
//#ifdef _USE_BAR
//    GetPressAndHeight();
//    intheight = Height*100;
//#endif
//#ifdef _SMT_TEST
//    printf("ÆøÑ¹Öµ£º%d",intheight);
//#endif
 
//    TagListUpdate();
 
//    LoraReportFreqPoll();
//    flag_getwgresp = 0;
//   // wg_report_freq = REPORT_MANGE_CHANNEL_FRQ;
//     //Lora_init();
//        uint32_t para;
 
//        para=freq_list[2] * 100000;
////        rf_set_freq(wg_report_freq*100000);
////        rf_set_carrier_wave_off();
////        rf_set_carrier_wave_on();
//        rf_set_freq(para);
//        //rf_set_sf(UWB_CHANNEL_SF);
////        rf_set_tx_power(para);
////        rf_set_carrier_wave_freq(freq_list[1] * 100000);
////      rf_set_freq(para);
//        rf_set_sf(REPORT_CHANNEL_SF);
//      //rf_set_default_para(wg_report_freq,REPORT_CHANNEL_SF);
//   // SwitchLoraSettings(wg_report_freq,REPORT_CHANNEL_SF,g_com_map[LORA_POWER]);
//      dangqian_frqe=rf_read_freq();
//    if(heatbeat_count++>HEATBEAT_UPDATE_TIME && WG_Connected == wg_state) //Èç¹ûÐÄÌø°üµ½´ïÉÏ´«Ê±¼ä£¬²¢ÇÒÍø¹Ø´¦ÓÚÁ´½Ó״̬£¬¾ÍÉÏ´«ÐÄÌø°ü
//    {
//        heatbeat_count = 0;
//        LoraHeartBeartPoll();
//        return;
//    }
//    for(uint16_t i=0; i<report_ancnum-1; i++)
//    {
//        for(uint16_t j=0; j<report_ancnum-1-i; j++)
//        {
//            if(report_ancdist[j]>report_ancdist[j+1])
//            {
//                uint16_t id,dist;
//                uint8_t bat;
//                id = report_ancid[j];
//                dist = report_ancdist[j];
//                report_ancid[j] = report_ancid[j+1];
//                report_ancdist[j] = report_ancdist[j+1];
//                report_ancid[j+1] = id;
//                report_ancdist[j+1] = dist;
//            }
//        }
//    }
//    
//    if(report_ancnum>LORA_REPORT_MAXANC_NUM)                                  //¿¼ÂÇlora´«Êäʱ¼ä£¬×î¶à·¢ËÍ10¸ö»ùÕ¾Êý¾Ý¡£
//        {
//      report_ancnum = LORA_REPORT_MAXANC_NUM;
//        }           
//                
//#ifdef USE_GPS
//    lora_sendbuffer[MSG_TYPE_IDX] = LORA_MSGTYPE_TAGMSGTOWG_GPS;
//    lora_sendbuffer[MSG_LENGTH] = 4*report_ancnum+30;
//#else
//    lora_sendbuffer[MSG_TYPE_IDX] = LORA_MSGTYPE_TAGMSGTOWG;
//    lora_sendbuffer[MSG_LENGTH] = 4*report_ancnum+ANCID_IDX;
//#endif
//    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;
//        //GET_USERKEYÕâ¸öÊÇÄǸölora¡ª¡ªbusyÄǸöÒý½Å
////        lora_sendbuffer[STATE_IDX]=0x01;
////        lora_sendbuffer[GATEWAY_CHANL]=0x02;
////        lora_sendbuffer[CHANL_NUM]=0x03;
//   // lora_sendbuffer[STATE_IDX] = !GET_USERKEY|stationary_flag<<1;
//#ifdef USE_GPS
//    memcpy(&lora_sendbuffer[GPS_JINGDU_IDX],&gps_jingdu,8);
//    memcpy(&lora_sendbuffer[GPS_WEIDU_IDX],&gps_jingdu,8);
//    memcpy(&lora_sendbuffer[GPS_HEIGHT_IDX],&gps_height,8);
//    lora_sendbuffer[GPS_STATE_IDX] = gps_state;
//    lora_sendbuffer[GPS_SATEL_NUM_IDX] = gps_satel_num;
//    lora_sendbuffer[GPS_SPOWER_IDX] = gps_signalpower;
//    lora_sendbuffer[GPS_CHAFENLINGQI] = gps_chafenlingqi;
//#endif
//    //  memcpy(&lora_sendbuffer[BAR_HEIGHT_IDX],&bar_height,2);
////        memcpy(&report_ancid,test_temp,10);
////        memcpy(&report_ancdist,test_temp2,10); 
 
//    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);
//        uint8_t LORA_RETRANSNUSSION_BT=0;
//        BT_NUM=DMA_RXBuf_BT[0];
//        if(0<BT_NUM&&BT_NUM<11)
//        {
//      lora_sendbuffer[MSG_TYPE_IDX] = LORA_MSGTYPE_TAGMSGTOWG_BT;
//    LORA_RETRANSNUSSION_BT=ANCID_IDX+report_ancnum*4;
//        //LORA_RETRANSNUSSION_BT   report_ancnum_bt
//        lora_sendbuffer[LORA_RETRANSNUSSION_BT] = 0x2D;         //À¶ÑÀÉÏ´«±êʶ·û
//    memcpy(&lora_sendbuffer[LORA_RETRANSNUSSION_BT+1],&DMA_RXBuf_BT[0],BT_NUM*2+1);                                     //»ùÕ¾ID
//    memcpy(&lora_sendbuffer[LORA_RETRANSNUSSION_BT+BT_NUM*2+2],&DMA_RXBuf_BT[1+BT_NUM*2],BT_NUM*2);//»ùÕ¾¾àÀë        
//        lora_sendbuffer[MSG_LENGTH] = 4*report_ancnum+4*BT_NUM+ANCID_IDX+2;
//        }
//        if(lora_sendbuffer[LORA_RETRANSNUSSION_BT]==0x2D)
//        {
//        checksum = Checksum_u16(lora_sendbuffer,4*BT_NUM+4*report_ancnum+ANCID_IDX+2);
//        memcpy(&lora_sendbuffer[ANCID_IDX+BT_NUM*4+report_ancnum*4+2],&checksum,2);
//        BT_SEND_flag++;
//        }
//        else
//        {
//        checksum = Checksum_u16(lora_sendbuffer,4*report_ancnum+ANCID_IDX);
//        memcpy(&lora_sendbuffer[ANCID_IDX+report_ancnum*4],&checksum,2);
//        }
 
 
//    LORA_3029_SINGLE_SEND(lora_sendbuffer,ANCID_IDX+report_ancnum*4+BT_NUM*4+4,0);
//        memset(DMA_RXBuf_BT, 0,200);
//        memset(&lora_sendbuffer[ANCID_IDX],0,200);
//    //LED_TB_ON;
 
//    
//    for(uint8_t i=0;i<3;i++)
//    recnum[i] = 0;
 
//}
 
//static uint16_t delaytime = 1200;
//static uint16_t source_id;
//uint8_t rec_index,rec_secdelay;
////uint16_t rec_value,rec_delaytime,rx_count;
////uint16_t rec_value,rec_delaytime,rx_count,datalen_offset;
 
//uint8_t shengji_flag,time=5;
//extern uint32_t uwbled,gpsled,loraled,powerled;
//extern struct RxDoneMsg RxDoneParams;
 
////extern     uint8_t Lora_tx_ancnum;
////extern   u8 lora_seq_nb2;
//extern uint16_t lora_yingda_num;
//uint8_t lora_tx_flag=0;
//uint8_t lora_txanchor_power_flag;
//extern uint16_t Lora_tx_ancid[50];
//extern uint16_t Lora_tx_ancdist[50];
//extern uint8_t Lora_tx_anc_electricity[50];
//uint8_t lora_seq_nb1;
 
//extern uint8_t lora_sendbuffer[200];
//void LoraSendComMap(uint8_t cmd)
//{
//        uint8_t data_length = 0x50;
//        uint16_t checksum = 0;
//        lora_sendbuffer[MSG_TYPE_IDX] = LORA_MSGTYPE_READPARARESP;
//        lora_sendbuffer[MSG_LENGTH] = data_length+11;
//                memcpy(&lora_sendbuffer[SOURCE_ID_IDX],&g_com_map[DEV_ID],2);
//                memcpy(&lora_sendbuffer[DEST_ID_IDX],&wg_report_id,2);
//        lora_sendbuffer[RP_CMD_IDX] = cmd;
//        lora_sendbuffer[RP_INDEX_IDX] = 2;
//        lora_sendbuffer[RP_LEN_IDX] = data_length;
//        memcpy(&lora_sendbuffer[9], &g_com_map[1], data_length);
//        checksum = Checksum_u16(lora_sendbuffer,11+data_length);
//        memcpy(&lora_sendbuffer[11+data_length],&checksum,2);
//        LORA_3029_SINGLE_SEND(lora_sendbuffer,data_length+13,0);
//          //++;
//  //  Delay_Ms(100);
//}
//void LoraRspWriteCommap(uint8_t index)
//{
//    uint8_t data_length = 2;
//    uint16_t checksum = 0;
//    lora_sendbuffer[MSG_TYPE_IDX] = LORA_MSGTYPE_READPARARESP;
//    lora_sendbuffer[MSG_LENGTH] = data_length+9;
//    memcpy(&lora_sendbuffer[SOURCE_ID_IDX],&g_com_map[DEV_ID],2);
//    memcpy(&lora_sendbuffer[DEST_ID_IDX],&wg_report_id,2);
//    lora_sendbuffer[RP_CMD_IDX] = WGRSP_RWTAG_WRITE;
//    lora_sendbuffer[RP_INDEX_IDX] = index;
//    lora_sendbuffer[RP_LEN_IDX] = data_length;
//    memcpy(&lora_sendbuffer[7], &g_com_map[index/2], data_length);
//    checksum = Checksum_u16(lora_sendbuffer,9+data_length);
//    memcpy(&lora_sendbuffer[9+data_length],&checksum,2);
//  //   Radio.Send(lora_sendbuffer,data_length+11);
//     LORA_3029_SINGLE_SEND(lora_sendbuffer,data_length+11,0);
//  //  Delay_Ms(100);
//}
//uint8_t t22[20],ti;
//uint8_t no_yingdaflag;
//uint8_t aRxBuffer[1];
 
//extern uint8_t group_id;
//uint16_t lora_send_count;
//uint8_t mode_flag=0;
//uint32_t frqe,dangqian_frqe;
//uint32_t freq_list[4] = {DEFAULT_up_FREQ/100000,4730,4780,4910};
 
//#define TX_LEN  10
//extern uint8_t tx_test_buf[TX_LEN];
 
//void Lora_Tx_Poll()
//{
//  
////    if(lora_tx_flag)
////    { 
////     OnMaster();
//////
////            //rf_enter_continous_rx();
////        }
// if(lora_tx_flag)
//    {
////            gpio_pin_set(IO_PIN_5);
//            
//        if(lora_send_count++%10==0||lora_jianting_flag)
//        {
//            lora_tx_flag=0;
//#ifdef GROUPID_SWITCH
//            if(rec_secdelay>0)
//            {
//                rec_secdelay--;
////                if(lora_jianting_flag)
////                {
////                    if(++group_id>GROUP_NUM)
////                    {
////                        group_id = 1;
////                    }
////                    t22[ti++] = group_id;
////                    if(ti>=20)
////                        ti=0;
////                    group_min_dist[group_id] = 0xffff;
////                    Radio.Standby();
////                    SwitchLoraSettings(UWB_CHANNEL_FRQ+group_id,UWB_CHANNEL_SF,0);
////                    Radio.Rx(0);
////                }
//                return;
//            }
////            //ÕÒ3¸öС×éÖÐ×î½ü¾àÀë×î´óµÄС×飬ÉÏ´«±¨ÎĺóÇл»µ½Õâ¸öС×飬ÒòΪÉÏ´«±¨ÎÄ»áʱ¼äÕ¼Óá£
////            if(group_min_dist[1]>group_min_dist[2])  //Èç¹û1´óÓÚ2
////            {
////                group_maxdist_index = group_min_dist[1]>group_min_dist[3]?1:3; //È¡ 1ºÍ3 ×î´óÖµ
////                group_mindist_index = group_min_dist[2]<group_min_dist[3]?2:3;//È¡ 2ºÍ3 ×îСֵ
////                    
////            }else{
////                group_maxdist_index = group_min_dist[2]>group_min_dist[3]?2:3; //È¡ 2ºÍ3 ×î´óÖµ
////                group_mindist_index = group_min_dist[1]<group_min_dist[3]?1:3;//È¡ 1ºÍ3 ×îСֵ
////            }
//////            group_id = 1;
////            group_id = group_maxdist_index;
//#endif
//            t22[ti++] = group_id;
//            if(ti>=20)
//                ti=0;
//         //  group_min_dist[group_id] = 0xffff;
//         //   Radio.Standby();
//                        //rf_antenna_close();
////                        rf_set_mode(RF_MODE_STB3);
////                        uint32_t para;
////                        frqe=((UWB_CHANNEL_FRQ+group_id)*100000);
////                        para=freq_list[1] * 100000;
//////                        rf_set_default_para(frqe,UWB_CHANNEL_SF);
////                        rf_set_carrier_wave_off();
//////                  rf_set_carrier_wave_on();
////                        rf_set_freq(para);
////                        rf_set_sf(5);
//////                        rf_set_tx_power(para);
//////                  rf_set_carrier_wave_freq(freq_list[1] * 100000);
////            //SwitchLoraSettings(UWB_CHANNEL_FRQ+group_id,UWB_CHANNEL_SF,0);
////                      dangqian_frqe=rf_read_freq();
//                //        LoraSendComMap(WGRSP_RWTAG_READ);
//                        
//                        //delay_us(5000);
////            rf_enter_continous_rx();
//            //LedTask();
//                        //LoraHeartBeartPoll();
////                      if(rf_continous_tx_send_data(tx_test_buf, TX_LEN) != OK)
////            {
////               while(1);
////            }
//                    //    rf_get_mode();
////            LoraReportPoll();
//            // LedOff_task();
 
//        }
//    }
 
//     
//}
//uint8_t TX_RX_SELECT=0;
 
//int LORA_3029_SINGLE_SEND(uint8_t *buffer, uint8_t size,uint8_t time)
//{
//    if((rf_single_tx_data(lora_sendbuffer,size,time))!= OK)
//        {
//      while(1);
//        }    
//        rf_delay_us(1);
//        
//        //rf_enter_single_rx();
//        //rf_enter_single_timeout_rx(700);
//}
 
//int LORA_3029_CONTINOUS_SEND(uint8_t *buffer, uint8_t size)
//{
 
 
//}