APM:Libraries
ConsoleDevice.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "SerialDevice.h"
5 
6 class ConsoleDevice: public SerialDevice {
7 public:
9  virtual ~ConsoleDevice();
10 
11  virtual bool open() override;
12  virtual bool close() override;
13  virtual ssize_t write(const uint8_t *buf, uint16_t n) override;
14  virtual ssize_t read(uint8_t *buf, uint16_t n) override;
15  virtual void set_blocking(bool blocking) override;
16  virtual void set_speed(uint32_t speed) override;
17 
18 private:
19  int _rd_fd = -1;
20  int _wr_fd = -1;
21  bool _closed = true;
22 
23  bool _set_signal_handlers(void) const;
24 };
virtual void set_speed(uint32_t speed) override
virtual ~ConsoleDevice()
virtual void set_blocking(bool blocking) override
bool _set_signal_handlers(void) const
virtual bool close() override
virtual ssize_t write(const uint8_t *buf, uint16_t n) override
virtual bool open() override
virtual ssize_t read(uint8_t *buf, uint16_t n) override