Methods

Chrome DevTools

BluetoothEmulation.addCharacteristic #

Adds a characteristic with |characteristicUuid| and |properties| to the service represented by |serviceId|.

Parameters

serviceId
string
characteristicUuid
string

Return object

characteristicId
string

An identifier that uniquely represents this characteristic.


Chrome DevTools

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.


Chrome DevTools

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.


Chrome DevTools

BluetoothEmulation.disable #

Disable the BluetoothEmulation domain.


Chrome DevTools

BluetoothEmulation.enable #

Enable the BluetoothEmulation domain.

Parameters

state
CentralState

State of the simulated central.

leSupported
boolean

If the simulated central supports low-energy.


Chrome DevTools

BluetoothEmulation.removeCharacteristic #

Removes the characteristic respresented by |characteristicId| from the simulated central.

Parameters

characteristicId
string

Chrome DevTools

BluetoothEmulation.removeDescriptor #

Removes the descriptor with |descriptorId| from the simulated central.

Parameters

descriptorId
string

Chrome DevTools

BluetoothEmulation.removeService #

Removes the service respresented by |serviceId| from the simulated central.

Parameters

serviceId
string

Chrome DevTools

BluetoothEmulation.setSimulatedCentralState #

Set the state of the simulated central.

Parameters

state
CentralState

State of the simulated central.


Chrome DevTools

BluetoothEmulation.simulateAdvertisement #

Simulates an advertisement packet described in |entry| being received by the central.

Parameters

entry

Chrome DevTools

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

Chrome DevTools

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

Chrome DevTools

BluetoothEmulation.simulateGATTDisconnection #

Simulates a GATT disconnection from the peripheral with |address|.

Parameters

address
string

Chrome DevTools

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
code
integer

Chrome DevTools

BluetoothEmulation.simulatePreconnectedPeripheral #

Simulates a peripheral with |address|, |name| and |knownServiceUuids| that has already been connected to the system.

Parameters

address
string
name
string
manufacturerData
knownServiceUuids
array[ string ]

Events

Chrome DevTools

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

Chrome DevTools

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

Chrome DevTools

BluetoothEmulation.gattOperationReceived #

Event for when a GATT operation of |type| to the peripheral with |address| happened.

Parameters

address
string

Types

Chrome DevTools

BluetoothEmulation.CentralState #

Indicates the various states of Central.

Type: string

Allowed values: absent, powered-off, powered-on


Chrome DevTools

BluetoothEmulation.CharacteristicOperationType #

Indicates the various types of characteristic operation.

Type: string

Allowed values: read, write, subscribe-to-notifications, unsubscribe-from-notifications


Chrome DevTools

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

Chrome DevTools

BluetoothEmulation.CharacteristicWriteType #

Indicates the various types of characteristic write.

Type: string

Allowed values: write-default-deprecated, write-with-response, write-without-response


Chrome DevTools

BluetoothEmulation.DescriptorOperationType #

Indicates the various types of descriptor operation.

Type: string

Allowed values: read, write


Chrome DevTools

BluetoothEmulation.GATTOperationType #

Indicates the various types of GATT event.

Type: string

Allowed values: connection, discovery


Chrome DevTools

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)


Chrome DevTools

BluetoothEmulation.ScanEntry #

Stores the advertisement packet information that is sent by a Bluetooth device.

Type: object

Properties

deviceAddress
string
rssi
integer
scanRecord

Chrome DevTools

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.