Flair
Framework Libre Air
RTDM_SerialPort.h
Go to the documentation of this file.
1 // %flair:license{
2 // This file is part of the Flair framework distributed under the
3 // CECILL-C License, Version 1.0.
4 // %flair:license}
13 #ifndef RTDM_SERIALPORT_H
14 #define RTDM_SERIALPORT_H
15 
16 #include <SerialPort.h>
17 
18 namespace flair {
19 namespace core {
27 class RTDM_SerialPort : public SerialPort {
28 
29 public:
40  RTDM_SerialPort(const Object *parent, std::string port_name,
41  std::string device);
42 
48 
55  void SetBaudrate(int baudrate);
56 
64  void SetRxTimeout(Time timeout_ns);
65 
74  ssize_t Write(const void *buf, size_t nbyte);
75 
84  ssize_t Read(void *buf, size_t nbyte);
85 
90  void FlushInput(void);
91 
92 private:
93  int fd;
94 };
95 } // end namespace core
96 } // end namespace flair
97 
98 #endif // RTDM_SERIALPORT_H
ssize_t Write(const void *buf, size_t nbyte)
Write datas.
Base class for all Framework's classes.
Definition: Object.h:77
namespace of the flair Framework
Definition: Ahrs.h:19
void SetBaudrate(int baudrate)
Set baudrate.
unsigned long long Time
Time definition, in ns.
Definition: Object.h:49
RTDM_SerialPort(const Object *parent, std::string port_name, std::string device)
Constructor.
Base class for serial port.
Definition: SerialPort.h:25
Class for real time serial port using RTDM.
Definition: RTDM_SerialPort.h:27
ssize_t Read(void *buf, size_t nbyte)
Read datas.
void FlushInput(void)
Flush input datas.
void SetRxTimeout(Time timeout_ns)
Set RX timeout.
Base class for serial port.