From 2df6441ec31b032f3e003dbadde2d0189ab0ce4f Mon Sep 17 00:00:00 2001 From: trotFunky Date: Thu, 11 Jan 2018 16:25:23 +0100 Subject: [PATCH] Prise en comtpe de la fin de transmission Proprification de la boucle infinie --- Perso/serialToCSV.sh | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/Perso/serialToCSV.sh b/Perso/serialToCSV.sh index 93e9790..97f99c6 100755 --- a/Perso/serialToCSV.sh +++ b/Perso/serialToCSV.sh @@ -1,8 +1,7 @@ #! /bin/bash -trap "boucle=false ; python3 /home/trotfunky/Programmation/Git/Python/extraction_asserv.py $1 $2 $3 ; exit" INT -trap "boucle=false ; python3 /home/trotfunky/Programmation/Git/Python/extraction_asserv.py $1 $2 $3 ; exit" TERM -boucle=true +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 @@ -15,7 +14,13 @@ fi rm -f $fileName touch $fileName -while $boucle; do +while true; do read line < /dev/ttyACM0 echo $line >> $fileName -done \ No newline at end of file + case "$line" in + *"DATAEND"*) + break;; + esac +done + +python3 /home/trotfunky/Programmation/Git/Python/extraction_asserv.py $1 $2 $3 \ No newline at end of file