I am receiving data from FPGA via PCIe in a Qt application using low-level C run-time APIs like _open and _read. some packets are sent to FPGA , some processes are done and the output is received in the program. The thing is if parameters are set to wrong values, there will be no output from the FPGA and _read function does not return and the code is stuck at this function. Is there any way that I could make _read return, for example after some time or immediately if there was no output? I'm using these functions like it was explained in http://xillybus.com/downloads/doc/xilly ... indows.pdf .
What I'm basically doing is like the following code:
int fdRead = open("\\\\.\\xillybus_read1", O_RDONLY | _O_BINARY);
while(!stop)
readBytes = _read(fdRead, buffer, readSize);
How can I prevent blocking in _read function? Any help would be appreciated, thanks.