Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LoRaWAN: Wrong type of message check #6892

Merged
merged 1 commit into from May 14, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion features/lorawan/LoRaWANStack.cpp
Expand Up @@ -521,7 +521,7 @@ void LoRaWANStack::process_reception(const uint8_t* const payload, uint16_t size
}

if (_loramac.nwk_joined()) {
if (_loramac.get_mcps_indication()->type == MCPS_CONFIRMED) {
if (_loramac.get_mcps_confirmation()->req_type == MCPS_CONFIRMED) {
// if ack was not received, we will try retransmission after
// ACK_TIMEOUT. handle_data_frame() already disables ACK_TIMEOUT timer
// if ack was received
Expand Down
7 changes: 1 addition & 6 deletions features/lorawan/lorastack/mac/LoRaMac.cpp
Expand Up @@ -166,7 +166,7 @@ void LoRaMac::post_process_mcps_req()
{
_params.is_last_tx_join_request = false;
_mcps_confirmation.status = LORAMAC_EVENT_INFO_STATUS_OK;
if (_mcps_indication.type == MCPS_CONFIRMED) {
if (_mcps_confirmation.req_type == MCPS_CONFIRMED) {
// An MCPS request for a CONFIRMED message has received an ack
// in the downlink message
if (_mcps_confirmation.ack_received) {
Expand Down Expand Up @@ -547,8 +547,6 @@ void LoRaMac::handle_data_frame(const uint8_t* const payload,
fctrl.value = payload[ptr_pos++];
app_payload_start_index = 8 + fctrl.bits.fopts_len;

tr_debug("RX at port %d", payload[app_payload_start_index]);

//perform MIC check
if (!message_integrity_check(payload, size, &ptr_pos, address,
&downlink_counter, nwk_skey)) {
Expand Down Expand Up @@ -1612,9 +1610,6 @@ lorawan_status_t LoRaMac::send_frame_on_channel(uint8_t channel)
_mcps_confirmation.tx_toa = _params.timers.tx_toa;
_mlme_confirmation.tx_toa = _params.timers.tx_toa;

// _lora_time.start(_params.timers.mac_state_check_timer,
// MAC_STATE_CHECK_TIMEOUT);

if (!_is_nwk_joined) {
_params.join_request_trial_counter++;
}
Expand Down