discoverpixy
usblink.h
1 //
2 // begin license header
3 //
4 // This file is part of Pixy CMUcam5 or "Pixy" for short
5 //
6 // All Pixy source code is provided under the terms of the
7 // GNU General Public License v2 (http://www.gnu.org/licenses/gpl-2.0.html).
8 // Those wishing to use Pixy source code, software and/or
9 // technologies under different licensing terms should contact us at
10 // cmucam@cs.cmu.edu. Such licensing terms are available for
11 // all portions of the Pixy codebase presented here.
12 //
13 // end license header
14 //
15 
16 #ifndef __USBLINK_H__
17 #define __USBLINK_H__
18 
19 #include "link.h"
20 #include "timer.hpp"
21 #include <libusb.h>
22 
23 class USBLink : public Link
24 {
25 public:
26  USBLink();
27  ~USBLink();
28 
29  int open();
30  virtual int send(const uint8_t *data, uint32_t len, uint16_t timeoutMs);
31  virtual int receive(uint8_t *data, uint32_t len, uint16_t timeoutMs);
32  virtual void setTimer();
33  virtual uint32_t getTimer();
34 
35 private:
36  libusb_context *m_context;
37  libusb_device_handle *m_handle;
38 
39  util::timer timer_;
40 };
41 
42 #endif
43 
Definition: timer.hpp:25