summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lora_pkt_fwd/src/lora_pkt_fwd.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/lora_pkt_fwd/src/lora_pkt_fwd.c b/lora_pkt_fwd/src/lora_pkt_fwd.c
index 7ced41e..c75624f 100644
--- a/lora_pkt_fwd/src/lora_pkt_fwd.c
+++ b/lora_pkt_fwd/src/lora_pkt_fwd.c
@@ -2507,7 +2507,15 @@ void thread_down(void) {
/* 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;
+ beacon_pkt.rf_power = beacon_power - antenna_gain;
+
+ if (max_tx_power != -99) {
+ if (txpkt.rf_power > max_tx_power - antenna_gain) {
+ MSG("INFO: [beacon] tx power reduced tx power: % dBm attn gain: %d dBi\n", max_tx_power, antenna_gain);
+ beacon_pkt.rf_power = max_tx_power - antenna_gain;
+ }
+ }
+
beacon_pkt.modulation = MOD_LORA;
switch (beacon_bw_hz) {
case 125000: