Class BluetoothEmulation

java.lang.Object
org.openqa.selenium.devtools.v139.bluetoothemulation.BluetoothEmulation

@Beta public class BluetoothEmulation extends Object
This domain allows configuring virtual Bluetooth devices to test the web-bluetooth API.
  • Constructor Details

    • BluetoothEmulation

      public BluetoothEmulation()
  • Method Details

    • enable

      public static org.openqa.selenium.devtools.Command<Void> enable(CentralState state, Boolean leSupported)
      Enable the BluetoothEmulation domain.
    • setSimulatedCentralState

      public static org.openqa.selenium.devtools.Command<Void> setSimulatedCentralState(CentralState state)
      Set the state of the simulated central.
    • disable

      public static org.openqa.selenium.devtools.Command<Void> disable()
      Disable the BluetoothEmulation domain.
    • simulatePreconnectedPeripheral

      public static org.openqa.selenium.devtools.Command<Void> simulatePreconnectedPeripheral(String address, String name, List<ManufacturerData> manufacturerData, List<String> knownServiceUuids)
      Simulates a peripheral with |address|, |name| and |knownServiceUuids| that has already been connected to the system.
    • simulateAdvertisement

      public static org.openqa.selenium.devtools.Command<Void> simulateAdvertisement(ScanEntry entry)
      Simulates an advertisement packet described in |entry| being received by the central.
    • simulateGATTOperationResponse

      public static org.openqa.selenium.devtools.Command<Void> simulateGATTOperationResponse(String address, GATTOperationType type, Integer code)
      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.
    • simulateCharacteristicOperationResponse

      public static org.openqa.selenium.devtools.Command<Void> simulateCharacteristicOperationResponse(String characteristicId, CharacteristicOperationType type, Integer code, Optional<String> data)
      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.
    • simulateDescriptorOperationResponse

      public static org.openqa.selenium.devtools.Command<Void> simulateDescriptorOperationResponse(String descriptorId, DescriptorOperationType type, Integer code, Optional<String> data)
      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.
    • addService

      public static org.openqa.selenium.devtools.Command<String> addService(String address, String serviceUuid)
      Adds a service with |serviceUuid| to the peripheral with |address|.
    • removeService

      public static org.openqa.selenium.devtools.Command<Void> removeService(String serviceId)
      Removes the service respresented by |serviceId| from the simulated central.
    • addCharacteristic

      public static org.openqa.selenium.devtools.Command<String> addCharacteristic(String serviceId, String characteristicUuid, CharacteristicProperties properties)
      Adds a characteristic with |characteristicUuid| and |properties| to the service represented by |serviceId|.
    • removeCharacteristic

      public static org.openqa.selenium.devtools.Command<Void> removeCharacteristic(String characteristicId)
      Removes the characteristic respresented by |characteristicId| from the simulated central.
    • addDescriptor

      public static org.openqa.selenium.devtools.Command<String> addDescriptor(String characteristicId, String descriptorUuid)
      Adds a descriptor with |descriptorUuid| to the characteristic respresented by |characteristicId|.
    • removeDescriptor

      public static org.openqa.selenium.devtools.Command<Void> removeDescriptor(String descriptorId)
      Removes the descriptor with |descriptorId| from the simulated central.
    • simulateGATTDisconnection

      public static org.openqa.selenium.devtools.Command<Void> simulateGATTDisconnection(String address)
      Simulates a GATT disconnection from the peripheral with |address|.
    • gattOperationReceived

      public static org.openqa.selenium.devtools.Event<GattOperationReceived> gattOperationReceived()
    • characteristicOperationReceived

      public static org.openqa.selenium.devtools.Event<CharacteristicOperationReceived> characteristicOperationReceived()
    • descriptorOperationReceived

      public static org.openqa.selenium.devtools.Event<DescriptorOperationReceived> descriptorOperationReceived()