SERIAL++ library: simple serial port access

◆ ~SerialPort()

serialport::SerialPort::~SerialPort ( )

close port

close serial port

Definition at line 63 of file serialport.cc.

References Mdevoptions, Mfd, and SERIALPORT_assert.

64  {
65  // restore options
66  ::tcsetattr(Mfd, TCSANOW, &Mdevoptions);
67  SERIALPORT_assert(close(Mfd)!=-1, "ERROR on closing port");
68  }
#define SERIALPORT_assert(C, M)
Check an assertion and report by throwing an exception.
Definition: error.h:144
struct termios Mdevoptions
remember device status
Definition: serialport.h:94
int Mfd
file descriptor to this port
Definition: serialport.h:90