Last edit: Peter Favrholdt on July 2, 2006 18:08 (4043 days, 18 hours and 38 minutes ago) (diff)
Rtai.Dk | RecentChanges | Preferences | DIAPM RTAI
From the mailinglist on how to use QT and realtime fifos:
you cannot mix blocking I/O with Qt's own event handling system. The
followind code skeletton shows how you can react on incoming data on a
RT FIFO using Qt's QSocketNotifier class:
1. int K2UDataFifo = open("/dev/rtfX", O_RDONLY | O_NONBLOCK);
2. QSocketNotifier *Data = new QSocketNotifier(K2UDataFifo,
3. QObject::connect(Data, SIGNAL(activated(int)),
At programm termination:
Your read-handler-slot which will be called every time new data is
read(K2UDataFifo, &YourDataStructure, sizeof(YourDataStructure));
//process your data, ...
That is all. For writing data from user to kernel, just use write() as
you would do from any user space application.