LeAdvertiser#
- class pytest_bluezenv.LeAdvertiser(service_uuids=(), adv_type='peripheral', index=0, adapter_path='/org/bluez/hci0', discoverable=True, timeout=None)[source]#
Host plugin registering a minimal connectable
org.bluez.LEAdvertisement1object on a Bluetooth adapter.In LE-only mode
bluetoothddoes not advertise the host by itself. Load this plugin to make the host discoverable and connectable by a peer. Registration completes before the test starts. On teardown the advertisement is unregistered and removed from the bus.- Parameters:
service_uuids (
sequence) – service UUIDs to advertise.adv_type (
str) – advertisement type,"peripheral"or"broadcast".index (
int) – index appended to the advertisement object path to keep advertisements of several instances distinct.adapter_path (
str) – D-Bus object path of the adapter to advertise on.discoverable (
bool) – whether to set theDiscoverableadvertisement property.timeout (
float) – seconds to wait for the advertisement to be registered, or None to use the default timeout.
Example
LE_CONF = "[General]\nControllerMode = le\n" @host_config( [Bluetoothd(conf=LE_CONF)], [Bluetoothd(conf=LE_CONF), LeAdvertiser(service_uuids=["180d"])], ) def test_le_connect(hosts): client, server = hosts
- PATH_BASE#
base D-Bus object path of the advertisements. The instance
indexis appended to it.- Type:
str
- __init__(service_uuids=(), adv_type='peripheral', index=0, adapter_path='/org/bluez/hci0', discoverable=True, timeout=None)[source]#
Configure a plugin on the upper tester at collection time.
Methods