Commit d4164be1 authored by luz's avatar luz

p44utils: SerialComm: Added support for controlling RTS and DTR lines

parent 2b13c467
......@@ -210,6 +210,23 @@ bool SerialComm::connectionIsOpen()
}
#pragma mark - handshake signal control
void SerialComm::setDTR(bool aActive)
{
if (!connectionIsOpen()) return; // ignore
int iFlags = TIOCM_DTR;
ioctl(connectionFd, aActive ? TIOCMBIS : TIOCMBIC, &iFlags);
}
void SerialComm::setRTS(bool aActive)
{
if (!connectionIsOpen()) return; // ignore
int iFlags = TIOCM_RTS;
ioctl(connectionFd, aActive ? TIOCMBIS : TIOCMBIC, &iFlags);
}
#pragma mark - handling data exception
......
......@@ -117,6 +117,15 @@ namespace p44 {
/// check if connection is currently open
bool connectionIsOpen();
/// control DTR
/// @param aActive if set DTR will set active, otherwise DTR will be made inactive
void setDTR(bool aActive);
/// control RTS
/// @param aActive if set RTS will set active, otherwise DTR will be made inactive
void setRTS(bool aActive);
protected:
/// This is called when
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment