mirror of https://github.com/ARMmbed/mbed-os.git
Adding valid frequency check for RXParamSetup cmd
We must check for a valid value of a frequency being sent by the network server.pull/7191/head
parent
ffb0698ce7
commit
27290bb12f
|
@ -666,7 +666,7 @@ void LoRaMac::on_radio_tx_done(lorawan_time_t timestamp)
|
|||
_params.timers.aggregated_last_tx_time = 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)
|
||||
{
|
||||
if (_device_class == CLASS_C && !_continuous_rx2_window_open) {
|
||||
|
|
|
@ -1034,6 +1034,10 @@ uint8_t LoRaPHY::accept_rx_param_setup_req(rx_param_setup_req_t* params)
|
|||
{
|
||||
uint8_t status = 0x07;
|
||||
|
||||
if (lookup_band_for_frequency(params->frequency) < 0) {
|
||||
status &= 0xFE;
|
||||
}
|
||||
|
||||
// Verify radio frequency
|
||||
if (_radio->check_rf_frequency(params->frequency) == false) {
|
||||
status &= 0xFE; // Channel frequency KO
|
||||
|
|
Loading…
Reference in New Issue