summaryrefslogtreecommitdiff
path: root/lora_pkt_fwd
diff options
context:
space:
mode:
authorJason Reiss <jreiss@multitech.com>2020-12-07 12:53:02 -0600
committerJason Reiss <jreiss@multitech.com>2020-12-07 12:53:02 -0600
commite124777c147b95fbac9a64a99a14adc3e758f987 (patch)
tree7b5b00c18c69d7c82863dc87ba60de3f99f5a995 /lora_pkt_fwd
parent51a29e60bf52f9e14a37aba35b847b248343cc86 (diff)
downloadpacket_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.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: