version: sunnypilot v2025.003.000 (dev) date: 2026-02-09T02:04:38 master commit: 254f55ac15a40343d7255f2f098de3442e0c4a6f
18 lines
585 B
Python
Executable File
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)
|