summaryrefslogtreecommitdiff
path: root/recipes-navigation/gpsd
diff options
context:
space:
mode:
authorJohn Klug <john.klug@multitech.com>2017-05-09 09:10:45 -0500
committerJohn Klug <john.klug@multitech.com>2017-05-09 09:10:45 -0500
commitf1ddd1ccc8c9d060f6f0ac79622695ecd7486380 (patch)
treefae49ada62d1fdcc1d15dd14ce8bb037bb0d4e66 /recipes-navigation/gpsd
parent038660f103660ddbcf6cd638d10ecc457224efea (diff)
downloadmeta-mlinux-f1ddd1ccc8c9d060f6f0ac79622695ecd7486380.tar.gz
meta-mlinux-f1ddd1ccc8c9d060f6f0ac79622695ecd7486380.tar.bz2
meta-mlinux-f1ddd1ccc8c9d060f6f0ac79622695ecd7486380.zip
Allow a maximum of 20 seconds to set the baud rate. Normally this takes ten seconds.
Diffstat (limited to 'recipes-navigation/gpsd')
-rwxr-xr-xrecipes-navigation/gpsd/gpsd/gpsd15
1 files changed, 9 insertions, 6 deletions
diff --git a/recipes-navigation/gpsd/gpsd/gpsd b/recipes-navigation/gpsd/gpsd/gpsd
index fcee788..d544ff5 100755
--- a/recipes-navigation/gpsd/gpsd/gpsd
+++ b/recipes-navigation/gpsd/gpsd/gpsd
@@ -63,12 +63,15 @@ do_start()
# 1 if daemon was already running
# 2 if daemon could not be started
# Set the baud rate. Works better with ntp at a higher baud rate.
- gpsctl -t 'u-blox' -s $GPS_BAUD -b -f $GPS_LINE
- # The next line is needed due to a bug in gpsctl.
- # We will go back to the default baud rate if we don't do this step.
- echo Expect a timeout error here. Need this error.
- gpsctl -T 2 -f $GPS_LINE
- stty -F $GPS_LINE $GPS_BAUD
+ if ! gpsctl -T 20 -t 'u-blox' -s $GPS_BAUD -b -f $GPS_LINE ; then
+ echo 'WARNING: Unable to set GPS serial port speed.'
+ else
+ # The next line is needed due to a bug in gpsctl.
+ # We will go back to the default baud rate if we don't do this step.
+ echo Expect a timeout error here. Need this error.
+ gpsctl -T 2 -f $GPS_LINE
+ stty -F $GPS_LINE $GPS_BAUD
+ fi
/usr/sbin/start-stop-daemon -N -20 --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \
$GPSD_OPTIONS -P $PIDFILE $GPS_DEVICES \
|| return 2