Skip to content

Commit 4fadc1e

Browse files
author
Antti Kauppila
committed
Increment app DL counter correctly
1 parent 45aec0c commit 4fadc1e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

features/lorawan/lorastack/mac/LoRaMac.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -580,6 +580,7 @@ void LoRaMac::handle_data_frame(const uint8_t *const payload,
580580
fport = payload[FHDR_LEN_WITHOUT_FOPTS + fctrl.bits.fopts_len];
581581
}
582582

583+
//TODO: Move this handling to LoRaMACCrypto class!
583584
if (address != _params.dev_addr) {
584585
// check if Multicast is destined for us
585586
cur_multicast_params = get_multicast_params(address);
@@ -604,7 +605,7 @@ void LoRaMac::handle_data_frame(const uint8_t *const payload,
604605
}
605606
if (!is_multicast) {
606607
if (_dl_fport_available && fport != 0) {
607-
downlink_counter = _params.app_dl_frame_counter;
608+
downlink_counter = _params.app_dl_frame_counter++;
608609
cnt_type = AFCNT_DOWN;
609610
} else {
610611
cnt_type = NFCNT_DOWN;

0 commit comments

Comments
 (0)