onInitialize method
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();
}
});
}