BleMessageServerConvenience extension

Common message-server operations without exposing the underlying GATT server.

on

Methods

forward(BleReceivedMessage message, {String? clientId}) → Future<void>

Available on BleMessageServer, provided by the BleMessageServerConvenience extension

Forwards unchanged bytes to clientId, or to everyone except the sender. Throws if no recipient is subscribed. Does not retain sender identity in the payload: use an application envelope when recipients need that detail. IDs are connection-local; applications must authorize routing themselves.
readStoredValue<T>(BleField<T> field) → T

Available on BleMessageServer, provided by the BleMessageServerConvenience extension

Reads a custom field's local value without making a Bluetooth request.
replyBytes(BleReceivedMessage message, List<int> bytes) → Future<void>

Available on BleMessageServer, provided by the BleMessageServerConvenience extension

Sends a complete byte reply only to the original sender.
replyJson(BleReceivedMessage message, Object? value) → Future<void>

Available on BleMessageServer, provided by the BleMessageServerConvenience extension

Sends a JSON reply only to the original sender.
replyText(BleReceivedMessage message, String text) → Future<void>

Available on BleMessageServer, provided by the BleMessageServerConvenience extension

Sends a UTF-8 reply only to the original sender.
startWithPermissions() → Future<void>

Available on BleMessageServer, provided by the BleMessageServerConvenience extension

Requests OS permission, verifies readiness and begins advertising.
updateStoredValue<T>(BleField<T> field, T value, {bool notify = false}) → Future<void>

Available on BleMessageServer, provided by the BleMessageServerConvenience extension

Stores a value and optionally notifies subscribers. Notifications must fit each recipient's payload limit; use complete messages for larger data.