Hierarchy (view full)

Constructors

Properties

abstraction: Abstraction
debug: boolean = false
info: PrinterInfo = {}
mutex: Mutex = ...
packetIntervalMs: number = 10
prefixed: string | boolean

Methods

  • Disconnect from printer port.

    Returns Promise<void>

  • Determine print task version if any.

    Returns
        | undefined
        | "B1"
        | "D110"
        | "D11_V1"
        | "B21_V1"
        | "D110M_V4"

  • Send "connect" packet and fetch the protocol version.

    Returns Promise<void>

  • Convert raw bytes to packet objects and fire events. Defragmentation included.

    Parameters

    • data: DataView | Uint8Array

      Bytes to process.

    Returns void

  • Remove all listeners, or those of the specified event.

    Parameters

    • Optionalevent: keyof ClientEventMap

    Returns this

  • Send raw bytes to the printer port.

    Parameters

    • data: Uint8Array

      Bytes to send.

    • Optionalforce: boolean

      Ignore mutex lock. It used internally and you should avoid using it.

    Returns Promise<void>

  • Enable some debug information logging.

    Parameters

    • value: boolean

    Returns void

  • Set the interval between packets in milliseconds.

    Parameters

    • milliseconds: number

    Returns void

  • Stops the heartbeat by clearing the interval timer.

    Returns void