SERIAL++ library: simple serial port access

◆ write()

void serialport::SerialPort::write ( const std::string &  text) const

write string to port

write to port

Definition at line 73 of file serialport.cc.

References Mfd, and SERIALPORT_assert.

Referenced by main().

74  {
75  int n,len=text.size();
76  n=::write(Mfd, text.c_str(), len);
77  SERIALPORT_assert(n==len, "ERROR on writing to port");
78  }
#define SERIALPORT_assert(C, M)
Check an assertion and report by throwing an exception.
Definition: error.h:144
void write(const std::string &text) const
write string to port
Definition: serialport.cc:73
int Mfd
file descriptor to this port
Definition: serialport.h:90
Here is the caller graph for this function: