Skip to content

Commit

Permalink
[SX1276, LoRaWAN] Fix confusing return value in LoRaWAN::processJoinA…
Browse files Browse the repository at this point in the history
…ccept (#1262)

The error RADIOLIB_ERR_LORA_HEADER_DAMAGED board returned fromreadData(...)
and signaled from a SX1276 is in fact correctly ignored but the state
variable is not corrected.

This confuses the caller due to the wrongly returned state value
RADIOLIB_ERR_LORA_HEADER_DAMAGED.

Change: Clear state also.
  • Loading branch information
VolkerChristian authored Oct 9, 2024
1 parent bce4d91 commit a7feeee
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/protocols/LoRaWAN/LoRaWAN.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -688,6 +688,8 @@ int16_t LoRaWANNode::processJoinAccept(LoRaWANJoinEvent_t *joinEvent) {
// we can ignore that error
if(state != RADIOLIB_ERR_LORA_HEADER_DAMAGED) {
RADIOLIB_ASSERT(state);
} else {
state = RADIOLIB_ERR_NONE;
}

// check reply message type
Expand Down

0 comments on commit a7feeee

Please sign in to comment.