Index: chrome/common/extensions/api/usb.idl |
diff --git a/chrome/common/extensions/api/usb.idl b/chrome/common/extensions/api/usb.idl |
index b651d7c93ec035d68047df65a460f9d8156ac462..89a0e608e1564835df27b18048ed2f1240acdf1b 100644 |
--- a/chrome/common/extensions/api/usb.idl |
+++ b/chrome/common/extensions/api/usb.idl |
@@ -4,11 +4,17 @@ |
namespace usb { |
- // Direction, Recipient and RequestType all map to their namesakes within the |
- // USB specification. |
+ // Direction, Recipient, RequestType, and TransferType all map to their |
+ // namesakes within the USB specification. |
enum Direction {in, out}; |
enum Recipient {device, _interface, endpoint, other}; |
enum RequestType {standard, class, vendor, reserved}; |
+ enum TransferType {control, interrupt, isochronous, bulk}; |
+ |
+ // For isochronous mode, SynchronizationType and UsageType map to their |
+ // namesakes within the USB specification. |
+ enum SynchronizationType {asynchronous, adaptive, synchronous}; |
+ enum UsageType {data, feedback, explicitFeedback}; |
// A Device encapsulates everything that is needed to communicate with a USB |
// device. They are returned by findDevice calls and have all of their |
@@ -19,6 +25,30 @@ namespace usb { |
long productId; |
}; |
+ dictionary EndpointDescriptor { |
+ long address; |
+ TransferType type; |
+ Direction direction; |
+ long maximumPacketSize; |
+ |
+ // Used for isochronous mode. |
+ SynchronizationType? synchronization; |
+ UsageType? usage; |
+ |
+ // If this is an interrupt endpoint, this will be 1-255 |
+ long? pollingInterval; |
+ }; |
+ |
+ dictionary InterfaceDescriptor { |
+ long interfaceNumber; |
+ long alternateSetting; |
+ long interfaceClass; |
+ long interfaceSubclass; |
+ long interfaceProtocol; |
+ DOMString? description; |
+ EndpointDescriptor[] endpoints; |
+ }; |
+ |
// ControlTransferInfo represents that parameters to a single USB control |
// transfer. |
dictionary ControlTransferInfo { |
@@ -97,6 +127,7 @@ namespace usb { |
callback VoidCallback = void (); |
callback FindDevicesCallback = void (Device[] device); |
+ callback ListInterfacesCallback = void (InterfaceDescriptor[] descriptors); |
callback CloseDeviceCallback = void (); |
callback TransferCallback = void (TransferResultInfo info); |
callback ResetDeviceCallback = void(boolean result); |
@@ -118,6 +149,12 @@ namespace usb { |
static void closeDevice(Device device, |
optional CloseDeviceCallback callback); |
+ // Lists all the interfaces on the USB device. |
+ // |device|: The device from which the interfaces should be listed. |
+ // |callback|: The callback to invoke when the interfaces are enumerated. |
+ static void listInterfaces(Device device, |
+ ListInterfacesCallback callback); |
+ |
// Claims an interface on the specified USB device. |
// |device|: The device on which the interface is to be claimed. |
// |interface|: The interface number to be claimed. |