Brian Silverman | 395d625 | 2013-09-13 20:58:14 -0700 | [diff] [blame^] | 1 | // Copyright 2012 Google Inc. All Rights Reserved. |
| 2 | // |
| 3 | // Internal conversions between libusb descriptors and enums. |
| 4 | |
| 5 | #ifndef _GLIBUSB_GLIBUSB_INTERNAL_H_ |
| 6 | #define _GLIBUSB_GLIBUSB_INTERNAL_H_ |
| 7 | |
| 8 | #include "glibusb_endpoint.h" |
| 9 | |
| 10 | namespace glibusb { |
| 11 | |
| 12 | // Converts libusb endpoint address to integer |
| 13 | int DescriptorToAddress(const struct libusb_endpoint_descriptor *descriptor); |
| 14 | |
| 15 | // Converts libusb direction to UsbEndpoint direction. |
| 16 | UsbEndpoint::DirectionType DescriptorToDirection( |
| 17 | const struct libusb_endpoint_descriptor *descriptor); |
| 18 | |
| 19 | // Converts libusb transfer type to UsbEndpoint transfer type. |
| 20 | UsbEndpoint::TransferType DescriptorToTransfer( |
| 21 | const struct libusb_endpoint_descriptor *descriptor); |
| 22 | |
| 23 | } // namespace glibusb |
| 24 | |
| 25 | #endif // _GLIBUSB_GLIBUSB_INTERNAL_H_ |