summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Klug <john.klug@multitech.com>2017-12-07 13:44:20 -0600
committerJohn Klug <john.klug@multitech.com>2018-03-01 12:22:24 -0600
commit2a2a9d07c8f19b25cca1bb29c6589a9316761c4a (patch)
tree32ca0d34ec39e77d545b88d4a07b7b5b5cbbdf85
parent718ec50ea66d0720e3e3b2ade5632f04c0f84122 (diff)
downloadmeta-multitech-2a2a9d07c8f19b25cca1bb29c6589a9316761c4a.tar.gz
meta-multitech-2a2a9d07c8f19b25cca1bb29c6589a9316761c4a.tar.bz2
meta-multitech-2a2a9d07c8f19b25cca1bb29c6589a9316761c4a.zip
Add radio trial parameter for get-eeprom-device-info.sh
-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