| Index: chrome/common/extensions/api/usb.idl
|
| diff --git a/chrome/common/extensions/api/usb.idl b/chrome/common/extensions/api/usb.idl
|
| index cba100a6731c3a0370087179f36322827030f73b..bbb6c546b6e5da110c43a704aa647f357452a3df 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 EndpointType 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 EndpointType {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;
|
| + EndpointType 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);
|
|
|
| @@ -117,6 +148,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.
|
|
|