DeviceController class

A DeviceController handles runtime management of all devices and services available to this phone, including the phone itself.

Each specific device is handled by a DeviceManager which are available as a map of devices.

Constructors

DeviceController()
Get the singleton DeviceController.
factory

Properties

batteryEvents Stream<BatteryStatus>
The stream of all battery events from all connected devices.
no setter
connectedDevices List<DeviceManager<DeviceConfiguration<DeviceRegistration>>>
The list of connected devices on runtime.
no setter
devices Map<String, DeviceManager<DeviceConfiguration<DeviceRegistration>>>
The devices available in this DeviceDataCollectorFactory mapped to their device type.
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
smartphoneDeviceManager SmartphoneDeviceManager
The smartphone (primary device) manager.
no setter

Methods

createDevice(String deviceType) Future<DeviceManager<DeviceConfiguration<DeviceRegistration>>?>
Create and register a DeviceDataCollector based on a deviceType. Returns null if a device cannot be created.
override
devicesToString() String
A string representation of all devices.
disconnectAllConnectedDevices() Future<void>
A convenient method for disconnecting all connected devices.
getDevice(String deviceType) DeviceManager<DeviceConfiguration<DeviceRegistration>>?
Returns the DeviceDataCollector of the given deviceType. Returns null if no device is found.
override
hasDevice(String deviceType) bool
Returns true if this factory contain a device manager of the given deviceType.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerAllAvailableDevices() → void
A convenient method for creating and registering all devices which are available in each SamplingPackage that has been registered in the SamplingPackageRegistry.
registerDevice(String deviceType, DeviceDataCollector<DeviceConfiguration<DeviceRegistration>> manager) → void
Register and initialize a DeviceDataCollector for a deviceType.
override
supportsDevice(String type) bool
Returns true if this factory supports a device of the given deviceType. Note that even though a certain type of device is supported, its device DeviceDataCollector is not loaded until registerDevice is called.
override
toString() String
A string representation of this object.
override
unregisterDevice(String deviceType) → void
override

Operators

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

Constants

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