initialize method

  1. @nonVirtual
void initialize(
  1. HealthService configuration
)
inherited

Initialize the device manager by specifying its configuration.

Implementation

@nonVirtual
void initialize(TDeviceConfiguration configuration) {
  info(
      '$runtimeType - Initializing, type: $typeName, configuration: $configuration');
  super.configuration = configuration;
  onInitialize(configuration);

  // Listen to status events and when this device is (re)connected, restart sampling.
  if (restartOnReconnect) {
    statusEvents
        .where((status) => status == DeviceStatus.connected)
        .listen((_) => restart());
  }
  status = DeviceStatus.initialized;
}