Adding port in trace & streamlining continuous RX2

pull/7191/head
Hasnain Virk 2018-06-11 15:42:45 +03:00
parent eab2bad593
commit ffb0698ce7
2 changed files with 7 additions and 16 deletions

View File

@ -962,8 +962,9 @@ void LoRaWANStack::mcps_indication_handler()
_rx_msg.msg.mcps_indication.type = mcps_indication->type;
// Notify application about received frame..
tr_debug("Packet Received %d bytes",
_rx_msg.msg.mcps_indication.buffer_size);
tr_debug("Packet Received %d bytes, Port=%d",
_rx_msg.msg.mcps_indication.buffer_size,
mcps_indication->port);
_rx_msg.receive_ready = true;
send_event_to_application(RX_DONE);
}

View File

@ -669,20 +669,10 @@ void LoRaMac::on_radio_tx_done(lorawan_time_t timestamp)
void LoRaMac::on_radio_rx_done(const uint8_t* const payload, uint16_t size,
int16_t rssi, int8_t snr)
{
// stop the RX1 timer here if its the first RX slot.
// If the MIC will pass we will stop RX2 timer as well later.
// If its RX2, stop RX2 timer.
if (_params.rx_slot == RX_SLOT_WIN_1) {
_lora_time.stop(_params.timers.rx_window1_timer);
} else if (_params.rx_slot == RX_SLOT_WIN_2) {
_lora_time.stop(_params.timers.rx_window2_timer);
}
if (_device_class == CLASS_C) {
if (!_continuous_rx2_window_open) {
if (_device_class == CLASS_C && !_continuous_rx2_window_open) {
open_rx2_window();
}
} else {
_lora_time.stop(_params.timers.rx_window1_timer);
_lora_phy.put_radio_to_sleep();
}