#include <serial_stream.h>
Public Member Functions | |
SerialStream (boost::shared_ptr< Data > data, const uint8_t &header=create::util::STREAM_HEADER) | |
Public Member Functions inherited from create::Serial | |
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 | processByte (uint8_t byteRead) |
bool | startSensorStream () |
Protected Member Functions inherited from create::Serial | |
void | notifyDataReady () |
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 |
boost::shared_ptr< Data > | data |
boost::asio::io_service | io |
boost::asio::serial_port | port |
uint64_t | totalPackets |
Definition at line 50 of file serial_stream.h.
|
private |
Enumerator | |
---|---|
READ_HEADER | |
READ_NBYTES | |
READ_PACKET_ID | |
READ_PACKET_BYTES | |
READ_CHECKSUM |
Definition at line 52 of file serial_stream.h.
create::SerialStream::SerialStream | ( | boost::shared_ptr< Data > | data, |
const uint8_t & | header = create::util::STREAM_HEADER |
||
) |
Definition at line 8 of file serial_stream.cpp.
|
protectedvirtual |
Implements create::Serial.
Definition at line 32 of file serial_stream.cpp.
|
protectedvirtual |
Implements create::Serial.
Definition at line 11 of file serial_stream.cpp.
|
private |
Definition at line 67 of file serial_stream.h.
|
private |
Definition at line 64 of file serial_stream.h.
|
private |
Definition at line 69 of file serial_stream.h.
|
private |
Definition at line 62 of file serial_stream.h.
|
private |
Definition at line 66 of file serial_stream.h.
|
private |
Definition at line 68 of file serial_stream.h.
|
private |
Definition at line 65 of file serial_stream.h.
|
private |
Definition at line 63 of file serial_stream.h.
|
private |
Definition at line 61 of file serial_stream.h.