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

void Posix_QextSerialPort::setFlowControl ( FlowType  flow  )  [virtual]

Sets the flow control used by the port. Possible values of flow are:

		FLOW_OFF            No flow control
		FLOW_HARDWARE       Hardware (RTS/CTS) flow control
		FLOW_XONXOFF        Software (XON/XOFF) flow control
		
Note:
FLOW_HARDWARE may not be supported on all versions of UNIX. In cases where it is unsupported, FLOW_HARDWARE is the same as FLOW_OFF.

Implements QextSerialBase.

Definition at line 745 of file posix_qextserialport.cpp.

Referenced by open(), and Posix_QextSerialPort().

{
      LOCK_MUTEX();
      if (Settings.FlowControl!=flow) {
            Settings.FlowControl=flow;
      }
      if (isOpen()) {
            switch(flow) {
                        
                        /*no flow control*/
                  case FLOW_OFF:
                        Posix_CommConfig.c_cflag&=(~CRTSCTS);
                        Posix_CommConfig.c_iflag&=(~(IXON|IXOFF|IXANY));
                        tcsetattr(Posix_File->handle(), TCSAFLUSH, &Posix_CommConfig);
                        break;
                        
                        /*software (XON/XOFF) flow control*/
                  case FLOW_XONXOFF:
                        Posix_CommConfig.c_cflag&=(~CRTSCTS);
                        Posix_CommConfig.c_iflag|=(IXON|IXOFF|IXANY);
                        tcsetattr(Posix_File->handle(), TCSAFLUSH, &Posix_CommConfig);
                        break;
                        
                  case FLOW_HARDWARE:
                        Posix_CommConfig.c_cflag|=CRTSCTS;
                        Posix_CommConfig.c_iflag&=(~(IXON|IXOFF|IXANY));
                        tcsetattr(Posix_File->handle(), TCSAFLUSH, &Posix_CommConfig);
                        break;
                  }
      }
      UNLOCK_MUTEX();
}


Generated by  Doxygen 1.6.0   Back to index