BluetoothEmulation Domain
This domain allows configuring virtual Bluetooth devices to test the web-bluetooth API.
Methods
- BluetoothEmulation.addCharacteristic
- BluetoothEmulation.addDescriptor
- BluetoothEmulation.addService
- BluetoothEmulation.disable
- BluetoothEmulation.enable
- BluetoothEmulation.removeCharacteristic
- BluetoothEmulation.removeDescriptor
- BluetoothEmulation.removeService
- BluetoothEmulation.setSimulatedCentralState
- BluetoothEmulation.simulateAdvertisement
- BluetoothEmulation.simulateCharacteristicOperationResponse
- BluetoothEmulation.simulateDescriptorOperationResponse
- BluetoothEmulation.simulateGATTDisconnection
- BluetoothEmulation.simulateGATTOperationResponse
- BluetoothEmulation.simulatePreconnectedPeripheral
Events
- BluetoothEmulation.characteristicOperationReceived
- BluetoothEmulation.descriptorOperationReceived
- BluetoothEmulation.gattOperationReceived
Types
- BluetoothEmulation.CentralState
- BluetoothEmulation.CharacteristicOperationType
- BluetoothEmulation.CharacteristicProperties
- BluetoothEmulation.CharacteristicWriteType
- BluetoothEmulation.DescriptorOperationType
- BluetoothEmulation.GATTOperationType
- BluetoothEmulation.ManufacturerData
- BluetoothEmulation.ScanEntry
- BluetoothEmulation.ScanRecord
Methods
BluetoothEmulation.addCharacteristic #
Adds a characteristic with |characteristicUuid| and |properties| to the service represented by |serviceId|.
Parameters
serviceId
string
characteristicUuid
string
properties
Return object
characteristicId
string
An identifier that uniquely represents this characteristic.
BluetoothEmulation.addDescriptor #
Adds a descriptor with |descriptorUuid| to the characteristic respresented by |characteristicId|.
Parameters
characteristicId
string
descriptorUuid
string
Return object
descriptorId
string
An identifier that uniquely represents this descriptor.
BluetoothEmulation.addService #
Adds a service with |serviceUuid| to the peripheral with |address|.
Parameters
address
string
serviceUuid
string
Return object
serviceId
string
An identifier that uniquely represents this service.
BluetoothEmulation.enable #
Enable the BluetoothEmulation domain.
Parameters
state
State of the simulated central.
leSupported
boolean
If the simulated central supports low-energy.
BluetoothEmulation.removeCharacteristic #
Removes the characteristic respresented by |characteristicId| from the simulated central.
Parameters
characteristicId
string
BluetoothEmulation.removeDescriptor #
Removes the descriptor with |descriptorId| from the simulated central.
Parameters
descriptorId
string
BluetoothEmulation.removeService #
Removes the service respresented by |serviceId| from the simulated central.
Parameters
serviceId
string
BluetoothEmulation.setSimulatedCentralState #
Set the state of the simulated central.
Parameters
state
State of the simulated central.
BluetoothEmulation.simulateAdvertisement #
Simulates an advertisement packet described in |entry| being received by the central.
Parameters
entry
BluetoothEmulation.simulateCharacteristicOperationResponse #
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.
Parameters
characteristicId
string
code
integer
data
Optional
string
BluetoothEmulation.simulateDescriptorOperationResponse #
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.
Parameters
descriptorId
string
code
integer
data
Optional
string
BluetoothEmulation.simulateGATTDisconnection #
Simulates a GATT disconnection from the peripheral with |address|.
Parameters
address
string
BluetoothEmulation.simulateGATTOperationResponse #
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.
Parameters
address
string
type
code
integer
BluetoothEmulation.simulatePreconnectedPeripheral #
Simulates a peripheral with |address|, |name| and |knownServiceUuids| that has already been connected to the system.
Parameters
address
string
name
string
manufacturerData
array[ ManufacturerData ]
knownServiceUuids
array[ string
]
Events
BluetoothEmulation.characteristicOperationReceived #
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.
Parameters
characteristicId
string
data
Optional
string
writeType
Optional
BluetoothEmulation.descriptorOperationReceived #
Event for when a descriptor operation of |type| to the descriptor respresented by |descriptorId| happened. |data| is expected to exist when |type| is write.
Parameters
descriptorId
string
data
Optional
string
BluetoothEmulation.gattOperationReceived #
Event for when a GATT operation of |type| to the peripheral with |address| happened.
Parameters
address
string
type
Types
BluetoothEmulation.CentralState #
Indicates the various states of Central.
Type: string
Allowed values: absent
, powered-off
, powered-on
BluetoothEmulation.CharacteristicOperationType #
Indicates the various types of characteristic operation.
Type: string
Allowed values: read
, write
, subscribe-to-notifications
, unsubscribe-from-notifications
BluetoothEmulation.CharacteristicProperties #
Describes the properties of a characteristic. This follows Bluetooth Core Specification BT 4.2 Vol 3 Part G 3.3.1. Characteristic Properties.
Type: object
Properties
broadcast
Optional
boolean
read
Optional
boolean
writeWithoutResponse
Optional
boolean
write
Optional
boolean
notify
Optional
boolean
indicate
Optional
boolean
authenticatedSignedWrites
Optional
boolean
extendedProperties
Optional
boolean
BluetoothEmulation.CharacteristicWriteType #
Indicates the various types of characteristic write.
Type: string
Allowed values: write-default-deprecated
, write-with-response
, write-without-response
BluetoothEmulation.DescriptorOperationType #
Indicates the various types of descriptor operation.
Type: string
Allowed values: read
, write
BluetoothEmulation.GATTOperationType #
Indicates the various types of GATT event.
Type: string
Allowed values: connection
, discovery
BluetoothEmulation.ManufacturerData #
Stores the manufacturer data
Type: object
Properties
key
integer
Company identifier https://bitbucket.org/bluetooth-SIG/public/src/main/assigned_numbers/company_identifiers/company_identifiers.yaml https://usb.org/developers
data
string
Manufacturer-specific data (Encoded as a base64 string when passed over JSON)
BluetoothEmulation.ScanEntry #
Stores the advertisement packet information that is sent by a Bluetooth device.
Type: object
Properties
deviceAddress
string
rssi
integer
scanRecord
BluetoothEmulation.ScanRecord #
Stores the byte data of the advertisement packet sent by a Bluetooth device.
Type: object
Properties
name
Optional
string
uuids
Optional
array[ string
]
appearance
Optional
integer
Stores the external appearance description of the device.
txPower
Optional
integer
Stores the transmission power of a broadcasting device.
manufacturerData
Optional
array[ ManufacturerData ]
Key is the company identifier and the value is an array of bytes of manufacturer specific data.