mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-03 12:32:06 +08:00
510b718f0f
old-commit-hash: da079d47d7
20 lines
448 B
Python
Executable File
20 lines
448 B
Python
Executable File
#!/usr/bin/env python3
|
|
import zmq
|
|
import cereal.messaging as messaging
|
|
from cereal.services import service_list
|
|
import pcap
|
|
|
|
def main(gctx=None):
|
|
ethernetData = messaging.pub_sock('ethernetData')
|
|
|
|
for ts, pkt in pcap.pcap('eth0'):
|
|
dat = messaging.new_message()
|
|
dat.init('ethernetData', 1)
|
|
dat.ethernetData[0].ts = ts
|
|
dat.ethernetData[0].pkt = str(pkt)
|
|
ethernetData.send(dat.to_bytes())
|
|
|
|
if __name__ == "__main__":
|
|
main()
|
|
|