Added command to listen to protobuf stream

This commit is contained in:
Ben Meadors
2024-03-08 14:16:02 -06:00
parent 90c218daa7
commit a1ffb459f8
2 changed files with 18 additions and 1 deletions

8
.vscode/launch.json vendored
View File

@@ -44,6 +44,14 @@
"justMyCode": true,
"args": ["--debug"]
},
{
"name": "meshtastic listen",
"type": "python",
"request": "launch",
"module": "meshtastic",
"justMyCode": true,
"args": ["--listen", "--debug"]
},
{
"name": "meshtastic debug getPref",
"type": "python",

View File

@@ -761,6 +761,9 @@ def onConnected(interface):
qr = pyqrcode.create(url)
print(qr.terminal())
if args.listen:
closeNow = False
have_tunnel = platform.system() == "Linux"
if have_tunnel and args.tunnel:
# pylint: disable=C0415
@@ -987,7 +990,7 @@ def common():
have_tunnel = platform.system() == "Linux"
if (
args.noproto or args.reply or (have_tunnel and args.tunnel)
args.noproto or args.reply or (have_tunnel and args.tunnel) or args.listen
): # loop until someone presses ctrlc
while True:
time.sleep(1000)
@@ -1335,6 +1338,12 @@ def initParser():
action="store_true",
)
parser.add_argument(
"--listen",
help="Just stay open and listen to the protobuf stream.",
action="store_true",
)
have_tunnel = platform.system() == "Linux"
if have_tunnel:
parser.add_argument(