dbusmock.templates.bluez5

bluetoothd mock template

This creates the expected methods and properties of the object manager org.bluez object (/), the manager object (/org/bluez), but no adapters or devices.

This supports BlueZ 5 only.

Attributes

__author__

__copyright__

BUS_NAME

MAIN_OBJ

SYSTEM_BUS

IS_OBJECT_MANAGER

BLUEZ_MOCK_IFACE

AGENT_MANAGER_IFACE

PROFILE_MANAGER_IFACE

ADAPTER_IFACE

MEDIA_IFACE

NETWORK_SERVER_IFACE

DEVICE_IFACE

LE_ADVERTISING_MANAGER_IFACE

LE_ADVERTISEMENT_IFACE

ADVERTISEMENT_MONITOR_MANAGER_IFACE

ADVERTISEMENT_MONITOR_IFACE

MOCK_PHONE_CLASS

MAX_ADVERTISEMENT_INSTANCES

Functions

RegisterAgent(manager, agent_path, capability)

UnregisterAgent(manager, agent_path)

RequestDefaultAgent(manager, agent_path)

load(mock, _parameters)

RemoveDevice(adapter, path)

StartDiscovery(adapter)

StopDiscovery(adapter)

SetDiscoveryFilter(adapter, discovery_filter)

AddAdapter(self, device_name, system_name)

Convenience method to add a Bluetooth adapter

RemoveAdapter(self, device_name)

Convenience method to remove a Bluetooth adapter

RemoveAdapterWithDevices(self, device_name)

Convenience method to remove a Bluetooth adapter and all

Pair(device)

Connect(device)

Disconnect(device)

AddDevice(self, adapter_device_name, device_address, alias)

Convenience method to add a Bluetooth device

PairDevice(_self, adapter_device_name, device_address)

Convenience method to mark an existing device as paired.

BlockDevice(_self, adapter_device_name, device_address)

Convenience method to mark an existing device as blocked.

ConnectDevice(_self, adapter_device_name, device_address)

Convenience method to mark an existing device as connected.

DisconnectDevice(_self, adapter_device_name, ...)

Convenience method to mark an existing device as disconnected.

RegisterAdvertisement(manager, adv_path, options)

UnregisterAdvertisement(manager, adv_path)

AddAdvertisement(self, adv_name)

Convenience method to add an Advertisement object

AddMonitor(self, monitor_name)

Convenience method to add an Advertisement Monitor

RegisterMonitor(manager, monitor_path)

UnregisterMonitor(manager, monitor_path)

Module Contents

dbusmock.templates.bluez5.__author__ = 'Philip Withnall'[source]
Show Value
"""
(c) 2013 Collabora Ltd.
(c) 2017 - 2022 Martin Pitt <martin@piware.de>
"""
dbusmock.templates.bluez5.BUS_NAME = 'org.bluez'[source]
dbusmock.templates.bluez5.MAIN_OBJ = '/'[source]
dbusmock.templates.bluez5.SYSTEM_BUS = True[source]
dbusmock.templates.bluez5.IS_OBJECT_MANAGER = True[source]
dbusmock.templates.bluez5.BLUEZ_MOCK_IFACE = 'org.bluez.Mock'[source]
dbusmock.templates.bluez5.AGENT_MANAGER_IFACE = 'org.bluez.AgentManager1'[source]
dbusmock.templates.bluez5.PROFILE_MANAGER_IFACE = 'org.bluez.ProfileManager1'[source]
dbusmock.templates.bluez5.ADAPTER_IFACE = 'org.bluez.Adapter1'[source]
dbusmock.templates.bluez5.MEDIA_IFACE = 'org.bluez.Media1'[source]
dbusmock.templates.bluez5.NETWORK_SERVER_IFACE = 'org.bluez.Network1'[source]
dbusmock.templates.bluez5.DEVICE_IFACE = 'org.bluez.Device1'[source]
dbusmock.templates.bluez5.LE_ADVERTISING_MANAGER_IFACE = 'org.bluez.LEAdvertisingManager1'[source]
dbusmock.templates.bluez5.LE_ADVERTISEMENT_IFACE = 'org.bluez.LEAdvertisement1'[source]
dbusmock.templates.bluez5.ADVERTISEMENT_MONITOR_MANAGER_IFACE = 'org.bluez.AdvertisementMonitorManager1'[source]
dbusmock.templates.bluez5.ADVERTISEMENT_MONITOR_IFACE = 'org.bluez.AdvertisementMonitor1'[source]
dbusmock.templates.bluez5.MOCK_PHONE_CLASS = 5898764[source]
dbusmock.templates.bluez5.MAX_ADVERTISEMENT_INSTANCES = 5[source]
dbusmock.templates.bluez5.RegisterAgent(manager, agent_path, capability)[source]
dbusmock.templates.bluez5.UnregisterAgent(manager, agent_path)[source]
dbusmock.templates.bluez5.RequestDefaultAgent(manager, agent_path)[source]
dbusmock.templates.bluez5.load(mock, _parameters)[source]
dbusmock.templates.bluez5.RemoveDevice(adapter, path)[source]
dbusmock.templates.bluez5.StartDiscovery(adapter)[source]
dbusmock.templates.bluez5.StopDiscovery(adapter)[source]
dbusmock.templates.bluez5.SetDiscoveryFilter(adapter, discovery_filter)[source]
dbusmock.templates.bluez5.AddAdapter(self, device_name, system_name)[source]

Convenience method to add a Bluetooth adapter

You have to specify a device name which must be a valid part of an object path, e. g. “hci0”, and an arbitrary system name (pretty hostname).

Returns the new object path.

dbusmock.templates.bluez5.RemoveAdapter(self, device_name)[source]

Convenience method to remove a Bluetooth adapter

dbusmock.templates.bluez5.RemoveAdapterWithDevices(self, device_name)[source]

Convenience method to remove a Bluetooth adapter and all the devices associated to it

dbusmock.templates.bluez5.Pair(device)[source]
dbusmock.templates.bluez5.Connect(device)[source]
dbusmock.templates.bluez5.Disconnect(device)[source]
dbusmock.templates.bluez5.AddDevice(self, adapter_device_name, device_address, alias)[source]

Convenience method to add a Bluetooth device

You have to specify a device address which must be a valid Bluetooth address (e.g. ‘AA:BB:CC:DD:EE:FF’). The alias is the human-readable name for the device (e.g. as set on the device itself), and the adapter device name is the device_name passed to AddAdapter.

This will create a new, unpaired and unconnected device with some default properties like MOCK_PHONE_CLASS “Class” and a static “Modalias”. Especially when working with more than one device, you may want to change these after creation.

Returns the new object path.

dbusmock.templates.bluez5.PairDevice(_self, adapter_device_name, device_address)[source]

Convenience method to mark an existing device as paired.

You have to specify a device address which must be a valid Bluetooth address (e.g. ‘AA:BB:CC:DD:EE:FF’). The adapter device name is the device_name passed to AddAdapter.

This unblocks the device if it was blocked.

If the specified adapter or device doesn’t exist, a NoSuchAdapter or NoSuchDevice error will be returned on the bus.

Returns nothing.

dbusmock.templates.bluez5.BlockDevice(_self, adapter_device_name, device_address)[source]

Convenience method to mark an existing device as blocked.

You have to specify a device address which must be a valid Bluetooth address (e.g. ‘AA:BB:CC:DD:EE:FF’). The adapter device name is the device_name passed to AddAdapter.

This disconnects the device if it was connected.

If the specified adapter or device doesn’t exist, a NoSuchAdapter or NoSuchDevice error will be returned on the bus.

Returns nothing.

dbusmock.templates.bluez5.ConnectDevice(_self, adapter_device_name, device_address)[source]

Convenience method to mark an existing device as connected.

You have to specify a device address which must be a valid Bluetooth address (e.g. ‘AA:BB:CC:DD:EE:FF’). The adapter device name is the device_name passed to AddAdapter.

This unblocks the device if it was blocked.

If the specified adapter or device doesn’t exist, a NoSuchAdapter or NoSuchDevice error will be returned on the bus.

Returns nothing.

dbusmock.templates.bluez5.DisconnectDevice(_self, adapter_device_name, device_address)[source]

Convenience method to mark an existing device as disconnected.

You have to specify a device address which must be a valid Bluetooth address (e.g. ‘AA:BB:CC:DD:EE:FF’). The adapter device name is the device_name passed to AddAdapter.

This does not change the device’s blocked status.

If the specified adapter or device doesn’t exist, a NoSuchAdapter or NoSuchDevice error will be returned on the bus.

Returns nothing.

dbusmock.templates.bluez5.RegisterAdvertisement(manager, adv_path, options)[source]
dbusmock.templates.bluez5.UnregisterAdvertisement(manager, adv_path)[source]
dbusmock.templates.bluez5.AddAdvertisement(self, adv_name)[source]

Convenience method to add an Advertisement object

Creates a simple broadcast advertisement with some manufacturer data.

Returns the new object path.

dbusmock.templates.bluez5.AddMonitor(self, monitor_name)[source]

Convenience method to add an Advertisement Monitor

Returns the new object path.

dbusmock.templates.bluez5.RegisterMonitor(manager, monitor_path)[source]
dbusmock.templates.bluez5.UnregisterMonitor(manager, monitor_path)[source]