-
Notifications
You must be signed in to change notification settings - Fork 9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
312ba62
commit e33b4be
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import os | ||
import sys | ||
import time | ||
|
||
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), "..")) | ||
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". | ||
|
||
# Resend every CAN message that has been received on the same bus, but with the data reversed | ||
if __name__ == "__main__": | ||
p = Panda() | ||
p.set_safety_mode(Panda.SAFETY_ALLOUTPUT) | ||
while True: | ||
incoming = p.can_recv() | ||
for message in incoming: | ||
address, notused, data, bus = message | ||
if b'test' in data: | ||
p.can_send(address, data[::-1], bus) | ||
|
||
|