DeviceController class

Keeps the DeviceManager of every device and service on this phone.

This includes the phone itself. A singleton, used by the SmartPhoneClientManager as its DeviceDataCollectorFactory. Device managers come from the SamplingPackages registered in the SamplingPackageRegistry, one per device type, and are kept in devices.

Use it to find a device manager, e.g. to connect a Bluetooth device: SmartPhoneClientManager().deviceController.getDeviceManager(type).

Inheritance
  • Object
  • DeviceDataCollectorFactory
  • DeviceController

Constructors

DeviceController()
Returns the singleton DeviceController.
factory

Properties

connectedDevices → List<DeviceManager<DeviceConfiguration<DeviceRegistration>, DeviceRegistration>>
The device managers whose device is connected now.
no setter
devices → Map<String, DeviceManager<DeviceConfiguration<DeviceRegistration>, DeviceRegistration>>
The registered device managers, by device type.
no setter
hashCode → int
The hash code for this object.
no setterinherited
localDataCollector ↔ DeviceDataCollector
The data collector for the primary device.
getter/setter pairinherited-setteroverride-getter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
smartphoneDeviceManager → SmartphoneDeviceManager
The device manager of this phone (the primary device).
no setter

Methods

createConnectedDataCollector(String deviceType, DeviceRegistration deviceRegistration) → DeviceManager<DeviceConfiguration<DeviceRegistration>, DeviceRegistration>?
Create a ConnectedDeviceDataCollector for a connected deviceType using connection options specified in deviceRegistration.
override
devicesToString() → String
The short names of all device types in devices, for logging.
disconnectAllConnectedDevices() → Future<void>
Starts disconnecting all connectedDevices. Does not wait for them.
getDeviceManager(String deviceType) → DeviceManager<DeviceConfiguration<DeviceRegistration>, DeviceRegistration>?
Returns the device manager for deviceType.
hasDevice(String deviceType) → bool
Whether a device manager for deviceType is registered in devices.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerAllAvailableDevices() → void
Registers the device managers of all packages in SamplingPackageRegistry.
registerDevice(String deviceType, DeviceManager<DeviceConfiguration<DeviceRegistration>, DeviceRegistration> manager) → void
Registers manager for deviceType.
supportsDevice(String deviceType) → bool
Whether a registered SamplingPackage provides the device deviceType.
toString() → String
A string representation of this object.
override
unregisterDevice(String deviceType) → void
Unregister the manager for deviceType.

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Constants

HEARTBEAT_PERIOD → const int
The period of sending Heartbeat measurements, in minutes.