error in awk script

master
ademant 2020-01-03 12:42:14 +01:00
parent 3c2351b930
commit 80a6b0b4fd
2 changed files with 24 additions and 5 deletions

15
gps_init5.sh Executable file
View File

@ -0,0 +1,15 @@
#!/bin/bash
#sleep 120
script=$(realpath $0)
sp=$(dirname $script )
for i in /dev/ttyACM*; do
if [ $(udevadm info -a -q property --export -n $i|grep GNSS|wc -l) -gt 1 ]; then
TTY=$(echo $i|cut -d/ -f3)
uid=$(echo $(udevadm info --name=${i}|sed -n '/MAJOR/{s/[A-Z: =]*//;p}')*256+$(udevadm info --name=/dev/${TTY}|sed -n '/MINOR/{s/[A-Z: =]*//;p}')|bc)
idp=$(udevadm info -a -q property --export -n $i|grep ID_MODEL_ID|cut -d= -f2|sed -e "s/'//g")
idv=$(udevadm info -a -q property --export -n $i|grep ID_VENDOR_ID|cut -d= -f2|sed -e "s/'//g")
idpath=$(udevadm info -a -q property --export -n $i|grep ID_PATH=|cut -d= -f2|sed -e "s/'//g")
nohup ${sp}/gps_raw5.sh ${TTY} &>/dev/null &
fi
done

View File

@ -11,9 +11,9 @@ pdop=-9}
/RMC/ {
if (valid != "V" ) {
if (length(gsview)>1){
gsview=gsview",\"SAT\":{"gsview"}}"
gsview=gsview",\"SAT\":{"gsat"}}"
}
print gsview
print gsview
}
hdop=-9
height=-9
@ -56,12 +56,16 @@ pdop=-9}
if($i!="")gsview=gsview$i","
}
gsview=gsview"}"
}
/GRS/ {
gsview=gsview",\"GRS\":{"
tgrs=""
for(i=4;i<=15;i++){
if($i!="")gsview=gsview$i","
if($i!="")tgrs=tgrs","
}
gsview=gsview"}"
if(tgrs!=""){
gsview=gsview",\"GRS\":{"tgrs"}"
}
}
/GSV/ { satfield= NF - 4
satcount= int(satfield / 4)
sati=(satcount<(satfield/4)?satcount+1:satcount)