Merge pull request #6892 from hasnainvirk/bug_fix

LoRaWAN: Wrong type of message check
pull/6836/merge
Cruz Monrreal 2018-05-14 17:35:32 -05:00 committed by GitHub
commit 80e109370d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 7 deletions

View File

@ -522,7 +522,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

View File

@ -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) {
@ -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)) {
@ -1617,9 +1615,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++;
}