UNPKG

selenium-webdriver

Version:

The official WebDriver JavaScript bindings from the Selenium project

261 lines (260 loc) • 31.8 kB
"use strict"; // Licensed to the Software Freedom Conservancy (SFC) under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The SFC licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use this file except in compliance // with the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, // software distributed under the License is distributed on an // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY // KIND, either express or implied. See the License for the // specific language governing permissions and limitations // under the License. Object.defineProperty(exports, "__esModule", { value: true }); exports.Bluetooth = void 0; // DO NOT EDIT! This file is generated by javascript/selenium-webdriver/generate_bidi.mjs. // Regenerate with: `bazel build //javascript/selenium-webdriver:create-bidi-src` // Built from the WebDriver BiDi CDDL spec (v1.0). // Source: https://github.com/w3c/webref/tree/main/ed/cddl const record_js_1 = require("../serialization/record.js"); const enum_js_1 = require("../serialization/enum.js"); const union_js_1 = require("../serialization/union.js"); const domain_js_1 = require("../domain.js"); (0, record_js_1.defineAlias)('bluetooth.BluetoothUuid', { "primitive": "string" }); const BluetoothBluetoothManufacturerData = (0, record_js_1.defineRecord)('bluetooth.BluetoothManufacturerData', [{ "name": "key", "wire": "key", "required": true, "type": { "primitive": "integer" } }, { "name": "data", "wire": "data", "required": true, "type": { "primitive": "string" } }]); const BluetoothCharacteristicProperties = (0, record_js_1.defineRecord)('bluetooth.CharacteristicProperties', [{ "name": "broadcast", "wire": "broadcast", "required": false, "type": { "primitive": "boolean" } }, { "name": "read", "wire": "read", "required": false, "type": { "primitive": "boolean" } }, { "name": "writeWithoutResponse", "wire": "writeWithoutResponse", "required": false, "type": { "primitive": "boolean" } }, { "name": "write", "wire": "write", "required": false, "type": { "primitive": "boolean" } }, { "name": "notify", "wire": "notify", "required": false, "type": { "primitive": "boolean" } }, { "name": "indicate", "wire": "indicate", "required": false, "type": { "primitive": "boolean" } }, { "name": "authenticatedSignedWrites", "wire": "authenticatedSignedWrites", "required": false, "type": { "primitive": "boolean" } }, { "name": "extendedProperties", "wire": "extendedProperties", "required": false, "type": { "primitive": "boolean" } }]); (0, record_js_1.defineAlias)('bluetooth.RequestDevice', { "primitive": "string" }); const BluetoothRequestDeviceInfo = (0, record_js_1.defineRecord)('bluetooth.RequestDeviceInfo', [{ "name": "id", "wire": "id", "required": true, "type": { "ref": "bluetooth.RequestDevice" } }, { "name": "name", "wire": "name", "required": true, "type": { "primitive": "string", "nullable": true } }]); (0, record_js_1.defineAlias)('bluetooth.RequestDevicePrompt', { "primitive": "string" }); const BluetoothScanRecord = (0, record_js_1.defineRecord)('bluetooth.ScanRecord', [{ "name": "name", "wire": "name", "required": false, "type": { "primitive": "string" } }, { "name": "uuids", "wire": "uuids", "required": false, "type": { "list": { "ref": "bluetooth.BluetoothUuid" } } }, { "name": "appearance", "wire": "appearance", "required": false, "type": { "primitive": "number" } }, { "name": "manufacturerData", "wire": "manufacturerData", "required": false, "type": { "list": { "ref": "bluetooth.BluetoothManufacturerData" } } }]); const BluetoothHandleRequestDevicePrompt = (0, record_js_1.defineRecord)('bluetooth.HandleRequestDevicePrompt', [{ "name": "method", "wire": "method", "required": true, "type": { "const": "bluetooth.handleRequestDevicePrompt" } }, { "name": "params", "wire": "params", "required": true, "type": { "ref": "bluetooth.HandleRequestDevicePromptParameters" } }]); const BluetoothHandleRequestDevicePromptParametersUnion = (0, union_js_1.defineUnion)('bluetooth.HandleRequestDevicePromptParameters', { "by": "accept", "variants": [{ "value": true, "ref": "bluetooth.HandleRequestDevicePromptParameters_AcceptParameters" }, { "value": false, "ref": "bluetooth.HandleRequestDevicePromptParameters_CancelParameters" }] }, { "objectOnly": true }); const BluetoothSimulateAdapter = (0, record_js_1.defineRecord)('bluetooth.SimulateAdapter', [{ "name": "method", "wire": "method", "required": true, "type": { "const": "bluetooth.simulateAdapter" } }, { "name": "params", "wire": "params", "required": true, "type": { "ref": "bluetooth.SimulateAdapterParameters" } }]); const BluetoothSimulateAdapterParameters = (0, record_js_1.defineRecord)('bluetooth.SimulateAdapterParameters', [{ "name": "context", "wire": "context", "required": true, "type": { "primitive": "string" } }, { "name": "leSupported", "wire": "leSupported", "required": false, "type": { "primitive": "boolean" } }, { "name": "state", "wire": "state", "required": true, "type": { "ref": "bluetooth.SimulateAdapterParametersState" } }]); const BluetoothDisableSimulation = (0, record_js_1.defineRecord)('bluetooth.DisableSimulation', [{ "name": "method", "wire": "method", "required": true, "type": { "const": "bluetooth.disableSimulation" } }, { "name": "params", "wire": "params", "required": true, "type": { "ref": "bluetooth.DisableSimulationParameters" } }]); const BluetoothDisableSimulationParameters = (0, record_js_1.defineRecord)('bluetooth.DisableSimulationParameters', [{ "name": "context", "wire": "context", "required": true, "type": { "primitive": "string" } }]); const BluetoothSimulatePreconnectedPeripheral = (0, record_js_1.defineRecord)('bluetooth.SimulatePreconnectedPeripheral', [{ "name": "method", "wire": "method", "required": true, "type": { "const": "bluetooth.simulatePreconnectedPeripheral" } }, { "name": "params", "wire": "params", "required": true, "type": { "ref": "bluetooth.SimulatePreconnectedPeripheralParameters" } }]); const BluetoothSimulatePreconnectedPeripheralParameters = (0, record_js_1.defineRecord)('bluetooth.SimulatePreconnectedPeripheralParameters', [{ "name": "context", "wire": "context", "required": true, "type": { "primitive": "string" } }, { "name": "address", "wire": "address", "required": true, "type": { "primitive": "string" } }, { "name": "name", "wire": "name", "required": true, "type": { "primitive": "string" } }, { "name": "manufacturerData", "wire": "manufacturerData", "required": true, "type": { "list": { "ref": "bluetooth.BluetoothManufacturerData" } } }, { "name": "knownServiceUuids", "wire": "knownServiceUuids", "required": true, "type": { "list": { "ref": "bluetooth.BluetoothUuid" } } }]); const BluetoothSimulateAdvertisement = (0, record_js_1.defineRecord)('bluetooth.SimulateAdvertisement', [{ "name": "method", "wire": "method", "required": true, "type": { "const": "bluetooth.simulateAdvertisement" } }, { "name": "params", "wire": "params", "required": true, "type": { "ref": "bluetooth.SimulateAdvertisementParameters" } }]); const BluetoothSimulateAdvertisementParameters = (0, record_js_1.defineRecord)('bluetooth.SimulateAdvertisementParameters', [{ "name": "context", "wire": "context", "required": true, "type": { "primitive": "string" } }, { "name": "scanEntry", "wire": "scanEntry", "required": true, "type": { "ref": "bluetooth.SimulateAdvertisementScanEntryParameters" } }]); const BluetoothSimulateAdvertisementScanEntryParameters = (0, record_js_1.defineRecord)('bluetooth.SimulateAdvertisementScanEntryParameters', [{ "name": "deviceAddress", "wire": "deviceAddress", "required": true, "type": { "primitive": "string" } }, { "name": "rssi", "wire": "rssi", "required": true, "type": { "primitive": "number" } }, { "name": "scanRecord", "wire": "scanRecord", "required": true, "type": { "ref": "bluetooth.ScanRecord" } }]); const BluetoothSimulateGattConnectionResponse = (0, record_js_1.defineRecord)('bluetooth.SimulateGattConnectionResponse', [{ "name": "method", "wire": "method", "required": true, "type": { "const": "bluetooth.simulateGattConnectionResponse" } }, { "name": "params", "wire": "params", "required": true, "type": { "ref": "bluetooth.SimulateGattConnectionResponseParameters" } }]); const BluetoothSimulateGattConnectionResponseParameters = (0, record_js_1.defineRecord)('bluetooth.SimulateGattConnectionResponseParameters', [{ "name": "context", "wire": "context", "required": true, "type": { "primitive": "string" } }, { "name": "address", "wire": "address", "required": true, "type": { "primitive": "string" } }, { "name": "code", "wire": "code", "required": true, "type": { "primitive": "integer" } }]); const BluetoothSimulateGattDisconnection = (0, record_js_1.defineRecord)('bluetooth.SimulateGattDisconnection', [{ "name": "method", "wire": "method", "required": true, "type": { "const": "bluetooth.simulateGattDisconnection" } }, { "name": "params", "wire": "params", "required": true, "type": { "ref": "bluetooth.SimulateGattDisconnectionParameters" } }]); const BluetoothSimulateGattDisconnectionParameters = (0, record_js_1.defineRecord)('bluetooth.SimulateGattDisconnectionParameters', [{ "name": "context", "wire": "context", "required": true, "type": { "primitive": "string" } }, { "name": "address", "wire": "address", "required": true, "type": { "primitive": "string" } }]); const BluetoothSimulateService = (0, record_js_1.defineRecord)('bluetooth.SimulateService', [{ "name": "method", "wire": "method", "required": true, "type": { "const": "bluetooth.simulateService" } }, { "name": "params", "wire": "params", "required": true, "type": { "ref": "bluetooth.SimulateServiceParameters" } }]); const BluetoothSimulateServiceParameters = (0, record_js_1.defineRecord)('bluetooth.SimulateServiceParameters', [{ "name": "context", "wire": "context", "required": true, "type": { "primitive": "string" } }, { "name": "address", "wire": "address", "required": true, "type": { "primitive": "string" } }, { "name": "uuid", "wire": "uuid", "required": true, "type": { "ref": "bluetooth.BluetoothUuid" } }, { "name": "type", "wire": "type", "required": true, "type": { "ref": "bluetooth.SimulateServiceParametersType" } }]); const BluetoothSimulateCharacteristic = (0, record_js_1.defineRecord)('bluetooth.SimulateCharacteristic', [{ "name": "method", "wire": "method", "required": true, "type": { "const": "bluetooth.simulateCharacteristic" } }, { "name": "params", "wire": "params", "required": true, "type": { "ref": "bluetooth.SimulateCharacteristicParameters" } }]); const BluetoothSimulateCharacteristicParameters = (0, record_js_1.defineRecord)('bluetooth.SimulateCharacteristicParameters', [{ "name": "context", "wire": "context", "required": true, "type": { "primitive": "string" } }, { "name": "address", "wire": "address", "required": true, "type": { "primitive": "string" } }, { "name": "serviceUuid", "wire": "serviceUuid", "required": true, "type": { "ref": "bluetooth.BluetoothUuid" } }, { "name": "characteristicUuid", "wire": "characteristicUuid", "required": true, "type": { "ref": "bluetooth.BluetoothUuid" } }, { "name": "characteristicProperties", "wire": "characteristicProperties", "required": false, "type": { "ref": "bluetooth.CharacteristicProperties" } }, { "name": "type", "wire": "type", "required": true, "type": { "ref": "bluetooth.SimulateCharacteristicParametersType" } }]); const BluetoothSimulateCharacteristicResponse = (0, record_js_1.defineRecord)('bluetooth.SimulateCharacteristicResponse', [{ "name": "method", "wire": "method", "required": true, "type": { "const": "bluetooth.simulateCharacteristicResponse" } }, { "name": "params", "wire": "params", "required": true, "type": { "ref": "bluetooth.SimulateCharacteristicResponseParameters" } }]); const BluetoothSimulateCharacteristicResponseParameters = (0, record_js_1.defineRecord)('bluetooth.SimulateCharacteristicResponseParameters', [{ "name": "context", "wire": "context", "required": true, "type": { "primitive": "string" } }, { "name": "address", "wire": "address", "required": true, "type": { "primitive": "string" } }, { "name": "serviceUuid", "wire": "serviceUuid", "required": true, "type": { "ref": "bluetooth.BluetoothUuid" } }, { "name": "characteristicUuid", "wire": "characteristicUuid", "required": true, "type": { "ref": "bluetooth.BluetoothUuid" } }, { "name": "type", "wire": "type", "required": true, "type": { "ref": "bluetooth.SimulateCharacteristicResponseParametersType" } }, { "name": "code", "wire": "code", "required": true, "type": { "primitive": "integer" } }, { "name": "data", "wire": "data", "required": false, "type": { "list": { "primitive": "integer" } } }]); const BluetoothSimulateDescriptor = (0, record_js_1.defineRecord)('bluetooth.SimulateDescriptor', [{ "name": "method", "wire": "method", "required": true, "type": { "const": "bluetooth.simulateDescriptor" } }, { "name": "params", "wire": "params", "required": true, "type": { "ref": "bluetooth.SimulateDescriptorParameters" } }]); const BluetoothSimulateDescriptorParameters = (0, record_js_1.defineRecord)('bluetooth.SimulateDescriptorParameters', [{ "name": "context", "wire": "context", "required": true, "type": { "primitive": "string" } }, { "name": "address", "wire": "address", "required": true, "type": { "primitive": "string" } }, { "name": "serviceUuid", "wire": "serviceUuid", "required": true, "type": { "ref": "bluetooth.BluetoothUuid" } }, { "name": "characteristicUuid", "wire": "characteristicUuid", "required": true, "type": { "ref": "bluetooth.BluetoothUuid" } }, { "name": "descriptorUuid", "wire": "descriptorUuid", "required": true, "type": { "ref": "bluetooth.BluetoothUuid" } }, { "name": "type", "wire": "type", "required": true, "type": { "ref": "bluetooth.SimulateDescriptorParametersType" } }]); const BluetoothSimulateDescriptorResponse = (0, record_js_1.defineRecord)('bluetooth.SimulateDescriptorResponse', [{ "name": "method", "wire": "method", "required": true, "type": { "const": "bluetooth.simulateDescriptorResponse" } }, { "name": "params", "wire": "params", "required": true, "type": { "ref": "bluetooth.SimulateDescriptorResponseParameters" } }]); const BluetoothSimulateDescriptorResponseParameters = (0, record_js_1.defineRecord)('bluetooth.SimulateDescriptorResponseParameters', [{ "name": "context", "wire": "context", "required": true, "type": { "primitive": "string" } }, { "name": "address", "wire": "address", "required": true, "type": { "primitive": "string" } }, { "name": "serviceUuid", "wire": "serviceUuid", "required": true, "type": { "ref": "bluetooth.BluetoothUuid" } }, { "name": "characteristicUuid", "wire": "characteristicUuid", "required": true, "type": { "ref": "bluetooth.BluetoothUuid" } }, { "name": "descriptorUuid", "wire": "descriptorUuid", "required": true, "type": { "ref": "bluetooth.BluetoothUuid" } }, { "name": "type", "wire": "type", "required": true, "type": { "ref": "bluetooth.SimulateDescriptorResponseParametersType" } }, { "name": "code", "wire": "code", "required": true, "type": { "primitive": "integer" } }, { "name": "data", "wire": "data", "required": false, "type": { "list": { "primitive": "integer" } } }]); const BluetoothRequestDevicePromptUpdated = (0, record_js_1.defineRecord)('bluetooth.RequestDevicePromptUpdated', [{ "name": "method", "wire": "method", "required": true, "type": { "const": "bluetooth.requestDevicePromptUpdated" } }, { "name": "params", "wire": "params", "required": true, "type": { "ref": "bluetooth.RequestDevicePromptUpdatedParameters" } }]); const BluetoothRequestDevicePromptUpdatedParameters = (0, record_js_1.defineRecord)('bluetooth.RequestDevicePromptUpdatedParameters', [{ "name": "context", "wire": "context", "required": true, "type": { "primitive": "string" } }, { "name": "prompt", "wire": "prompt", "required": true, "type": { "ref": "bluetooth.RequestDevicePrompt" } }, { "name": "devices", "wire": "devices", "required": true, "type": { "list": { "ref": "bluetooth.RequestDeviceInfo" } } }]); const BluetoothGattConnectionAttempted = (0, record_js_1.defineRecord)('bluetooth.GattConnectionAttempted', [{ "name": "method", "wire": "method", "required": true, "type": { "const": "bluetooth.gattConnectionAttempted" } }, { "name": "params", "wire": "params", "required": true, "type": { "ref": "bluetooth.GattConnectionAttemptedParameters" } }]); const BluetoothGattConnectionAttemptedParameters = (0, record_js_1.defineRecord)('bluetooth.GattConnectionAttemptedParameters', [{ "name": "context", "wire": "context", "required": true, "type": { "primitive": "string" } }, { "name": "address", "wire": "address", "required": true, "type": { "primitive": "string" } }]); const BluetoothCharacteristicEventGenerated = (0, record_js_1.defineRecord)('bluetooth.CharacteristicEventGenerated', [{ "name": "method", "wire": "method", "required": true, "type": { "const": "bluetooth.characteristicEventGenerated" } }, { "name": "params", "wire": "params", "required": true, "type": { "ref": "bluetooth.CharacteristicEventGeneratedParameters" } }]); const BluetoothCharacteristicEventGeneratedParameters = (0, record_js_1.defineRecord)('bluetooth.CharacteristicEventGeneratedParameters', [{ "name": "context", "wire": "context", "required": true, "type": { "primitive": "string" } }, { "name": "address", "wire": "address", "required": true, "type": { "primitive": "string" } }, { "name": "serviceUuid", "wire": "serviceUuid", "required": true, "type": { "ref": "bluetooth.BluetoothUuid" } }, { "name": "characteristicUuid", "wire": "characteristicUuid", "required": true, "type": { "ref": "bluetooth.BluetoothUuid" } }, { "name": "type", "wire": "type", "required": true, "type": { "ref": "bluetooth.CharacteristicEventGeneratedParametersType" } }, { "name": "data", "wire": "data", "required": false, "type": { "list": { "primitive": "integer" } } }]); const BluetoothDescriptorEventGenerated = (0, record_js_1.defineRecord)('bluetooth.DescriptorEventGenerated', [{ "name": "method", "wire": "method", "required": true, "type": { "const": "bluetooth.descriptorEventGenerated" } }, { "name": "params", "wire": "params", "required": true, "type": { "ref": "bluetooth.DescriptorEventGeneratedParameters" } }]); const BluetoothDescriptorEventGeneratedParameters = (0, record_js_1.defineRecord)('bluetooth.DescriptorEventGeneratedParameters', [{ "name": "context", "wire": "context", "required": true, "type": { "primitive": "string" } }, { "name": "address", "wire": "address", "required": true, "type": { "primitive": "string" } }, { "name": "serviceUuid", "wire": "serviceUuid", "required": true, "type": { "ref": "bluetooth.BluetoothUuid" } }, { "name": "characteristicUuid", "wire": "characteristicUuid", "required": true, "type": { "ref": "bluetooth.BluetoothUuid" } }, { "name": "descriptorUuid", "wire": "descriptorUuid", "required": true, "type": { "ref": "bluetooth.BluetoothUuid" } }, { "name": "type", "wire": "type", "required": true, "type": { "ref": "bluetooth.DescriptorEventGeneratedParametersType" } }, { "name": "data", "wire": "data", "required": false, "type": { "list": { "primitive": "integer" } } }]); const BluetoothSimulateAdapterParametersStateEnum = (0, enum_js_1.defineEnum)('bluetooth.SimulateAdapterParametersState', ["absent", "powered-off", "powered-on"]); const BluetoothSimulateServiceParametersTypeEnum = (0, enum_js_1.defineEnum)('bluetooth.SimulateServiceParametersType', ["add", "remove"]); const BluetoothSimulateCharacteristicParametersTypeEnum = (0, enum_js_1.defineEnum)('bluetooth.SimulateCharacteristicParametersType', ["add", "remove"]); const BluetoothSimulateCharacteristicResponseParametersTypeEnum = (0, enum_js_1.defineEnum)('bluetooth.SimulateCharacteristicResponseParametersType', ["read", "write", "subscribe-to-notifications", "unsubscribe-from-notifications"]); const BluetoothSimulateDescriptorParametersTypeEnum = (0, enum_js_1.defineEnum)('bluetooth.SimulateDescriptorParametersType', ["add", "remove"]); const BluetoothSimulateDescriptorResponseParametersTypeEnum = (0, enum_js_1.defineEnum)('bluetooth.SimulateDescriptorResponseParametersType', ["read", "write"]); const BluetoothCharacteristicEventGeneratedParametersTypeEnum = (0, enum_js_1.defineEnum)('bluetooth.CharacteristicEventGeneratedParametersType', ["read", "write-with-response", "write-without-response", "subscribe-to-notifications", "unsubscribe-from-notifications"]); const BluetoothDescriptorEventGeneratedParametersTypeEnum = (0, enum_js_1.defineEnum)('bluetooth.DescriptorEventGeneratedParametersType', ["read", "write"]); const BluetoothHandleRequestDevicePromptParameters_AcceptParameters = (0, record_js_1.defineRecord)('bluetooth.HandleRequestDevicePromptParameters_AcceptParameters', [{ "name": "context", "wire": "context", "required": true, "type": { "primitive": "string" } }, { "name": "prompt", "wire": "prompt", "required": true, "type": { "ref": "bluetooth.RequestDevicePrompt" } }, { "name": "accept", "wire": "accept", "required": true, "type": { "const": true } }, { "name": "device", "wire": "device", "required": true, "type": { "ref": "bluetooth.RequestDevice" } }]); const BluetoothHandleRequestDevicePromptParameters_CancelParameters = (0, record_js_1.defineRecord)('bluetooth.HandleRequestDevicePromptParameters_CancelParameters', [{ "name": "context", "wire": "context", "required": true, "type": { "primitive": "string" } }, { "name": "prompt", "wire": "prompt", "required": true, "type": { "ref": "bluetooth.RequestDevicePrompt" } }, { "name": "accept", "wire": "accept", "required": true, "type": { "const": false } }]); // --- Implementation --- /** * This is an unsupported API. No compatibility guarantees are provided. * It tracks the W3C WebDriver BiDi specification directly. As the specification * evolves, this API will change or be removed without prior notice. */ class Bluetooth extends domain_js_1.Domain { static async create(driver) { return new Bluetooth(await domain_js_1.Domain.connect(driver), domain_js_1.DOMAIN_TOKEN); } /** * @param {BluetoothHandleRequestDevicePromptParameters} params * @returns {Promise<void>} * @see https://w3c.github.io/webdriver-bidi/#command-bluetooth-handleRequestDevicePrompt */ async handleRequestDevicePrompt(params) { const validatedParams = BluetoothHandleRequestDevicePromptParametersUnion.build(params); await this.send('bluetooth.handleRequestDevicePrompt', validatedParams); } /** * @param {BluetoothSimulateAdapterParameters} params * @param {string} params.context * @param {boolean} [params.leSupported] * @param {BluetoothSimulateAdapterParametersState} params.state * @returns {Promise<void>} * @see https://w3c.github.io/webdriver-bidi/#command-bluetooth-simulateAdapter */ async simulateAdapter(params) { const validatedParams = new BluetoothSimulateAdapterParameters(params); await this.send('bluetooth.simulateAdapter', validatedParams); } /** * @param {BluetoothDisableSimulationParameters} params * @param {string} params.context * @returns {Promise<void>} * @see https://w3c.github.io/webdriver-bidi/#command-bluetooth-disableSimulation */ async disableSimulation(params) { const validatedParams = new BluetoothDisableSimulationParameters(params); await this.send('bluetooth.disableSimulation', validatedParams); } /** * @param {BluetoothSimulatePreconnectedPeripheralParameters} params * @param {string} params.context * @param {string} params.address * @param {string} params.name * @param {Array<BluetoothBluetoothManufacturerData>} params.manufacturerData * @param {Array<BluetoothBluetoothUuid>} params.knownServiceUuids * @returns {Promise<void>} * @see https://w3c.github.io/webdriver-bidi/#command-bluetooth-simulatePreconnectedPeripheral */ async simulatePreconnectedPeripheral(params) { const validatedParams = new BluetoothSimulatePreconnectedPeripheralParameters(params); await this.send('bluetooth.simulatePreconnectedPeripheral', validatedParams); } /** * @param {BluetoothSimulateAdvertisementParameters} params * @param {string} params.context * @param {BluetoothSimulateAdvertisementScanEntryParameters} params.scanEntry * @returns {Promise<void>} * @see https://w3c.github.io/webdriver-bidi/#command-bluetooth-simulateAdvertisement */ async simulateAdvertisement(params) { const validatedParams = new BluetoothSimulateAdvertisementParameters(params); await this.send('bluetooth.simulateAdvertisement', validatedParams); } /** * @param {BluetoothSimulateGattConnectionResponseParameters} params * @param {string} params.context * @param {string} params.address * @param {number} params.code * @returns {Promise<void>} * @see https://w3c.github.io/webdriver-bidi/#command-bluetooth-simulateGattConnectionResponse */ async simulateGattConnectionResponse(params) { const validatedParams = new BluetoothSimulateGattConnectionResponseParameters(params); await this.send('bluetooth.simulateGattConnectionResponse', validatedParams); } /** * @param {BluetoothSimulateGattDisconnectionParameters} params * @param {string} params.context * @param {string} params.address * @returns {Promise<void>} * @see https://w3c.github.io/webdriver-bidi/#command-bluetooth-simulateGattDisconnection */ async simulateGattDisconnection(params) { const validatedParams = new BluetoothSimulateGattDisconnectionParameters(params); await this.send('bluetooth.simulateGattDisconnection', validatedParams); } /** * @param {BluetoothSimulateServiceParameters} params * @param {string} params.context * @param {string} params.address * @param {BluetoothBluetoothUuid} params.uuid * @param {BluetoothSimulateServiceParametersType} params.type * @returns {Promise<void>} * @see https://w3c.github.io/webdriver-bidi/#command-bluetooth-simulateService */ async simulateService(params) { const validatedParams = new BluetoothSimulateServiceParameters(params); await this.send('bluetooth.simulateService', validatedParams); } /** * @param {BluetoothSimulateCharacteristicParameters} params * @param {string} params.context * @param {string} params.address * @param {BluetoothBluetoothUuid} params.serviceUuid * @param {BluetoothBluetoothUuid} params.characteristicUuid * @param {BluetoothCharacteristicProperties} [params.characteristicProperties] * @param {BluetoothSimulateCharacteristicParametersType} params.type * @returns {Promise<void>} * @see https://w3c.github.io/webdriver-bidi/#command-bluetooth-simulateCharacteristic */ async simulateCharacteristic(params) { const validatedParams = new BluetoothSimulateCharacteristicParameters(params); await this.send('bluetooth.simulateCharacteristic', validatedParams); } /** * @param {BluetoothSimulateCharacteristicResponseParameters} params * @param {string} params.context * @param {string} params.address * @param {BluetoothBluetoothUuid} params.serviceUuid * @param {BluetoothBluetoothUuid} params.characteristicUuid * @param {BluetoothSimulateCharacteristicResponseParametersType} params.type * @param {number} params.code * @param {Array<number>} [params.data] * @returns {Promise<void>} * @see https://w3c.github.io/webdriver-bidi/#command-bluetooth-simulateCharacteristicResponse */ async simulateCharacteristicResponse(params) { const validatedParams = new BluetoothSimulateCharacteristicResponseParameters(params); await this.send('bluetooth.simulateCharacteristicResponse', validatedParams); } /** * @param {BluetoothSimulateDescriptorParameters} params * @param {string} params.context * @param {string} params.address * @param {BluetoothBluetoothUuid} params.serviceUuid * @param {BluetoothBluetoothUuid} params.characteristicUuid * @param {BluetoothBluetoothUuid} params.descriptorUuid * @param {BluetoothSimulateDescriptorParametersType} params.type * @returns {Promise<void>} * @see https://w3c.github.io/webdriver-bidi/#command-bluetooth-simulateDescriptor */ async simulateDescriptor(params) { const validatedParams = new BluetoothSimulateDescriptorParameters(params); await this.send('bluetooth.simulateDescriptor', validatedParams); } /** * @param {BluetoothSimulateDescriptorResponseParameters} params * @param {string} params.context * @param {string} params.address * @param {BluetoothBluetoothUuid} params.serviceUuid * @param {BluetoothBluetoothUuid} params.characteristicUuid * @param {BluetoothBluetoothUuid} params.descriptorUuid * @param {BluetoothSimulateDescriptorResponseParametersType} params.type * @param {number} params.code * @param {Array<number>} [params.data] * @returns {Promise<void>} * @see https://w3c.github.io/webdriver-bidi/#command-bluetooth-simulateDescriptorResponse */ async simulateDescriptorResponse(params) { const validatedParams = new BluetoothSimulateDescriptorResponseParameters(params); await this.send('bluetooth.simulateDescriptorResponse', validatedParams); } } exports.Bluetooth = Bluetooth; /** @see https://w3c.github.io/webdriver-bidi/#event-bluetooth-requestDevicePromptUpdated */ Bluetooth.REQUEST_DEVICE_PROMPT_UPDATED = (0, domain_js_1.event)('bluetooth.requestDevicePromptUpdated', BluetoothRequestDevicePromptUpdatedParameters); /** @see https://w3c.github.io/webdriver-bidi/#event-bluetooth-gattConnectionAttempted */ Bluetooth.GATT_CONNECTION_ATTEMPTED = (0, domain_js_1.event)('bluetooth.gattConnectionAttempted', BluetoothGattConnectionAttemptedParameters); /** @see https://w3c.github.io/webdriver-bidi/#event-bluetooth-characteristicEventGenerated */ Bluetooth.CHARACTERISTIC_EVENT_GENERATED = (0, domain_js_1.event)('bluetooth.characteristicEventGenerated', BluetoothCharacteristicEventGeneratedParameters); /** @see https://w3c.github.io/webdriver-bidi/#event-bluetooth-descriptorEventGenerated */ Bluetooth.DESCRIPTOR_EVENT_GENERATED = (0, domain_js_1.event)('bluetooth.descriptorEventGenerated', BluetoothDescriptorEventGeneratedParameters); Bluetooth.SimulateAdapterParametersState = Object.freeze({ ABSENT: "absent", POWERED_OFF: "powered-off", POWERED_ON: "powered-on" }); Bluetooth.SimulateServiceParametersType = Object.freeze({ ADD: "add", REMOVE: "remove" }); Bluetooth.SimulateCharacteristicParametersType = Object.freeze({ ADD: "add", REMOVE: "remove" }); Bluetooth.SimulateCharacteristicResponseParametersType = Object.freeze({ READ: "read", WRITE: "write", SUBSCRIBE_TO_NOTIFICATIONS: "subscribe-to-notifications", UNSUBSCRIBE_FROM_NOTIFICATIONS: "unsubscribe-from-notifications" }); Bluetooth.SimulateDescriptorParametersType = Object.freeze({ ADD: "add", REMOVE: "remove" }); Bluetooth.SimulateDescriptorResponseParametersType = Object.freeze({ READ: "read", WRITE: "write" }); Bluetooth.CharacteristicEventGeneratedParametersType = Object.freeze({ READ: "read", WRITE_WITH_RESPONSE: "write-with-response", WRITE_WITHOUT_RESPONSE: "write-without-response", SUBSCRIBE_TO_NOTIFICATIONS: "subscribe-to-notifications", UNSUBSCRIBE_FROM_NOTIFICATIONS: "unsubscribe-from-notifications" }); Bluetooth.DescriptorEventGeneratedParametersType = Object.freeze({ READ: "read", WRITE: "write" });