#!/usr/bin/env python
import os
from panda.lib.panda import Panda
import time

if __name__ == "__main__":
  if os.getenv("WIFI") is not None:
    p = Panda("WIFI")
  else:
    p = Panda()
  print p.health()

  while 1:
    # flood
    p.can_send(0xaa, "\xaa"*8, 0)
    p.can_send(0xaa, "\xaa"*8, 1)
    p.can_send(0xaa, "\xaa"*8, 4)
    time.sleep(0.01)

    print p.can_recv()


@@ -25,16 +25,42 @@
 port os%0A
+import struct%0Aimport time%0A
 from pan
@@ -84,28 +84,16 @@
 rt Panda
-%0Aimport time
 %0A%0Aif __n
@@ -215,16 +215,24 @@
 alth()%0A%0A
+  a = 0%0A
   while 
@@ -246,16 +246,57 @@
 # flood%0A
+    msg = %22%5Cxaa%22*4 + struct.pack(%22I%22, a)%0A
     p.ca
@@ -308,24 +308,19 @@
 d(0xaa, 
-%22%5Cxaa%22*8
+msg
 , 0)%0A   
@@ -337,24 +337,19 @@
 d(0xaa, 
-%22%5Cxaa%22*8
+msg
 , 1)%0A   
@@ -370,16 +370,11 @@
 aa, 
-%22%5Cxaa%22*8
+msg
 , 4)
@@ -418,10 +418,21 @@
 n_recv()
+%0A    a += 1
 %0A%0A

improve standalone test