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:
73  std::shared_ptr<Data> data,
74  const uint8_t& header = create::util::STREAM_HEADER,
75  bool install_signal_handler = true);
76 
77  };
78 } // namespace create
79 
80 #endif // CREATE_SERIAL_H
uint8_t byteRead
Definition: serial.h:65
uint8_t expectedNumDataBytes
Definition: serial_stream.h:65
Definition: create.h:48
std::shared_ptr< Data > data
Definition: serial.h:76
void processByte(uint8_t byteRead)
static const uint8_t STREAM_HEADER
Definition: util.h:43
SerialStream(std::shared_ptr< Data > data, const uint8_t &header=create::util::STREAM_HEADER, bool install_signal_handler=true)


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