Logo Search packages:      
Sourcecode: qmk-groundstation version File versions  Download package

void Posix_QextSerialPort::setTimeout ( ulong  sec,
ulong  millisec 
) [virtual]

Sets the read and write timeouts for the port to sec seconds and millisec milliseconds. Note that this is a per-character timeout, i.e. the port will wait this long for each individual character, not for the whole read operation. This timeout also applies to the bytesWaiting() function.

POSIX does not support millisecond-level control for I/O timeout values. Any timeout set using this function will be set to the next lowest tenth of a second for the purposes of detecting read or write timeouts. For example a timeout of 550 milliseconds will be seen by the class as a timeout of 500 milliseconds for the purposes of reading and writing the port. However millisecond-level control is allowed by the select() system call, so for example a 550-millisecond timeout will be seen as 550 milliseconds on POSIX systems for the purpose of detecting available bytes in the read buffer.

Implements QextSerialBase.

Definition at line 795 of file posix_qextserialport.cpp.

Referenced by open(), and Posix_QextSerialPort().

      if (isOpen()) {
            tcgetattr(Posix_File->handle(), &Posix_CommConfig);
            tcsetattr(Posix_File->handle(), TCSAFLUSH, &Posix_CommConfig);

Generated by  Doxygen 1.6.0   Back to index