[Qt-interest] serial communication, RTS and DTR

Marcello Romani mromani at ottotecnica.com
Tue Mar 30 17:38:23 CEST 2010


HardMaker ha scritto:
> Hi,
> I'm trying to make a serial comunication too and I need to control the 
> RTS and DTR lines. Not for make a hardware hand shaking, yust I wan't to 
> drive this lines and send and recive data trow the serial port as 
> diferents things.
> As you suggest, I try QextSerialPort from google and use this code on 
> linux to initialize the port:
> 
>     QextSerialPort serial = new QextSerialPort();
>     serial->setBaudRate(BAUD9600);
>     serial->setFlowControl(FLOW_OFF);
>     serial->setParity(PAR_NONE);
>     serial->setDataBits(DATA_8);
>     serial->setStopBits(STOP_2);
> 
> but when I press a button to execute this code:
> 
>   serial->setRts(true);
> or
>   serial->setRts(false);
> 
> Nothing happend, I'm using a digital voltimeter conected to RTS and 
> don't change. But, if use other applications  it's ok  (the hardware work).
> Can helpme?
> 
> Thank's
> 
> Sergio

I think you have to actually write() to the file descriptor of the 
serial port...
I don't have QextSerialPort at hand to look for the exact method though...

Marcello



More information about the Qt-interest-old mailing list