summaryrefslogtreecommitdiff
path: root/recipes-connectivity/lora/lora-packet-forwarder
diff options
context:
space:
mode:
authorEvan Hosseini <evan.hosseini@multitech.com>2018-11-01 09:36:29 -0500
committerEvan Hosseini <evan.hosseini@multitech.com>2018-11-01 09:36:29 -0500
commit4e35f3af861714cda1a209149435af3f5b3e9add (patch)
tree6b0a6198a1cd391e29732943199f094153e6d85e /recipes-connectivity/lora/lora-packet-forwarder
parent4f1474a121b3359b60124e204c977765fe6f212d (diff)
downloadmeta-mlinux-4e35f3af861714cda1a209149435af3f5b3e9add.tar.gz
meta-mlinux-4e35f3af861714cda1a209149435af3f5b3e9add.tar.bz2
meta-mlinux-4e35f3af861714cda1a209149435af3f5b3e9add.zip
lora: Fix for lora-packet-forwarder beacon config
* Need logic to differentiate AU915 from US915 region for beacon RFU fields
Diffstat (limited to 'recipes-connectivity/lora/lora-packet-forwarder')
-rw-r--r--recipes-connectivity/lora/lora-packet-forwarder/lora-packet-forwarder-beacon-rfu-fix.patch40
1 files changed, 40 insertions, 0 deletions
diff --git a/recipes-connectivity/lora/lora-packet-forwarder/lora-packet-forwarder-beacon-rfu-fix.patch b/recipes-connectivity/lora/lora-packet-forwarder/lora-packet-forwarder-beacon-rfu-fix.patch
new file mode 100644
index 0000000..80a7ae1
--- /dev/null
+++ b/recipes-connectivity/lora/lora-packet-forwarder/lora-packet-forwarder-beacon-rfu-fix.patch
@@ -0,0 +1,40 @@
+diff --git a/lora_pkt_fwd/src/lora_pkt_fwd.c b/lora_pkt_fwd/src/lora_pkt_fwd.c
+index 801f28d..2772a8e 100644
+--- a/lora_pkt_fwd/src/lora_pkt_fwd.c
++++ b/lora_pkt_fwd/src/lora_pkt_fwd.c
+@@ -233,6 +233,8 @@ static struct lgw_tx_gain_lut_s txlut; /* TX gain table */
+ static uint32_t tx_freq_min[LGW_RF_CHAIN_NB]; /* lowest frequency supported by TX chain */
+ static uint32_t tx_freq_max[LGW_RF_CHAIN_NB]; /* highest frequency supported by TX chain */
+
++static uint32_t rx_rf_freq[LGW_RF_CHAIN_NB]; /* center frequency of the radio in Hz */
++
+ /* -------------------------------------------------------------------------- */
+ /* --- PRIVATE FUNCTIONS DECLARATION ---------------------------------------- */
+
+@@ -494,7 +496,7 @@ static int parse_SX1301_configuration(const char * conf_file) {
+ MSG("INFO: radio %i disabled\n", i);
+ } else { /* radio enabled, will parse the other parameters */
+ snprintf(param_name, sizeof param_name, "radio_%i.freq", i);
+- rfconf.freq_hz = (uint32_t)json_object_dotget_number(conf_obj, param_name);
++ rfconf.freq_hz = rx_rf_freq[i] = (uint32_t)json_object_dotget_number(conf_obj, param_name);
+ snprintf(param_name, sizeof param_name, "radio_%i.rssi_offset", i);
+ rfconf.rssi_offset = (float)json_object_dotget_number(conf_obj, param_name);
+ snprintf(param_name, sizeof param_name, "radio_%i.type", i);
+@@ -1995,8 +1997,15 @@ void thread_down(void) {
+ break;
+ case 12:
+ beacon_pkt.datarate = DR_LORA_SF12;
+- beacon_RFU1_size = 5;
+- beacon_RFU2_size = 3;
++
++ /* Check radio 0 center frequency to determine if US or AU region */
++ if (rx_rf_freq[0] > 914900000U ) {
++ beacon_RFU1_size = 3;
++ beacon_RFU2_size = 1;
++ } else {
++ beacon_RFU1_size = 5;
++ beacon_RFU2_size = 3;
++ }
+ break;
+ default:
+ /* should not happen */