mirror of
https://github.com/meshtastic/python.git
synced 2026-04-29 03:13:56 -04:00
Added command to listen to protobuf stream
This commit is contained in:
@@ -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