debian: added giffgaff chatscripts
[barry.git] / src / usbwrap_libusb_1_0.h
blob6857338f0ff7e2dea20eb12107b4d90eee8ba21e
1 ///
2 /// \file usbwrap_libusb_1_0.h
3 /// USB API wrapper for libusb version 1.0
4 ///
6 /*
7 Copyright (C) 2005-2013, Chris Frey
8 Portions Copyright (C) 2011, RealVNC Ltd.
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2 of the License, or
13 (at your option) any later version.
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19 See the GNU General Public License in the COPYING file at the
20 root directory of this project for more details.
23 #ifndef __SB_USBWRAP_LIBUSB_1_0_H__
24 #define __SB_USBWRAP_LIBUSB_1_0_H__
26 #include "usbwrap.h"
27 #include <libusb.h>
29 #if defined( WIN32 )
30 // On Windows systems, libusb.h includes <windows.h> which defines min/max,
31 // which causes trouble for other headers
32 #undef min
33 #undef max
34 #endif
36 namespace Usb
39 class DeviceIDImpl
41 public:
42 libusb_device *m_dev;
43 std::string m_busname;
44 std::string m_filename;
45 public:
46 DeviceIDImpl(libusb_device *dev);
47 ~DeviceIDImpl();
50 struct DeviceHandle
52 libusb_device_handle *m_handle;
55 struct DeviceListImpl
57 libusb_device** m_list;
58 ssize_t m_listcnt;
59 std::vector<DeviceID> m_devices;
62 struct EndpointDescriptorImpl
64 const struct libusb_endpoint_descriptor* m_desc;
67 struct InterfaceDescriptorImpl
69 const struct libusb_interface_descriptor* m_desc;
72 struct ConfigDescriptorImpl
74 struct libusb_config_descriptor* m_desc;
77 struct DeviceDescriptorImpl
79 struct libusb_device_descriptor m_desc;
80 DeviceID m_devid;
83 }; // namespace Usb
85 #endif // __SB_USBWRAP_LIBUSB_1_0_H__