Qt embedded console commands request and reply
I'm using Qt embedded on linux.
From the console (serial console) I use the following command to get status on my ppp:
The ppp will reply with "pppd running" or "pppd not running"
I would like to execute this request from my Qt application and read the reply from my Qt application.
How can I do this?
So I execute the command with a QProcess for example:
which is creating the desired effect.
Now how do I read the response?
Blizzard last edited by
@qpCommand.readData(char * data, qint64 maxlen)@
But readData is a protected function?
goetz last edited by
QProcess::execute() is a static method. It does not return any output of the started command/executable. You will have to use the non-static methods in order to ready any data.
p.waitForFinished(); // blocks!
QByteArray output = p.readAllStandardOutput();