BluetoothManager class abstract
Manages Bluetooth operations such as device discovery, connection, disconnection, and streaming data for BLE devices.
This class is responsible for handling all the Bluetooth-related operations.
Constructors
Properties
-
adapterState
→ Stream<
BleAdapterState> -
A stream of
BleAdapterState
representing the state of the Bluetooth adapter.no setter - hashCode → int
-
The hash code for this object.
no setterinherited
-
isBluetoothAvailable
→ Future<
bool> -
Checks if Bluetooth is available on the device.
no setter
- isScanning → bool
-
Checks if the Bluetooth adapter is currently scanning for devices (discovery).
no setter
-
isScanningStream
→ Stream<
bool> -
A stream of
bool
representing the scanning state.no setter -
listenToDiscoveredDevices
→ Stream<
BleDiscoveredDevice> -
A stream of
BleDiscoveredDevice
representing discovered BLE devices.no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
connect(
String deviceId) → Future< void> -
Connects to the BLE device with the given
deviceId
. -
disconnect(
String deviceId) → Future< void> -
Disconnects from the BLE device with the given
deviceId
. -
dispose(
) → Future< void> - Cleans up BLE-related resources when no longer needed.
-
getLatestBatteryPercentage(
String deviceId) → int -
Gets the latest battery percentage for the given
deviceId
. -
getLatestBatteryStatus(
String deviceId) → BatteryLevelStatus -
Gets the latest battery status for the given
deviceId
. -
listenToConnectionState(
String deviceId) → Stream< BleDeviceConnectionState> -
Listens to the connection state of the BLE device with the given
deviceId
. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
startDiscovery(
) → Future< void> - Starts the BLE device discovery process.
-
stopDiscovery(
) → Future< void> - Stops the BLE device discovery process.
-
subscribeToBarcodeDataStream(
String deviceId) → Future< Stream< BarcodeData> > -
Subscribes to the barcode data stream from the BLE device with the given
deviceId
. -
subscribeToBatteryPercentageStream(
String deviceId) → Future< Stream< int> > -
Subscribes to the battery percentage stream from the BLE device with the given
deviceId
. -
subscribeToBatteryStatusStream(
String deviceId) → Future< Stream< BatteryLevelStatus> > -
Subscribes to the battery status stream from the BLE device with the given
deviceId
. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited