mirror of
https://github.com/infiniteCable2/panda.git
synced 2026-02-18 17:23:52 +08:00
improve standalone test
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
#!/usr/bin/env python
|
||||
import os
|
||||
from panda.lib.panda import Panda
|
||||
import struct
|
||||
import time
|
||||
from panda.lib.panda import Panda
|
||||
|
||||
if __name__ == "__main__":
|
||||
if os.getenv("WIFI") is not None:
|
||||
@@ -10,12 +11,15 @@ if __name__ == "__main__":
|
||||
p = Panda()
|
||||
print p.health()
|
||||
|
||||
a = 0
|
||||
while 1:
|
||||
# flood
|
||||
p.can_send(0xaa, "\xaa"*8, 0)
|
||||
p.can_send(0xaa, "\xaa"*8, 1)
|
||||
p.can_send(0xaa, "\xaa"*8, 4)
|
||||
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)
|
||||
|
||||
print p.can_recv()
|
||||
a += 1
|
||||
|
||||
|
||||
Reference in New Issue
Block a user