mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-06-22 16:42:07 +08:00
682c866a55
old-commit-hash: 6ff881f789
19 lines
424 B
Python
Executable File
19 lines
424 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():
|
|
ethernetData = messaging.pub_sock('ethernetData')
|
|
|
|
for ts, pkt in pcap.pcap('eth0'):
|
|
dat = messaging.new_message('ethernetData', 1)
|
|
dat.ethernetData[0].ts = ts
|
|
dat.ethernetData[0].pkt = str(pkt)
|
|
ethernetData.send(dat.to_bytes())
|
|
|
|
if __name__ == "__main__":
|
|
main()
|
|
|