Constructors

  • Creates a new BTP session handler

    Parameters

    • role: "central" | "peripheral"

      The role of the BTP session handler

    • btpVersion: number

      The BTP protocol version to use

    • fragmentSize: number

      The fragment size to use for the messages

    • clientWindowSize: number

      The client window size to use

    • writeBleCallback: ((data: Uint8Array) => Promise<void>)

      Callback to write data to the BLE transport

        • (data): Promise<void>
        • Parameters

          • data: Uint8Array

          Returns Promise<void>

    • disconnectBleCallback: (() => Promise<void>)

      Callback to disconnect the BLE transport

        • (): Promise<void>
        • Returns Promise<void>

    • handleMatterMessagePayload: ((data: Uint8Array) => Promise<void>)

      Callback to handle a Matter message payload

        • (data): Promise<void>
        • Parameters

          • data: Uint8Array

          Returns Promise<void>

    Returns BtpSessionHandler

Methods

  • Handle incoming data from the transport layer and hand over completely received matter messages to the ExchangeManager layer

    Parameters

    • data: Uint8Array

      ByteArray containing the data

    Returns Promise<void>

  • Send a Matter message to the transport layer, but before that encode it into a BTP packet and potentially split it into multiple segments. This Method is indirectly called by the ExchangeManager layer when a Matter message should be sent.

    Parameters

    • data: Uint8Array

      ByteArray containing the Matter message

    Returns Promise<void>

  • Parameters

    • handshakeResponsePayload: Uint8Array
    • writeBleCallback: ((data: Uint8Array) => Promise<void>)
        • (data): Promise<void>
        • Parameters

          • data: Uint8Array

          Returns Promise<void>

    • disconnectBleCallback: (() => Promise<void>)
        • (): Promise<void>
        • Returns Promise<void>

    • handleMatterMessagePayload: ((data: Uint8Array) => Promise<void>)
        • (data): Promise<void>
        • Parameters

          • data: Uint8Array

          Returns Promise<void>

    Returns Promise<BtpSessionHandler>

  • Factory method to create a new BTPSessionHandler from a received handshake request

    Parameters

    • maxDataSize: undefined | number
    • handshakeRequestPayload: Uint8Array
    • writeBleCallback: ((data: Uint8Array) => Promise<void>)
        • (data): Promise<void>
        • Parameters

          • data: Uint8Array

          Returns Promise<void>

    • disconnectBleCallback: (() => Promise<void>)
        • (): Promise<void>
        • Returns Promise<void>

    • handleMatterMessagePayload: ((data: Uint8Array) => Promise<void>)
        • (data): Promise<void>
        • Parameters

          • data: Uint8Array

          Returns Promise<void>

    Returns Promise<BtpSessionHandler>