Class: Selenium::DevTools::V136::BluetoothEmulation
- Inherits:
-
Object
- Object
- Selenium::DevTools::V136::BluetoothEmulation
- Defined in:
- lib/selenium/devtools/v136/bluetooth_emulation.rb
Constant Summary collapse
- EVENTS =
{ gatt_operation_received: 'gattOperationReceived', }.freeze
Instance Method Summary collapse
- #add_characteristic(address:, service_id:, characteristic_uuid:, properties:) ⇒ Object
- #add_service(address:, service_uuid:) ⇒ Object
- #disable ⇒ Object
- #enable(state:, le_supported:) ⇒ Object
-
#initialize(devtools) ⇒ BluetoothEmulation
constructor
A new instance of BluetoothEmulation.
- #on(event, &block) ⇒ Object
- #remove_characteristic(address:, service_id:, characteristic_id:) ⇒ Object
- #remove_service(address:, service_id:) ⇒ Object
- #set_simulated_central_state(state:) ⇒ Object
- #simulate_advertisement(entry:) ⇒ Object
- #simulate_gatt_operation_response(address:, type:, code:) ⇒ Object
- #simulate_preconnected_peripheral(address:, name:, manufacturer_data:, known_service_uuids:) ⇒ Object
Constructor Details
#initialize(devtools) ⇒ BluetoothEmulation
Returns a new instance of BluetoothEmulation.
29 30 31 |
# File 'lib/selenium/devtools/v136/bluetooth_emulation.rb', line 29 def initialize(devtools) @devtools = devtools end |
Instance Method Details
#add_characteristic(address:, service_id:, characteristic_uuid:, properties:) ⇒ Object
85 86 87 88 89 90 91 |
# File 'lib/selenium/devtools/v136/bluetooth_emulation.rb', line 85 def add_characteristic(address:, service_id:, characteristic_uuid:, properties:) @devtools.send_cmd('BluetoothEmulation.addCharacteristic', address: address, serviceId: service_id, characteristicUuid: characteristic_uuid, properties: properties) end |
#add_service(address:, service_uuid:) ⇒ Object
73 74 75 76 77 |
# File 'lib/selenium/devtools/v136/bluetooth_emulation.rb', line 73 def add_service(address:, service_uuid:) @devtools.send_cmd('BluetoothEmulation.addService', address: address, serviceUuid: service_uuid) end |
#disable ⇒ Object
49 50 51 |
# File 'lib/selenium/devtools/v136/bluetooth_emulation.rb', line 49 def disable @devtools.send_cmd('BluetoothEmulation.disable') end |
#enable(state:, le_supported:) ⇒ Object
38 39 40 41 42 |
# File 'lib/selenium/devtools/v136/bluetooth_emulation.rb', line 38 def enable(state:, le_supported:) @devtools.send_cmd('BluetoothEmulation.enable', state: state, leSupported: le_supported) end |
#on(event, &block) ⇒ Object
33 34 35 36 |
# File 'lib/selenium/devtools/v136/bluetooth_emulation.rb', line 33 def on(event, &block) event = EVENTS[event] if event.is_a?(Symbol) @devtools.callbacks["BluetoothEmulation.#{event}"] << block end |
#remove_characteristic(address:, service_id:, characteristic_id:) ⇒ Object
93 94 95 96 97 98 |
# File 'lib/selenium/devtools/v136/bluetooth_emulation.rb', line 93 def remove_characteristic(address:, service_id:, characteristic_id:) @devtools.send_cmd('BluetoothEmulation.removeCharacteristic', address: address, serviceId: service_id, characteristicId: characteristic_id) end |
#remove_service(address:, service_id:) ⇒ Object
79 80 81 82 83 |
# File 'lib/selenium/devtools/v136/bluetooth_emulation.rb', line 79 def remove_service(address:, service_id:) @devtools.send_cmd('BluetoothEmulation.removeService', address: address, serviceId: service_id) end |
#set_simulated_central_state(state:) ⇒ Object
44 45 46 47 |
# File 'lib/selenium/devtools/v136/bluetooth_emulation.rb', line 44 def set_simulated_central_state(state:) @devtools.send_cmd('BluetoothEmulation.setSimulatedCentralState', state: state) end |
#simulate_advertisement(entry:) ⇒ Object
61 62 63 64 |
# File 'lib/selenium/devtools/v136/bluetooth_emulation.rb', line 61 def simulate_advertisement(entry:) @devtools.send_cmd('BluetoothEmulation.simulateAdvertisement', entry: entry) end |
#simulate_gatt_operation_response(address:, type:, code:) ⇒ Object
66 67 68 69 70 71 |
# File 'lib/selenium/devtools/v136/bluetooth_emulation.rb', line 66 def simulate_gatt_operation_response(address:, type:, code:) @devtools.send_cmd('BluetoothEmulation.simulateGATTOperationResponse', address: address, type: type, code: code) end |
#simulate_preconnected_peripheral(address:, name:, manufacturer_data:, known_service_uuids:) ⇒ Object
53 54 55 56 57 58 59 |
# File 'lib/selenium/devtools/v136/bluetooth_emulation.rb', line 53 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 |