FakeBleService

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard

Optional suspend hook invoked after the attempt is counted and before writeException is evaluated, so it also runs for writes that then fail.

Characteristic-specific observe failures that occur before BleService.observe's onSubscription callback.

Link copied to clipboard

When non-null, observe returns a flow that immediately throws. Reset to null when observe() is called (before flow collection).

Link copied to clipboard

Characteristic-specific observe failures that occur when the returned flow is collected.

Link copied to clipboard

Characteristics whose 2-arg observe never invokes onSubscription. Notifications can still be emitted.

Link copied to clipboard

When non-null, read throws this exception instead of returning data. Reset to null before throwing (in the same call).

Link copied to clipboard

Counts every write invocation, including attempts that fail before they can be recorded in writes.

Link copied to clipboard

When non-null, write throws this exception on every call until explicitly cleared.

Link copied to clipboard

Functions

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun emitNotification(uuid: Uuid, data: ByteArray)
Link copied to clipboard
fun enqueueRead(uuid: Uuid, data: ByteArray)
Link copied to clipboard
open override fun hasCharacteristic(characteristic: BleCharacteristic): Boolean
Link copied to clipboard
open override fun observe(characteristic: BleCharacteristic): Flow<ByteArray>

open override fun observe(characteristic: BleCharacteristic, onSubscription: suspend () -> Unit): Flow<ByteArray>

Overrides the 2-arg observe to prevent false subscriptionReady when testing pre-readiness failures.

Link copied to clipboard
open override fun preferredWriteType(characteristic: BleCharacteristic): BleWriteType
Link copied to clipboard
open suspend override fun read(characteristic: BleCharacteristic): ByteArray
Link copied to clipboard
open suspend override fun write(characteristic: BleCharacteristic, data: ByteArray, writeType: BleWriteType)