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 <boost/asio.hpp>
39 #include <boost/thread.hpp>
40 #include <boost/thread/condition_variable.hpp>
41 #include <boost/function.hpp>
42 #include <boost/shared_ptr.hpp>
43 
44 #include "create/data.h"
45 #include "create/types.h"
46 #include "create/util.h"
47 #include "create/serial.h"
48 
49 namespace create {
50  class SerialStream : public Serial {
51  private:
52  enum ReadState {
58  };
59 
60  // State machine variables
62  uint8_t headerByte;
63  uint8_t packetID;
65  uint16_t packetBytes;
66  uint8_t numBytesRead;
67  uint32_t byteSum;
70 
71  protected:
72  bool startSensorStream();
73  void processByte(uint8_t byteRead);
74 
75  public:
76  SerialStream(boost::shared_ptr<Data> data, const uint8_t& header = create::util::STREAM_HEADER);
77 
78  };
79 } // namespace create
80 
81 #endif // CREATE_SERIAL_H
uint8_t byteRead
Definition: serial.h:64
SerialStream(boost::shared_ptr< Data > data, const uint8_t &header=create::util::STREAM_HEADER)
boost::shared_ptr< Data > data
Definition: serial.h:75
uint8_t expectedNumDataBytes
Definition: serial_stream.h:69
Definition: create.h:47
void processByte(uint8_t byteRead)
static const uint8_t STREAM_HEADER
Definition: util.h:41


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