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
Hasnain Virk 2018-06-11 15:44:35 +03:00
parent ffb0698ce7
commit 27290bb12f
2 changed files with 5 additions and 1 deletions

View File

@ -1034,6 +1034,10 @@ uint8_t LoRaPHY::accept_rx_param_setup_req(rx_param_setup_req_t* params)
{ {
uint8_t status = 0x07; uint8_t status = 0x07;
if (lookup_band_for_frequency(params->frequency) < 0) {
status &= 0xFE;
}
// Verify radio frequency // Verify radio frequency
if (_radio->check_rf_frequency(params->frequency) == false) { if (_radio->check_rf_frequency(params->frequency) == false) {
status &= 0xFE; // Channel frequency KO status &= 0xFE; // Channel frequency KO