MockBleDevice class

Implemented types

Constructors

MockBleDevice({required String device})

Properties

device String
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

connect({Duration duration = const Duration(seconds: 2), bool autoConnect = false}) Future<IBleDevice>
Connect to the Device
override
disableCharacteristicIndicate({required String serviceUuid, required String charUuid}) Future<bool>
Tries to disable the specified characteristic to indicate. @param serviceUuid UUID of the service the characteristic belongs to. @param charUuid UUID of the characteristic to enable notify for.
override
disableCharacteristicNotify({required String serviceUuid, required String charUuid}) Future<bool>
Tries to disable the specified characteristic notify. @param serviceUuid UUID of the service the characteristic belongs to. @param charUuid UUID of the characteristic to enable notify for.
override
disconnect() Future<IBleDevice>
Disconnect from the Device
override
discoverServices({bool refresh = false}) Future<void>
Discover the available services in the BLE device.
override
enableCharacteristicIndicate({required String serviceUuid, required String charUuid}) Future<bool>
Tries to enable the specified characteristic to indicate. @param serviceUuid UUID of the service the characteristic belongs to. @param charUuid UUID of the characteristic to enable notify for.
override
enableCharacteristicNotify({required String serviceUuid, required String charUuid}) Future<bool>
Tries to enable the specified characteristic notify. @param serviceUuid UUID of the service the characteristic belongs to. @param charUuid UUID of the characteristic to enable notify for.
override
getConnectionState() BleConnectionState
Returns the connection state for this device. @return connection state for the device, or BleConnectionState.UNKNOWN if state cannot be detected.
override
getConnectionStates() Stream<BleConnectionState>
Returns stream to listen for changes in connection states.
override
getId() String
Returns the ID of the device.
override
getName() String
Returns the device name.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
readCharacteristic({required String serviceUuid, required String charUuid}) Future<IBluetoothGattCharacteristic>
Reads a the specified chracteristic from the service @param serviceUuid 128 bit UUID of the service @param charUuid 128 bit UUID of the characteristic
override
reconnect() Future<IBleDevice>
Tries to reconnect the device.
override
setOnCharacteristicChangeListener({IBleCharacteristicChangeListener? listener}) → void
Sets a listener to be notified when a characteristic changes. @param listener to be called when a characteristic changes.
override
setOnDeviceConnectionsStateChangeListener({IBleDeviceConnectionStateChangeListener? listener}) → void
Sets the listener to be notified when the connection state of the device changes. @param listener to be called when the connection state changes.
override
toString() String
A string representation of this object.
inherited
writeCharacteristic({required String serviceUuid, required String charUuid, required Uint8List value}) Future<IBluetoothGattCharacteristic>
Writes the value to the specified characteristic of the given service. @param serviceUuid 128 bit UUID of the service @param charUuid 128 bit UUID of the characteristic @param value bytes of the value to write
override

Operators

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