mirror of https://github.com/ARMmbed/mbed-os.git
Adding port in trace & streamlining continuous RX2
parent
2db1b9a01d
commit
6ab0c0b688
|
@ -962,8 +962,9 @@ void LoRaWANStack::mcps_indication_handler()
|
||||||
_rx_msg.msg.mcps_indication.type = mcps_indication->type;
|
_rx_msg.msg.mcps_indication.type = mcps_indication->type;
|
||||||
|
|
||||||
// Notify application about received frame..
|
// Notify application about received frame..
|
||||||
tr_debug("Packet Received %d bytes",
|
tr_debug("Packet Received %d bytes, Port=%d",
|
||||||
_rx_msg.msg.mcps_indication.buffer_size);
|
_rx_msg.msg.mcps_indication.buffer_size,
|
||||||
|
mcps_indication->port);
|
||||||
_rx_msg.receive_ready = true;
|
_rx_msg.receive_ready = true;
|
||||||
send_event_to_application(RX_DONE);
|
send_event_to_application(RX_DONE);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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,
|
void LoRaMac::on_radio_rx_done(const uint8_t* const payload, uint16_t size,
|
||||||
int16_t rssi, int8_t snr)
|
int16_t rssi, int8_t snr)
|
||||||
{
|
{
|
||||||
// stop the RX1 timer here if its the first RX slot.
|
if (_device_class == CLASS_C && !_continuous_rx2_window_open) {
|
||||||
// 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) {
|
|
||||||
open_rx2_window();
|
open_rx2_window();
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
|
_lora_time.stop(_params.timers.rx_window1_timer);
|
||||||
_lora_phy.put_radio_to_sleep();
|
_lora_phy.put_radio_to_sleep();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue