SERIAL++ library: simple serial port access

◆ SerialPort()

serialport::SerialPort::SerialPort ( const std::string &  devname,
const int &  flags = (O_RDWR | O_NOCTTY | O_NDELAY) 
)

open port by name of device file

open serial port

Definition at line 50 of file serialport.cc.

References Mdebug, Mdevoptions, Mfd, Musexon, and SERIALPORT_assert.

52  {
53  Mfd=open(devname.c_str(), flags);
54  SERIALPORT_assert(Mfd>0, "ERROR on opening port");
55  Mdebug=false;
56  ::tcgetattr(Mfd, &Mdevoptions);
57  Musexon=false;
58  }
#define SERIALPORT_assert(C, M)
Check an assertion and report by throwing an exception.
Definition: error.h:144
bool Musexon
use xon/xoff flow control
Definition: serialport.h:96
struct termios Mdevoptions
remember device status
Definition: serialport.h:94
int Mfd
file descriptor to this port
Definition: serialport.h:90
bool Mdebug
debug flag
Definition: serialport.h:92