Files
panda-meb/tests/standalone_test.py
2017-04-28 17:25:37 -07:00

29 lines
498 B
Python
Executable File

#!/usr/bin/env python
import os
import struct
import time
from panda.lib.panda import Panda
if __name__ == "__main__":
if os.getenv("WIFI") is not None:
p = Panda("WIFI")
else:
p = Panda()
print p.health()
print p.get_serial()
a = 0
while 1:
# flood
msg = "\xaa"*4 + struct.pack("I", a)
p.can_send(0xaa, msg, 0)
p.can_send(0xaa, msg, 1)
p.can_send(0xaa, msg, 4)
time.sleep(0.01)
dat = p.can_recv()
if len(dat) > 0:
print dat
a += 1