serial_query.h
Go to the documentation of this file.
1 
33 // Based on example from:
34 // https://github.com/labust/labust-ros-pkg/wiki/Create-a-Serial-Port-application
35 
36 #ifndef CREATE_SERIAL_QUERY_H
37 #define CREATE_SERIAL_QUERY_H
38 
39 #include <memory>
40 
41 #include <boost/asio.hpp>
42 
43 #include "create/data.h"
44 #include "create/types.h"
45 #include "create/util.h"
46 #include "create/serial.h"
47 
48 namespace create {
49  class SerialQuery : public Serial {
50 
51  private:
52  boost::asio::deadline_timer streamRecoveryTimer;
53  uint8_t packetID;
54  int8_t packetByte;
55  uint16_t packetData;
56  const uint8_t maxPacketID;
57 
58  bool started;
59 
60  void requestSensorData();
61  void restartSensorStream(const boost::system::error_code& err);
62 
63  void flushInput();
64 
65  protected:
66  bool startSensorStream();
67  void processByte(uint8_t byteRead);
68 
69  public:
70  SerialQuery(std::shared_ptr<Data> data, bool install_signal_handler = true);
71  };
72 } // namespace create
73 
74 #endif // CREATE_SERIAL_H
SerialQuery(std::shared_ptr< Data > data, bool install_signal_handler=true)
uint8_t byteRead
Definition: serial.h:65
Definition: create.h:48
boost::asio::deadline_timer streamRecoveryTimer
Definition: serial_query.h:52
std::shared_ptr< Data > data
Definition: serial.h:76
void restartSensorStream(const boost::system::error_code &err)
void processByte(uint8_t byteRead)
const uint8_t maxPacketID
Definition: serial_query.h:56


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