mirror of
https://github.com/meshcore-dev/meshcore-cli.git
synced 2026-04-20 22:13:48 +00:00
catch bleak error at ble scan
This commit is contained in:
parent
ed581e3788
commit
a5f5f1538b
1 changed files with 8 additions and 1 deletions
|
|
@ -3537,7 +3537,14 @@ async def main(argv):
|
|||
logger.info(f"Searching first MC BLE device")
|
||||
else:
|
||||
logger.info(f"Scanning BLE for device matching {address}")
|
||||
devices = await BleakScanner.discover(timeout=timeout)
|
||||
try:
|
||||
devices = await BleakScanner.discover(timeout=timeout)
|
||||
except (BleakError, BleakDBusError):
|
||||
print("BLE connection asked (default behaviour), but no BLE HW found")
|
||||
print("Call meshcore-cli with -h for some more help (on commands)")
|
||||
command_usage()
|
||||
return
|
||||
|
||||
found = False
|
||||
for d in devices:
|
||||
if not d.name is None and d.name.startswith("MeshCore-") and\
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue