Skip to content

Commit

Permalink
BGAPIBackend: add timeout parameter in discover_characteristics method
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitaly Gridin authored and peplin committed Feb 20, 2021
1 parent 487d591 commit 240b11f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pygatt/backends/bgapi/bgapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ def connect(self, address, timeout=5,
exc.__cause__ = None
raise exc

def discover_characteristics(self, connection_handle):
def discover_characteristics(self, connection_handle, timeout=30):
att_handle_start = 0x0001 # first valid handle
att_handle_end = 0xFFFF # last valid handle
log.info("Fetching characteristics for connection %d",
Expand All @@ -467,7 +467,7 @@ def discover_characteristics(self, connection_handle):
self.expect(ResponsePacketType.attclient_find_information)
try:
self.expect(EventPacketType.attclient_procedure_completed,
timeout=30)
timeout=timeout)
except ExpectedResponseTimeout:
log.warn("Continuing even though discovery hasn't finished")

Expand Down

0 comments on commit 240b11f

Please sign in to comment.