onInitialize method

  1. @override
  2. @mustCallSuper
void onInitialize(
  1. DeviceDescriptor descriptor
)
override

Callback on initialize.

Is to be overridden in sub-classes. Note, however, that it must not be doing a lot of work on startup.

Implementation

@override
@mustCallSuper
void onInitialize(DeviceDescriptor descriptor) {
  statusEvents.listen((event) {
    // when this device is (re)connected, restart sampling
    if (event == DeviceStatus.connected) {
      restart();
    }
  });
}