Skip to content

Commit

Permalink
[LoRaWAN] Fixed a few warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jgromes committed Nov 18, 2023
1 parent 75a9420 commit 063b427
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
10 changes: 2 additions & 8 deletions src/protocols/LoRaWAN/LoRaWAN.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -797,7 +797,7 @@ int16_t LoRaWANNode::uplink(uint8_t* data, size_t len, uint8_t port, bool isConf
uint8_t* foptsPtr = foptsBuff;

// append all MAC replies into fopts buffer
size_t i = 0;
int16_t i = 0;
for (; i < this->commandsUp.numCommands; i++) {
LoRaWANMacCommand_t cmd = this->commandsUp.commands[i];
memcpy(foptsPtr, &cmd, 1 + cmd.len);
Expand All @@ -813,9 +813,6 @@ int16_t LoRaWANNode::uplink(uint8_t* data, size_t len, uint8_t port, bool isConf
} else {
deleteMacCommand(this->commandsUp.commands[i].cid, &this->commandsUp);
}
if(i == 0) {
break;
}
}

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

this->isMACPayload = true;
Expand Down
2 changes: 1 addition & 1 deletion src/protocols/LoRaWAN/LoRaWAN.h
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ class LoRaWANNode {
uint8_t difsSlots;

// 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
LoRaWANChannel_t currentChannels[2] = { RADIOLIB_LORAWAN_CHANNEL_NONE, RADIOLIB_LORAWAN_CHANNEL_NONE };
Expand Down

0 comments on commit 063b427

Please sign in to comment.