Flair
Framework Libre Air
flair::core::RTDM_SerialPort Class Reference

Class for real time serial port using RTDM. More...

#include <RTDM_SerialPort.h>

+ Inheritance diagram for flair::core::RTDM_SerialPort:

Public Member Functions

 RTDM_SerialPort (const Object *parent, std::string port_name, std::string device)
 Constructor. More...
 
 ~RTDM_SerialPort ()
 Destructor. More...
 
void SetBaudrate (int baudrate)
 Set baudrate. More...
 
void SetRxTimeout (Time timeout_ns)
 Set RX timeout. More...
 
ssize_t Write (const void *buf, size_t nbyte)
 Write datas. More...
 
ssize_t Read (void *buf, size_t nbyte)
 Read datas. More...
 
void FlushInput (void)
 Flush input datas. More...
 
- Public Member Functions inherited from flair::core::SerialPort
 SerialPort (const Object *parent, std::string name)
 Constructor. More...
 
 ~SerialPort ()
 Destructor. More...
 
- Public Member Functions inherited from flair::core::Object
 Object (const Object *parent=NULL, std::string name="", std::string type="")
 Constructor. More...
 
virtual ~Object ()
 Destructor. More...
 
std::string ObjectName (void) const
 Name. More...
 
std::string ObjectType (void) const
 Type. More...
 
const ObjectParent (void) const
 Parent. More...
 
std::vector< const Object * > * TypeChilds (void) const
 Childs of the same type. More...
 
std::vector< const Object * > * Childs (void) const
 Childs. More...
 
void Information (const char *function, int line, const char *format,...) const
 Formatted information. More...
 
void Warning (const char *function, const char *format,...) const
 Formatted warning. More...
 
void Error (const char *function, const char *format,...) const
 Formatted error. More...
 
bool ErrorOccured (bool recursive=true) const
 Has an errror occured? More...
 

Additional Inherited Members

- Public Types inherited from flair::core::Object
enum  color_t { Auto = 0, Red = 31, Green = 32, Orange = 33 }
 

Detailed Description

Class for real time serial port using RTDM.

This class can only be used with the real time version of Framework library.

Constructor & Destructor Documentation

flair::core::RTDM_SerialPort::RTDM_SerialPort ( const Object parent,
std::string  port_name,
std::string  device 
)

Constructor.

Construct an RTDM serial port, with the following default values:

  • 115200bps baudrate
Parameters
parentparent
namename
deviceserial device (ex rtser1)
flair::core::RTDM_SerialPort::~RTDM_SerialPort ( )

Destructor.

Member Function Documentation

void flair::core::RTDM_SerialPort::SetBaudrate ( int  baudrate)
virtual

Set baudrate.

Parameters
baudratebaudrate

Implements flair::core::SerialPort.

void flair::core::RTDM_SerialPort::SetRxTimeout ( Time  timeout_ns)
virtual

Set RX timeout.

Timeout for waiting datas.

Parameters
timeout_nstimeout in nano second

Implements flair::core::SerialPort.

ssize_t flair::core::RTDM_SerialPort::Write ( const void *  buf,
size_t  nbyte 
)
virtual

Write datas.

Parameters
bufpointer to datas
nbytelength of datas
Returns
amount of written datas

Implements flair::core::SerialPort.

ssize_t flair::core::RTDM_SerialPort::Read ( void *  buf,
size_t  nbyte 
)
virtual

Read datas.

Parameters
bufpointer to datas
nbytelength of datas
Returns
amount of read datas

Implements flair::core::SerialPort.

void flair::core::RTDM_SerialPort::FlushInput ( void  )
virtual

Flush input datas.

Implements flair::core::SerialPort.