mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
* pandora_arduino.c: Added microcode for arduino. * AUTHORS: Added Jorge to autors, was missing. * pandora_serialread: Added sleep to improve serial read. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@710 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
27 lines
507 B
Bash
Executable File
27 lines
507 B
Bash
Executable File
#!/bin/sh
|
|
# (c) Jorge Loza, Sancho Lerena 2007-2008
|
|
# Licensed under GPL2 Terms
|
|
# Pandora FMS - http://pandora.sf.net
|
|
|
|
TMPFILE=/tmp/pandora_async.tmp
|
|
SERIALPORT=/dev/usb/tts/0
|
|
|
|
variable=0
|
|
rm $TMPFILE 2> /dev/null
|
|
|
|
# Fork and let a process reading from serialport
|
|
cat < $SERIALPORT > $TMPFILE &
|
|
sleep 1
|
|
|
|
# Send gate read request to SERIALPORT
|
|
echo $1 > $SERIALPORT
|
|
|
|
until test -s $TMPFILE || test $variable -ge 200
|
|
do
|
|
variable=$(($variable + 1))
|
|
done
|
|
sleep 1
|
|
cat $TMPFILE | head -1
|
|
|
|
kill -0 $! && kill $!
|