2 * Copyright (C) 2023 Mohamad Al-Jaf
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 #pragma winrt ns_prefix
23 import
"inspectable.idl";
24 import
"asyncinfo.idl";
25 import
"eventtoken.idl";
26 import
"windowscontracts.idl";
27 import
"windows.foundation.idl";
28 import
"windows.storage.streams.idl";
30 namespace Windows.Devices.Usb
{
32 interface IUsbDeviceClass
;
33 interface IUsbConfiguration
;
34 interface IUsbDeviceDescriptor
;
35 interface IUsbDeviceStatics
;
36 interface IUsbInterface
;
37 interface IUsbSetupPacket
;
38 interface IUsbSetupPacketFactory
;
40 runtimeclass UsbConfiguration
;
41 runtimeclass UsbDevice
;
42 runtimeclass UsbDeviceClass
;
43 runtimeclass UsbDeviceDescriptor
;
44 runtimeclass UsbInterface
;
45 runtimeclass UsbSetupPacket
;
48 interface Windows.Foundation.AsyncOperationCompletedHandler
<Windows.Devices.Usb.UsbDevice
*>;
49 interface Windows.Foundation.IAsyncOperation
<Windows.Devices.Usb.UsbDevice
*>;
53 contract
(Windows.Foundation.UniversalApiContract
, 1.0),
54 exclusiveto
(Windows.Devices.Usb.UsbDevice
),
55 uuid(5249b992
-c456
-44d5
-ad5e
-24f5a089f63b
)
57 interface IUsbDevice
: IInspectable
58 requires Windows.Foundation.IClosable
60 [overload
("SendControlOutTransferAsync")]
61 HRESULT SendControlOutTransferAsync
(
62 [in] Windows.Devices.Usb.UsbSetupPacket
*packet
,
63 [in] Windows.Storage.Streams.IBuffer
*buffer
,
64 [out, retval] Windows.Foundation.IAsyncOperation
<UINT32
> **operation
66 [overload
("SendControlOutTransferAsync")]
67 HRESULT SendControlOutTransferAsyncNoBuffer
(
68 [in] Windows.Devices.Usb.UsbSetupPacket
*packet
,
69 [out, retval] Windows.Foundation.IAsyncOperation
<UINT32
> **operation
71 [overload
("SendControlInTransferAsync")]
72 HRESULT SendControlInTransferAsync
(
73 [in] Windows.Devices.Usb.UsbSetupPacket
*packet
,
74 [in] Windows.Storage.Streams.IBuffer
*buffer
,
75 [out, retval] Windows.Foundation.IAsyncOperation
<Windows.Storage.Streams.IBuffer
*> **operation
77 [overload
("SendControlInTransferAsync")]
78 HRESULT SendControlInTransferAsyncNoBuffer
(
79 [in] Windows.Devices.Usb.UsbSetupPacket
*packet
,
80 [out, retval] Windows.Foundation.IAsyncOperation
<Windows.Storage.Streams.IBuffer
*> **operation
82 [propget] HRESULT DefaultInterface
([out, retval] Windows.Devices.Usb.UsbInterface
**value
);
83 [propget] HRESULT DeviceDescriptor
([out, retval] Windows.Devices.Usb.UsbDeviceDescriptor
**value
);
84 [propget] HRESULT Configuration
([out, retval] Windows.Devices.Usb.UsbConfiguration
**value
);
88 contract
(Windows.Foundation.UniversalApiContract
, 1.0),
89 exclusiveto
(Windows.Devices.Usb.UsbDeviceClass
),
90 uuid(051942f9
-845e-47eb
-b12a
-38f2f617afe7
)
92 interface IUsbDeviceClass
: IInspectable
94 [propget] HRESULT ClassCode
([out, retval] BYTE *value
);
95 [propput] HRESULT ClassCode
([in] BYTE value
);
96 [propget] HRESULT SubclassCode
([out, retval] Windows.Foundation.IReference
<BYTE> **value
);
97 [propput] HRESULT SubclassCode
([in] Windows.Foundation.IReference
<BYTE> *value
);
98 [propget] HRESULT ProtocolCode
([out, retval] Windows.Foundation.IReference
<BYTE> **value
);
99 [propput] HRESULT ProtocolCode
([in] Windows.Foundation.IReference
<BYTE> *value
);
103 contract
(Windows.Foundation.UniversalApiContract
, 1.0),
104 exclusiveto
(Windows.Devices.Usb.UsbDevice
),
105 uuid(066b85a2
-09b7
-4446-8502-6fe6dcaa7309
)
107 interface IUsbDeviceStatics
: IInspectable
109 [overload
("GetDeviceSelector")]
110 HRESULT GetDeviceSelector
([in] UINT32 vendor
, [in] UINT32 product
, [in] GUID class
, [out, retval] HSTRING
*value
);
111 [overload
("GetDeviceSelector")]
112 HRESULT GetDeviceSelectorGuidOnly
([in] GUID class
, [out, retval] HSTRING
*value
);
113 [overload
("GetDeviceSelector")]
114 HRESULT GetDeviceSelectorVidPidOnly
([in] UINT32 vendor
, [in] UINT32 product
, [out, retval] HSTRING
*value
);
115 HRESULT GetDeviceClassSelector
([in] Windows.Devices.Usb.UsbDeviceClass
*class
, [out, retval] HSTRING
*value
);
116 HRESULT FromIdAsync
([in] HSTRING
id, [out, retval] Windows.Foundation.IAsyncOperation
<Windows.Devices.Usb.UsbDevice
*> **operation
);
120 contract
(Windows.Foundation.UniversalApiContract
, 1.0),
121 marshaling_behavior
(agile
)
123 runtimeclass UsbConfiguration
125 [default] interface Windows.Devices.Usb.IUsbConfiguration
;
129 contract
(Windows.Foundation.UniversalApiContract
, 1.0),
130 marshaling_behavior
(agile
),
131 static
(Windows.Devices.Usb.IUsbDeviceStatics
, Windows.Foundation.UniversalApiContract
, 1.0)
133 runtimeclass UsbDevice
135 [default] interface Windows.Devices.Usb.IUsbDevice
;
136 interface Windows.Foundation.IClosable
;
140 activatable
(Windows.Foundation.UniversalApiContract
, 1.0),
141 contract
(Windows.Foundation.UniversalApiContract
, 1.0),
142 marshaling_behavior
(agile
)
144 runtimeclass UsbDeviceClass
146 [default] interface Windows.Devices.Usb.IUsbDeviceClass
;
150 contract
(Windows.Foundation.UniversalApiContract
, 1.0),
151 marshaling_behavior
(agile
)
153 runtimeclass UsbDeviceDescriptor
155 [default] interface Windows.Devices.Usb.IUsbDeviceDescriptor
;
159 contract
(Windows.Foundation.UniversalApiContract
, 1.0),
160 marshaling_behavior
(agile
)
162 runtimeclass UsbInterface
164 [default] interface Windows.Devices.Usb.IUsbInterface
;
168 activatable
(Windows.Devices.Usb.IUsbSetupPacketFactory
, Windows.Foundation.UniversalApiContract
, 1.0),
169 activatable
(Windows.Foundation.UniversalApiContract
, 1.0),
170 contract
(Windows.Foundation.UniversalApiContract
, 1.0),
171 marshaling_behavior
(agile
)
173 runtimeclass UsbSetupPacket
175 [default] interface Windows.Devices.Usb.IUsbSetupPacket
;