Skip to content

Commit 80e1093

Browse files
author
Cruz Monrreal
authored
Merge pull request #6892 from hasnainvirk/bug_fix
LoRaWAN: Wrong type of message check
2 parents 0fd5447 + d270105 commit 80e1093

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

features/lorawan/LoRaWANStack.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ void LoRaWANStack::process_reception(const uint8_t* const payload, uint16_t size
522522
}
523523

524524
if (_loramac.nwk_joined()) {
525-
if (_loramac.get_mcps_indication()->type == MCPS_CONFIRMED) {
525+
if (_loramac.get_mcps_confirmation()->req_type == MCPS_CONFIRMED) {
526526
// if ack was not received, we will try retransmission after
527527
// ACK_TIMEOUT. handle_data_frame() already disables ACK_TIMEOUT timer
528528
// if ack was received

features/lorawan/lorastack/mac/LoRaMac.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ void LoRaMac::post_process_mcps_req()
166166
{
167167
_params.is_last_tx_join_request = false;
168168
_mcps_confirmation.status = LORAMAC_EVENT_INFO_STATUS_OK;
169-
if (_mcps_indication.type == MCPS_CONFIRMED) {
169+
if (_mcps_confirmation.req_type == MCPS_CONFIRMED) {
170170
// An MCPS request for a CONFIRMED message has received an ack
171171
// in the downlink message
172172
if (_mcps_confirmation.ack_received) {
@@ -547,8 +547,6 @@ void LoRaMac::handle_data_frame(const uint8_t* const payload,
547547
fctrl.value = payload[ptr_pos++];
548548
app_payload_start_index = 8 + fctrl.bits.fopts_len;
549549

550-
tr_debug("RX at port %d", payload[app_payload_start_index]);
551-
552550
//perform MIC check
553551
if (!message_integrity_check(payload, size, &ptr_pos, address,
554552
&downlink_counter, nwk_skey)) {
@@ -1617,9 +1615,6 @@ lorawan_status_t LoRaMac::send_frame_on_channel(uint8_t channel)
16171615
_mcps_confirmation.tx_toa = _params.timers.tx_toa;
16181616
_mlme_confirmation.tx_toa = _params.timers.tx_toa;
16191617

1620-
// _lora_time.start(_params.timers.mac_state_check_timer,
1621-
// MAC_STATE_CHECK_TIMEOUT);
1622-
16231618
if (!_is_nwk_joined) {
16241619
_params.join_request_trial_counter++;
16251620
}

0 commit comments

Comments
 (0)