dbusmock.templates.bluez5 ========================= .. py:module:: dbusmock.templates.bluez5 .. autoapi-nested-parse:: 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 ---------- .. autoapisummary:: dbusmock.templates.bluez5.__author__ dbusmock.templates.bluez5.__copyright__ dbusmock.templates.bluez5.BUS_NAME dbusmock.templates.bluez5.MAIN_OBJ dbusmock.templates.bluez5.SYSTEM_BUS dbusmock.templates.bluez5.IS_OBJECT_MANAGER dbusmock.templates.bluez5.BLUEZ_MOCK_IFACE dbusmock.templates.bluez5.AGENT_MANAGER_IFACE dbusmock.templates.bluez5.PROFILE_MANAGER_IFACE dbusmock.templates.bluez5.ADAPTER_IFACE dbusmock.templates.bluez5.MEDIA_IFACE dbusmock.templates.bluez5.NETWORK_SERVER_IFACE dbusmock.templates.bluez5.DEVICE_IFACE dbusmock.templates.bluez5.LE_ADVERTISING_MANAGER_IFACE dbusmock.templates.bluez5.LE_ADVERTISEMENT_IFACE dbusmock.templates.bluez5.ADVERTISEMENT_MONITOR_MANAGER_IFACE dbusmock.templates.bluez5.ADVERTISEMENT_MONITOR_IFACE dbusmock.templates.bluez5.MOCK_PHONE_CLASS dbusmock.templates.bluez5.MAX_ADVERTISEMENT_INSTANCES Functions --------- .. autoapisummary:: dbusmock.templates.bluez5.RegisterAgent dbusmock.templates.bluez5.UnregisterAgent dbusmock.templates.bluez5.RequestDefaultAgent dbusmock.templates.bluez5.load dbusmock.templates.bluez5.RemoveDevice dbusmock.templates.bluez5.StartDiscovery dbusmock.templates.bluez5.StopDiscovery dbusmock.templates.bluez5.SetDiscoveryFilter dbusmock.templates.bluez5.AddAdapter dbusmock.templates.bluez5.RemoveAdapter dbusmock.templates.bluez5.RemoveAdapterWithDevices dbusmock.templates.bluez5.Pair dbusmock.templates.bluez5.Connect dbusmock.templates.bluez5.Disconnect dbusmock.templates.bluez5.AddDevice dbusmock.templates.bluez5.PairDevice dbusmock.templates.bluez5.BlockDevice dbusmock.templates.bluez5.ConnectDevice dbusmock.templates.bluez5.DisconnectDevice dbusmock.templates.bluez5.RegisterAdvertisement dbusmock.templates.bluez5.UnregisterAdvertisement dbusmock.templates.bluez5.AddAdvertisement dbusmock.templates.bluez5.AddMonitor dbusmock.templates.bluez5.RegisterMonitor dbusmock.templates.bluez5.UnregisterMonitor Module Contents --------------- .. py:data:: __author__ :value: 'Philip Withnall' .. py:data:: __copyright__ :value: Multiline-String .. raw:: html
Show Value .. code-block:: python """ (c) 2013 Collabora Ltd. (c) 2017 - 2022 Martin Pitt """ .. raw:: html
.. py:data:: BUS_NAME :value: 'org.bluez' .. py:data:: MAIN_OBJ :value: '/' .. py:data:: SYSTEM_BUS :value: True .. py:data:: IS_OBJECT_MANAGER :value: True .. py:data:: BLUEZ_MOCK_IFACE :value: 'org.bluez.Mock' .. py:data:: AGENT_MANAGER_IFACE :value: 'org.bluez.AgentManager1' .. py:data:: PROFILE_MANAGER_IFACE :value: 'org.bluez.ProfileManager1' .. py:data:: ADAPTER_IFACE :value: 'org.bluez.Adapter1' .. py:data:: MEDIA_IFACE :value: 'org.bluez.Media1' .. py:data:: NETWORK_SERVER_IFACE :value: 'org.bluez.Network1' .. py:data:: DEVICE_IFACE :value: 'org.bluez.Device1' .. py:data:: LE_ADVERTISING_MANAGER_IFACE :value: 'org.bluez.LEAdvertisingManager1' .. py:data:: LE_ADVERTISEMENT_IFACE :value: 'org.bluez.LEAdvertisement1' .. py:data:: ADVERTISEMENT_MONITOR_MANAGER_IFACE :value: 'org.bluez.AdvertisementMonitorManager1' .. py:data:: ADVERTISEMENT_MONITOR_IFACE :value: 'org.bluez.AdvertisementMonitor1' .. py:data:: MOCK_PHONE_CLASS :value: 5898764 .. py:data:: MAX_ADVERTISEMENT_INSTANCES :value: 5 .. py:function:: RegisterAgent(manager, agent_path, capability) .. py:function:: UnregisterAgent(manager, agent_path) .. py:function:: RequestDefaultAgent(manager, agent_path) .. py:function:: load(mock, parameters) .. py:function:: RemoveDevice(adapter, path) .. py:function:: StartDiscovery(adapter) .. py:function:: StopDiscovery(adapter) .. py:function:: SetDiscoveryFilter(adapter, discovery_filter) .. py:function:: AddAdapter(self, device_name, system_name) 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. .. py:function:: RemoveAdapter(self, device_name) Convenience method to remove a Bluetooth adapter .. py:function:: RemoveAdapterWithDevices(self, device_name) Convenience method to remove a Bluetooth adapter and all the devices associated to it .. py:function:: Pair(device) .. py:function:: Connect(device) .. py:function:: Disconnect(device) .. py:function:: AddDevice(self, adapter_device_name, device_address, alias) 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. .. py:function:: PairDevice(_self, adapter_device_name, device_address) 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. .. py:function:: BlockDevice(_self, adapter_device_name, device_address) 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. .. py:function:: ConnectDevice(_self, adapter_device_name, device_address) 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. .. py:function:: DisconnectDevice(_self, adapter_device_name, device_address) 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. .. py:function:: RegisterAdvertisement(manager, adv_path, options) .. py:function:: UnregisterAdvertisement(manager, adv_path) .. py:function:: AddAdvertisement(self, adv_name) Convenience method to add an Advertisement object Creates a simple broadcast advertisement with some manufacturer data. Returns the new object path. .. py:function:: AddMonitor(self, monitor_name) Convenience method to add an Advertisement Monitor Returns the new object path. .. py:function:: RegisterMonitor(manager, monitor_path) .. py:function:: UnregisterMonitor(manager, monitor_path)