bluetooth_emulation
CentralState
Bases: Enum
Indicates the various states of Central.
Source code in zendriver/cdp/bluetooth_emulation.py
ABSENT = 'absent'
class-attribute
instance-attribute
POWERED_OFF = 'powered-off'
class-attribute
instance-attribute
POWERED_ON = 'powered-on'
class-attribute
instance-attribute
from_json(json)
classmethod
ManufacturerData
dataclass
Stores the manufacturer data
Source code in zendriver/cdp/bluetooth_emulation.py
data: str
instance-attribute
key: int
instance-attribute
__init__(key, data)
from_json(json)
classmethod
ScanEntry
dataclass
Stores the advertisement packet information that is sent by a Bluetooth device.
Source code in zendriver/cdp/bluetooth_emulation.py
device_address: str
instance-attribute
rssi: int
instance-attribute
scan_record: ScanRecord
instance-attribute
__init__(device_address, rssi, scan_record)
from_json(json)
classmethod
ScanRecord
dataclass
Stores the byte data of the advertisement packet sent by a Bluetooth device.
Source code in zendriver/cdp/bluetooth_emulation.py
appearance: typing.Optional[int] = None
class-attribute
instance-attribute
manufacturer_data: typing.Optional[typing.List[ManufacturerData]] = None
class-attribute
instance-attribute
name: typing.Optional[str] = None
class-attribute
instance-attribute
tx_power: typing.Optional[int] = None
class-attribute
instance-attribute
uuids: typing.Optional[typing.List[str]] = None
class-attribute
instance-attribute
__init__(name=None, uuids=None, appearance=None, tx_power=None, manufacturer_data=None)
from_json(json)
classmethod
Source code in zendriver/cdp/bluetooth_emulation.py
to_json()
Source code in zendriver/cdp/bluetooth_emulation.py
disable()
Disable the BluetoothEmulation domain.
enable(state)
Enable the BluetoothEmulation domain.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
CentralState
|
State of the simulated central. |
required |
Source code in zendriver/cdp/bluetooth_emulation.py
simulate_advertisement(entry)
Simulates an advertisement packet described in entry
being received by
the central.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
entry
|
ScanEntry
|
|
required |
Source code in zendriver/cdp/bluetooth_emulation.py
simulate_preconnected_peripheral(address, name, manufacturer_data, known_service_uuids)
Simulates a peripheral with address
, name
and knownServiceUuids
that has already been connected to the system.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
address
|
str
|
|
required |
name
|
str
|
|
required |
manufacturer_data
|
List[ManufacturerData]
|
|
required |
known_service_uuids
|
List[str]
|
|
required |