NiimBlueLib Docs
    Preparing search index...

    Class NiimbotBluetoothClient

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    debug: boolean = false
    heartbeatData: HeartbeatData = {}
    mutex: Mutex = ...
    packetIntervalMs: number = NIIMBOT_CLIENT_DEFAULTS.packetIntervalMs
    printerInfo: PrinterInfo = ...
    protocol: NiimbotProtocol
    rfidInfo: CombinedRfidInfo = {}
    prefixed: string | boolean

    Methods

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

      Returns Promise<void>

    • Disconnect from printer port.

      Returns Promise<void>

    • Determine print task version if any.

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

    • Returns string[]

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

      Parameters

      • data: Uint8Array<ArrayBufferLike> | DataView<ArrayBufferLike>

        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 max failed heartbeat attempts to disconnect. Use 0 to disable.

      Parameters

      • value: number

      Returns void

    • Set the interval between packets in milliseconds.

      Parameters

      • milliseconds: number

      Returns void

    • Parameters

      • ids: string[]

      Returns void

    • Stops the heartbeat by clearing the interval timer.

      Returns void