Skip to content

Commit

Permalink
sys/net/gnrc/link_layer/lorawan: process TX timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
olegart committed Dec 15, 2019
1 parent 512cd1b commit 26c76da
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion sys/net/gnrc/link_layer/lorawan/gnrc_lorawan.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ static void _config_radio(gnrc_lorawan_t *mac, uint32_t channel_freq, uint8_t dr
netdev_set_pass(&mac->netdev, NETOPT_SINGLE_RECEIVE, &single, sizeof(single));
const uint16_t timeout = CONFIG_GNRC_LORAWAN_MIN_SYMBOLS_TIMEOUT;
netdev_set_pass(&mac->netdev, NETOPT_RX_SYMBOL_TIMEOUT, &timeout, sizeof(timeout));
} else {
const uint32_t timeout = CONFIG_GNRC_LORAWAN_TX_TIMEOUT;
netdev_set_pass(&mac->netdev, NETOPT_TX_TIMEOUT, &timeout, sizeof(timeout));
}
}

Expand Down Expand Up @@ -169,6 +172,7 @@ void gnrc_lorawan_event_timeout(gnrc_lorawan_t *mac)
mac->state = LORAWAN_STATE_RX_2;
break;
case LORAWAN_STATE_RX_2:
case LORAWAN_STATE_TX: /* TX timeout */
gnrc_lorawan_mlme_no_rx(mac);
gnrc_lorawan_mcps_event(mac, MCPS_EVENT_NO_RX, 0);
mac->state = LORAWAN_STATE_IDLE;
Expand Down Expand Up @@ -242,7 +246,6 @@ void gnrc_lorawan_send_pkt(gnrc_lorawan_t *mac, gnrc_pktsnip_t *pkt, uint8_t dr)
if (netdev_send_pass(&mac->netdev, &iolist) == -ENOTSUP) {
DEBUG("gnrc_lorawan: Cannot send: radio is still transmitting");
}

}

void gnrc_lorawan_process_pkt(gnrc_lorawan_t *mac, gnrc_pktsnip_t *pkt)
Expand Down

0 comments on commit 26c76da

Please sign in to comment.