diff options
author | Jason Reiss <jreiss@multitech.com> | 2020-03-12 12:41:38 -0500 |
---|---|---|
committer | Jason Reiss <jreiss@multitech.com> | 2020-03-12 12:41:38 -0500 |
commit | d47e6d997a114e5b2899bd3d4a0359843dd211d2 (patch) | |
tree | 24f149cc19a84d2bf92164ebd5397efac8c5ce15 /recipes-connectivity/lora/lora-packet-forwarder/lora-packet-forwarder.init | |
parent | 4f6244cf5d3310724cc0d1cbff8b864055332af2 (diff) | |
download | meta-mlinux-d47e6d997a114e5b2899bd3d4a0359843dd211d2.tar.gz meta-mlinux-d47e6d997a114e5b2899bd3d4a0359843dd211d2.tar.bz2 meta-mlinux-d47e6d997a114e5b2899bd3d4a0359843dd211d2.zip |
lora: add MTCAP2 global_conf files, adjust init scripts to detect MTCAP2
Diffstat (limited to 'recipes-connectivity/lora/lora-packet-forwarder/lora-packet-forwarder.init')
-rwxr-xr-x | recipes-connectivity/lora/lora-packet-forwarder/lora-packet-forwarder.init | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/recipes-connectivity/lora/lora-packet-forwarder/lora-packet-forwarder.init b/recipes-connectivity/lora/lora-packet-forwarder/lora-packet-forwarder.init index 1ac5bda..5821e1e 100755 --- a/recipes-connectivity/lora/lora-packet-forwarder/lora-packet-forwarder.init +++ b/recipes-connectivity/lora/lora-packet-forwarder/lora-packet-forwarder.init @@ -107,13 +107,22 @@ setup_mtcdt() { } setup_mtcap() { + hw=$(mts-io-sysfs show hw-version 2> /dev/null) + if [ "$lora_id" = "$lora_mtcap_id868" ]; then - GLOBAL_CONF=/opt/lora/global_conf.json.MTCAP_LORA_1_5.EU868 + if [ "$hw" = "MTCAP-0.2" ]; then + GLOBAL_CONF=/opt/lora/global_conf.json.MTCAP2_LORA_1_5.EU868 + else + GLOBAL_CONF=/opt/lora/global_conf.json.MTCAP_LORA_1_5.EU868 + fi elif [ "$lora_id" = "$lora_mtcap_id915" ]; then - GLOBAL_CONF=/opt/lora/global_conf.json.MTCAP_LORA_1_5.US915 + if [ "$hw" = "MTCAP-0.2" ]; then + GLOBAL_CONF=/opt/lora/global_conf.json.MTCAP2_LORA_1_5.US915 + else + GLOBAL_CONF=/opt/lora/global_conf.json.MTCAP_LORA_1_5.US915 + fi else - echo "No valid configuration found for mtcap exiting." - exit 1 + return 1 fi opt_conf_file=$opt_conf_dir/global_conf.json |