Flair
Framework Libre Air
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 SERIALPORT_H
14 #define SERIALPORT_H
15 
16 #include <Object.h>
17 #include <stdint.h>
18 
19 namespace flair {
20 namespace core {
25 class SerialPort : public Object {
26 public:
35  SerialPort(const Object *parent, std::string name) : Object(parent, name) {}
36 
42 
49  virtual void SetBaudrate(int baudrate) = 0;
50 
58  virtual void SetRxTimeout(Time timeout_ns) = 0;
59 
68  virtual ssize_t Write(const void *buf, size_t nbyte) = 0;
69 
78  virtual ssize_t Read(void *buf, size_t nbyte) = 0;
79 
84  virtual void FlushInput(void) = 0;
85 };
86 } // end namespace core
87 } // end namespace framework
88 
89 #endif // SERIALPORT_H
Base class for all Framework's classes.
Definition: Object.h:77
virtual ssize_t Write(const void *buf, size_t nbyte)=0
Write datas.
namespace of the flair Framework
Definition: Ahrs.h:19
unsigned long long Time
Time definition, in ns.
Definition: Object.h:49
SerialPort(const Object *parent, std::string name)
Constructor.
Definition: SerialPort.h:35
virtual void SetRxTimeout(Time timeout_ns)=0
Set RX timeout.
Base class for serial port.
Definition: SerialPort.h:25
Base class for all Framework's classes.
~SerialPort()
Destructor.
Definition: SerialPort.h:41
virtual void FlushInput(void)=0
Flush input datas.
virtual void SetBaudrate(int baudrate)=0
Set baudrate.
virtual ssize_t Read(void *buf, size_t nbyte)=0
Read datas.