Treehopper C++ API
UsbConnection.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <string>
4 #include "Treehopper.h"
5 
6 using namespace std;
7 
8 namespace Treehopper {
10  public:
11  virtual ~UsbConnection() = default;;
12 
13  virtual bool open() = 0;
14 
15  virtual void close() = 0;
16 
17  virtual wstring serialNumber() = 0;
18 
19  virtual wstring name() = 0;
20 
21  virtual wstring devicePath() = 0;
22 
23  virtual void sendDataPinConfigChannel(uint8_t *data, size_t len) = 0;
24 
25  virtual void sendDataPeripheralChannel(uint8_t *data, size_t len) = 0;
26 
27  virtual bool receiveDataPeripheralChannel(uint8_t *data, size_t len) = 0;
28 
29  virtual bool receivePinReportPacket(uint8_t *data) = 0;
30 
31  protected:
32  wstring _serialNumber;
33  wstring _name;
34  wstring _devicePath;
35  int _rev;
36  uint8_t pinReportEndpoint = 0x81;
37  uint8_t peripheralResponseEndpoint = 0x82;
38  uint8_t pinConfigEndpoint = 0x01;
39  uint8_t peripheralConfigEndpoint = 0x02;
40  };
41 }
Definition: AdcPin.h:3
#define TREEHOPPER_API
Definition: Treehopper.h:17
Definition: UsbConnection.h:9