Skip to content

Commit

Permalink
refactor: RX2 delay setting
Browse files Browse the repository at this point in the history
  • Loading branch information
REGIOIGER committed Aug 2, 2024
1 parent 483c82f commit 35b2d32
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/arduino-rfm/lorawan-arduino-rfm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,12 @@ bool LoRaWANClass::init(void)
LoRa_Settings.Channel_Hopping = 0x00; //0x00 no channel hopping, 0x01 channel hopping

// Set default rx delay and window
LoRa_Settings.Rx1_Delay = 5000; // Thing stack seems to be 5000 ms (so Rx2_delay 6000 ms)
LoRa_Settings.Rx2_Delay = 6000; // Rx2_Delay >= Rx1_Delay + RX1_Window
LoRa_Settings.RX1_Window = 1000;
LoRa_Settings.RX2_Window = 1000;

LoRa_Settings.Rx1_Delay = 5000; // Thing stack seems to be 5000 ms (so Rx2_delay 6000 ms)
LoRa_Settings.Rx2_Delay = LoRa_Settings.Rx1_Delay + LoRa_Settings.RX1_Window;


// Initialise buffer for data to transmit
memset(Data_Tx, 0x00, sizeof(Data_Tx));
Expand Down Expand Up @@ -507,7 +509,6 @@ void LoRaWANClass::update(void)
bool isConfirmed = ((Message_Rx.MAC_Header & 0xE0)>>5) == 5 ? true : false ; // MType
uint8_t fPort = Message_Rx.Frame_Port;
if(lora.messageCallback) lora.messageCallback(&Buffer_Rx, isConfirmed, fPort);
//Buffer_Rx.Counter = 0x00; // clear counter for the next cycle
Rx_Status = NEW_RX;
Serial.println("Data received over RX1");

Expand Down

0 comments on commit 35b2d32

Please sign in to comment.