summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Klug <john.klug@multitech.com>2021-01-25 03:36:13 -0600
committerJohn Klug <john.klug@multitech.com>2021-06-22 09:10:41 -0500
commite92ec5954fbc59f194d45df943e4675f7f71ccbc (patch)
tree7bad5f3a93ef5f4d4d0dbdba595a9d86a97b238f
parent0dde332c945bcb0d04ed116a01ca61687166ee26 (diff)
downloadmeta-mlinux-e92ec5954fbc59f194d45df943e4675f7f71ccbc.tar.gz
meta-mlinux-e92ec5954fbc59f194d45df943e4675f7f71ccbc.tar.bz2
meta-mlinux-e92ec5954fbc59f194d45df943e4675f7f71ccbc.zip
If gpsctl is successful the first time, quit
-rwxr-xr-x[-rw-r--r--]recipes-navigation/gpsd/gpsd/gpsd-default15
-rw-r--r--recipes-navigation/gpsd/gpsd_3.20.bb2
2 files changed, 13 insertions, 4 deletions
diff --git a/recipes-navigation/gpsd/gpsd/gpsd-default b/recipes-navigation/gpsd/gpsd/gpsd-default
index 9bc1eef..b4bf11b 100644..100755
--- a/recipes-navigation/gpsd/gpsd/gpsd-default
+++ b/recipes-navigation/gpsd/gpsd/gpsd-default
@@ -79,13 +79,22 @@ if [[ $(cat /run/config/gpstype) == u-blox ]] ; then
fi
# Set the baud rate. Works better with ntp at a higher baud rate.
- if ! gpsctl -T 20 -t 'u-blox' -s $GPS_BAUD -b -f $GPS_LINE ; then
+ gpsctlout=$(gpsctl -T 20 -t 'u-blox' -s $GPS_BAUD -b -f $GPS_LINE 2>&1)
+ result=$?
+ if [[ $gpsctlout =~ u-blox[[:space:]]at[[:space:]]115200[[:space:]]baud ]] ; then
+ break
+ fi
+
+ if ((result != 0)) ; then
+ echo $gpsctlout
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
+ gpsctlout=$(gpsctl -T 2 -f $GPS_LINE 2>&1)
+ if [[ $gpsctlout =~ u-blox[[:space:]]at[[:space:]]115200[[:space:]]baud ]] ; then
+ break
+ fi
stty -F $GPS_LINE $GPS_BAUD
fi
speed=$(stty -F $GPS_LINE speed 2>&1)
diff --git a/recipes-navigation/gpsd/gpsd_3.20.bb b/recipes-navigation/gpsd/gpsd_3.20.bb
index e177884..b6a3773 100644
--- a/recipes-navigation/gpsd/gpsd_3.20.bb
+++ b/recipes-navigation/gpsd/gpsd_3.20.bb
@@ -4,7 +4,7 @@ LICENSE = "BSD"
LIC_FILES_CHKSUM = "file://COPYING;md5=01764c35ae34d9521944bb6ab312af53"
DEPENDS = "dbus dbus-glib ncurses python3 libusb1 chrpath-replacement-native pps-tools"
PROVIDES = "virtual/gpsd"
-PR="m2"
+PR="m3"
EXTRANATIVEPATH += "chrpath-native"