subscribe method
Enables notifications/indications on characteristic and streams the
values the peripheral pushes. Cancelling the subscription disables them.
Implementation
@override
Stream<Uint8List> subscribe(Uuid service, Uuid characteristic) {
final err = subscribeError;
if (err != null) throw err;
final c = _notify.putIfAbsent(
characteristic,
() => StreamController<Uint8List>.broadcast(
onListen: () => notifyEnabled[characteristic] = true,
onCancel: () => notifyEnabled[characteristic] = false,
),
);
return c.stream;
}