Skip to content

Commit

Permalink
fix #580
Browse files Browse the repository at this point in the history
  • Loading branch information
barbibulle committed Nov 2, 2024
1 parent b78f895 commit b2864da
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion bumble/smp.py
Original file line number Diff line number Diff line change
Expand Up @@ -1839,7 +1839,7 @@ def on_smp_pairing_public_key_command(
if self.is_initiator:
if self.pairing_method == PairingMethod.OOB:
self.send_pairing_random_command()
else:
elif self.pairing_method == PairingMethod.PASSKEY:
self.send_pairing_confirm_command()
else:
if self.pairing_method == PairingMethod.PASSKEY:
Expand Down
6 changes: 4 additions & 2 deletions bumble/transport/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,11 +370,13 @@ async def pump_packets() -> None:
self.parser.feed_data(packet)
except asyncio.CancelledError:
logger.debug('source pump task done')
self.terminated.set_result(None)
if not self.terminated.done():
self.terminated.set_result(None)
break
except Exception as error:
logger.warning(f'exception while waiting for packet: {error}')
self.terminated.set_exception(error)
if not self.terminated.done():
self.terminated.set_exception(error)
break

self.pump_task = asyncio.create_task(pump_packets())
Expand Down

0 comments on commit b2864da

Please sign in to comment.