summaryrefslogtreecommitdiff
path: root/recipes-connectivity/lora/lora-packet-forwarder
diff options
context:
space:
mode:
authorHarsh Sharma <92harshsharma@gmail.com>2018-05-16 14:30:24 -0500
committerHarsh Sharma <92harshsharma@gmail.com>2018-05-16 14:30:24 -0500
commitae61842801a5ec82b73c207459193da18bff281a (patch)
treef13fe75f76e8908499645765bcacbc7e9aa7a7a0 /recipes-connectivity/lora/lora-packet-forwarder
parent628eb0cecde96a3d04e0a1e16f04a2a04c340088 (diff)
downloadmeta-mlinux-ae61842801a5ec82b73c207459193da18bff281a.tar.gz
meta-mlinux-ae61842801a5ec82b73c207459193da18bff281a.tar.bz2
meta-mlinux-ae61842801a5ec82b73c207459193da18bff281a.zip
Updated packet forwarder script
Diffstat (limited to 'recipes-connectivity/lora/lora-packet-forwarder')
-rwxr-xr-xrecipes-connectivity/lora/lora-packet-forwarder/lora-packet-forwarder.init38
1 files changed, 22 insertions, 16 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 a671b7d..688acd9 100755
--- a/recipes-connectivity/lora/lora-packet-forwarder/lora-packet-forwarder.init
+++ b/recipes-connectivity/lora/lora-packet-forwarder/lora-packet-forwarder.init
@@ -23,16 +23,19 @@ port2=/sys/devices/platform/mts-io/ap2
lora_mtac_id="MTAC-LORA"
lora_1_0_hw="MTAC-LORA-1.0"
lora_1_5_h_hw="MTAC-LORA-1.5"
-lora_2_1_hw="MTCDTIPHP-LORA-2.1"
+lora_2_1_hw="MTAC-LORA-2.1"
lora_mtcap_id="MTCAP-LORA"
lora_mtcap_id868="MTCAP-LORA-868"
lora_mtcap_id915="MTCAP-LORA-915"
-lora_mtcdt_id868="MTCDTIPHP-LORA-868"
-lora_mtcdt_id915="MTCDTIPHP-LORA-915"
+lora_mtac_g_id="MTAC-LORA-G"
+lora_mtac_g16_id868="MTAC-LORA-G16-868"
+lora_mtac_g16_id915="MTAC-LORA-G16-915"
+lora_mtac_g64_id868="MTAC-LORA-G64-868"
+lora_mtac_g64_id915="MTAC-LORA-G64-915"
-pkf_options=""
+pkt_fwd_options=""
gps_path="/dev/gps0"
@@ -44,12 +47,12 @@ read_lora_hw_info() {
}
hardware_found() {
- if [[ "$lora_id" =~ "$lora_mtac_id" ]]; then
- setup_mtcdt
+ if [[ "$lora_id" =~ "$lora_mtac_g_id" ]]; then
+ setup_mtcdt_2_1
elif [[ "$lora_id" =~ "$lora_mtcap_id" ]]; then
setup_mtcap
- elif [[ "$lora_hw" =~ "$lora_2_1_hw" ]]; then
- setup_mtcdt_2_1
+ elif [[ "$lora_id" =~ "$lora_mtac_id" ]]; then
+ setup_mtcdt
else
return 1
fi
@@ -95,13 +98,16 @@ setup_mtcap() {
}
setup_mtcdt_2_1() {
- if [[ "$lora_id" =~ "$lora_mtcdt_id868" ]]; then
- CONFIG=/opt/lora/global_conf.json.MTAC_LORA_2_1_loc_single_antenna_16ch_EU868
- elif [[ "$lora_id" =~ "$lora_mtcdt_id915" ]]; then
- CONFIG=/opt/lora/global_conf.json.MTAC_LORA_2_1_loc_single_antenna_16ch_US915
+ if [[ "$lora_id" = "$lora_mtac_g16_id868" ]]; then
+ GLOBAL_CONF=/opt/lora/global_conf.json.MTAC_LORA_2_1_loc_single_antenna_16ch_EU868
+ elif [[ "$lora_id" = "$lora_mtac_g16_id915" ]]; then
+ GLOBAL_CONF=/opt/lora/global_conf.json.MTAC_LORA_2_1_loc_single_antenna_16ch_US915
+ elif [[ "$lora_id" = "$lora_mtac_g16_id868" ]]; then
+ GLOBAL_CONF=/opt/lora/global_conf.json.MTAC_LORA_2_1_test_single_antenna_64ch_8x8_EU868
+ elif [[ "$lora_id" = "$lora_mtac_g64_id915" ]]; then
+ GLOBAL_CONF=/opt/lora/global_conf.json.MTAC_LORA_2_1_loc_single_antenna_64ch_US915
else
- echo "No valid configuration found for mtcdt 2.1, exiting."
- exit 1
+ return 1
fi
opt_conf_file=$opt_conf_dir/global_conf.json
@@ -117,7 +123,7 @@ setup_mtcdt_2_1() {
ln -sf /opt/lora/pkt_forwarder $pkt_fwd
if [ -f $gps_path ]; then
- pkf_options=" -g"
+ pkt_fwd_options=" -g"
fi
}
@@ -154,7 +160,7 @@ do_start() {
echo -n "Starting $NAME: "
/usr/sbin/start-stop-daemon --chdir $run_dir/1 --background --start --make-pidfile \
- --pidfile $pkt_fwd_pidfile --startas /bin/bash -- -c "exec $pkt_fwd $pkf_options"
+ --pidfile $pkt_fwd_pidfile --startas /bin/bash -- -c "exec $pkt_fwd $pkt_fwd_options"
renice -n -20 -p $(pgrep $(basename $pkt_fwd))