Skip to content

Commit 8f98878

Browse files
committed
Merge branch 'ble-logging' into pr-powermon
# Conflicts: # .vscode/launch.json # meshtastic/protobuf/config_pb2.py # meshtastic/protobuf/mesh_pb2.py # meshtastic/protobuf/mesh_pb2.pyi
2 parents 13ca8fd + 5c2851d commit 8f98878

3 files changed

Lines changed: 6 additions & 10 deletions

File tree

.coveragerc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[run]
2-
omit = meshtastic/*_pb2.py,meshtastic/tests/*.py,meshtastic/test.py
2+
omit = meshtastic/protobuf/*_pb2.py,meshtastic/tests/*.py,meshtastic/test.py
33

44
[report]
55
exclude_lines =

bin/regen-protobufs.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ echo "Fixing up protobuf paths in ${TMPDIR} temp directory"
1515

1616

1717
# Ensure a clean build
18-
rm -r "${TMPDIR}"
18+
[ -e "${TMPDIR}" ] && rm -r "${TMPDIR}"
1919

2020
INDIR=${TMPDIR}/in/meshtastic/protobuf
2121
OUTDIR=${TMPDIR}/out

meshtastic/__main__.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1089,7 +1089,7 @@ def common():
10891089
print(f"Found: name='{x.name}' address='{x.address}'")
10901090
meshtastic.util.our_exit("BLE scan finished", 0)
10911091
elif args.ble:
1092-
client = BLEInterface(args.ble_dest, debugOut=logfile, noProto=args.noproto, noNodes=args.no_nodes)
1092+
client = BLEInterface(args.ble if args.ble != "any" else None, debugOut=logfile, noProto=args.noproto, noNodes=args.no_nodes)
10931093
elif args.host:
10941094
try:
10951095
client = meshtastic.tcp_interface.TCPInterface(
@@ -1159,14 +1159,10 @@ def addConnectionArgs(parser: argparse.ArgumentParser) -> argparse.ArgumentParse
11591159

11601160
group.add_argument(
11611161
"--ble",
1162-
help="The BLE device address or name to connect to",
1163-
action="store_true",
1164-
)
1165-
1166-
outer.add_argument(
1167-
"--ble-dest",
1168-
help="The BLE device address or name to connect to",
1162+
help="Connect to a BLE device, optionally specifying a device name (defaults to 'any')",
1163+
nargs="?",
11691164
default=None,
1165+
const="any"
11701166
)
11711167

11721168
return parser

0 commit comments

Comments
 (0)