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
Functions
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Convenience method to add a Bluetooth adapter |
|
Convenience method to remove a Bluetooth adapter |
|
Convenience method to remove a Bluetooth adapter and all |
|
|
|
|
|
|
|
Convenience method to add a Bluetooth device |
|
Convenience method to mark an existing device as paired. |
|
Convenience method to mark an existing device as blocked. |
|
Convenience method to mark an existing device as connected. |
|
Convenience method to mark an existing device as disconnected. |
|
|
|
|
|
Convenience method to add an Advertisement object |
|
Convenience method to add an Advertisement Monitor |
|
|
|
Module Contents
- dbusmock.templates.bluez5.__copyright__ = Multiline-String[source]
Show Value
""" (c) 2013 Collabora Ltd. (c) 2017 - 2022 Martin Pitt <martin@piware.de> """
- dbusmock.templates.bluez5.ADVERTISEMENT_MONITOR_MANAGER_IFACE = 'org.bluez.AdvertisementMonitorManager1'[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.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.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.