From 3e5ef6c93996278ac86ebf8c58f7acb31d7a3534 Mon Sep 17 00:00:00 2001 From: Benjamin Tissoires Date: Fri, 19 Jan 2018 16:47:09 +0100 Subject: [PATCH] ble: remove the duplicate events filter So we get more chances of capturing the advertisement from the device if it is rather static. --- tuhi/ble.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tuhi/ble.py b/tuhi/ble.py index a4067c5..927cb4d 100755 --- a/tuhi/ble.py +++ b/tuhi/ble.py @@ -325,6 +325,9 @@ class BlueZDeviceManager(GObject.Object): if i is None: continue + # remove the duplicate data filter so we get notifications as they come in + i.SetDiscoveryFilter('(a{sv})', {'DuplicateData': GLib.Variant.new_boolean(False)}) + objpath = obj.get_object_path() try: i.StartDiscovery() @@ -364,6 +367,9 @@ class BlueZDeviceManager(GObject.Object): except GLib.Error as e: logger.debug('{}: Failed to stop discovery ({})'.format(objpath, e)) + # reset the discovery filters + i.SetDiscoveryFilter('(a{sv})', {}) + self.emit("discovery-stopped") def _on_device_updated(self, device):