VectorNav C++ Library
packetfinder.h
1 #ifndef _VNPROTOCOL_UART_PACKETFINDER_H_
2 #define _VNPROTOCOL_UART_PACKETFINDER_H_
3 
4 #include "nocopy.h"
5 #include "vntime.h"
6 #include "packet.h"
7 
8 #if PYTHON
9  #include "vn/util/boostpython.h"
10 #endif
11 
12 namespace vn {
13 namespace protocol {
14 namespace uart {
15 
25 class vn_proglib_DLLEXPORT PacketFinder : private util::NoCopy
26 {
27 
28 public:
29 
39  typedef void (*ValidPacketFoundHandler)(void* userData, Packet& packet, size_t runningIndexOfPacketStart, xplat::TimeStamp timestamp);
40 
43  PacketFinder();
44 
50  explicit PacketFinder(size_t internalReceiveBufferSize);
51 
52  ~PacketFinder();
53 
59  void processReceivedData(char data[], size_t length);
60 
67  void processReceivedData(char data[], size_t length, xplat::TimeStamp timestamp);
68 
69  #if PYTHON
70 
71  void processReceivedData(boost::python::list data);
72 
73  #endif
74 
81  void registerPossiblePacketFoundHandler(void* userData, ValidPacketFoundHandler handler);
82 
84  void unregisterPossiblePacketFoundHandler();
85 
86  #if PYTHON
87 
88  boost::python::object* register_packet_found_handler(/*boost::python::object* callable*/ PyObject* callable);
89  //void register_packet_found_handler(boost::python::object* callable);
90 
91  #endif
92 
93 private:
94  struct Impl;
95  Impl *_pi;
96 };
97 
98 }
99 }
100 }
101 
102 #endif
Helps with management of communication with a sensor using the UART protocol.
Definition: packetfinder.h:25
Definition: vntime.h:10
Identifies a derived class as being unable to be copied and prevents copy attempts.
Definition: nocopy.h:21
Definition: attitude.h:8
Structure representing a UART packet received from the VectorNav sensor.
Definition: packet.h:16