summaryrefslogtreecommitdiff
path: root/recipes-bsp/multitech/get-eeprom-device-info
diff options
context:
space:
mode:
authorJohn Klug <john.klug@multitech.com>2017-12-07 13:44:20 -0600
committerJohn Klug <john.klug@multitech.com>2017-12-07 14:14:18 -0600
commit4186e178a17013588e40ef47213d8678025f0618 (patch)
treeb6ffd225bc7a884605d4db4fa603cb540ff60b4c /recipes-bsp/multitech/get-eeprom-device-info
parent1cb0f1bccbd0accb2fadae1cf04e285e0f8cb629 (diff)
downloadmeta-multitech-4186e178a17013588e40ef47213d8678025f0618.tar.gz
meta-multitech-4186e178a17013588e40ef47213d8678025f0618.tar.bz2
meta-multitech-4186e178a17013588e40ef47213d8678025f0618.zip
Add radio trial parameter for get-eeprom-device-info.sh
Diffstat (limited to 'recipes-bsp/multitech/get-eeprom-device-info')
-rwxr-xr-xrecipes-bsp/multitech/get-eeprom-device-info/get-eeprom-device-info.sh32
1 files changed, 30 insertions, 2 deletions
diff --git a/recipes-bsp/multitech/get-eeprom-device-info/get-eeprom-device-info.sh b/recipes-bsp/multitech/get-eeprom-device-info/get-eeprom-device-info.sh
index e67a53f..b84b360 100755
--- a/recipes-bsp/multitech/get-eeprom-device-info/get-eeprom-device-info.sh
+++ b/recipes-bsp/multitech/get-eeprom-device-info/get-eeprom-device-info.sh
@@ -1,4 +1,6 @@
#!/bin/bash
+# Radio ID loop count
+TRY_COUNT=30
CONFIG_PATH=/var/run/config
@@ -28,6 +30,14 @@ TEMP_AC_JSON="$TEMP_AC_PATH/ac_data.json"
# Number of accessory card places - size of array
AC_CARD_COUNT=4
+function usage {
+ echo 'get-eeprom-device-info [-t TRY_COUNT]'
+ echo ' Where TRY_COUNT is the number of half'
+ echo ' second waits for the cellular radio'
+ echo ' to be ready for identification'
+ exit 1
+}
+
# Reads accessory cards data
# WARNING: Make sure function called after CAPABILITIY_* variables is set with initial values.
ReadAcData() {
@@ -109,6 +119,23 @@ isNativeLoraPresent() {
fi
}
+TEMP=$(getopt -o t: -n 'get-eeprom-device-info' -- "$@")
+eval set -- "$TEMP"
+# extract options and their arguments into variables.
+while true ; do
+ case "$1" in
+ -t)
+ case "$2" in
+ "") usage ;;
+ *) TRY_COUNT=$2 ; shift 2 ;;
+ esac ;;
+ --) shift ; break ;;
+ *) echo "usage" ;;
+ esac
+done
+
+echo TRY_COUNT IS $TRY_COUNT
+
# Read device information from eeprom device
mts-id-eeprom --in-file /sys/bus/i2c/devices/i2c-0/0-0056/eeprom > ${CONFIG_PATH}/device_info
@@ -170,7 +197,6 @@ fi
done <${CONFIG_PATH}/device_info
-TRY_COUNT=30
echo "Finding cellular module..."
for ((i=0; i < TRY_COUNT; i++))
do
@@ -180,7 +206,9 @@ for ((i=0; i < TRY_COUNT; i++))
CAPABILITY_CELL="true"
break
fi
- sleep 0.5
+ if ((TRY_COUNT > 1)) ; then
+ sleep 0.5
+ fi
done
if isNativeLoraPresent; then