Package-level declarations

Types

Link copied to clipboard
sealed class MergeResult

The result of the Flow.merge operation.

Properties

Link copied to clipboard

Bluetooth UUIDs are 128-bit values used to uniquely identify services, characteristics, and descriptors. They are defined by the Bluetooth Special Interest Group (SIG).

Link copied to clipboard

Check whether the given UUID is a 16-bit UUID.

Link copied to clipboard

Check whether the given UUID is a 32-bit UUID.

Link copied to clipboard

Check whether the given UUID is a 16-bit or 32-bit UUID.

Link copied to clipboard

Extract the 16-bit or 32-bit Service Identifier of the 128-bit UUID.

Functions

Link copied to clipboard
infix fun Uuid.and(other: Uuid): Uuid

Creates a new UUID by doing a binary AND operation on bits of both UUIDs.

Link copied to clipboard

Splits the data into chunks of given length. The last chunk may be shorter.

Link copied to clipboard
fun <ID, T : Peer<ID>> Flow<T>.distinct(): Flow<T>

Returns a flow that emits only distinct peers.

Link copied to clipboard
fun Uuid.Companion.fromBytes(uuidBytes: ByteArray, offset: Int, length: Int): Uuid

Converts 2, 4 or 16 byte array to a UUID using Little Endian byte order.

Link copied to clipboard

Creates a 128-bit UUID from a 16-bit or 32-bit UUID using Bluetooth Base UUID.

Link copied to clipboard
fun Flow<ByteArray>.merge(operation: suspend (accumulator: ByteArray, received: ByteArray) -> MergeResult): Flow<ByteArray>

Collects the flow of packets and emits a new flow of merged data using the given operation.

Link copied to clipboard
fun Flow<ByteArray>.mergeIndexed(operation: suspend (accumulator: ByteArray, received: ByteArray, index: Int) -> MergeResult): Flow<ByteArray>

Collects the flow of packets and emits a new flow of merged data using the given operation.

Link copied to clipboard
fun Flow<ByteArray>.split(size: Int): Flow<ByteArray>

Collects the flow of data and emits a new flow of packet of at-most given size.

fun Flow<ByteArray>.split(size: Int, operation: suspend (data: ByteArray, size: Int) -> List<ByteArray>): Flow<ByteArray>

Collects the flow of data and emits a new flow of chunked data using the given operation.

Link copied to clipboard

Returns the UUID as Byte Array, in Little Endian.

Link copied to clipboard

Returns a string representation of the UUID.