# Class UsbPlatform

java.lang.Object
com.codename1.io.usb.UsbPlatform

public class UsbPlatform extends java.lang.Object

Platform-supplied implementation of the USB host APIs. Application code talks to `Usb`; the facade fetches this via `Display.getInstance().getUsbPlatform()`.

Part of the framework's service-provider interface, not intended for application use.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `UsbPlatform()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addDeviceListener(UsbDeviceListener listener)`
  `boolean`
  `hasPermission(UsbDevice device)`
  `boolean`
  `isSupported()`
  `UsbDevice[]`
  `listDevices()`
  `java.io.InputStream`
  `openInputStream(UsbDevice device, int endpointAddress)`
  `java.io.OutputStream`
  `openOutputStream(UsbDevice device, int endpointAddress)`
  `void`
  `removeDeviceListener(UsbDeviceListener listener)`
  `void`
  `requestPermission(UsbDevice device)`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### UsbPlatform

    public UsbPlatform()

- ## Method Details

  - ### isSupported

    public boolean isSupported()

  - ### listDevices

    public UsbDevice[] listDevices()

  - ### addDeviceListener

    public void addDeviceListener(UsbDeviceListener listener)

  - ### removeDeviceListener

    public void removeDeviceListener(UsbDeviceListener listener)

  - ### requestPermission

    public void requestPermission(UsbDevice device)

  - ### hasPermission

    public boolean hasPermission(UsbDevice device)

  - ### openInputStream

    public java.io.InputStream openInputStream(UsbDevice device, int endpointAddress) throws java.io.IOException
    Throws:
      `java.io.IOException`

  - ### openOutputStream

    public java.io.OutputStream openOutputStream(UsbDevice device, int endpointAddress) throws java.io.IOException
    Throws:
      `java.io.IOException`