Files
openpilot/panda/scripts/standalone_test.py
lochuan e093d74e0a openpilot v2026.003.000 lean release (device-built, flat)
date: 2026-10-25T03:40:59
source commit: c3xl-lean@b13531ea3f789dc796a77901d5ff912baa85a1ac
built on: comma device
2026-10-25 03:40:59 +00:00

34 lines
655 B
Python
Executable File

#!/usr/bin/env python3
import struct
import time
from opendbc.car.structs import CarParams
from panda import Panda
if __name__ == "__main__":
p = Panda()
print(p.get_serial())
print(p.health())
t1 = time.time()
for _ in range(100):
p.get_serial()
t2 = time.time()
print("100 requests took %.2f ms" % ((t2 - t1) * 1000))
p.set_safety_mode(CarParams.SafetyModel.allOutput)
a = 0
while True:
# flood
msg = b"\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