mirror of
https://github.com/meshtastic/python.git
synced 2026-01-02 12:57:56 -05:00
Added command to listen to protobuf stream
This commit is contained in:
8
.vscode/launch.json
vendored
8
.vscode/launch.json
vendored
@@ -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",
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user