Ethernet communication (RPI and PC) in Qt
-
Hi there, this is Jessie.
I m working on a Qt project that involves Ethernet communication between Raspberry Pi and windows PC. Here Raspberry pi is working as a server and as soon as i establish connection is established raspberry pi should send stream of bytes to the client(PC). I have successfully done Server-Client part from normal C code on Rpi console and windows console But i am not able to do the same through QT GUI app (not a console app).
I have gone through fortunclient/server examples but don't understand them, also followed questions related to this topic on this forum but there seems to be no satisfactory answer. please help!, my knowledge is limited up-to making GUI's, this is new concept for me.
note: i am cross compiling from Ubuntu to my Rpi.
Best regards,
Jessie. -
Comming from C you should read about object oriented concepts in c++.
After this you can start with the qt´s signal slot concept.
https://doc.qt.io/qt-5/signalsandslots.html
Then you should be able to use the QTcpServer
https://doc.qt.io/qt-5/qtcpserver.html#details -
@bublee_jessie
follow the link at bogotobogo and incorporate it in your GUI. -
@sneubert
I have followed the documents you have suggested.
@vishbynature
thanks for the link now I also have the same question as you how can we make server listen to only one address. -
@bublee_jessie said in Ethernet communication (RPI and PC) in Qt:
how can we make server listen to only one address
What do you mean? Do you want your server to only accept connections from one specific client IP?
-
@bublee_jessie And what is the problem? On the server side check the client IP which is trying to connect and only accept connection if correct IP and not connected yet.