mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-08-21 08:14:00 +08:00
@@ -13,6 +13,7 @@ if __name__ == "__main__":
|
||||
poller = zmq.Poller()
|
||||
|
||||
parser = argparse.ArgumentParser(description='Sniff a communcation socket')
|
||||
parser.add_argument('--pipe', action='store_true')
|
||||
parser.add_argument('--raw', action='store_true')
|
||||
parser.add_argument('--json', action='store_true')
|
||||
parser.add_argument('--addr', default='127.0.0.1')
|
||||
@@ -33,7 +34,10 @@ if __name__ == "__main__":
|
||||
for sock, mode in polld:
|
||||
if mode != zmq.POLLIN:
|
||||
continue
|
||||
if args.raw:
|
||||
if args.pipe:
|
||||
sys.stdout.write(sock.recv())
|
||||
sys.stdout.flush()
|
||||
elif args.raw:
|
||||
hexdump(sock.recv())
|
||||
elif args.json:
|
||||
print(json.loads(sock.recv()))
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
# simple script to get a vehicle fingerprint.
|
||||
# keep this script running for few seconds: some messages are published every few seconds
|
||||
|
||||
# Instructions:
|
||||
# - connect to a Panda
|
||||
# - run selfdrive/boardd/boardd
|
||||
# - launching this script
|
||||
# - since some messages are published at low frequency, keep this script running for few seconds,
|
||||
# until all messages are received at least once
|
||||
# - since some messages are published at low frequency, keep this script running for few
|
||||
# seconds, until all messages are received at least once
|
||||
|
||||
import zmq
|
||||
import selfdrive.messaging as messaging
|
||||
|
||||
Reference in New Issue
Block a user