Created
May 22, 2020 00:08
-
-
Save pd0wm/5099dbfd897190e3da7fdc96e8275318 to your computer and use it in GitHub Desktop.
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
import time | |
import struct | |
from panda import Panda | |
from hexdump import hexdump | |
from panda.python.isotp import isotp_send, isotp_recv | |
BUS = 1 | |
panda = Panda() | |
panda.set_safety_mode(Panda.SAFETY_ELM327) | |
panda.can_clear(BUS) | |
ext_diag = b"\x10\x03" | |
tester_present = b"\x3E\x00" | |
blink_left_on = b"\x2F\xBC\x15\x03" | |
addr = 0x770 | |
isotp_send(panda, ext_diag, addr, bus=BUS) | |
hexdump(isotp_recv(panda, addr + 8, bus=BUS)) | |
isotp_send(panda, tester_present, addr, bus=BUS) | |
hexdump(isotp_recv(panda, addr + 8, bus=BUS)) | |
isotp_send(panda, blink_left_on, addr, bus=BUS) | |
hexdump(isotp_recv(panda, addr + 8, bus=BUS)) | |
time.sleep(1) | |
for i in range(20): | |
isotp_send(panda, tester_present, addr, bus=BUS) | |
hexdump(isotp_recv(panda, addr + 8, bus=BUS)) | |
time.sleep(1.0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment