Skip to content

Commit

Permalink
Pass custom timeout also to deep scan
Browse files Browse the repository at this point in the history
ref #30
  • Loading branch information
Jakeler committed May 26, 2021
1 parent b2250e1 commit 22d5fd2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ble_serial/scan/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

async def scan(args):
if args.addr:
await deep_scan(args.addr)
await deep_scan(args.addr, args.sec)
else:
await general_scan(args.sec)

Expand All @@ -21,10 +21,10 @@ async def general_scan(time: float):
print("\nFinished BLE scan")


async def deep_scan(dev: str):
async def deep_scan(dev: str, time: float):
print(f"Started deep scan of {dev}\n")

async with BleakClient(dev) as client:
async with BleakClient(dev, timeout=time) as client:
print_details(await client.get_services())

print(f"\nCompleted deep scan of {dev}")
Expand Down

0 comments on commit 22d5fd2

Please sign in to comment.