DeviceManager<TDeviceConfiguration extends DeviceConfiguration<TRegistration> , TRegistration extends DeviceRegistration> class
abstract
A DeviceManager handles the runtime of any type of device or service used for data collection.
Examples include a hardware device like a smartwatch or fitness band, an onboard service on the smartphone like a location service, or an online service, like a weather service.
- Implemented types
-
- DeviceDataCollector
- Implementers
Constructors
- DeviceManager(String deviceType, {TDeviceConfiguration? configuration})
-
Create a new DeviceManager specifying its
deviceType.
Properties
- canConnect → bool
-
Determines whether a connection can be made at this point in time to the device.
no setterinherited
- configuration → TDeviceConfiguration?
-
The configuration for this device.
no setter
- deviceType → String
-
The type of the device managed by this device manager
no setter
- displayName → String?
-
no setter
-
executors
→ Set<
TaskControlExecutor> -
The set of task control executors that use this device manager.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isConfigured → bool
-
Has this device manager been configured?
no setter
- isConnected → bool
-
Is this device manager connected to the real device?
no setter
- isConnecting → bool
-
Is this device manager connecting or already connected to a device?
no setter
- registration → TRegistration?
-
The latest registration for this device.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- shouldConnect → bool
-
Indicates whether this device manager should connect to the real device
based on the last known registration information.
Returns true (default) if no prior registration information is available,
no setter
- status ↔ DeviceStatus
-
The runtime status of this device.
getter/setter pair
-
statusEvents
→ Stream<
DeviceStatus> -
The stream of status events for this device.
no setter
-
supportedDataTypes
→ Set<
DataType> -
The set of data types defining which data can be collected on this device.
no setteroverride
- typeName → String
-
The name of the deviceType without the namespace.
no setter
Methods
-
configure(
TDeviceConfiguration configuration, [TRegistration? registration]) → void -
Configure this device manager by specifying its
configuration. Optionally, aregistrationcan be specified to provide runtime information about the real device, e.g., the BLE address of a Bluetooth device. -
connect(
) → Future< DeviceStatus> - Ask this DeviceManager to start connecting to the device. Returns the DeviceStatus of the device.
-
createRegistration(
) → TRegistration - Create a device registration which can be used to configure this device for deployment.
-
disconnect(
) → Future< bool> - Ask this DeviceManager to disconnect from the device.
-
hasPermissions(
) → Future< bool> -
Does this device manager have the
permissionsto run? -
isDisconnecting(
) → Future< void> - Callback when the physical device is disconnected due to e.g., a temporary loss of Bluetooth connection.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onConfigure(
) → void - Callback on configure.
-
onConnect(
) → Future< DeviceStatus> - Callback on connect. Returns the DeviceStatus of the device.
-
onDisconnect(
) → Future< bool> - Callback on disconnect.
-
onHasPermissions(
) → Future< bool> - Callback on hasPermissions.
-
onRequestPermissions(
) → Future< void> - Callback on requestPermissions.
-
requestPermissions(
) → Future< void> -
Request all
permissionsfor this device manager. -
restart(
) → void - Restart sampling of the measures using this device.
-
start(
) → void - Start sampling of all measures using this device.
-
stop(
{bool shouldBeResumed = false}) → void - Stop sampling the measures using this device.
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited