[LoRaWAN] Additional error-code

This commit is contained in:
StevenCellist 2024-05-18 11:27:33 +02:00
parent f2f47e088a
commit 491241c12d
2 changed files with 7 additions and 2 deletions

View file

@ -578,6 +578,11 @@
*/
#define RADIOLIB_LORAWAN_NONCES_DISCARDED (-1119)
/*!
\brief The supplied Session buffer is discarded as it doesn't match the Nonces.
*/
#define RADIOLIB_LORAWAN_SESSION_DISCARDED (-1120)
// LR11x0-specific status codes
/*!

View file

@ -130,7 +130,7 @@ int16_t LoRaWANNode::setBufferSession(uint8_t* persistentBuffer) {
uint16_t signatureInSession = LoRaWANNode::ntoh<uint16_t>(&persistentBuffer[RADIOLIB_LW_SESSION_NONCES_SIGNATURE]);
if(signatureNonces != signatureInSession) {
RADIOLIB_DEBUG_PROTOCOL_PRINTLN("The supplied session buffer does not match the Nonces buffer");
return(RADIOLIB_ERR_CHECKSUM_MISMATCH);
return(RADIOLIB_LORAWAN_SESSION_DISCARDED);
}
// copy the whole buffer over
@ -833,7 +833,7 @@ int16_t LoRaWANNode::activateABP(bool force, uint8_t initialDr) {
LoRaWANNode::hton<uint8_t>(&this->bufferSession[RADIOLIB_LW_SESSION_VERSION], this->rev);
this->isActive = true;
return(RADIOLIB_LORAWAN_NEW_SESSION);
}