BluetoothEmulation interface
Exposes the bluetooth emulation abilities.
Signature
export interface BluetoothEmulation
Remarks
Web Bluetooth specification requires the emulated adapters should be isolated per top-level navigable. However, at the moment Chromium's bluetooth emulation implementation is tight to the browser context, not the page. This means the bluetooth emulation exposed from different pages of the same browser context would interfere their states.
Example
await page.bluetooth.emulateAdapter('powered-on');
await page.bluetooth.simulatePreconnectedPeripheral({
address: '09:09:09:09:09:09',
name: 'SOME_NAME',
manufacturerData: [
{
key: 17,
data: 'AP8BAX8=',
},
],
knownServiceUuids: ['12345678-1234-5678-9abc-def123456789'],
});
await page.bluetooth.disableEmulation();
Methods
Method | Description |
|---|---|
| disableEmulation() | (Experimental) Disable emulated bluetooth adapter. See bluetooth.disableSimulation. |
| emulateAdapter(state, leSupported) | (Experimental) Emulate Bluetooth adapter. Required for bluetooth simulations See bluetooth.simulateAdapter. |
| simulatePreconnectedPeripheral(preconnectedPeripheral) | (Experimental) Simulated preconnected Bluetooth Peripheral. See bluetooth.simulatePreconnectedPeripheral. |