Skip to content

Commit a1ffb45

Browse files
committed
Added command to listen to protobuf stream
1 parent 90c218d commit a1ffb45

2 files changed

Lines changed: 18 additions & 1 deletion

File tree

.vscode/launch.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,14 @@
4444
"justMyCode": true,
4545
"args": ["--debug"]
4646
},
47+
{
48+
"name": "meshtastic listen",
49+
"type": "python",
50+
"request": "launch",
51+
"module": "meshtastic",
52+
"justMyCode": true,
53+
"args": ["--listen", "--debug"]
54+
},
4755
{
4856
"name": "meshtastic debug getPref",
4957
"type": "python",

meshtastic/__main__.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -761,6 +761,9 @@ def setSimpleConfig(modem_preset):
761761
qr = pyqrcode.create(url)
762762
print(qr.terminal())
763763

764+
if args.listen:
765+
closeNow = False
766+
764767
have_tunnel = platform.system() == "Linux"
765768
if have_tunnel and args.tunnel:
766769
# pylint: disable=C0415
@@ -987,7 +990,7 @@ def common():
987990

988991
have_tunnel = platform.system() == "Linux"
989992
if (
990-
args.noproto or args.reply or (have_tunnel and args.tunnel)
993+
args.noproto or args.reply or (have_tunnel and args.tunnel) or args.listen
991994
): # loop until someone presses ctrlc
992995
while True:
993996
time.sleep(1000)
@@ -1335,6 +1338,12 @@ def initParser():
13351338
action="store_true",
13361339
)
13371340

1341+
parser.add_argument(
1342+
"--listen",
1343+
help="Just stay open and listen to the protobuf stream.",
1344+
action="store_true",
1345+
)
1346+
13381347
have_tunnel = platform.system() == "Linux"
13391348
if have_tunnel:
13401349
parser.add_argument(

0 commit comments

Comments
 (0)