Class Serial

Inheritance Relationships

Base Type

  • public std::enable_shared_from_this< Serial >

Derived Types

Class Documentation

class Serial : public std::enable_shared_from_this<Serial>

Subclassed by create::SerialQuery, create::SerialStream

Public Functions

Serial(std::shared_ptr<Data> data, bool install_signal_handler)
~Serial()
bool connect(const std::string &port, const int &baud = 115200, std::function<void()> cb = 0)
void disconnect()
inline bool connected() const
bool send(const uint8_t *bytes, const uint32_t numBytes)
bool sendOpcode(const Opcode &code)
uint64_t getNumCorruptPackets() const
uint64_t getTotalPackets() const

Protected Functions

virtual bool startSensorStream() = 0
virtual void processByte(uint8_t byteRead) = 0
void signalHandler(const boost::system::error_code &error, int signal_number)
void notifyDataReady()

Protected Attributes

boost::asio::io_service io
boost::asio::signal_set signals
boost::asio::serial_port port
std::shared_ptr<Data> data
uint64_t corruptPackets
uint64_t totalPackets