Represents a session with a Pixel die. This class is used to abstract the underlying platform used to connect to Pixels.

Constructors

Properties

_connStatusCb?: ((ev) => void)

Type declaration

_systemId: string

Accessors

Methods

  • Sets the function to be called when the Pixel connection status changes.

    Parameters

    • Optional connectionStatusListener: ((ev) => void)

      The function called when the Pixel connection status changes.

    Returns void

  • Subscribes to the "notify" characteristic and returns unsubscribe function.

    Parameters

    • listener: ((dataView) => void)

      The function to be called when the Pixel connection status changes.

        • (dataView): void
        • Parameters

          • dataView: DataView

          Returns void

    Returns Promise<(() => void)>

  • Sends data to Pixel using the "write" characteristic

    Parameters

    • data: ArrayBuffer

      The raw data to send to the Pixel.

    • Optional withoutResponse: boolean

      Whether or not to request the device to acknowledge having received the data.

    • Optional timeoutMs: number

      The timeout in milliseconds before throwing an error when waiting for the device to acknowledgement.

    Returns Promise<void>

Generated using TypeDoc