Update dashboard, kb, memory +4 more (+28 ~18 -1)

This commit is contained in:
Echo
2026-02-06 14:25:10 +00:00
parent 7f64d5054a
commit 19d178268a
6767 changed files with 1346472 additions and 1282 deletions

View File

@@ -0,0 +1,47 @@
/**
* @license
* Copyright 2025 Google Inc.
* SPDX-License-Identifier: Apache-2.0
*/
import type {
AdapterState,
BluetoothEmulation,
PreconnectedPeripheral,
} from '../api/BluetoothEmulation.js';
import type {Connection} from './Connection.js';
/**
* @internal
*/
export class CdpBluetoothEmulation implements BluetoothEmulation {
#connection: Connection;
constructor(connection: Connection) {
this.#connection = connection;
}
async emulateAdapter(state: AdapterState, leSupported = true): Promise<void> {
// Bluetooth spec requires overriding the existing adapter (step 6). From the CDP
// perspective, it means disabling the emulation first.
// https://webbluetoothcg.github.io/web-bluetooth/#bluetooth-simulateAdapter-command
await this.#connection.send('BluetoothEmulation.disable');
await this.#connection.send('BluetoothEmulation.enable', {
state,
leSupported,
});
}
async disableEmulation(): Promise<void> {
await this.#connection.send('BluetoothEmulation.disable');
}
async simulatePreconnectedPeripheral(
preconnectedPeripheral: PreconnectedPeripheral,
): Promise<void> {
await this.#connection.send(
'BluetoothEmulation.simulatePreconnectedPeripheral',
preconnectedPeripheral,
);
}
}