Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
create::Serial Class Referenceabstract

#include <serial.h>

Inheritance diagram for create::Serial:
Inheritance graph

Public Member Functions

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

Protected Member Functions

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

Protected Attributes

uint64_t corruptPackets
boost::shared_ptr< Datadata
boost::asio::io_service io
boost::asio::serial_port port
boost::asio::signal_set signals
uint64_t totalPackets

Private Member Functions

void onData (const boost::system::error_code &e, const std::size_t &size)
bool startReading ()
void stopReading ()

Private Attributes

uint8_t byteRead
boost::function< void()> callback
bool dataReady
boost::condition_variable dataReadyCond
boost::mutex dataReadyMut
bool firstRead
boost::thread ioThread
bool isReading

Detailed Description

Definition at line 50 of file serial.h.

Constructor & Destructor Documentation

create::Serial::Serial ( boost::shared_ptr< Data data)

Definition at line 8 of file serial.cpp.

create::Serial::~Serial ( )

Definition at line 18 of file serial.cpp.

Member Function Documentation

bool create::Serial::connect ( const std::string &  port,
const int &  baud = 115200,
boost::function< void()>  cb = 0 

Definition at line 34 of file serial.cpp.

bool create::Serial::connected ( ) const

Definition at line 92 of file serial.h.

void create::Serial::disconnect ( )

Definition at line 58 of file serial.cpp.

uint64_t create::Serial::getNumCorruptPackets ( ) const

Definition at line 184 of file serial.cpp.

uint64_t create::Serial::getTotalPackets ( ) const

Definition at line 188 of file serial.cpp.

void create::Serial::notifyDataReady ( )

Definition at line 135 of file serial.cpp.

void create::Serial::onData ( const boost::system::error_code &  e,
const std::size_t &  size 

Definition at line 152 of file serial.cpp.

virtual void create::Serial::processByte ( uint8_t  byteRead)
protectedpure virtual
bool create::Serial::send ( const uint8_t *  bytes,
const uint32_t  numBytes 

Definition at line 169 of file serial.cpp.

bool create::Serial::sendOpcode ( const Opcode code)

Definition at line 179 of file serial.cpp.

void create::Serial::signalHandler ( const boost::system::error_code &  error,
int  signal_number 

Definition at line 22 of file serial.cpp.

bool create::Serial::startReading ( )

Definition at line 72 of file serial.cpp.

virtual bool create::Serial::startSensorStream ( )
protectedpure virtual
void create::Serial::stopReading ( )

Definition at line 122 of file serial.cpp.

Member Data Documentation

uint8_t create::Serial::byteRead

Definition at line 64 of file serial.h.

boost::function<void()> create::Serial::callback

Definition at line 69 of file serial.h.

uint64_t create::Serial::corruptPackets

Definition at line 77 of file serial.h.

boost::shared_ptr<Data> create::Serial::data

Definition at line 75 of file serial.h.

bool create::Serial::dataReady

Definition at line 61 of file serial.h.

boost::condition_variable create::Serial::dataReadyCond

Definition at line 59 of file serial.h.

boost::mutex create::Serial::dataReadyMut

Definition at line 60 of file serial.h.

bool create::Serial::firstRead

Definition at line 63 of file serial.h.

boost::asio::io_service create::Serial::io

Definition at line 53 of file serial.h.

boost::thread create::Serial::ioThread

Definition at line 58 of file serial.h.

bool create::Serial::isReading

Definition at line 62 of file serial.h.

boost::asio::serial_port create::Serial::port

Definition at line 55 of file serial.h.

boost::asio::signal_set create::Serial::signals

Definition at line 54 of file serial.h.

uint64_t create::Serial::totalPackets

Definition at line 78 of file serial.h.

The documentation for this class was generated from the following files:

Author(s): Jacob Perron
autogenerated on Thu Dec 5 2019 04:03:13