From 53f6352ec232de30a42c32b4d5aabc7afb985bac Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 12 Dec 2019 13:48:39 -0800 Subject: [PATCH] Fix ANCS example. Fixes #44 --- examples/ble_apple_notifications.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/examples/ble_apple_notifications.py b/examples/ble_apple_notifications.py index eeb7b82..aa0f243 100644 --- a/examples/ble_apple_notifications.py +++ b/examples/ble_apple_notifications.py @@ -10,7 +10,6 @@ radio = adafruit_ble.BLERadio() a = SolicitServicesAdvertisement() -a.complete_name = "NotifyPlease" a.solicited_services.append(AppleNotificationService) radio.start_advertising(a) @@ -28,10 +27,8 @@ print("paired") ans = connection[AppleNotificationService] - for notification in ans: - if notification.id not in known_notifications: - print(notification) - known_notifications.add(notification.id) + for notification in ans.wait_for_new_notifications(): + print(notification) time.sleep(1) print("disconnected")