drivers: lora: shell: fix invalid range in config bw param

'bw' parameter in 'lora config' command has a range of 0 to INT8_MAX.
However possible values of 'bw' (125, 250, 500) don't fit this range
and we need to extend it to 0 to INT16_MAX.

This fix has been tested on custom board with STM32L4 and SX1276.

Signed-off-by: Petr Sharshavin <sharshavin@mail.ru>
This commit is contained in:
Petr Sharshavin 2022-02-28 17:43:53 +07:00 committed by Fabio Baltieri
parent 8959b838bf
commit 2489416ec2

View file

@ -161,7 +161,7 @@ static int lora_conf_set(const struct shell *sh, const char *param,
modem_config.tx_power = lval;
} else if (!strcmp("bw", param)) {
if (parse_long_range(&lval, sh, value,
"bw", 0, INT8_MAX) < 0) {
"bw", 0, INT16_MAX) < 0) {
return -EINVAL;
}
switch (lval) {