serial_stream.h
Go to the documentation of this file.
1 
32 // Based on example from:
33 // https://github.com/labust/labust-ros-pkg/wiki/Create-a-Serial-Port-application
34 
35 #ifndef CREATE_SERIAL_STREAM_H
36 #define CREATE_SERIAL_STREAM_H
37 
38 #include <memory>
39 
40 #include "create/data.h"
41 #include "create/types.h"
42 #include "create/util.h"
43 #include "create/serial.h"
44 
45 namespace create {
46  class SerialStream : public Serial {
47  private:
48  enum ReadState {
54  };
55 
56  // State machine variables
58  uint8_t headerByte;
59  uint8_t packetID;
61  uint16_t packetBytes;
62  uint8_t numBytesRead;
63  uint32_t byteSum;
66 
67  protected:
68  bool startSensorStream();
69  void processByte(uint8_t byteRead);
70 
71  public:
72  SerialStream(std::shared_ptr<Data> data, const uint8_t& header = create::util::STREAM_HEADER);
73 
74  };
75 } // namespace create
76 
77 #endif // CREATE_SERIAL_H
uint8_t byteRead
Definition: serial.h:65
uint8_t expectedNumDataBytes
Definition: serial_stream.h:65
Definition: create.h:47
SerialStream(std::shared_ptr< Data > data, const uint8_t &header=create::util::STREAM_HEADER)
std::shared_ptr< Data > data
Definition: serial.h:76
void processByte(uint8_t byteRead)
static const uint8_t STREAM_HEADER
Definition: util.h:43


libcreate
Author(s): Jacob Perron
autogenerated on Mon Nov 2 2020 03:59:34