Sunday 15 August 2010

c - write() with ttyS is non block -


My question is - how can you write calls to UCLink 2.6.21 synchronous, i.e. the end of sending the call Did not complete? Now I have the following code:

  // ... fd = open (PORT, O_RDWR | O_SYNC) // ... FIO3CLR | = 0x30000000; // RTS = 0 (enable transfer) (FD, "A", 1) // Pass FIO3SET | = 0x30000000; // RTS = 1 (disable transfer)   

command FIO3SET | = 0x30000000; write () immediately after calling , this is undesirable for the work Thank you.

My guess is that you should set up TTI features and the Linux kernel rts / if you set the attributes If you do, see CTS handling for full examples. I think the part that answers your question is:

  newtio.c_cflag = BAUDRATE | CRTSCTS | CS8 | Classic | CREAD; // CRTSCTS is set here ... tcsetattr (fd, TCSANOW, and newtio);    

No comments:

Post a Comment