File tree Expand file tree Collapse file tree 4 files changed +18
-30
lines changed Expand file tree Collapse file tree 4 files changed +18
-30
lines changed Original file line number Diff line number Diff line change @@ -300,16 +300,11 @@ class LoRaRadio
300
300
virtual void send (uint8_t *buffer, uint8_t size) = 0;
301
301
302
302
/* *
303
- * Sets the radio in reception mode for a given time.
304
- *
305
- * If the timeout is set to 0, it essentially puts the receiver in continuous mode and it should
306
- * be treated as if in continuous mode. However, an appropriate way to set the receiver in continuous mode is
307
- * to use the `set_rx_config()` API.
308
- *
309
- * @param timeout Reception timeout [ms].
303
+ * Sets the radio in reception mode.
310
304
*
305
+ * For configuration of the receiver use the `set_rx_config()` API.
311
306
*/
312
- virtual void receive (uint32_t timeout ) = 0;
307
+ virtual void receive (void ) = 0;
313
308
314
309
/* *
315
310
* Sets the carrier frequency
Original file line number Diff line number Diff line change @@ -867,10 +867,13 @@ void LoRaMac::open_rx1_window(void)
867
867
}
868
868
869
869
_mcps_indication.rx_datarate = _params.rx_window1_config .datarate ;
870
- _lora_phy.rx_config (&_params.rx_window1_config );
871
870
872
- _lora_phy.setup_rx_window (_params.rx_window1_config .is_rx_continuous ,
873
- _params.sys_params .max_rx_win_time );
871
+ if (_lora_phy.rx_config (&_params.rx_window1_config )) {
872
+ _lora_phy.handle_receive ();
873
+ } else {
874
+ tr_error (" Receive failed. Radio is not IDLE" );
875
+ return ;
876
+ }
874
877
875
878
tr_debug (" Opening RX1 Window" );
876
879
}
@@ -897,14 +900,14 @@ void LoRaMac::open_rx2_window()
897
900
_mcps_indication.rx_datarate = _params.rx_window2_config .datarate ;
898
901
899
902
if (_lora_phy.rx_config (&_params.rx_window2_config )) {
900
-
901
- _lora_phy.setup_rx_window (_params.rx_window2_config .is_rx_continuous ,
902
- _params.sys_params .max_rx_win_time );
903
-
903
+ _lora_phy.handle_receive ();
904
904
_params.rx_slot = _params.rx_window2_config .rx_slot ;
905
+ } else {
906
+ tr_error (" Receive failed. Radio is not IDLE" );
907
+ return ;
905
908
}
906
909
907
- tr_debug (" Opening RX2 Window, Frequency = %u " , _params.rx_window2_config .frequency );
910
+ tr_debug (" Opening RX2 Window, Frequency = %lu " , _params.rx_window2_config .frequency );
908
911
}
909
912
910
913
void LoRaMac::on_ack_timeout_timer_event (void )
Original file line number Diff line number Diff line change @@ -88,14 +88,10 @@ void LoRaPHY::setup_public_network_mode(bool set)
88
88
_radio->unlock ();
89
89
}
90
90
91
- void LoRaPHY::setup_rx_window ( bool rx_continuous, uint32_t max_rx_window )
91
+ void LoRaPHY::handle_receive ( void )
92
92
{
93
93
_radio->lock ();
94
- if (!rx_continuous) {
95
- _radio->receive (max_rx_window);
96
- } else {
97
- _radio->receive (0 ); // Continuous mode
98
- }
94
+ _radio->receive ();
99
95
_radio->unlock ();
100
96
}
101
97
Original file line number Diff line number Diff line change @@ -68,15 +68,9 @@ class LoRaPHY : private mbed::NonCopyable<LoRaPHY> {
68
68
69
69
/* * Puts radio in receive mode.
70
70
*
71
- * Requests the radio driver to enter receive mode for a given time or to
72
- * enter continuous reception mode.
73
- *
74
- * @param is_rx_continuous if true, sets the radio to enter continuous
75
- * reception mode.
76
- *
77
- * @param max_rx_window duration of receive window
71
+ * Requests the radio driver to enter receive mode.
78
72
*/
79
- void setup_rx_window ( bool is_rx_continuous, uint32_t max_rx_window );
73
+ void handle_receive ( void );
80
74
81
75
/* * Delegates MAC layer request to transmit packet.
82
76
*
You can’t perform that action at this time.
0 commit comments