notifyClient method

  1. @override
Future<void> notifyClient(
  1. String characteristicUuid,
  2. List<int> value,
  3. String clientId
)
override

Implementation

@override
Future<void> notifyClient(
  String characteristicUuid,
  List<int> value,
  String clientId,
) async {
  if (activeProfile == null ||
      subscribers[characteristicUuid]?.contains(clientId) != true) {
    throw StateError('Client is not subscribed');
  }
  final event = <String, Object>{
    'uuid': characteristicUuid,
    'value': List<int>.of(value),
    'clientId': clientId,
  };
  notifications.add(event);
  _notificationEvents.add(event);
}