Options
All
  • Public
  • Public/Protected
  • All
Menu

It represents a HID comm at the client side.

Hierarchy

  • HIDComm

Index

Constructors

  • new HIDComm(devicePath: string): HIDComm
  • Creates an instance of the HIDComm class wiht the specified information.

    Parameters

    • devicePath: string

      The HID device path. Use JSPM.JSPrintManager.getHidDevices() to get it if unkown.

    Returns HIDComm

Methods

  • close(): void
  • Closes the HID connection

    Returns void

  • connect(): Promise<unknown>
  • Connects to a HID device using the specified path.

    Returns Promise<unknown>

  • onClose(data: any): void
  • Occurs when communication is close.

    Parameters

    • data: any

      The callback function

    Returns void

  • onDataReceived(data: any): void
  • Occurs when data is received.

    Parameters

    • data: any

      The callback function

    Returns void

  • onError(data: any, critical: any): void
  • Occurs when an error is thrown.

    Parameters

    • data: any

      The callback function

    • critical: any

    Returns void

  • propertiesJSON(): { type: string }
  • Returns { type: string }

    • type: string
  • send(utf8string: string): void
  • Sends the specified string to the HID device.

    Parameters

    • utf8string: string

      The string to send to the USB device.

    Returns void