Public Member Functions | Protected Member Functions | Private Types | Private Attributes | List of all members
create::SerialStream Class Reference

#include <serial_stream.h>

Inheritance diagram for create::SerialStream:
Inheritance graph
[legend]

Public Member Functions

 SerialStream (std::shared_ptr< Data > data, const uint8_t &header=create::util::STREAM_HEADER, bool install_signal_handler=true)
 
- Public Member Functions inherited from create::Serial
bool connect (const std::string &port, const int &baud=115200, std::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 (std::shared_ptr< Data > data, bool install_signal_handler)
 
 ~Serial ()
 

Protected Member Functions

void processByte (uint8_t byteRead)
 
bool startSensorStream ()
 
- Protected Member Functions inherited from create::Serial
void notifyDataReady ()
 
void signalHandler (const boost::system::error_code &error, int signal_number)
 

Private Types

enum  ReadState {
  READ_HEADER, READ_NBYTES, READ_PACKET_ID, READ_PACKET_BYTES,
  READ_CHECKSUM
}
 

Private Attributes

uint32_t byteSum
 
uint8_t expectedNumBytes
 
uint8_t expectedNumDataBytes
 
uint8_t headerByte
 
uint8_t numBytesRead
 
uint8_t numDataBytesRead
 
uint16_t packetBytes
 
uint8_t packetID
 
ReadState readState
 

Additional Inherited Members

- Protected Attributes inherited from create::Serial
uint64_t corruptPackets
 
std::shared_ptr< Datadata
 
boost::asio::io_service io
 
boost::asio::serial_port port
 
boost::asio::signal_set signals
 
uint64_t totalPackets
 

Detailed Description

Definition at line 46 of file serial_stream.h.

Member Enumeration Documentation

Enumerator
READ_HEADER 
READ_NBYTES 
READ_PACKET_ID 
READ_PACKET_BYTES 
READ_CHECKSUM 

Definition at line 48 of file serial_stream.h.

Constructor & Destructor Documentation

create::SerialStream::SerialStream ( std::shared_ptr< Data data,
const uint8_t &  header = create::util::STREAM_HEADER,
bool  install_signal_handler = true 
)

Definition at line 9 of file serial_stream.cpp.

Member Function Documentation

void create::SerialStream::processByte ( uint8_t  byteRead)
protectedvirtual

Implements create::Serial.

Definition at line 27 of file serial_stream.cpp.

bool create::SerialStream::startSensorStream ( )
protectedvirtual

Implements create::Serial.

Definition at line 12 of file serial_stream.cpp.

Member Data Documentation

uint32_t create::SerialStream::byteSum
private

Definition at line 63 of file serial_stream.h.

uint8_t create::SerialStream::expectedNumBytes
private

Definition at line 60 of file serial_stream.h.

uint8_t create::SerialStream::expectedNumDataBytes
private

Definition at line 65 of file serial_stream.h.

uint8_t create::SerialStream::headerByte
private

Definition at line 58 of file serial_stream.h.

uint8_t create::SerialStream::numBytesRead
private

Definition at line 62 of file serial_stream.h.

uint8_t create::SerialStream::numDataBytesRead
private

Definition at line 64 of file serial_stream.h.

uint16_t create::SerialStream::packetBytes
private

Definition at line 61 of file serial_stream.h.

uint8_t create::SerialStream::packetID
private

Definition at line 59 of file serial_stream.h.

ReadState create::SerialStream::readState
private

Definition at line 57 of file serial_stream.h.


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


libcreate
Author(s): Jacob Perron
autogenerated on Sat May 8 2021 03:02:37