BLEDeviceManager<TDeviceConfiguration extends BLEDevice<TRegistration> , TRegistration extends BLEDeviceRegistration> class
abstract
A device manager for a connectable Bluetooth Low Energy (BLE) device.
- Inheritance
-
- Object
- DeviceManager<
TDeviceConfiguration, TRegistration> - HardwareDeviceManager<
TDeviceConfiguration, TRegistration> - BLEDeviceManager
Constructors
- BLEDeviceManager(String deviceType, {TDeviceConfiguration? configuration})
Properties
-
batteryEvents
→ Stream<
int> -
The stream of battery level events (0-100) from this hardware device.
no setterinherited
- batteryLevel → int?
-
The runtime battery level of this hardware device in percent (0-100).
Returns null if unknown.
no setterinherited
- bleAddress ↔ String?
-
The BLE address of this device.
getter/setter pair
- bleName ↔ String?
-
The BLE name of this device, if known.
getter/setter pair
- 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 setterinherited
- deviceType → String
-
The type of the device managed by this device manager
no setterinherited
- displayName → String?
-
Default display name for a BLE device is its BLE name or address.
no setteroverride
-
executors
→ Set<
TaskControlExecutor> -
The set of task control executors that use this device manager.
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- isConfigured → bool
-
Has this device manager been configured?
no setterinherited
- isConnected → bool
-
Is this device manager connected to the real device?
no setterinherited
- isConnecting → bool
-
Is this device manager connecting or already connected to a device?
no setterinherited
-
manufacturerData
↔ List<
int> -
Manufacturer specific data. The first 2 bytes are the Company Identifier Codes.
getter/setter pair
- registration → TRegistration?
-
The latest registration for this device.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
serviceUuids
↔ List<
String> -
Advertised services of this device, if known.
getter/setter pair
- 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 setterinherited
- status ↔ DeviceStatus
-
The runtime status of this device.
getter/setter pairinherited
-
statusEvents
→ Stream<
DeviceStatus> -
The stream of status events for this device.
no setterinherited
-
supportedDataTypes
→ Set<
DataType> -
The set of data types defining which data can be collected on this device.
no setterinherited
- typeName → String
-
The name of the deviceType without the namespace.
no setterinherited
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.inherited -
connect(
) → Future< DeviceStatus> -
Ask this DeviceManager to start connecting to the device.
Returns the DeviceStatus of the device.
inherited
-
createRegistration(
) → TRegistration -
Create a device registration which can be used to configure this device
for deployment.
inherited
-
disconnect(
) → Future< bool> -
Ask this DeviceManager to disconnect from the device.
inherited
-
hasPermissions(
) → Future< bool> -
Does this device manager have the
permissionsto run?inherited -
isDisconnecting(
) → Future< void> -
Callback when the physical device is disconnected due to e.g., a temporary
loss of Bluetooth connection.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onConfigure(
) → void -
Callback on configure.
override
-
onConnect(
) → Future< DeviceStatus> -
Callback on connect. Returns the DeviceStatus of the device.
inherited
-
onDisconnect(
) → Future< bool> -
Callback on disconnect.
inherited
-
onHasPermissions(
) → Future< bool> -
Callback on hasPermissions.
override
-
onPaired(
) → bool - Callback on pair.
-
onRequestPermissions(
) → Future< void> -
Callback on requestPermissions.
override
-
pair(
{required String bleAddress, String? bleName, List< String> ? serviceUuids, List<int> ? manufacturerData}) → void -
Pair this device manager with a BLE device by specifying the
bleAddress, and optionally itsbleName,serviceUuids, andmanufacturerData. -
requestPermissions(
) → Future< void> -
Request all
permissionsfor this device manager.inherited -
restart(
) → void -
Restart sampling of the measures using this device.
inherited
-
start(
) → void -
Start sampling of all measures using this device.
inherited
-
stop(
{bool shouldBeResumed = false}) → void -
Stop sampling the measures using this device.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited