Skip to content

Commit

Permalink
[LoRaWAN] Fix JoinRequest dwelltime calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
StevenCellist committed Jun 27, 2024
1 parent ce8e6fd commit 3348023
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/protocols/LoRaWAN/LoRaWAN.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,8 @@ int16_t LoRaWANNode::activateOTAA(uint8_t joinDr, LoRaWANJoinEvent_t *joinEvent)
RADIOLIB_ASSERT(state);

if(this->dwellTimeEnabledUp) {
RadioLibTime_t toa = this->phyLayer->getTimeOnAir(RADIOLIB_LORAWAN_JOIN_REQUEST_LEN);
// calculate JoinRequest time-on-air in milliseconds
RadioLibTime_t toa = this->phyLayer->getTimeOnAir(RADIOLIB_LORAWAN_JOIN_REQUEST_LEN) / 1000;
if(toa > this->dwellTimeUp) {
return(RADIOLIB_ERR_DWELL_TIME_EXCEEDED);
}
Expand Down

0 comments on commit 3348023

Please sign in to comment.