BluetoothDeviceWindows class
- Inheritance
-
- Object
- BluetoothDevice
- BluetoothDeviceWindows
Constructors
- BluetoothDeviceWindows({required String platformName, required DeviceIdentifier remoteId, int? rssi})
Properties
- advName → String
-
Advertised Named
no setterinherited
-
bondState
→ Stream<
BluetoothBondState> -
Get the current bondState of the device (Android Only)
no setterinherited
-
connectionState
→ Stream<
BluetoothConnectionState> -
The current connection state of our app to the device
no setteroverride
- disconnectReason → DisconnectReason?
-
The most recent disconnection reason
no setteroverride
- hashCode → int
-
The hash code for this object.
no setteroverride
- id → DeviceIdentifier
-
no setteroverride
- isAutoConnectEnabled → bool
-
Returns true if autoConnect is currently enabled for this device
no setterinherited
- isConnected → bool
-
Returns true if this device is currently connected to your app
no setteroverride
- isDisconnected → bool
-
Returns true if this device is currently disconnected from your app
no setteroverride
-
isDiscoveringServices
→ Stream<
bool> -
no setteroverride
- localName → String
-
no setterinherited
-
mtu
→ Stream<
int> -
Stream emits a value:
no setteroverride
- mtuNow → int
-
The current MTU size in bytes
no setterinherited
- name → String
-
no setteroverride
-
onServicesReset
→ Stream<
void> -
Services Reset Stream
no setterinherited
- platformName → String
-
platform name
final
- prevBondState → BluetoothBondState?
-
Get the previous bondState of the device (Android Only)
no setterinherited
- remoteId → DeviceIdentifier
-
finalinherited
- rssi → int?
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
services
→ Stream<
List< BluetoothService> > -
no setteroverride
-
servicesList
→ List<
BluetoothServiceWindows> -
Get services
no setteroverride
-
servicesStream
→ Stream<
List< BluetoothService> > -
Stream of bluetooth services offered by the remote device
no setteroverride
-
state
→ Stream<
BluetoothConnectionState> -
no setteroverride
Methods
-
cancelWhenDisconnected(
StreamSubscription subscription, {bool next = false, bool delayed = false}) → void -
Register a subscription to be canceled when the device is disconnected.
This function simplifies cleanup, so you can prevent creating duplicate stream subscriptions.
inherited
-
clearGattCache(
) → Future< void> -
Refresh ble services & characteristics (Android Only)
override
-
connect(
{Duration? timeout = const Duration(seconds: 35), bool autoConnect = false, int? mtu = 512}) → Future< void> -
Establishes a connection to the Bluetooth Device.
timeout
if timeout occurs, cancel the connection request and throw exceptionmtu
Android only. Request a larger mtu right after connection, if set.autoConnect
reconnect whenever the device is found - if true, this function always returns immediately. - you must listen toconnectionState
to know when connection occurs. - auto connect is turned off by callingdisconnect
- auto connect results in a slower connection process compared to a direct connection because it relies on the internal scheduling of background scans.override -
createBond(
{int timeout = 90}) → Future< void> -
Force the bonding popup to show now (Android Only)
Note! calling this is usually not necessary!! The platform does it automatically.
override
-
disconnect(
{int androidDelay = 2000, int timeout = 35, bool queue = true}) → Future< void> -
Cancels connection to the Bluetooth Device
override
-
discoverServices(
{bool subscribeToServicesChanged = true, int timeout = 15}) → Future< List< BluetoothService> > -
Discover services, characteristics, and descriptors of the remote device
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pair(
) → Future< void> -
override
-
readRssi(
{int timeout = 15}) → Future< int> -
Read the RSSI of connected remote device
override
-
removeBond(
{int timeout = 30}) → Future< void> -
Remove bond (Android Only)
override
-
requestConnectionPriority(
{required ConnectionPriority connectionPriorityRequest}) → Future< void> -
Request connection priority update (Android only)
override
-
requestMtu(
int desiredMtu, {double predelay = 0.35, int timeout = 15}) → Future< int> -
Request to change MTU (Android Only)
override
-
setPreferredPhy(
{required int txPhy, required int rxPhy, required PhyCoding option}) → Future< void> -
Set the preferred connection (Android Only)
override
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override