View Full Version : setstandardoutputprocess vs piped shell script

14th October 2009, 14:19
i need to read out the signal strength of a modem to my qt program like this:

echo at+csq > /dev/ttyUSB2 | head -n 4 /dev/ttyUSB2

which is the best to use:

Qprocess::setStandardOutputProcess with two Qprocesses, one for "echo at+csq > /dev/ttyUSB2" and one for "head -n 4 /dev/ttyUSB2 " or a single Qprocess that runs a shell script with pipe

Like this


echo at+csq > /dev/ttyUSB2 | head -n 4 /dev/ttyUSB2

15th October 2009, 16:19
Neither of them. If you have a native C++ application, you should not depend on bash. Open the device directly in Qt.

16th October 2009, 13:35
How do i do that?

16th October 2009, 14:16
I think QFile is your friend.