| | |
| | | #include "string.h" |
| | | #include "stdio.h" |
| | | #include "delay.h" |
| | | static RadioEvents_t RadioEvents; |
| | | #include "dw_mbx_anc.h" |
| | | #define USE_MODEM_LORA |
| | | //#define USE_MODEM_FSK |
| | | #define REGION_CN779 |
| | | |
| | | #if defined( REGION_AS923 ) |
| | | |
| | | #define RF_FREQUENCY 923000000 // Hz |
| | |
| | | */ |
| | | |
| | | static RadioEvents_t RadioEvents; |
| | | /** |
| | | * @brief Update CRC16 for input byte |
| | | * @param CRC input value |
| | | * @param input byte |
| | | * @retval Updated CRC value |
| | | */ |
| | | uint16_t UpdateCRC16(uint16_t crcIn, uint8_t byte) |
| | | { |
| | | uint32_t crc = crcIn; |
| | | uint32_t in = byte|0x100; |
| | | |
| | | do |
| | | { |
| | | crc <<= 1; |
| | | in <<= 1; |
| | | |
| | | if(in&0x100) |
| | | { |
| | | ++crc; |
| | | } |
| | | |
| | | if(crc&0x10000) |
| | | { |
| | | crc ^= 0x1021; |
| | | } |
| | | } while(!(in&0x10000)); |
| | | |
| | | return (crc&0xffffu); |
| | | } |
| | | |
| | | /** |
| | | * @brief Cal CRC16 for YModem Packet |
| | | * @param data |
| | | * @param length |
| | | * @retval CRC value |
| | | */ |
| | | uint16_t Cal_CRC16(const uint8_t* data, uint32_t size) |
| | | { |
| | | uint32_t crc = 0; |
| | | const uint8_t* dataEnd = data+size; |
| | | |
| | | while(data<dataEnd) |
| | | { |
| | | crc = UpdateCRC16(crc,*data++); |
| | | } |
| | | crc = UpdateCRC16(crc,0); |
| | | crc = UpdateCRC16(crc,0); |
| | | |
| | | return (crc&0xffffu); |
| | | } |
| | | |
| | | #if defined( USE_MODEM_LORA ) |
| | | |
| | |
| | | // 2: 4/6, |
| | | // 3: 4/7, |
| | | // 4: 4/8] |
| | | #define LORA_PREAMBLE_LENGTH_T 96 // Same for Tx |
| | | #define LORA_PREAMBLE_LENGTH_R 64 // Same for Rx |
| | | #define LORA_PREAMBLE_LENGTH_T 8 // 96 // Same for Tx |
| | | #define LORA_PREAMBLE_LENGTH_R 8 // Same for Rx |
| | | //#define LORA_PREAMBLE_LENGTH 990 // Same for Tx and Rx |
| | | #define LORA_SYMBOL_TIMEOUT 0 // Symbols |
| | | #define LORA_FIX_LENGTH_PAYLOAD_ON false |
| | | #define LORA_IQ_INVERSION_ON_T false |
| | | #define LORA_IQ_INVERSION_ON_R true |
| | | #define LORA_IQ_INVERSION_ON_R false |
| | | |
| | | |
| | | #elif defined( USE_MODEM_FSK ) |
| | |
| | | TX_TIMEOUT, |
| | | }States_t; |
| | | |
| | | #define RX_TIMEOUT_VALUE 1000 |
| | | static uint8_t flag_lora_wait_sync = 0; |
| | | |
| | | #define RX_TIMEOUT_VALUE 9999 |
| | | #define BUFFER_SIZE 64 // Define the payload size here |
| | | |
| | | const uint8_t PingMsg[] = "PING"; |
| | |
| | | // HAL_GPIO_TogglePin(GPIOB, LED1_Pin); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | uint8_t huifushengjibao_flag; |
| | | uint8_t LoraUp_flag; |
| | | extern uint8_t flag_writepara_needreset; |
| | | void OnTxDone( void ) |
| | | { |
| | | // T_R_Init(0); |
| | | // Radio.Standby(); |
| | | Radio.Standby(); |
| | | // Radio.Rx( RX_TIMEOUT_VALUE ); //进入接收 |
| | | Radio.Sleep( ); |
| | | if(flag_writepara_needreset) //配置写入完成设备需要重启 |
| | | { |
| | | printf("网关下发配置写入完成,重启"); |
| | | SCB->AIRCR = 0X05FA0000|(unsigned int)0x04; //软复位回到bootloader |
| | | } |
| | | if(LoraUp_flag) |
| | | { |
| | | huifushengjibao_flag=1; |
| | | Radio.Rx( 500 ); |
| | | } |
| | | else |
| | | { Radio.Sleep( );} |
| | | //printf("TX SUCCESS2\r\n"); |
| | | } |
| | | static uint8_t rxbuffer[255],rxbuff_len; |
| | | static uint16_t rec_lp_count; |
| | | uint8_t GetLoraBufferAndLen(uint8_t* buffer,uint16_t* lp_count) |
| | | { |
| | | memcpy(buffer,rxbuffer,rxbuff_len); |
| | | memcpy(lp_count,&rec_lp_count,2); |
| | | return rxbuff_len; |
| | | } |
| | | uint16_t GetLoraSyncCount(void) |
| | | { |
| | | return rec_lp_count; |
| | | } |
| | | uint8_t lora_up_rec_flag; |
| | | extern uint16_t tx_num; |
| | | void OnRxDone( uint8_t *payload, uint16_t size, int16_t rssi, int8_t snr ) |
| | | { |
| | | BufferSize = size; |
| | | memcpy( RX_Buffer, payload, BufferSize ); |
| | | rec_lp_count = HAL_LPTIM_ReadCounter(&hlptim1); |
| | | rxbuff_len = size; |
| | | memcpy( rxbuffer, payload, size ); |
| | | RssiValue = rssi; |
| | | SnrValue = snr; |
| | | |
| | | Radio.Standby(); |
| | | |
| | | if(EnableMaster) |
| | | { |
| | | if(memcmp(RX_Buffer,PongMsg,4)==0) |
| | | { |
| | | LedToggle();//LED闪烁 |
| | | printf("Master RXD PONG!\r\n"); |
| | | |
| | | } |
| | | lora_up_rec_flag=1; |
| | | flag_lora_wait_sync = 0; |
| | | SetFlagSyncSuccess(1); |
| | | Radio.Rx( RX_TIMEOUT_VALUE ); |
| | | |
| | | |
| | | // HAL_Delay_nMS(1000); |
| | | // |
| | | // TX_Buffer[0] = 'P'; |
| | | // TX_Buffer[1] = 'I'; |
| | | // TX_Buffer[2] = 'N'; |
| | | // TX_Buffer[3] = 'G'; |
| | | // |
| | | //// crc_value=RadioComputeCRC(TX_Buffer,4,CRC_TYPE_IBM);//计算得出要发送数据包CRC值 |
| | | //// TX_Buffer[4]=crc_value>>8; |
| | | //// TX_Buffer[5]=crc_value; |
| | | //// //Radio.Send( TX_Buffer, 6); |
| | | // Radio.Send( TX_Buffer, 4); |
| | | |
| | | // HAL_GPIO_WritePin( OUT1_GPIO_Port, OUT1_Pin,GPIO_PIN_SET); |
| | | // printf("Master TXD PING!\r\n"); |
| | | // HAL_Delay_nMS( 1 ); |
| | | // HAL_GPIO_WritePin( OUT1_GPIO_Port, OUT1_Pin,GPIO_PIN_RESET); |
| | | |
| | | //printf("Master TXD PING!\r\n"); |
| | | } |
| | | else |
| | | { |
| | | if(memcmp(RX_Buffer,PingMsg,4)==0) |
| | | { |
| | | |
| | | // HAL_GPIO_WritePin( OUT1_GPIO_Port, OUT1_Pin,GPIO_PIN_SET); |
| | | printf("Slave RXD PING!\r\n"); |
| | | // HAL_Delay_nMS( 1 ); |
| | | // HAL_GPIO_WritePin( OUT1_GPIO_Port, OUT1_Pin,GPIO_PIN_RESET); |
| | | |
| | | // LedToggle();//LED闪烁 |
| | | //printf("Slave RXD PING!\r\n"); |
| | | |
| | | // T_R_Init(1); |
| | | |
| | | // TX_Buffer[0] = 'P'; |
| | | // TX_Buffer[1] = 'O'; |
| | | // TX_Buffer[2] = 'N'; |
| | | // TX_Buffer[3] = 'G'; |
| | | |
| | | |
| | | // crc_value=RadioComputeCRC(TX_Buffer,4,CRC_TYPE_IBM);//计算得出要发送数据包CRC值 |
| | | // TX_Buffer[4]=crc_value>>8; |
| | | // TX_Buffer[5]=crc_value; |
| | | // //Radio.Send( TX_Buffer, 6); |
| | | |
| | | |
| | | Radio.Send( TX_Buffer, 4); |
| | | printf("Slave TXD PONG!\r\n"); |
| | | } |
| | | else |
| | | { |
| | | Radio.Rx( RX_TIMEOUT_VALUE ); |
| | | printf("Slave TXD XXXX\r\n"); |
| | | } |
| | | } |
| | | // if(LoraUp_flag) |
| | | // { |
| | | // |
| | | // } |
| | | } |
| | | |
| | | void OnTxTimeout( void ) |
| | |
| | | void OnRxTimeout( void ) |
| | | { |
| | | Radio.Standby(); |
| | | if(EnableMaster) |
| | | { |
| | | TX_Buffer[0] = 'P'; |
| | | TX_Buffer[1] = 'I'; |
| | | TX_Buffer[2] = 'N'; |
| | | TX_Buffer[3] = 'G'; |
| | | |
| | | // crc_value=RadioComputeCRC(TX_Buffer,4,CRC_TYPE_IBM);//计算得出要发送数据包CRC值 |
| | | // TX_Buffer[4]=crc_value>>8; |
| | | // TX_Buffer[5]=crc_value; |
| | | //Radio.Send( TX_Buffer, 6); |
| | | Radio.Send( TX_Buffer, 4); |
| | | |
| | | // HAL_GPIO_WritePin( OUT1_GPIO_Port, OUT1_Pin,GPIO_PIN_SET); |
| | | // HAL_Delay_nMS( 1 ); |
| | | // HAL_GPIO_WritePin( OUT1_GPIO_Port, OUT1_Pin,GPIO_PIN_RESET); |
| | | printf("Master TXD PING!\r\n"); |
| | | } |
| | | else |
| | | { |
| | | Radio.Rx( RX_TIMEOUT_VALUE ); |
| | | } |
| | | flag_lora_wait_sync = 0; |
| | | } |
| | | |
| | | void OnRxError( void ) |
| | | { |
| | | |
| | | flag_lora_wait_sync = 0; |
| | | Radio.Standby(); |
| | | if(EnableMaster) |
| | | { |
| | | TX_Buffer[0] = 'P'; |
| | | TX_Buffer[1] = 'I'; |
| | | TX_Buffer[2] = 'N'; |
| | | TX_Buffer[3] = 'G'; |
| | | |
| | | // crc_value=RadioComputeCRC(TX_Buffer,4,CRC_TYPE_IBM);//计算得出要发送数据包CRC值 |
| | | // TX_Buffer[4]=crc_value>>8; |
| | | // TX_Buffer[5]=crc_value; |
| | | //Radio.Send( TX_Buffer, 6); |
| | | Radio.Send( TX_Buffer, 4); |
| | | // HAL_GPIO_WritePin( OUT1_GPIO_Port, OUT1_Pin,GPIO_PIN_SET); |
| | | // HAL_Delay_nMS( 1 ); |
| | | // HAL_GPIO_WritePin( OUT1_GPIO_Port, OUT1_Pin,GPIO_PIN_RESET); |
| | | printf("Master TXD PING!\r\n"); |
| | | } |
| | | else |
| | | { |
| | | Radio.Rx( RX_TIMEOUT_VALUE ); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | void T_R_Init(uint8_t kind) |
| | | { |
| | | // Radio.Init( &RadioEvents ); |
| | | // if(kind==1) //1:Txd config |
| | | // { |
| | | // Radio.SetChannel( RF_FREQUENCY ); |
| | | // Radio.SetTxConfig( MODEM_LORA, TX_OUTPUT_POWER, 0, LORA_BANDWIDTH, |
| | | // LORA_SPREADING_FACTOR, LORA_CODINGRATE, |
| | | // LORA_PREAMBLE_LENGTH_T, LORA_FIX_LENGTH_PAYLOAD_ON, |
| | | // false, 0, 0, LORA_IQ_INVERSION_ON_T, 1000 ); |
| | | |
| | | // } |
| | | // else //0:Rxd config |
| | | // { |
| | | // Radio.SetChannel( RF_FREQUENCY ); |
| | | // Radio.SetRxConfig( MODEM_LORA, LORA_BANDWIDTH, LORA_SPREADING_FACTOR, |
| | | // LORA_CODINGRATE, 0, LORA_PREAMBLE_LENGTH_R, |
| | | // LORA_SYMBOL_TIMEOUT, LORA_FIX_LENGTH_PAYLOAD_ON, |
| | | // 0, false, 0, 0, LORA_IQ_INVERSION_ON_R, false ); |
| | | // } |
| | | // |
| | | //// Radio.SetTxConfig( MODEM_LORA, TX_OUTPUT_POWER, 0, LORA_BANDWIDTH, |
| | | //// LORA_SPREADING_FACTOR, LORA_CODINGRATE, |
| | | //// LORA_PREAMBLE_LENGTH_T, LORA_FIX_LENGTH_PAYLOAD_ON, |
| | | //// false, 0, 0, LORA_IQ_INVERSION_ON_T, 1000 ); |
| | | |
| | | //// Radio.SetRxConfig( MODEM_LORA, LORA_BANDWIDTH, LORA_SPREADING_FACTOR, |
| | | //// LORA_CODINGRATE, 0, LORA_PREAMBLE_LENGTH_R, |
| | | //// LORA_SYMBOL_TIMEOUT, LORA_FIX_LENGTH_PAYLOAD_ON, |
| | | //// 0, false, 0, 0, LORA_IQ_INVERSION_ON_R, false ); |
| | | } |
| | | |
| | | void Lora_Init(void) |
| | |
| | | RadioEvents.RxTimeout = OnRxTimeout; |
| | | RadioEvents.RxError = OnRxError; |
| | | |
| | | Radio.Init( &RadioEvents ); |
| | | Radio.SetChannel( RF_FREQUENCY ); |
| | | Radio.SetTxConfig( MODEM_LORA, 22, 0, LORA_BANDWIDTH, |
| | | LORA_SPREADING_FACTOR, LORA_CODINGRATE, |
| | | LORA_PREAMBLE_LENGTH_T, LORA_FIX_LENGTH_PAYLOAD_ON, |
| | | false, 0, 0, LORA_IQ_INVERSION_ON_T, 3000 ); |
| | | |
| | | TX_Buffer[0] = 'P'; |
| | | TX_Buffer[1] = 'I'; |
| | | TX_Buffer[2] = 'N'; |
| | | TX_Buffer[3] = tx_num; |
| | | |
| | | crc_value=RadioComputeCRC(TX_Buffer,4,CRC_TYPE_IBM);//计算得出要发送数据包CRC值 |
| | | TX_Buffer[4]=crc_value>>8; |
| | | TX_Buffer[5]=crc_value; |
| | | |
| | | Radio.Init( &RadioEvents ); |
| | | Radio.Standby(); |
| | | Radio.Sleep(); |
| | | |
| | | // Radio.SetChannel( UWB_CHANNEL_FRQ ); |
| | | // Radio.SetTxConfig( MODEM_LORA, 22, 0, LORA_BANDWIDTH, |
| | | // LORA_SPREADING_FACTOR, LORA_CODINGRATE, |
| | | // LORA_PREAMBLE_LENGTH_T, LORA_FIX_LENGTH_PAYLOAD_ON, |
| | | // false, 0, 0, LORA_IQ_INVERSION_ON_T, 3000 ); |
| | | } |
| | | |
| | | |
| | |
| | | // TX_Buffer[5]=crc_value; |
| | | |
| | | } |
| | | void SetFlagLoraWaitSync(uint8_t value) |
| | | { |
| | | flag_lora_wait_sync = value; |
| | | } |
| | | uint8_t GetFlagLoraWaitSync(void) |
| | | { |
| | | return flag_lora_wait_sync; |
| | | } |
| | | void SwitchLoraSettings(uint32_t freq,uint8_t sf,uint8_t power) |
| | | { |
| | | |
| | | // RadioEvents.TxDone = OnTxDone; |
| | | // RadioEvents.RxDone = OnRxDone; |
| | | // RadioEvents.TxTimeout = OnTxTimeout; |
| | | // RadioEvents.RxTimeout = OnRxTimeout; |
| | | // RadioEvents.RxError = OnRxError; |
| | | //HAL_GPIO_WritePin(GPIOB, GPIO_PIN_12, GPIO_PIN_SET); |
| | | // Radio.Init( &RadioEvents ); |
| | | Radio.Standby(); |
| | | // HAL_GPIO_WritePin(GPIOB, GPIO_PIN_12, GPIO_PIN_RESET); |
| | | Radio.SetChannel( freq*1000000 ); |
| | | |
| | | Radio.SetTxConfig( MODEM_LORA, power, 0, 2, |
| | | sf, LORA_CODINGRATE,LORA_PREAMBLE_LENGTH_T, LORA_FIX_LENGTH_PAYLOAD_ON, |
| | | false, 0, 0, LORA_IQ_INVERSION_ON_T, 3000 ); |
| | | |
| | | Radio.SetRxConfig( MODEM_LORA, LORA_BANDWIDTH, |
| | | sf,LORA_CODINGRATE, 0, LORA_PREAMBLE_LENGTH_R, |
| | | LORA_SYMBOL_TIMEOUT, LORA_FIX_LENGTH_PAYLOAD_ON, |
| | | 0, false, 0, 0, LORA_IQ_INVERSION_ON_R, 0 ); |
| | | |
| | | |
| | | } |
| | | |
| | | uint16_t rec_wenjian_daxiao; |
| | | uint16_t wangguan_up_id; |
| | | uint8_t send_lora_data[250]; |
| | | extern uint8_t lora_recbuffer[255]; |
| | | uint8_t muqiandeshengjibao; |
| | | static uint16_t current_count1,target_count1,end_count1,start_count1; |
| | | uint8_t huifushengjibaoerror_num; |
| | | uint8_t final_bag_num; |
| | | void LoraUp_Poll() |
| | | { uint16_t result ; |
| | | uint16_t crc16; |
| | | memcpy(&rec_wenjian_daxiao,&rxbuffer[WRITEPARA_VALUE_IDX],2);//网关ID 占用2个字节 |
| | | // rec_wenjian_daxiao=rxbuffer[WRITEPATE_VALUE_IDX]; |
| | | if(rec_wenjian_daxiao>0XAC00) |
| | | {}//文件过大,超出范围 |
| | | else |
| | | { |
| | | final_bag_num=(rec_wenjian_daxiao/220)+1;//计算一共要请求多少包 |
| | | wangguan_up_id=rxbuffer[SOURCE_ID_IDX]; |
| | | send_lora_data[MSG_TYPE_IDX]=LORA_MSGTYPE_UPDATE_CONFIRM; |
| | | memcpy(&send_lora_data[WANGGUAN_ID],&wangguan_up_id,2);//网关ID 占用2个字节 |
| | | memcpy(&send_lora_data[JIZHAN_ID],&dev_id,2);//标签或者基站的设备ID 2个字节 |
| | | send_lora_data[MUQIAN_BAG]=0xFF; |
| | | crc16=Cal_CRC16(send_lora_data,6); |
| | | memcpy(&send_lora_data[6],&crc16,2); |
| | | huifushengjibao_flag=0; |
| | | LoraUp_flag=1; |
| | | Radio.Send(send_lora_data,8);//基站发送升级确认回复 |
| | | while(1) |
| | | { |
| | | if(huifushengjibao_flag==1) |
| | | {lora_up_rec_flag=1; |
| | | while(1) |
| | | { |
| | | send_lora_data[MSG_TYPE_IDX]=LORA_MSGTYPE_UPDATEFILE_REQUEST; |
| | | memcpy(&send_lora_data[WANGGUAN_ID],&wangguan_up_id,2);//网关ID 占用2个字节 |
| | | memcpy(&send_lora_data[JIZHAN_ID],&dev_id,2);//标签或者基站的设备ID 2个字节 |
| | | send_lora_data[MUQIAN_BAG]=muqiandeshengjibao; |
| | | crc16=Cal_CRC16(send_lora_data,6); |
| | | memcpy(&send_lora_data[6],&crc16,2); |
| | | lora_up_rec_flag=0; |
| | | Radio.Send(send_lora_data,8);//基站发送升级确认回复 |
| | | |
| | | start_count1=HAL_LPTIM_ReadCounter(&hlptim1); //等待接收完成直到超时 |
| | | end_count1=start_count1+32768/2;//500ms等待 |
| | | if(end_count1>=32768) |
| | | {end_count1-=32768;} |
| | | current_count1=HAL_LPTIM_ReadCounter(&hlptim1); |
| | | while(!lora_up_rec_flag) |
| | | { |
| | | current_count1=HAL_LPTIM_ReadCounter(&hlptim1); |
| | | if(current_count1>=end_count1&¤t_count1<end_count1+15000) |
| | | { |
| | | break; |
| | | } |
| | | } |
| | | if(lora_up_rec_flag) |
| | | { |
| | | crc16=Cal_CRC16(rxbuffer,6+ONE_BAG_DAXIAO); |
| | | if(!memcmp(&crc16,&rxbuffer[6+ONE_BAG_DAXIAO],2)&&!memcmp(&dev_id,&RX_Buffer[JIZHAN_ID],2)&& !memcmp(&wangguan_up_id,&RX_Buffer[WANGGUAN_ID],2)) |
| | | { |
| | | result = FLASH_Prepare(APP2_ADRESS+ONE_BAG_DAXIAO*rxbuffer[MUQIAN_BAG], ONE_BAG_DAXIAO); |
| | | if(result) |
| | | result = FLASH_Write(APP2_ADRESS+ONE_BAG_DAXIAO*rxbuffer[MUQIAN_BAG],rxbuffer[DATA_IDX],ONE_BAG_DAXIAO); |
| | | muqiandeshengjibao++; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | huifushengjibaoerror_num++; |
| | | if(huifushengjibaoerror_num>=20) |
| | | { |
| | | huifushengjibaoerror_num=0; |
| | | break; |
| | | } |
| | | } |
| | | if(muqiandeshengjibao==final_bag_num) |
| | | { |
| | | Delay_Ms(500); |
| | | HAL_NVIC_SystemReset(); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | Delay_Ms(500); |
| | | huifushengjibao_flag=0; |
| | | Radio.Send(send_lora_data,8);//基站发送升级确认回复 |
| | | huifushengjibaoerror_num++; |
| | | if(huifushengjibaoerror_num>=5) |
| | | { |
| | | huifushengjibaoerror_num=0; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | // LoraUp_flag=1; |
| | | // SetFlagLoraWaitSync(1); |
| | | // while(1) |
| | | // { |
| | | // start_count1=HAL_LPTIM_ReadCounter(&hlptim1); //等待接收完成直到超时 |
| | | //// poll_timeout=500*10; //单位0.1ms |
| | | // end_count1=start_count1+(5000<<2); |
| | | // if(end_count1>=32768) |
| | | // {end_count1-=32768;} |
| | | // current_count1=HAL_LPTIM_ReadCounter(&hlptim1); |
| | | // while(GetFlagLoraWaitSync()) |
| | | // { |
| | | // current_count1=HAL_LPTIM_ReadCounter(&hlptim1); |
| | | // if(current_count1>=end_count1&¤t_count1<end_count1+15000) |
| | | // { |
| | | // break; |
| | | // } |
| | | // } |
| | | // if(!GetFlagLoraWaitSync()) |
| | | // { |
| | | // send_lora_data[MSG_TYPE_IDX]=LORA_MSGTYPE_UPDATEFILE_REQUEST; |
| | | // memcpy(&send_lora_data[WANGGUAN_ID],&wangguan_up_id,2);//网关ID 占用2个字节 |
| | | // memcpy(&send_lora_data[JIZHAN_ID],&dev_id,2);//标签或者基站的设备ID 2个字节 |
| | | // send_lora_data[MUQIAN_BAG]=mudeshengjibao; |
| | | // crc16=Cal_CRC16(send_lora_data,6); |
| | | // memcpy(&send_lora_data[6],&crc16,2); |
| | | // |
| | | // } |
| | | // } |
| | | } |
| | | } |
| | | |
| | | //void test1() |
| | | //{ |
| | | // if(!memcmp(&dev_id,&rxbuffer[ANCTAG_DEVICEID_IDX],2)) |
| | | // {LoraUp_Poll();} |
| | | //} |