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 <boost/asio.hpp>
40 #include <boost/thread.hpp>
41 #include <boost/thread/condition_variable.hpp>
42 #include <boost/function.hpp>
43 #include <boost/shared_ptr.hpp>
44 
45 #include "create/data.h"
46 #include "create/types.h"
47 #include "create/util.h"
48 #include "create/serial.h"
49 
50 namespace create {
51  class SerialQuery : public Serial {
52 
53  private:
54  boost::asio::deadline_timer streamRecoveryTimer;
55  uint8_t packetID;
56  int8_t packetByte;
57  uint16_t packetData;
58  const uint8_t maxPacketID;
59 
60  bool started;
61 
62  void requestSensorData();
63  void restartSensorStream(const boost::system::error_code& err);
64 
65  void flushInput();
66 
67  protected:
68  bool startSensorStream();
69  void processByte(uint8_t byteRead);
70 
71  public:
72  SerialQuery(boost::shared_ptr<Data> data);
73  };
74 } // namespace create
75 
76 #endif // CREATE_SERIAL_H
uint8_t byteRead
Definition: serial.h:62
SerialQuery(boost::shared_ptr< Data > data)
boost::shared_ptr< Data > data
Definition: serial.h:74
Definition: create.h:46
boost::asio::deadline_timer streamRecoveryTimer
Definition: serial_query.h:54
void restartSensorStream(const boost::system::error_code &err)
void processByte(uint8_t byteRead)
const uint8_t maxPacketID
Definition: serial_query.h:58


libcreate
Author(s): Jacob Perron
autogenerated on Sat Jun 8 2019 17:58:17