diff options
-rw-r--r-- | lora_pkt_fwd/src/lora_pkt_fwd.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lora_pkt_fwd/src/lora_pkt_fwd.c b/lora_pkt_fwd/src/lora_pkt_fwd.c index 8fbbd7b..5cfd28a 100644 --- a/lora_pkt_fwd/src/lora_pkt_fwd.c +++ b/lora_pkt_fwd/src/lora_pkt_fwd.c @@ -513,6 +513,14 @@ static int parse_SX1301_configuration(const char * conf_file) { return -1; } + val = json_object_get_value(conf_obj, "max_tx_power"); /* fetch value (if possible) */ + if (json_value_get_type(val) == JSONNumber && (uint8_t)json_value_get_number(val) <= 32) { + boardconf.max_tx_power = (uint8_t)json_value_get_number(val); + } else { + MSG("WARNING: Data for max_tx_power is invalid, must be an integer (0-32)\n"); + boardconf.max_tx_power = 32; + } + /* set LBT configuration */ memset(&lbtconf, 0, sizeof lbtconf); /* initialize configuration structure */ conf_lbt_obj = json_object_get_object(conf_obj, "lbt_cfg"); /* fetch value (if possible) */ |