mirror of
https://github.com/infiniteCable2/panda.git
synced 2026-02-18 17:23:52 +08:00
* move to opendbc * all passing * do the rest * fix * and another * order * and update ref to master
18 lines
569 B
Python
Executable File
18 lines
569 B
Python
Executable File
#!/usr/bin/env python3
|
|
from opendbc.safety import Safety
|
|
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(Safety.SAFETY_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)
|