Files
sunnypilot/panda/tests/echo.py
T
github-actions[bot] f5e5d688c3 sunnypilot v2025.03.18-1285
version: sunnypilot v0.9.9 release
  date: 2025-03-18T06:26:39
  master commit: 8e5b656e654a7694c22f2b0b7bee0802db02b4af
2025-03-18 06:26:39 +00:00

18 lines
585 B
Python
Executable File

#!/usr/bin/env python3
from opendbc.car.structs import CarParams
from panda import Panda
# This script is intended to be used in conjunction with the echo_loopback_test.py test script from panda jungle.
# It sends a reversed response back for every message received containing b"test".
if __name__ == "__main__":
p = Panda()
p.set_safety_mode(CarParams.SafetyModel.allOutput)
p.set_power_save(False)
while True:
incoming = p.can_recv()
for message in incoming:
address, data, bus = message
if b'test' in data:
p.can_send(address, data[::-1], bus)