Skip to content

Commit 434e7e0

Browse files
authored
Merge pull request #45 from tannewt/fix_ancs_example
Fix ANCS example. Fixes #44
2 parents 26325f6 + 53f6352 commit 434e7e0

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

examples/ble_apple_notifications.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
radio = adafruit_ble.BLERadio()
1212
a = SolicitServicesAdvertisement()
13-
a.complete_name = "NotifyPlease"
1413
a.solicited_services.append(AppleNotificationService)
1514
radio.start_advertising(a)
1615

@@ -28,10 +27,8 @@
2827
print("paired")
2928

3029
ans = connection[AppleNotificationService]
31-
for notification in ans:
32-
if notification.id not in known_notifications:
33-
print(notification)
34-
known_notifications.add(notification.id)
30+
for notification in ans.wait_for_new_notifications():
31+
print(notification)
3532
time.sleep(1)
3633

3734
print("disconnected")

0 commit comments

Comments
 (0)