startNotifications method

  1. @override
Future<void> startNotifications()
override

Implementation

@override
Future<void> startNotifications() async {
  final characteristic = _getCharacteristic();
  _subscription = backend.characteristicNotified.listen((data) {
    if (data.peripheral.uuid != peripheral.uuid ||
        data.characteristic.uuid != characteristicId) return;
    notifyData(data.value);
  });
  await backend.setCharacteristicNotifyState(peripheral, characteristic!,
      state: true);
}