If I open a serial port in blocking mode
fd1 = open (“/com/0”, (O_RDWR|O_DMA));
and then later use tcgetbuffers I always get error no. 88 which is ENOSYS(function not supported) as
while(1)
{
retbuf = tcgetbuffers(fd1, &bufs);
if (retbuf < 0)
{
printf("Error no.= %d
", getErrno());
tx_thread_sleep(100);
continue;
}
}
Can tcgetbuffers not be used with blocking operations?
Since you are using a while() loop anyway, you could just wait calling tx_thread_sleep(1) repeatedly until tcgetbuffers() returns that there is data (bufs.rxbuf>0).