[LoRaWAN] Fixed a few warnings

This commit is contained in:
jgromes 2023-11-18 15:03:48 +01:00
parent 75a9420552
commit 063b42752f
2 changed files with 3 additions and 9 deletions

View file

@ -797,7 +797,7 @@ int16_t LoRaWANNode::uplink(uint8_t* data, size_t len, uint8_t port, bool isConf
uint8_t* foptsPtr = foptsBuff; uint8_t* foptsPtr = foptsBuff;
// append all MAC replies into fopts buffer // append all MAC replies into fopts buffer
size_t i = 0; int16_t i = 0;
for (; i < this->commandsUp.numCommands; i++) { for (; i < this->commandsUp.numCommands; i++) {
LoRaWANMacCommand_t cmd = this->commandsUp.commands[i]; LoRaWANMacCommand_t cmd = this->commandsUp.commands[i];
memcpy(foptsPtr, &cmd, 1 + cmd.len); memcpy(foptsPtr, &cmd, 1 + cmd.len);
@ -813,9 +813,6 @@ int16_t LoRaWANNode::uplink(uint8_t* data, size_t len, uint8_t port, bool isConf
} else { } else {
deleteMacCommand(this->commandsUp.commands[i].cid, &this->commandsUp); deleteMacCommand(this->commandsUp.commands[i].cid, &this->commandsUp);
} }
if(i == 0) {
break;
}
} }
uplinkMsgLen = RADIOLIB_LORAWAN_FRAME_LEN(len, foptsLen); uplinkMsgLen = RADIOLIB_LORAWAN_FRAME_LEN(len, foptsLen);
@ -1206,7 +1203,7 @@ int16_t LoRaWANNode::downlink(uint8_t* data, size_t* len, LoRaWANEvent_t* event)
uint8_t foptsBuff[foptsBufSize]; uint8_t foptsBuff[foptsBufSize];
uint8_t* foptsPtr = foptsBuff; uint8_t* foptsPtr = foptsBuff;
// append all MAC replies into fopts buffer // append all MAC replies into fopts buffer
size_t i = 0; int16_t i = 0;
for (; i < this->commandsUp.numCommands; i++) { for (; i < this->commandsUp.numCommands; i++) {
LoRaWANMacCommand_t cmd = this->commandsUp.commands[i]; LoRaWANMacCommand_t cmd = this->commandsUp.commands[i];
memcpy(foptsPtr, &cmd, 1 + cmd.len); memcpy(foptsPtr, &cmd, 1 + cmd.len);
@ -1222,9 +1219,6 @@ int16_t LoRaWANNode::downlink(uint8_t* data, size_t* len, LoRaWANEvent_t* event)
} else { } else {
deleteMacCommand(this->commandsUp.commands[i].cid, &this->commandsUp); deleteMacCommand(this->commandsUp.commands[i].cid, &this->commandsUp);
} }
if(i == 0) {
break;
}
} }
this->isMACPayload = true; this->isMACPayload = true;

View file

@ -626,7 +626,7 @@ class LoRaWANNode {
uint8_t difsSlots; uint8_t difsSlots;
// available channel frequencies from list passed during OTA activation // available channel frequencies from list passed during OTA activation
LoRaWANChannel_t availableChannels[2][RADIOLIB_LORAWAN_NUM_AVAILABLE_CHANNELS] = { { 0 }, { 0 } }; LoRaWANChannel_t availableChannels[2][RADIOLIB_LORAWAN_NUM_AVAILABLE_CHANNELS];
// currently configured channels for TX and RX1 // currently configured channels for TX and RX1
LoRaWANChannel_t currentChannels[2] = { RADIOLIB_LORAWAN_CHANNEL_NONE, RADIOLIB_LORAWAN_CHANNEL_NONE }; LoRaWANChannel_t currentChannels[2] = { RADIOLIB_LORAWAN_CHANNEL_NONE, RADIOLIB_LORAWAN_CHANNEL_NONE };