[SX1276, LoRaWAN] Fix confusing return value in LoRaWAN::processJoinAccept (#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.
This commit is contained in:
Volker Christian 2024-10-09 20:32:50 +02:00 committed by GitHub
parent bce4d91715
commit a7feeee1e0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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