Package-level declarations
Types
Bidirectional codec combining BleEncoder and BleDecoder.
Decodes a BleData into a value of type T without copying.
Encodes a value of type T directly into BleData.
Raised when the peripheral is ready to resolve the characteristic and the characteristic is absent from the device's GATT database. Ready to resolve means Peripheral.services is populated and Peripheral.state is a stable State.Connected substate other than State.Connected.ServiceChanged.
Typed equivalent of com.atruedev.kmpble.gatt.Observation.
Raised when a BleDecoder rejects a value read from a characteristic. The raw bytes are preserved for logging or inspection of the malformed payload, and the underlying decoder exception is preserved as the cause.
Thrown from Unframer.feed when a length prefix exceeds the configured cap. Indicates a malformed stream or hostile peer; the Unframer should not be reused.
Little-endian signed 16-bit integer codec (-32768..32767). Strict size on decode.
Little-endian signed 32-bit integer codec. Strict size on decode.
Length-prefix framing: each frame is [length: uint32 LE][payload: bytes].
Raised when the peripheral is not ready to resolve the characteristic: discovery has not completed, the cached service list is pending invalidation (State.Connected.ServiceChanged), or the peripheral is disconnecting/disconnected. Retry after Peripheral.state reaches State.Connected.Ready, reconnecting first if necessary. The currentState is captured at dispatch time for diagnostics.
Codec that passes bytes through unchanged. Defensive copies on both sides.
A typed, framed view over an L2capChannel.
Little-endian unsigned 16-bit integer codec (0..65535). Strict size on decode.
Little-endian unsigned 32-bit integer codec (0..4_294_967_295). Strict size on decode.
Single-byte unsigned integer codec (0..255). Common for level/enum characteristics like Battery Level (0x2A19).
Stateful inverse of Framer.frame. Implementations buffer partial frames across feed calls; each call returns zero or more complete payloads.
UTF-8 string codec. decode throws on malformed UTF-8 byte sequences via ByteArray.decodeToString with throwOnInvalidSequence = true. The exact exception type is platform-dependent (CharacterCodingException on JVM, kotlin.io.CharacterCodingException on Native); treat as a generic decode failure.
Functions
Bridge a BleDecoder to work with BleData input.
Bridge a BleEncoder to produce BleData via BleData factory.
Bridge a BleDataDecoder to work with ByteArray input.
Bridge a BleDataEncoder to produce ByteArray via BleData.toByteArray.
Combine a standalone BleEncoder and BleDecoder into a BleCodec.
Transform the input of this BleData encoder.
Transform the input of this encoder.
Combines unframing and decoding into one operator: byte chunks in, typed values out.
Decode manufacturer-specific data. Zero-copy on iOS.
Decode service-specific data. Zero-copy on iOS.
Accept incoming L2CAP connections and pre-wrap each one as a TypedL2capChannel using the supplied codec and framer.
Decode framed payloads from the L2CAP incoming stream.
Encode a value directly to BleData and send it as an indication.
Encode a value and send it as an indication.
Transform the output of this BleData decoder.
Transform the output of this decoder.
Encode a value directly to BleData and send it as a notification.
Encode a value and send it as a notification.
Observe decoded observations, including disconnect events.
Observes notifications/indications from a characteristic addressed by service+characteristic UUID, decoding each payload with decoder.
Observe decoded values with transparent reconnection.
Adapts a stream of byte chunks (e.g. from an L2CAP CoC incoming flow) into a stream of complete framed payloads.
Encode a value and write it to the L2CAP channel.
Encode a value and write it to a characteristic.
Encode a value, frame the bytes, and write the framed packet.