View Full Version : Bash to c++/QT

26th June 2006, 21: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>"
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???

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