startNotifications method

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

Implementation

@override
Future<void> startNotifications() async {
  final characteristic = _getCharacteristic();
  _subscription = characteristic.propertiesChanged
      .where((properties) => properties.contains('Value'))
      .listen((properties) {
    notifyData(Uint8List.fromList(characteristic.value));
  });
  await characteristic.startNotify();
}