libcsdbg  1.28
C++ exception (and generic) stack trace debug library
csdbg::sttybuf::sttybuf ( const i8 port,
u32  baud = 9600 
)

Object constructor.

Parameters
[in]portthe path of the serial interface device node
[in]baudthe baud rate
Exceptions
std::bad_alloc
csdbg::exception
Note
The port configuration (except baud rate) is fixed to 8N1

Definition at line 67 of file sttybuf.cpp.

References m_devnode, and unlikely.

Referenced by clone().

68  :
69 streambuf(),
70 m_devnode(NULL),
71 m_baud(baud)
72 {
73  if ( unlikely(port == NULL) )
74  throw exception("invalid argument: port (=%p)", port);
75 
76  m_devnode = new i8[strlen(port) + 1];
77  strcpy(m_devnode, port);
78 }
79 
80 catch (...) {
81  delete[] m_data;
82  m_data = NULL;
83  m_devnode = NULL;
84 }
u32 m_baud
Baud rate.
Definition: sttybuf.hpp:36
char i8
8-bit signed integer
Definition: config.hpp:72
streambuf()
Object default constructor.
Definition: streambuf.cpp:20
i8 * m_devnode
Device node file (devfs)
Definition: sttybuf.hpp:34
i8 * m_data
String data.
Definition: string.hpp:42
virtual u32 baud() const
Get the baud rate.
Definition: sttybuf.cpp:154
#define unlikely(expr)
Offer a hint (negative) to the pipeline branch predictor.
Definition: config.hpp:349

+ Here is the caller graph for this function: