Skip to content

Instantly share code, notes, and snippets.

@cnlpete
Created January 17, 2011 23:33
Show Gist options
  • Save cnlpete/783700 to your computer and use it in GitHub Desktop.
Save cnlpete/783700 to your computer and use it in GitHub Desktop.
rgm-get ... used for getting info from my device and reading nmea and gpx simultaniously .... also supports reading ranges (17-22)
#!/bin/bash
DEVICE=/dev/ttyUSB0
NUMBER=$1
VAR=`echo $NUMBER | grep -o - | wc -l`
if [ "$VAR" == "1" ]
then
#list
POS=`expr index "$NUMBER" -`
FIRST=${NUMBER:0:$POS-1}
REST=${NUMBER:$POS}
else
#no list
FIRST=$NUMBER
REST=$NUMBER
fi
echo "from $FIRST to $REST do..."
i=$FIRST
while [ $i -le $REST ]
do
echo $i
NAME=`rgm3800-rev25.py -d $DEVICE list $i | grep -o ....-..-..`
FILE=$NAME-$i
rgm3800-rev25.py -d $DEVICE track $i > $FILE.nmea
rgm3800-rev25.py -d $DEVICE trackx $i > $FILE.gpx
i=$(( $i + 1 ))
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment