Skip to content

Commit 6b1dd31

Browse files
committed
discover_remote_services() now returns the services; no property needed
1 parent e4d6fe9 commit 6b1dd31

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

adafruit_ble/current_time_client.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,7 @@ def pair(self):
9999
def discover(self):
100100
"""Discover service information."""
101101
self._check_connected()
102-
self._periph.discover_remote_services((self.CTS_UUID,))
103-
services = self._periph.remote_services
102+
services = self._periph.discover_remote_services((self.CTS_UUID,))
104103
if not services:
105104
raise OSError("Unable to discover service")
106105
for characteristic in services[0].characteristics:

adafruit_ble/uart_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,12 @@ def connect(self, address, timeout):
7171
"""
7272
self._central.connect(address, timeout)
7373
# Restrict discovery to NUS service only.
74-
self._central.discover_remote_services((NUS_SERVICE_UUID,))
74+
remote_services = self._central.discover_remote_services((NUS_SERVICE_UUID,))
7575

7676
# Connect succeeded. Get the remote characteristics we need, which were
7777
# found during discovery.
7878

79-
for characteristic in self._central.remote_services[0].characteristics:
79+
for characteristic in remote_services[0].characteristics:
8080
# Since we're remote we receive on tx and send on rx.
8181
# The names are from the point of view of the server.
8282
if characteristic.uuid == NUS_RX_CHAR_UUID:

0 commit comments

Comments
 (0)