setRAW in Serial
This commit is contained in:
@@ -260,6 +260,27 @@ void TimeoutSerial::readCompleted(const boost::system::error_code& error,
|
||||
result=resultError;
|
||||
}
|
||||
|
||||
void TimeoutSerial::setRAW()
|
||||
{
|
||||
int fd = port.native_handle();
|
||||
struct termios options;
|
||||
|
||||
fcntl(fd, F_SETFL, 0);
|
||||
|
||||
/* get the current options */
|
||||
tcgetattr(fd, &options);
|
||||
|
||||
options.c_cflag |= (CLOCAL | CREAD);
|
||||
options.c_lflag &= ~(ICANON | ECHO | ECHOE | ISIG);
|
||||
options.c_oflag &= ~OPOST;
|
||||
|
||||
tcsetattr(fd, TCSANOW, &options);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void TimeoutSerial::setRTS(bool enabled)
|
||||
{
|
||||
int fd = port.native_handle();
|
||||
|
||||
@@ -165,6 +165,7 @@ public:
|
||||
|
||||
void setRTS(bool enabled);
|
||||
void setDTR(bool enabled);
|
||||
void setRAW();
|
||||
|
||||
~TimeoutSerial();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user