blob: 8c34e5dc9833c1f0dbc7f01db16e6f8411b0413d [file] [log] [blame]
Brian Silverman395d6252013-09-13 20:58:14 -07001// 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
10namespace glibusb {
11
12// Converts libusb endpoint address to integer
13int DescriptorToAddress(const struct libusb_endpoint_descriptor *descriptor);
14
15// Converts libusb direction to UsbEndpoint direction.
16UsbEndpoint::DirectionType DescriptorToDirection(
17 const struct libusb_endpoint_descriptor *descriptor);
18
19// Converts libusb transfer type to UsbEndpoint transfer type.
20UsbEndpoint::TransferType DescriptorToTransfer(
21 const struct libusb_endpoint_descriptor *descriptor);
22
23} // namespace glibusb
24
25#endif // _GLIBUSB_GLIBUSB_INTERNAL_H_