Files
sunnypilot/selfdrive/loggerd/ethernetsniffer.py
Willem Melching c0866d9edb pre-commit pylint (#1580)
* "The commit-hook project sounds interesting though. I would definitely merge something that runs flake8 and pylint on the modified files!"
-  pd0wm, https://github.com/commaai/openpilot/pull/1575#issuecomment-634974344

* add pylint to pre-commit and make everything pass

* Remove uncommented stuff

Co-authored-by: J <user@4800.lan>
old-commit-hash: bd06434243
2020-05-27 20:00:14 -07:00

18 lines
392 B
Python
Executable File

#!/usr/bin/env python3
# pylint: skip-file
import cereal.messaging as messaging
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()