PDA

View Full Version : Bash to c++/QT



soldstatic
26th June 2006, 20:24
I found this bash script:



#! /bin/sh
# Display output (hex) from a WGL W800RF32A RF receiver
# Significant bytes are bytes 1 and 3, i.e., XX and YY
# in the displayed sequence "XX ~XX YY ~YY"


if [ $# -ne 1 ] ; then
echo "Usage: $0 <serial port>"
exit
fi
echo "Reading W800RF32A on port: "$1
stty -F $1 4800 cs8 raw cread clocal -parenb -cstopb -echo
cat $1 | xxd -g1 -c4



But I need to figure out how to do the same thing in c++ / QT... any ideas???

jacek
26th June 2006, 20:30
You can't do that in pure Qt. If you don't want to use QextSerialPort, see `man termios` for some useful functions.