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 stringcharacteristicUuid stringproperties Return object
characteristicId stringAn identifier that uniquely represents this characteristic.
BluetoothEmulation.addDescriptor #
Adds a descriptor with |descriptorUuid| to the characteristic respresented by |characteristicId|.
Parameters
characteristicId stringdescriptorUuid stringReturn object
descriptorId stringAn identifier that uniquely represents this descriptor.
BluetoothEmulation.addService #
Adds a service with |serviceUuid| to the peripheral with |address|.
Parameters
address stringserviceUuid stringReturn object
serviceId stringAn identifier that uniquely represents this service.
BluetoothEmulation.enable #
Enable the BluetoothEmulation domain.
Parameters
state State of the simulated central.
leSupported booleanIf the simulated central supports low-energy.
BluetoothEmulation.removeCharacteristic #
Removes the characteristic respresented by |characteristicId| from the simulated central.
Parameters
characteristicId stringBluetoothEmulation.removeDescriptor #
Removes the descriptor with |descriptorId| from the simulated central.
Parameters
descriptorId stringBluetoothEmulation.removeService #
Removes the service respresented by |serviceId| from the simulated central.
Parameters
serviceId stringBluetoothEmulation.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 stringcode integerdataOptional
stringBluetoothEmulation.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 stringcode integerdataOptional
stringBluetoothEmulation.simulateGATTDisconnection #
Simulates a GATT disconnection from the peripheral with |address|.
Parameters
address stringBluetoothEmulation.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 stringtype code integerBluetoothEmulation.simulatePreconnectedPeripheral #
Simulates a peripheral with |address|, |name| and |knownServiceUuids| that has already been connected to the system.
Parameters
address stringname stringmanufacturerData 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 stringdataOptional
stringwriteTypeOptional
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 stringdataOptional
stringBluetoothEmulation.gattOperationReceived #
Event for when a GATT operation of |type| to the peripheral with |address| happened.
Parameters
address stringtype 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
broadcastOptional
booleanreadOptional
booleanwriteWithoutResponseOptional
booleanwriteOptional
booleannotifyOptional
booleanindicateOptional
booleanauthenticatedSignedWritesOptional
booleanextendedPropertiesOptional
booleanBluetoothEmulation.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 integerCompany identifier https://bitbucket.org/bluetooth-SIG/public/src/main/assigned_numbers/company_identifiers/company_identifiers.yaml https://usb.org/developers
data stringManufacturer-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 stringrssi integerscanRecord BluetoothEmulation.ScanRecord #
Stores the byte data of the advertisement packet sent by a Bluetooth device.
Type: object
Properties
nameOptional
stringuuidsOptional
array[ string ]appearanceOptional
integerStores the external appearance description of the device.
txPowerOptional
integerStores the transmission power of a broadcasting device.
manufacturerDataOptional
array[ ManufacturerData ]Key is the company identifier and the value is an array of bytes of manufacturer specific data.