Documentation
    Preparing search index...

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

    Index

    Constructors

    Properties

    _connStatusCb?: (ev: PixelSessionConnectionEvent) => void
    _systemId: string

    Accessors

    • get lastConnectionStatus(): | "connecting"
      | "connected"
      | "failedToConnect"
      | "ready"
      | "disconnecting"
      | "disconnected"

      Gets the last known connection status.

      Returns
          | "connecting"
          | "connected"
          | "failedToConnect"
          | "ready"
          | "disconnecting"
          | "disconnected"

    Methods

    • Parameters

      • status:
            | "connecting"
            | "connected"
            | "failedToConnect"
            | "ready"
            | "disconnecting"
            | "disconnected"
      • reason:
            | "unknown"
            | "success"
            | "canceled"
            | "notSupported"
            | "timeout"
            | "linkLoss"
            | "bluetoothOff"
            | "host"
            | "peripheral" = "success"

      Returns void

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

      Parameters

      • listener: (dataView: DataView) => void

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

      Returns Promise<() => void>

    • Sends data to Pixel using the "write" characteristic

      Parameters

      • data: ArrayBuffer

        The raw data to send to the Pixel.

      • OptionalwithoutResponse: boolean

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

      • OptionaltimeoutMs: number

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

      Returns Promise<void>