Skip to content

Commit 3225785

Browse files
author
Antti Kauppila
committed
Added missing mac_cmd_buf_idx_to_repeat to LoRaMacCommand class
- Reordered LoRaWANStack internal variables for more compact code
1 parent 488cf03 commit 3225785

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

features/lorawan/LoRaWANStack.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ lorawan_status_t LoRaWANStack::set_application_port(uint8_t port)
8787
LoRaWANStack::LoRaWANStack()
8888
: _loramac(_lora_time), _lora_phy(_lora_time),
8989
_device_current_state(DEVICE_STATE_NOT_INITIALIZED), _mac_handlers(NULL),
90-
_num_retry(1), _queue(NULL), _duty_cycle_on(MBED_CONF_LORA_DUTY_CYCLE_ON),
91-
_app_port(INVALID_PORT)
90+
_num_retry(1), _app_port(INVALID_PORT), _duty_cycle_on(MBED_CONF_LORA_DUTY_CYCLE_ON),
91+
_queue(NULL)
9292
{
9393
#ifdef MBED_CONF_LORA_APP_PORT
9494
if (is_port_valid(MBED_CONF_LORA_APP_PORT)) {

features/lorawan/LoRaWANStack.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -456,10 +456,9 @@ class LoRaWANStack: private mbed::NonCopyable<LoRaWANStack> {
456456
loramac_tx_message_t _tx_msg;
457457
loramac_rx_message_t _rx_msg;
458458
uint8_t _num_retry;
459-
events::EventQueue *_queue;
460-
bool _duty_cycle_on;
461459
uint8_t _app_port;
462-
460+
bool _duty_cycle_on;
461+
events::EventQueue *_queue;
463462

464463
#if defined(LORAWAN_COMPLIANCE_TEST)
465464
/**

features/lorawan/lorastack/mac/LoRaMacCommand.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ void LoRaMacCommand::parse_mac_commands_to_repeat()
209209
} else {
210210
mac_cmd_in_next_tx = false;
211211
}
212+
mac_cmd_buf_idx_to_repeat = cmd_cnt;
212213
}
213214

214215

@@ -426,7 +427,6 @@ lorawan_status_t LoRaMacCommand::process_mac_commands(uint8_t *payload, uint8_t
426427

427428
bool LoRaMacCommand::is_sticky_mac_command_pending()
428429
{
429-
//DEAD CODE: mac_cmd_buf_idx_to_repeat is never set
430430
if (mac_cmd_buf_idx_to_repeat > 0) {
431431
return true;
432432
}

0 commit comments

Comments
 (0)