1
0
Fork 0
Scripts/Perso/serialToCSV.sh
trotFunky 2df6441ec3 Prise en comtpe de la fin de transmission
Proprification de la boucle infinie
2020-05-17 14:26:09 +01:00

26 lines
No EOL
637 B
Bash
Executable file

#! /bin/bash
trap "python3 /home/trotfunky/Programmation/Git/Python/extraction_asserv.py $1 $2 $3 ; exit" INT
trap "python3 /home/trotfunky/Programmation/Git/Python/extraction_asserv.py $1 $2 $3 ; exit" TERM
stty -F /dev/ttyACM0 115200 raw -echo -echoe -echok
if [ $# -eq 3 ]; then
fileName="./serialOutput/serialOutput-"$1","$2","$3".csv"
else
fileName="./serialOutput/serialOutput.csv"
fi
rm -f $fileName
touch $fileName
while true; do
read line < /dev/ttyACM0
echo $line >> $fileName
case "$line" in
*"DATAEND"*)
break;;
esac
done
python3 /home/trotfunky/Programmation/Git/Python/extraction_asserv.py $1 $2 $3