QT wiringpi serial communication
-
Hi,
i want to use wiringpi for serial communication with qt. i need to read the incoming data continuously. I have read slot and signals but i could not write any working code. Sending data is more easy but i have problem with reading data. I have tried to write first connection like this;connect(sender, SIGNAL(destroyed()), this, SLOT(objectDestroyed()));
but it doesnt work.
-
Is there any reason you cannot use the Qt serial library ?
http://doc.qt.io/qt-5/qtserialport-index.html
http://doc.qt.io/qt-5/qtserialport-terminal-example.htmlIt would provide for reading incoming data continuously very easy.
The terminal program sample will read and show any incoming data.
-
ok.
The wiringpi don't use signal and slot so you cannot connect that way.
You should use it like any C/C++ library.But you could use a Qtimer + a slot and call
int serialDataAvail (int fd) ; to check if anything to read and then call
int serialGetchar (int fd) ;
to get the input.http://stackoverflow.com/questions/17784409/linking-a-function-to-a-timer-with-qt