Qt 6.11 is out! See what's new in the release
blog
Qt embedded console commands request and reply
General and Desktop
5
Posts
3
Posters
4.1k
Views
1
Watching
-
I'm using Qt embedded on linux.
From the console (serial console) I use the following command to get status on my ppp:/etc/rc.d/S09pppd status
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?
-
@qpCommand.readData(char * data, qint64 maxlen)@
-
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.
@
QProcess p;
p.start("/etc/rc.d/S09pppd status");
p.waitForFinished(); // blocks!
QByteArray output = p.readAllStandardOutput();
@