TypedL2capChannel

A typed, framed view over an L2capChannel.

Wraps an accepted L2CAP channel together with a BleCodec and a Framer so that callers read and write typed values directly. Pairs with L2capListener.framedConnections: the listener accepts raw channels and each accepted channel is wrapped into a TypedL2capChannel.

The underlying channel is intentionally not exposed. Collecting raw bytes from it alongside incoming would split the byte stream between two collectors and corrupt frames; writing raw bytes would bypass the framer and produce a stream the peer cannot decode. Use a separate L2capListener.incoming collection if raw access is required.

mtu, psm, and isOpen forward to the underlying channel for convenience. close closes the underlying channel.

Properties

Link copied to clipboard
val incoming: Flow<T>
Link copied to clipboard
Link copied to clipboard
val mtu: Int
Link copied to clipboard
val psm: Int

Functions

Link copied to clipboard
open override fun close()
Link copied to clipboard
suspend fun write(value: T)

Encode value through the codec, frame the bytes, and write the framed packet on the underlying channel.