diff --git a/recipes-connectivity/gnss-init/files/gnss-reset b/recipes-connectivity/gnss-init/files/gnss-reset index 8110de9..249f327 100755 --- a/recipes-connectivity/gnss-init/files/gnss-reset +++ b/recipes-connectivity/gnss-init/files/gnss-reset @@ -26,7 +26,7 @@ START_REASON=/sys/kernel/broker/start-reason GNSS_RST=/sys/class/leds/gnss_rst/brightness ON_VALUE=0 OFF_VALUE=255 -CHECK_TIMEOUT_S=20 +CHECK_TIMEOUT_S=0 export RST_STATE="off" export IS_CHECK=false @@ -45,7 +45,8 @@ function printUsage() echo -e " -h|--help Show this help" echo -e "" echo -e " OPT:" - echo -e " -t|--timeout=TIMEOUT_S Set the check timeout in seconds (default=${CHECK_TIMEOUT_S}s)" + echo -e " -t|--timeout=TIMEOUT_S Set the check timeout in seconds" + echo -e " * 0s = disabled (default)" echo -e "" } @@ -53,12 +54,14 @@ function checkDeviceState() { if [ $(cat $START_REASON | grep reboot | wc -l) == 1 ]; then echo "$SCRIPT_NAME: Reboot, no further check necessary" - else - echo "$SCRIPT_NAME: Power cycle detected, checking usb hub (timeout=${CHECK_TIMEOUT_S}s)" + elif [ $CHECK_TIMEOUT_S != 0 ]; then + echo "$SCRIPT_NAME: Power cycle detected, checking for v2x event on usb-hub (timeout=${CHECK_TIMEOUT_S}s)" timeout $CHECK_TIMEOUT_S bash -c -- 'while true; do dmesg | grep "usb 1-1.*USB disconnect"; if [ $? == 0 ]; then break; fi; done' if [ $? == 124 ]; then echo "$SCRIPT_NAME: timed out - no reset of v2x module detected" fi + else + echo "$SCRIPT_NAME: Power cycle detected (disabled v2x event check)" fi }