Options
All
  • Public
  • Public/Protected
  • All
Menu

USB Transport class

Hierarchy

  • USB

Implements

Index

Constructors

Properties

Methods

Constructors

constructor

  • new USB(device: Device, interfaceClass?: number, configuration?: number, alwaysControlTransfer?: boolean): USB
  • USB constructor

    Parameters

    • device: Device

      USB device to use

    • interfaceClass: number = DEFAULT_CLASS

      Optional interface class to use (default: 0xFF)

    • configuration: number = DEFAULT_CONFIGURATION

      Optional Configuration to use (default: 1)

    • alwaysControlTransfer: boolean = false

      Whether to always use control transfer instead of endpoints (default: false)

    Returns USB

Properties

Readonly packetSize

packetSize: 64 = 64

Packet size

Methods

close

  • close(): Promise<void>

open

  • open(): Promise<void>

read

  • read(): Promise<DataView>

write

  • write(data: BufferSource): Promise<void>