BleMessageClientConvenience extension

Typed fields and finite discovery on the same connection as complete messages.

on

Methods

discover({Duration duration = const Duration(seconds: 3), bool requestPermissions = true, int maxResults = 256}) → Future<List<BleDiscoveredServer>>

Available on BleMessageClient, provided by the BleMessageClientConvenience extension

Scans for this message protocol and returns one latest result per device. No device is connected automatically. The scan stops after duration. Set requestPermissions to false to manage permission prompts separately.
readValue<T>(BleFieldDefinition<T> field) → Future<T>

Available on BleMessageClient, provided by the BleMessageClientConvenience extension

Reads and decodes one custom field from the connected server.
watchValue<T>(BleFieldDefinition<T> field) → Future<Stream<T>>

Available on BleMessageClient, provided by the BleMessageClientConvenience extension

Subscribes to a typed field. Listen to the returned stream and cancel that subscription when finished; the last watcher releases the native resource.
watchValues(List<BleFieldDefinition> fields) → Stream<BleFieldUpdate>

Available on BleMessageClient, provided by the BleMessageClientConvenience extension

Combines multiple fields into one stream, retaining each field's identity.
writeValue<T>(BleFieldDefinition<T> field, T value) → Future<void>

Available on BleMessageClient, provided by the BleMessageClientConvenience extension

Writes one custom field with a response. The value must fit the peer limit.