• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2023 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16/**
17 * This module provides the capability of manage USB device.
18 * @namespace usbManager
19 * @syscap SystemCapability.USB.USBManager
20 * @since 9
21 */
22declare namespace usbManager {
23  /**
24   * Obtains the USB device list.
25   *
26   * @returns Returns the {@link USBDevice} list.
27   * @syscap SystemCapability.USB.USBManager
28   * @since 9
29   */
30  function getDevices(): Array<Readonly<USBDevice>>;
31
32  /**
33   * Connects to the USB device based on the device information returned by {@link getDevices()}.
34   *
35   * @param device USB device on the device list returned by {@link getDevices()}.
36   * @returns Returns the {@link USBDevicePipe} object for data transfer.
37   * @throws {BusinessError} 401 - The parameter types do not match or parameter is not specified.
38   * @throws {BusinessError} 14400001 - USB Device access denied.
39   * @syscap SystemCapability.USB.USBManager
40   * @since 9
41   */
42  function connectDevice(device: USBDevice): Readonly<USBDevicePipe>;
43
44  /**
45   * Checks whether the application has the permission to access the device.
46   *
47   * @param deviceName Device name defined by {@link USBDevice.name}.
48   * @returns Returns **true** if the user has the permission to access the device; return **false** otherwise.
49   * @throws {BusinessError} 401 - The parameter types do not match or parameter is not specified.
50   * @syscap SystemCapability.USB.USBManager
51   * @since 9
52   */
53  function hasRight(deviceName: string): boolean;
54
55  /**
56   * Requests the permission for a given application to access the USB device.
57   * The system application has access to the device by default, and there is no need to call this interface to apply.
58   *
59   * @param deviceName Device name defined by {@link USBDevice.name}.
60   * @returns Returns **true** if the device access permissions are granted; return **false** otherwise.
61   * @throws {BusinessError} 401 - The parameter types do not match or parameter is not specified.
62   * @syscap SystemCapability.USB.USBManager
63   * @since 9
64   */
65  function requestRight(deviceName: string): Promise<boolean>;
66
67  /**
68   * Remove the permission for a given application to access the USB device.
69   *  The system application has access to the device by default, and calling this interface will not have any impact.
70   *
71   * @param deviceName Device name defined by {@link USBDevice.name}.
72   * @returns Returns **true** if the device access permissions are removed; return **false** otherwise.
73   * @throws {BusinessError} 401 - The parameter types do not match or parameter is not specified.
74   * @syscap SystemCapability.USB.USBManager
75   * @since 9
76   */
77  function removeRight(deviceName: string): boolean;
78
79  /**
80   * Add device access permission.
81   *  The system application has access to the device by default, and calling this interface will not have any impact.
82   *
83   * @permission ohos.permission.MANAGE_USB_CONFIG
84   * @param bundleName refers to application that require access permissions.
85   * @param deviceName Device name defined by {@link USBDevice.name}.
86   * @returns Returns the boolean value to indicate whether the permission is granted.
87   * @throws {BusinessError} 401 - The parameter types do not match or parameter is not specified.
88   * @systemapi
89   * @syscap SystemCapability.USB.USBManager
90   * @since 9
91   */
92  function addRight(bundleName: string, deviceName: string): boolean;
93
94  /**
95   * Converts the string descriptor of a given USB function list to a numeric mask combination.
96   *
97   * @permission ohos.permission.MANAGE_USB_CONFIG
98   * @param funcs Descriptor of the supported function list.
99   * @returns Returns the numeric mask combination of the function list.
100   * @throws {BusinessError} 401 - The parameter types do not match or parameter is not specified.
101   * @systemapi
102   * @syscap SystemCapability.USB.USBManager
103   * @since 9
104   */
105  function usbFunctionsFromString(funcs: string): number;
106
107  /**
108   * Converts the numeric mask combination of a given USB function list to a string descriptor.
109   *
110   * @permission ohos.permission.MANAGE_USB_CONFIG
111   * @param funcs Numeric mask combination of the function list.
112   * @returns Returns the string descriptor of the supported function list.
113   * @throws {BusinessError} 401 - The parameter types do not match or parameter is not specified.
114   * @systemapi
115   * @syscap SystemCapability.USB.USBManager
116   * @since 9
117   */
118  function usbFunctionsToString(funcs: FunctionType): string;
119
120  /**
121   * Sets the current USB function list in Device mode.
122   *
123   * @permission ohos.permission.MANAGE_USB_CONFIG
124   * @param funcs Numeric mask combination of the supported function list.
125   * @returns Returns **true** if the setting is successful; returns **false** otherwise.
126   * @throws {BusinessError} 401 - The parameter types do not match or parameter is not specified.
127   * @throws {BusinessError} 14400002 - Permission denied.The HDC is disabled by the system.
128   * @systemapi
129   * @syscap SystemCapability.USB.USBManager
130   * @since 9
131   */
132  function setCurrentFunctions(funcs: FunctionType): Promise<void>;
133
134  /**
135   * Obtains the numeric mask combination for the current USB function list in Device mode.
136   *
137   * @permission ohos.permission.MANAGE_USB_CONFIG
138   * @returns Returns the numeric mask combination for the current USB function list in {@link FunctionType}.
139   * @systemapi
140   * @syscap SystemCapability.USB.USBManager
141   * @since 9
142   */
143  function getCurrentFunctions(): FunctionType;
144
145  /* usb port functions begin */
146  /**
147   * Obtains the {@link USBPort} list.
148   *
149   * @permission ohos.permission.MANAGE_USB_CONFIG
150   * @returns Returns the {@link USBPort} list.
151   * @systemapi
152   * @syscap SystemCapability.USB.USBManager
153   * @since 9
154   */
155  function getPorts(): Array<USBPort>;
156
157  /**
158   * Gets the mask combination for the supported mode list of the specified {@link USBPort}.
159   *
160   * @permission ohos.permission.MANAGE_USB_CONFIG
161   * @returns Returns the mask combination for the supported mode list in {@link PortModeType}.
162   * @throws {BusinessError} 401 - The parameter types do not match or parameter is not specified.
163   * @systemapi
164   * @syscap SystemCapability.USB.USBManager
165   * @since 9
166   */
167  function getSupportedModes(portId: number): PortModeType;
168
169  /**
170   * Sets the role types supported by the specified {@link USBPort}, which can be powerRole (for charging) and dataRole (for data transfer).
171   *
172   * @permission ohos.permission.MANAGE_USB_CONFIG
173   * @param portId Unique ID of the port.
174   * @param powerRole Charging role defined by {@link PowerRoleType}.
175   * @param dataRole Data role defined by {@link DataRoleType}.
176   * @returns Returns the supported role type.
177   * @throws {BusinessError} 401 - The parameter types do not match or parameter is not specified.
178   * @systemapi
179   * @syscap SystemCapability.USB.USBManager
180   * @since 9
181   */
182  function setPortRoles(portId: number, powerRole: PowerRoleType, dataRole: DataRoleType): Promise<void>;
183
184  /* usb pipe functions begin */
185  /**
186   * Claims a USB interface.
187   *
188   * @param pipe Device pipe defined by {@link USBDevicePipe}, which is used to determine the bus number and device address.
189   * @param iface USB interface defined by {@link USBInterface}, which is used to determine the interface to claim.
190   * @param force Optional parameter that determines whether to forcibly claim the USB interface.
191   * @returns Returns **0** if the USB interface is successfully claimed; returns an error code otherwise.
192   * @throws {BusinessError} 401 - The parameter types do not match or parameter is not specified.
193   * @syscap SystemCapability.USB.USBManager
194   * @since 9
195   */
196  function claimInterface(pipe: USBDevicePipe, iface: USBInterface, force?: boolean): number;
197
198  /**
199   * Releases a USB interface.
200   *
201   * @param pipe Device pipe defined by {@link USBDevicePipe}, which is used to determine the bus number and device address.
202   * @param iface USB interface defined by {@link USBInterface}, which is used to determine the interface to release.
203   * @returns Returns **0** if the USB interface is successfully released; returns an error code otherwise.
204   * @syscap SystemCapability.USB.USBManager
205   * @since 9
206   */
207  function releaseInterface(pipe: USBDevicePipe, iface: USBInterface): number;
208
209  /**
210   * Sets the device configuration.
211   *
212   * @param pipe Device pipe defined by {@link USBDevicePipe}, which is used to determine the bus number and device address.
213   * @param config Device configuration defined by {@link USBConfiguration}.
214   * @returns Returns **0** if the device configuration is successfully set; returns an error code otherwise.
215   * @throws {BusinessError} 401 - The parameter types do not match or parameter is not specified.
216   * @syscap SystemCapability.USB.USBManager
217   * @since 9
218   */
219  function setConfiguration(pipe: USBDevicePipe, config: USBConfiguration): number;
220
221  /**
222   * Sets a USB interface.
223   *
224   * @param pipe Device pipe defined by {@link USBDevicePipe}, which is used to determine the bus number and device address.
225   * @param iface USB interface defined by {@link USBInterface}, which is used to determine the interface to set.
226   * @returns Returns **0** if the USB interface is successfully set; return an error code otherwise.
227   * @throws {BusinessError} 401 - The parameter types do not match or parameter is not specified.
228   * @syscap SystemCapability.USB.USBManager
229   * @since 9
230   */
231  function setInterface(pipe: USBDevicePipe, iface: USBInterface): number;
232
233  /**
234   * Obtains the raw USB descriptor.
235   *
236   * @param pipe Device pipe defined by {@link USBDevicePipe}, which is used to determine the bus number and device address.
237   * @returns Returns the raw descriptor data.
238   * @throws {BusinessError} 401 - The parameter types do not match or parameter is not specified.
239   * @syscap SystemCapability.USB.USBManager
240   * @since 9
241   */
242  function getRawDescriptor(pipe: USBDevicePipe): Uint8Array;
243
244  /**
245   * Obtains the file descriptor.
246   *
247   * @param pipe Device pipe defined by {@link USBDevicePipe}, which is used to determine the USB device.
248   * @returns Returns the file descriptor of the USB device.
249   * @throws {BusinessError} 401 - The parameter types do not match or parameter is not specified.
250   * @syscap SystemCapability.USB.USBManager
251   * @since 9
252   */
253  function getFileDescriptor(pipe: USBDevicePipe): number;
254
255  /**
256    * Performs control transfer.
257   *
258   * @param pipe Device pipe defined by {@link USBDevicePipe}, which is used to determine the USB device.
259   * @param controlparam Control transfer parameters.
260   * @param timeout Timeout duration. This parameter is optional. The default value is **0**, indicating no timeout.
261   * @returns Returns the size of the transmitted or received data block if the control transfer is successful; return **-1** if an exception occurs.
262   * @throws {BusinessError} 401 - The parameter types do not match or parameter is not specified.
263   * @syscap SystemCapability.USB.USBManager
264   * @since 9
265   */
266  function controlTransfer(pipe: USBDevicePipe, controlparam: USBControlParams, timeout?: number): Promise<number>;
267
268  /**
269   * Performs bulk transfer.
270   *
271   * @param pipe Device pipe defined by {@link USBDevicePipe}, which is used to determine the USB device.
272   * @param endpoint USB endpoint defined by {@link USBEndpoint}, which is used to determine the USB port for data transfer.
273   * @param buffer Buffer for writing or reading data.
274   * @param timeout Timeout duration. This parameter is optional. The default value is **0**, indicating no timeout.
275   * @returns Returns the size of the transmitted or received data block if the control transfer is successful; return **-1** if an exception occurs.
276   * @throws {BusinessError} 401 - The parameter types do not match or parameter is not specified.
277   * @syscap SystemCapability.USB.USBManager
278   * @since 9
279   */
280  function bulkTransfer(pipe: USBDevicePipe, endpoint: USBEndpoint, buffer: Uint8Array,
281    timeout?: number): Promise<number>;
282
283  /**
284   * Closes a USB device pipe.
285   *
286   * @param pipe Device pipe defined by {@link USBDevicePipe}, which is used to determine the USB device.
287   * @returns Returns **0** if the USB device pipe is closed successfully; return an error code otherwise.
288   * @throws {BusinessError} 401 - The parameter types do not match or parameter is not specified.
289   * @syscap SystemCapability.USB.USBManager
290   * @since 9
291   */
292  function closePipe(pipe: USBDevicePipe): number;
293
294  /**
295   * Represents the USB endpoint from which data is sent or received. You can obtain the USB endpoint through {@link USBInterface}.
296   *
297   * @typedef USBEndpoint
298   * @syscap SystemCapability.USB.USBManager
299   * @since 9
300   */
301  interface USBEndpoint {
302    /**
303    * Endpoint address
304    *
305    * @since 9
306    */
307    address: number;
308
309    /**
310    * Endpoint attributes
311    *
312    * @since 9
313    */
314    attributes: number;
315
316    /**
317    * Endpoint interval
318    *
319    * @since 9
320    */
321    interval: number;
322
323    /**
324    * Maximum size of data packets on the endpoint
325    *
326    * @since 9
327    */
328    maxPacketSize: number;
329
330    /**
331    * Endpoint direction
332    *
333    * @since 9
334    */
335    direction: USBRequestDirection;
336
337    /**
338    * Endpoint number
339    *
340    * @since 9
341    */
342    number: number;
343
344    /**
345    * Endpoint type
346    *
347    * @since 9
348    */
349    type: number;
350
351    /**
352    * Unique ID defined by {@link USBInterface.id}, which indicates the interface to which the endpoint belongs
353    *
354    * @since 9
355    */
356    interfaceId: number;
357  }
358
359
360  /**
361   * Represents a USB interface. One config {@link USBConfiguration} can contain multiple **USBInterface** instances, each providing a specific function.
362   *
363   * @typedef USBInterface
364   * @syscap SystemCapability.USB.USBManager
365   * @since 9
366   */
367  interface USBInterface {
368    /**
369     * Unique ID of the USB interface
370     *
371     * @since 9
372     */
373    id: number;
374
375    /**
376     * Interface protocol
377     *
378     * @since 9
379     */
380    protocol: number;
381
382    /**
383     * Device type
384     *
385     * @since 9
386     */
387    clazz: number;
388
389    /**
390     * Device subclass
391     *
392     * @since 9
393     */
394    subClass: number;
395
396    /**
397     * Alternation between descriptors of the same USB interface
398     *
399     * @since 9
400     */
401    alternateSetting: number;
402
403    /**
404     * Interface name
405     *
406     * @since 9
407     */
408    name: string;
409
410    /**
411     * {@link USBEndpoint} that belongs to the USB interface
412     *
413     * @since 9
414     */
415    endpoints: Array<USBEndpoint>;
416  }
417
418  /**
419   * USB configuration. One {@link USBDevice} can contain multiple USBConfiguration instances.
420   *
421   * @typedef USBConfiguration
422   * @syscap SystemCapability.USB.USBManager
423   * @since 9
424   */
425  interface USBConfiguration {
426    /**
427     * Unique ID of the USB configuration
428     *
429     * @since 9
430     *
431     *
432     */
433    id: number;
434
435    /**
436     * Configuration attributes
437     *
438     * @since 9
439     */
440    attributes: number;
441
442    /**
443     * Maximum power consumption, in mA
444     *
445     * @since 9
446     */
447    maxPower: number;
448
449    /**
450     * Configuration name, which can be left empty
451     *
452     * @since 9
453     */
454    name: string;
455
456    /**
457     * Support for remote wakeup
458     *
459     * @since 9
460     */
461    isRemoteWakeup: boolean;
462
463    /**
464     * Support for independent power supplies
465     *
466     * @since 9
467     */
468    isSelfPowered: boolean;
469
470    /**
471     * Supported interface attributes defined by {@link USBInterface}
472     *
473     * @since 9
474     */
475    interfaces: Array<USBInterface>;
476  }
477
478  /**
479   * Represents a USB device.
480   *
481   * @typedef USBDevice
482   * @syscap SystemCapability.USB.USBManager
483   * @since 9
484   */
485  interface USBDevice {
486    /**
487     * Bus address
488     *
489     * @since 9
490     */
491    busNum: number;
492
493    /**
494     * Device address
495     *
496     * @since 9
497     */
498    devAddress: number;
499
500    /**
501     * Device SN
502     *
503     * @since 9
504     */
505    serial: string;
506
507    /**
508     * Device name
509     *
510     * @since 9
511     */
512    name: string;
513
514    /**
515     * Device manufacturer
516     *
517     * @since 9
518     */
519    manufacturerName: string;
520
521    /**
522     * Product information
523     *
524     * @since 9
525     */
526    productName: string;
527
528    /**
529     * Product version
530     *
531     * @since 9
532     */
533    version: string;
534
535    /**
536     * Vendor ID
537     *
538     * @since 9
539     */
540    vendorId: number;
541
542    /**
543     * Product ID
544     *
545     * @since 9
546     */
547    productId: number;
548
549    /**
550     * Device class
551     *
552     * @since 9
553     */
554    clazz: number;
555
556    /**
557     * Device subclass
558     *
559     * @since 9
560     */
561    subClass: number;
562
563    /**
564     * Device protocol code
565     *
566     * @since 9
567     */
568    protocol: number;
569
570    /**
571     * Device configuration descriptor information defined by {@link USBConfiguration}
572     *
573     * @since 9
574     */
575    configs: Array<USBConfiguration>;
576  }
577
578  /**
579   * Represents a USB device pipe, which is used to determine the USB device.
580   *
581   * @typedef USBDevicePipe
582   * @syscap SystemCapability.USB.USBManager
583   * @since 9
584   */
585  interface USBDevicePipe {
586    /**
587     * Bus address.
588     *
589     * @since 9
590     */
591    busNum: number;
592
593    /**
594     * Device address
595     *
596     * @since 9
597     */
598    devAddress: number;
599  }
600
601  /**
602   * Enumerates power role types.
603   *
604   * @enum { number }
605   * @syscap SystemCapability.USB.USBManager
606   * @systemapi
607   * @since 9
608   */
609  export enum PowerRoleType {
610    /**
611     * None
612     *
613     * @since 9
614     */
615    NONE = 0,
616
617    /**
618     * External power supply
619     *
620     * @since 9
621     */
622    SOURCE = 1,
623
624    /**
625     * Internal power supply
626     *
627     * @since 9
628     */
629    SINK = 2
630  }
631
632  /**
633   * Enumerates data role types.
634   *
635   * @enum { number }
636   * @syscap SystemCapability.USB.USBManager
637   * @systemapi
638   * @since 9
639   */
640  export enum DataRoleType {
641    /**
642     * None
643     *
644     * @since 9
645     */
646    NONE = 0,
647
648    /**
649     * Host mode
650     *
651     * @since 9
652     */
653    HOST = 1,
654
655    /**
656     * Device mode
657     *
658     * @since 9
659     */
660    DEVICE = 2
661  }
662
663  /**
664   * Enumerates port mode types
665   *
666   * @enum { number }
667   * @syscap SystemCapability.USB.USBManager
668   * @systemapi
669   * @since 9
670   */
671  export enum PortModeType {
672    /**
673     * None
674     *
675     * @since 9
676     */
677    NONE = 0,
678
679    /**
680     * Upstream facing port, which functions as the sink of power supply
681     *
682     * @since 9
683     */
684    UFP = 1,
685
686    /**
687     * Downstream facing port, which functions as the source of power supply
688     *
689     * @since 9
690     */
691    DFP = 2,
692
693    /**
694     * Dynamic reconfiguration port (DRP), which can function as the DFP (host) or UFP (device). It is not supported currently.
695     *
696     * @since 9
697     */
698    DRP = 3,
699
700    /**
701     * Not supported currently
702     *
703     * @since 9
704     */
705    NUM_MODES = 4
706  }
707
708  /**
709   * Enumerates USB device port roles.
710   *
711   * @typedef USBPortStatus
712   * @syscap SystemCapability.USB.USBManager
713   * @systemapi
714   * @since 9
715   */
716  interface USBPortStatus {
717    /**
718     * USB mode
719     *
720     * @since 9
721     */
722    currentMode: number;
723
724    /**
725     * Power role
726     *
727     * @since 9
728     */
729    currentPowerRole: number;
730
731    /**
732     * Data role
733     *
734     * @since 9
735     */
736    currentDataRole: number;
737  }
738
739  /**
740   * Represents a USB device port.
741   *
742   * @typedef USBPort
743   * @syscap SystemCapability.USB.USBManager
744   * @systemapi
745   * @since 9
746   */
747  interface USBPort {
748    /**
749     * Unique ID of the USB port
750     *
751     * @since 9
752     */
753    id: number;
754
755    /**
756     * Mask combination for the supported mode list of the USB port
757     *
758     * @since 9
759     */
760    supportedModes: PortModeType;
761
762    /**
763     * USB port role defined by {@link USBPortStatus}
764     *
765     * @since 9
766     */
767    status: USBPortStatus;
768  }
769
770  /**
771  * Represents control transfer parameters.
772  *
773  * @typedef USBControlParams
774  * @syscap SystemCapability.USB.USBManager
775  * @since 9
776  */
777  interface USBControlParams {
778    /**
779     * Request type
780     *
781     * @since 9
782     */
783    request: number;
784
785    /**
786     * Request target type
787     *
788     * @since 9
789     */
790    target: USBRequestTargetType;
791
792    /**
793     * Control request type
794     *
795     * @since 9
796     */
797    reqType: USBControlRequestType;
798
799    /**
800     * Request parameter value
801     *
802     * @since 9
803       */
804    value: number;
805
806    /**
807     * Index of the parameter value
808     *
809     * @since 9
810     */
811    index: number;
812
813    /**
814     * Data written to or read from the buffer
815     * @since 9
816     */
817    data: Uint8Array;
818  }
819
820  /**
821   * Enumerates USB request target types.
822   *
823   * @enum { number }
824   * @syscap SystemCapability.USB.USBManager
825   * @since 9
826   */
827  export enum USBRequestTargetType {
828    /**
829     * USB device
830     *
831     * @since 9
832     */
833    USB_REQUEST_TARGET_DEVICE = 0,
834
835    /**
836     * USB interface
837     *
838     * @since 9
839     */
840    USB_REQUEST_TARGET_INTERFACE = 1,
841
842    /**
843     * Endpoint
844     *
845     * @since 9
846     */
847    USB_REQUEST_TARGET_ENDPOINT = 2,
848
849    /**
850     * Others
851     *
852     * @since 9
853     */
854    USB_REQUEST_TARGET_OTHER = 3
855  }
856
857  /**
858   * Enumerates control request types.
859   *
860   * @enum { number }
861   * @syscap SystemCapability.USB.USBManager
862   * @since 9
863   */
864  export enum USBControlRequestType {
865    /**
866     * Standard
867     *
868     * @since 9
869     */
870    USB_REQUEST_TYPE_STANDARD = 0,
871
872    /**
873     * Class
874     *
875     * @since 9
876     */
877    USB_REQUEST_TYPE_CLASS = 1,
878
879    /**
880     * Vendor
881     *
882     * @since 9
883     */
884    USB_REQUEST_TYPE_VENDOR = 2
885  }
886
887  /**
888   * Enumerates request directions.
889   *
890   * @enum { number }
891   * @syscap SystemCapability.USB.USBManager
892   * @since 9
893   */
894  export enum USBRequestDirection {
895    /**
896     * Request for writing data from the host to the device
897     *
898     * @since 9
899     */
900    USB_REQUEST_DIR_TO_DEVICE = 0,
901
902    /**
903     * Request for reading data from the device to the host
904     *
905     * @since 9
906     */
907    USB_REQUEST_DIR_FROM_DEVICE = 0x80
908  }
909
910  /**
911   * Enumerates function modes.
912   *
913   * @enum { number }
914   * @syscap SystemCapability.USB.USBManager
915   * @systemapi
916   * @since 9
917   */
918  export enum FunctionType {
919    /**
920     * None
921     *
922     * @since 9
923     */
924    NONE = 0,
925
926    /**
927     * Serial port device
928     *
929     * @since 9
930     */
931    ACM = 1,
932
933    /**
934     * Ethernet port device
935     *
936     * @since 9
937     */
938    ECM = 2,
939
940    /**
941     * HDC device
942     *
943     * @since 9
944     */
945    HDC = 4,
946
947    /**
948     * MTP device
949     *
950     * @since 9
951     */
952    MTP = 8,
953
954    /**
955     * PTP device
956     *
957     * @since 9
958     */
959    PTP = 16,
960
961    /**
962     * RNDIS device
963     *
964     * @since 9
965     */
966    RNDIS = 32,
967
968    /**
969     * MIDI device
970     *
971     * @since 9
972     */
973    MIDI = 64,
974
975    /**
976     * Audio source device
977     *
978     * @since 9
979     */
980    AUDIO_SOURCE = 128,
981
982    /**
983     * NCM device
984     *
985     * @since 9
986     */
987    NCM = 256
988  }
989
990}
991
992export default usbManager;
993