Table of Contents

Class BluetoothEmulationAdapter

Namespace
OpenQA.Selenium.DevTools.V148.BluetoothEmulation
Assembly
Selenium.WebDriver.dll

Represents an adapter for the BluetoothEmulation domain to simplify the command interface.

public class BluetoothEmulationAdapter
Inheritance
BluetoothEmulationAdapter
Inherited Members

Constructors

BluetoothEmulationAdapter(IDevToolsSession)

Initializes a new instance of the BluetoothEmulationAdapter class.

public BluetoothEmulationAdapter(IDevToolsSession session)

Parameters

session IDevToolsSession

The IDevToolsSession to be used with this adapter.

Exceptions

ArgumentNullException

If session is null.

Properties

Session

Gets the DevToolsSession associated with the adapter.

public IDevToolsSession Session { get; }

Property Value

IDevToolsSession

Methods

AddCharacteristic(AddCharacteristicCommandSettings, CancellationToken, int?, bool)

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

public Task<AddCharacteristicCommandResponse> AddCharacteristic(AddCharacteristicCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command AddCharacteristicCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<AddCharacteristicCommandResponse>

AddDescriptor(AddDescriptorCommandSettings, CancellationToken, int?, bool)

Adds a descriptor with |descriptorUuid| to the characteristic respresented by |characteristicId|.

public Task<AddDescriptorCommandResponse> AddDescriptor(AddDescriptorCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command AddDescriptorCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<AddDescriptorCommandResponse>

AddService(AddServiceCommandSettings, CancellationToken, int?, bool)

Adds a service with |serviceUuid| to the peripheral with |address|.

public Task<AddServiceCommandResponse> AddService(AddServiceCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command AddServiceCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<AddServiceCommandResponse>

Disable(DisableCommandSettings?, CancellationToken, int?, bool)

Disable the BluetoothEmulation domain.

public Task<DisableCommandResponse?> Disable(DisableCommandSettings? command = null, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command DisableCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<DisableCommandResponse>

Enable(EnableCommandSettings, CancellationToken, int?, bool)

Enable the BluetoothEmulation domain.

public Task<EnableCommandResponse?> Enable(EnableCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command EnableCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<EnableCommandResponse>

RemoveCharacteristic(RemoveCharacteristicCommandSettings, CancellationToken, int?, bool)

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

public Task<RemoveCharacteristicCommandResponse?> RemoveCharacteristic(RemoveCharacteristicCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command RemoveCharacteristicCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<RemoveCharacteristicCommandResponse>

RemoveDescriptor(RemoveDescriptorCommandSettings, CancellationToken, int?, bool)

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

public Task<RemoveDescriptorCommandResponse?> RemoveDescriptor(RemoveDescriptorCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command RemoveDescriptorCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<RemoveDescriptorCommandResponse>

RemoveService(RemoveServiceCommandSettings, CancellationToken, int?, bool)

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

public Task<RemoveServiceCommandResponse?> RemoveService(RemoveServiceCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command RemoveServiceCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<RemoveServiceCommandResponse>

SetSimulatedCentralState(SetSimulatedCentralStateCommandSettings, CancellationToken, int?, bool)

Set the state of the simulated central.

public Task<SetSimulatedCentralStateCommandResponse?> SetSimulatedCentralState(SetSimulatedCentralStateCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetSimulatedCentralStateCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetSimulatedCentralStateCommandResponse>

SimulateAdvertisement(SimulateAdvertisementCommandSettings, CancellationToken, int?, bool)

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

public Task<SimulateAdvertisementCommandResponse?> SimulateAdvertisement(SimulateAdvertisementCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SimulateAdvertisementCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SimulateAdvertisementCommandResponse>

SimulateCharacteristicOperationResponse(SimulateCharacteristicOperationResponseCommandSettings, CancellationToken, int?, bool)

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.

public Task<SimulateCharacteristicOperationResponseCommandResponse?> SimulateCharacteristicOperationResponse(SimulateCharacteristicOperationResponseCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SimulateCharacteristicOperationResponseCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SimulateCharacteristicOperationResponseCommandResponse>

SimulateDescriptorOperationResponse(SimulateDescriptorOperationResponseCommandSettings, CancellationToken, int?, bool)

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.

public Task<SimulateDescriptorOperationResponseCommandResponse?> SimulateDescriptorOperationResponse(SimulateDescriptorOperationResponseCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SimulateDescriptorOperationResponseCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SimulateDescriptorOperationResponseCommandResponse>

SimulateGATTDisconnection(SimulateGATTDisconnectionCommandSettings, CancellationToken, int?, bool)

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

public Task<SimulateGATTDisconnectionCommandResponse?> SimulateGATTDisconnection(SimulateGATTDisconnectionCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SimulateGATTDisconnectionCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SimulateGATTDisconnectionCommandResponse>

SimulateGATTOperationResponse(SimulateGATTOperationResponseCommandSettings, CancellationToken, int?, bool)

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.

public Task<SimulateGATTOperationResponseCommandResponse?> SimulateGATTOperationResponse(SimulateGATTOperationResponseCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SimulateGATTOperationResponseCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SimulateGATTOperationResponseCommandResponse>

SimulatePreconnectedPeripheral(SimulatePreconnectedPeripheralCommandSettings, CancellationToken, int?, bool)

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

public Task<SimulatePreconnectedPeripheralCommandResponse?> SimulatePreconnectedPeripheral(SimulatePreconnectedPeripheralCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SimulatePreconnectedPeripheralCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SimulatePreconnectedPeripheralCommandResponse>

Events

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.

public event EventHandler<CharacteristicOperationReceivedEventArgs>? CharacteristicOperationReceived

Event Type

EventHandler<CharacteristicOperationReceivedEventArgs>

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.

public event EventHandler<DescriptorOperationReceivedEventArgs>? DescriptorOperationReceived

Event Type

EventHandler<DescriptorOperationReceivedEventArgs>

GattOperationReceived

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

public event EventHandler<GattOperationReceivedEventArgs>? GattOperationReceived

Event Type

EventHandler<GattOperationReceivedEventArgs>