diff options
author | Jason Reiss <jreiss@multitech.com> | 2020-12-07 12:53:02 -0600 |
---|---|---|
committer | Jason Reiss <jreiss@multitech.com> | 2020-12-07 12:53:02 -0600 |
commit | e124777c147b95fbac9a64a99a14adc3e758f987 (patch) | |
tree | 7b5b00c18c69d7c82863dc87ba60de3f99f5a995 /lora_pkt_fwd | |
parent | 51a29e60bf52f9e14a37aba35b847b248343cc86 (diff) | |
download | packet_forwarder_mtac_full-e124777c147b95fbac9a64a99a14adc3e758f987.tar.gz packet_forwarder_mtac_full-e124777c147b95fbac9a64a99a14adc3e758f987.tar.bz2 packet_forwarder_mtac_full-e124777c147b95fbac9a64a99a14adc3e758f987.zip |
Apply max power limit to beacon power, reduced by antenna gain4.0.1-mts-11
Diffstat (limited to 'lora_pkt_fwd')
-rw-r--r-- | lora_pkt_fwd/src/lora_pkt_fwd.c | 10 |
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: |