summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lora_pkt_fwd/src/lora_pkt_fwd.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/lora_pkt_fwd/src/lora_pkt_fwd.c b/lora_pkt_fwd/src/lora_pkt_fwd.c
index 145b717..eba3c48 100644
--- a/lora_pkt_fwd/src/lora_pkt_fwd.c
+++ b/lora_pkt_fwd/src/lora_pkt_fwd.c
@@ -2703,19 +2703,19 @@ void thread_down(void) {
last_beacon_gps_time.tv_sec = 0;
last_beacon_gps_time.tv_nsec = 0;
- /* beacon packet parameters */
- beacon_pkt.tx_mode = ON_GPS; /* send on PPS pulse */
- beacon_pkt.rf_chain = 0; /* antenna A */
- beacon_pkt.rf_power = beacon_power - antenna_gain;
- beacon_pkt.dig_gain = -1;
-
if (max_tx_power != -99) {
if (beacon_power > max_tx_power) {
MSG("INFO: [beacon] tx power reduced tx power: % dBm attn gain: %d dBi\n", max_tx_power, antenna_gain);
- beacon_power = max_tx_power - antenna_gain;
+ beacon_power = max_tx_power;
}
}
+ /* beacon packet parameters */
+ beacon_pkt.tx_mode = ON_GPS; /* send on PPS pulse */
+ beacon_pkt.rf_chain = 0; /* antenna A */
+ beacon_pkt.rf_power = beacon_power - antenna_gain;
+ beacon_pkt.dig_gain = -1;
+
if (temp_comp_enabled) {
float pwr = beacon_power;
/* look for power index and DIG gain for current temperature */
@@ -3195,13 +3195,14 @@ void thread_down(void) {
/* parse TX power (optional field) */
val = json_object_get_value(txpk_obj,"powe");
if (val != NULL) {
- pwr = json_value_get_number(val) - antenna_gain;
+ pwr = (int8_t)json_value_get_number(val);
if (max_tx_power != -99) {
- if (pwr > max_tx_power - antenna_gain) {
+ if (pwr > max_tx_power) {
MSG("INFO: [down] tx power reduced tx power: % dBm attn gain: %d dBi\n", max_tx_power, antenna_gain);
- pwr = max_tx_power - antenna_gain;
+ pwr = max_tx_power;
}
}
+ pwr = pwr - antenna_gain;
}
if (temp_comp_enabled) {