Treehopper C++ API
MacUsbConnection.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "Treehopper.h"
4 #include "UsbConnection.h"
5 #include <string>
6 #include "IOKit/IOKitLib.h"
7 #include "IOKit/IOTypes.h"
8 #include "IOKit/usb/IOUSBLib.h"
9 #include "IOKit/IOCFPlugin.h"
10 #include "IOKit/usb/USBSpec.h"
11 #include "CoreFoundation/CoreFoundation.h"
12 
13 using namespace std;
14 
15 namespace Treehopper {
17  public:
18  MacUsbConnection(io_service_t deviceService, string name, string serial);
19 
21 
22  bool open();
23 
24  void close();
25 
26  void sendDataPinConfigChannel(uint8_t *data, size_t len);
27 
28  void sendDataPeripheralChannel(uint8_t *data, size_t len);
29 
30  wstring serialNumber();
31 
32  wstring name();
33 
34  wstring devicePath();
35 
36  bool receivePinReportPacket(uint8_t *data);
37 
38  bool receiveDataPeripheralChannel(uint8_t *data, size_t len);
39 
40  private:
41  wstring _name;
42  wstring _serialNumber;
43  int _currentConfiguration;
44  int _currentInterface = 0;
45  uint8_t _currentAlternateInterface = 0;
46  IOCFPlugInInterface **_currentPlugInInterface = NULL;
47  IOUSBDeviceInterface320 **deviceInterface = NULL;
48  IOUSBInterfaceInterface197 **_currentInterfaceInterface = NULL;
49  };
50 }
Definition: AdcPin.h:3
Definition: MacUsbConnection.h:16
#define TREEHOPPER_API
Definition: Treehopper.h:17
Definition: UsbConnection.h:9