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
sessionIDevToolsSessionThe IDevToolsSession to be used with this adapter.
Exceptions
- ArgumentNullException
If
sessionis null.
Properties
Session
Gets the DevToolsSession associated with the adapter.
public IDevToolsSession Session { get; }
Property Value
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
commandAddCharacteristicCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandAddDescriptorCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandAddServiceCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandDisableCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandEnableCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandRemoveCharacteristicCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandRemoveDescriptorCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandRemoveServiceCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandSetSimulatedCentralStateCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandSimulateAdvertisementCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandSimulateCharacteristicOperationResponseCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandSimulateDescriptorOperationResponseCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandSimulateGATTDisconnectionCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandSimulateGATTOperationResponseCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
commandSimulatePreconnectedPeripheralCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
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
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
GattOperationReceived
Event for when a GATT operation of |type| to the peripheral with |address| happened.
public event EventHandler<GattOperationReceivedEventArgs>? GattOperationReceived