Class: Selenium::DevTools::V130::BluetoothEmulation
- Inherits:
-
Object
- Object
- Selenium::DevTools::V130::BluetoothEmulation
- Defined in:
- lib/selenium/devtools/v130/bluetooth_emulation.rb
Instance Method Summary collapse
- #disable ⇒ Object
- #enable(state:) ⇒ Object
-
#initialize(devtools) ⇒ BluetoothEmulation
constructor
A new instance of BluetoothEmulation.
- #on(event, &block) ⇒ Object
- #simulate_advertisement(entry:) ⇒ Object
- #simulate_preconnected_peripheral(address:, name:, manufacturer_data:, known_service_uuids:) ⇒ Object
Constructor Details
#initialize(devtools) ⇒ BluetoothEmulation
Returns a new instance of BluetoothEmulation.
26 27 28 |
# File 'lib/selenium/devtools/v130/bluetooth_emulation.rb', line 26 def initialize(devtools) @devtools = devtools end |
Instance Method Details
#disable ⇒ Object
40 41 42 |
# File 'lib/selenium/devtools/v130/bluetooth_emulation.rb', line 40 def disable @devtools.send_cmd('BluetoothEmulation.disable') end |
#enable(state:) ⇒ Object
35 36 37 38 |
# File 'lib/selenium/devtools/v130/bluetooth_emulation.rb', line 35 def enable(state:) @devtools.send_cmd('BluetoothEmulation.enable', state: state) end |
#on(event, &block) ⇒ Object
30 31 32 33 |
# File 'lib/selenium/devtools/v130/bluetooth_emulation.rb', line 30 def on(event, &block) event = EVENTS[event] if event.is_a?(Symbol) @devtools.callbacks["BluetoothEmulation.#{event}"] << block end |
#simulate_advertisement(entry:) ⇒ Object
52 53 54 55 |
# File 'lib/selenium/devtools/v130/bluetooth_emulation.rb', line 52 def simulate_advertisement(entry:) @devtools.send_cmd('BluetoothEmulation.simulateAdvertisement', entry: entry) end |
#simulate_preconnected_peripheral(address:, name:, manufacturer_data:, known_service_uuids:) ⇒ Object
44 45 46 47 48 49 50 |
# File 'lib/selenium/devtools/v130/bluetooth_emulation.rb', line 44 def simulate_preconnected_peripheral(address:, name:, manufacturer_data:, known_service_uuids:) @devtools.send_cmd('BluetoothEmulation.simulatePreconnectedPeripheral', address: address, name: name, manufacturerData: manufacturer_data, knownServiceUuids: known_service_uuids) end |