Skip to main content

Module bluetooth_emulation

Module bluetooth_emulation 

Source
Expand description

This domain allows configuring virtual Bluetooth devices to test the web-bluetooth API.

Types, command parameters and event payloads for the BluetoothEmulation domain. The method-name constants for the same domain are in crate::methods.

This domain is experimental and may change without notice.

Structs§

AddCharacteristicParams
Adds a characteristic with |characteristicUuid| and |properties| to the service represented by |serviceId|.
AddCharacteristicReturns
What BluetoothEmulation.addCharacteristic answers with.
AddDescriptorParams
Adds a descriptor with |descriptorUuid| to the characteristic respresented by |characteristicId|.
AddDescriptorReturns
What BluetoothEmulation.addDescriptor answers with.
AddServiceParams
Adds a service with |serviceUuid| to the peripheral with |address|.
AddServiceReturns
What BluetoothEmulation.addService answers with.
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.
CharacteristicProperties
Describes the properties of a characteristic. This follows Bluetooth Core Specification BT 4.2 Vol 3 Part G 3.3.1. Characteristic Properties.
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.
DisableParams
Disable the BluetoothEmulation domain.
EnableParams
Enable the BluetoothEmulation domain.
GattOperationReceivedEvent
Event for when a GATT operation of |type| to the peripheral with |address| happened.
ManufacturerData
Stores the manufacturer data
RemoveCharacteristicParams
Removes the characteristic respresented by |characteristicId| from the simulated central.
RemoveDescriptorParams
Removes the descriptor with |descriptorId| from the simulated central.
RemoveServiceParams
Removes the service respresented by |serviceId| from the simulated central.
ScanEntry
Stores the advertisement packet information that is sent by a Bluetooth device.
ScanRecord
Stores the byte data of the advertisement packet sent by a Bluetooth device.
SetSimulatedCentralStateParams
Set the state of the simulated central.
SimulateAdvertisementParams
Simulates an advertisement packet described in |entry| being received by the central.
SimulateCharacteristicOperationResponseParams
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.
SimulateDescriptorOperationResponseParams
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.
SimulateGattDisconnectionParams
Simulates a GATT disconnection from the peripheral with |address|.
SimulateGattOperationResponseParams
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.
SimulatePreconnectedPeripheralParams
Simulates a peripheral with |address|, |name| and |knownServiceUuids| that has already been connected to the system.

Enums§

CentralState
Indicates the various states of Central.
CharacteristicOperationType
Indicates the various types of characteristic operation.
CharacteristicWriteType
Indicates the various types of characteristic write.
DescriptorOperationType
Indicates the various types of descriptor operation.
GattOperationType
Indicates the various types of GATT event.