For days, I had been working on how to establish communication between BBB and my Windows PC through Ethernet, I had little experience programming a PC side software, after scratching my head and surfing through the Internet, I pick up Qt for its rich resources. I planed to have a thread in Qt to wait for incoming data from BBB, but I realized the way Qt uses a terminology called "signal and slot"; a simple way to put this is "a incoming signal trigger the slot to do a task".
Here is the example of how Qt link incoming Ethernet signal to a function, "readyRead" is the incoming signal while rxPacket is the function to process the UDP packet when triggered.
connect(udpSocket, SIGNAL(readyRead()), this, SLOT(rxPacket()));
Below is the snap of my Qt data acquisition interface, I will explain the functions of program later.
沒有留言:
張貼留言