Boost logo

Boost Users :

Subject: [Boost-users] [boost.asio] Getting/setting RTS and CTS/DSR/DCD with serial_port
From: David Faure (dfaure_at_[hidden])
Date: 2010-02-02 04:53:34


Hello,

I'm porting old platform-specific serial port code to use
asio::serial_port,
and it's working nicely overall, but I'm missing some functionality.
How can I get/set the status of the DTR, RTS and DCD pins? This
seems
to be needed for some devices. I'm no expert, but the current
documentation
says:

   // RTS on if Data in Transmit queue or while BREAK transmitted
   // RTS off iff no data in transmit queue
and
   // Output Handshaking via CTS/DSR/DCD
   // data is transmitted only when all lines which are enabled for
   // output handshake are up. (BREAKs can be transmitted)

There is also this one, can this be implemented in asio?
   // setErrorChar ... enable/disable Error handling and lets you define
   // the error replacement char.
   // Specifies whether bytes received with parity errors are replaced
   // with the character specified by the ErrorChar member.
  void setErrorChar(bool on, char errorChar);
If it helps, the Windows implementation was:
     dcbI.fbFlowReplace |= MODE_ERROR_CHAR;
     dcbI.bErrorReplacementChar = cError;
but I suppose I don't have access to the DCBINFO used inside boost,
and anyway the whole purpose is to make this cross-platform :)

-- 
David Faure | dfaure_at_[hidden] | KDE/Qt Senior Software Engineer
Klarälvdalens Datakonsult AB, a KDAB Group company
Tel. Sweden (HQ) +46-563-540090, USA +1-866-777-KDAB(5322)
KDAB - Qt Experts - Platform-independent software solutions

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net