BluetoothEmulationApi class
This domain allows configuring virtual Bluetooth devices to test the web-bluetooth API.
Constructors
- BluetoothEmulationApi.new(Client _client)
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
-
onCharacteristicOperationReceived
→ Stream<
CharacteristicOperationReceivedEvent> -
Event for when a characteristic operation of |type| to the characteristic
respresented by |characteristicId| happened. |data| and |writeType| is
expected to exist when |type| is write.
no setter
-
onDescriptorOperationReceived
→ Stream<
DescriptorOperationReceivedEvent> -
Event for when a descriptor operation of |type| to the descriptor
respresented by |descriptorId| happened. |data| is expected to exist when
|type| is write.
no setter
-
onGattOperationReceived
→ Stream<
GattOperationReceivedEvent> -
Event for when a GATT operation of |type| to the peripheral with |address|
happened.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addCharacteristic(
String serviceId, String characteristicUuid, CharacteristicProperties properties) → Future< String> - Adds a characteristic with |characteristicUuid| and |properties| to the service represented by |serviceId|. Returns: An identifier that uniquely represents this characteristic.
-
addDescriptor(
String characteristicId, String descriptorUuid) → Future< String> - Adds a descriptor with |descriptorUuid| to the characteristic respresented by |characteristicId|. Returns: An identifier that uniquely represents this descriptor.
-
addService(
String address, String serviceUuid) → Future< String> - Adds a service with |serviceUuid| to the peripheral with |address|. Returns: An identifier that uniquely represents this service.
-
disable(
) → Future< void> - Disable the BluetoothEmulation domain.
-
enable(
CentralState state, bool leSupported) → Future< void> -
Enable the BluetoothEmulation domain.
state
State of the simulated central.leSupported
If the simulated central supports low-energy. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
removeCharacteristic(
String characteristicId) → Future< void> - Removes the characteristic respresented by |characteristicId| from the simulated central.
-
removeDescriptor(
String descriptorId) → Future< void> - Removes the descriptor with |descriptorId| from the simulated central.
-
removeService(
String serviceId) → Future< void> - Removes the service respresented by |serviceId| from the simulated central.
-
setSimulatedCentralState(
CentralState state) → Future< void> -
Set the state of the simulated central.
state
State of the simulated central. -
simulateAdvertisement(
ScanEntry entry) → Future< void> - Simulates an advertisement packet described in |entry| being received by the central.
-
simulateCharacteristicOperationResponse(
String characteristicId, CharacteristicOperationType type, int code, {String? data}) → Future< void> - Simulates the response from the characteristic with |characteristicId| for a characteristic operation of |type|. The |code| value follows the Error Codes from Bluetooth Core Specification Vol 3 Part F 3.4.1.1 Error Response. The |data| is expected to exist when simulating a successful read operation response.
-
simulateDescriptorOperationResponse(
String descriptorId, DescriptorOperationType type, int code, {String? data}) → Future< void> - Simulates the response from the descriptor with |descriptorId| for a descriptor operation of |type|. The |code| value follows the Error Codes from Bluetooth Core Specification Vol 3 Part F 3.4.1.1 Error Response. The |data| is expected to exist when simulating a successful read operation response.
-
simulateGATTDisconnection(
String address) → Future< void> - Simulates a GATT disconnection from the peripheral with |address|.
-
simulateGATTOperationResponse(
String address, GATTOperationType type, int code) → Future< void> - Simulates the response code from the peripheral with |address| for a GATT operation of |type|. The |code| value follows the HCI Error Codes from Bluetooth Core Specification Vol 2 Part D 1.3 List Of Error Codes.
-
simulatePreconnectedPeripheral(
String address, String name, List< ManufacturerData> manufacturerData, List<String> knownServiceUuids) → Future<void> - Simulates a peripheral with |address|, |name| and |knownServiceUuids| that has already been connected to the system.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited