forked from commaai/openpilot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request commaai#145 from gregjhogan/uds
Unified Diagnostic Services (UDS) panda library (ISO 14229)
- Loading branch information
Showing
2 changed files
with
829 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,62 @@ | ||
#!/usr/bin/env python3 | ||
import sys | ||
import os | ||
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), "..")) | ||
from python import Panda | ||
from python.uds import UdsClient, NegativeResponseError, DATA_IDENTIFIER_TYPE | ||
|
||
if __name__ == "__main__": | ||
address = 0x18da30f1 # Honda EPS | ||
panda = Panda() | ||
uds_client = UdsClient(panda, address, debug=False) | ||
|
||
print("tester present ...") | ||
uds_client.tester_present() | ||
|
||
try: | ||
print("") | ||
print("read data by id: boot software id ...") | ||
data = uds_client.read_data_by_identifier(DATA_IDENTIFIER_TYPE.BOOT_SOFTWARE_IDENTIFICATION) | ||
print(data.decode('utf-8')) | ||
except NegativeResponseError as e: | ||
print(e) | ||
|
||
try: | ||
print("") | ||
print("read data by id: application software id ...") | ||
data = uds_client.read_data_by_identifier(DATA_IDENTIFIER_TYPE.APPLICATION_SOFTWARE_IDENTIFICATION) | ||
print(data.decode('utf-8')) | ||
except NegativeResponseError as e: | ||
print(e) | ||
|
||
try: | ||
print("") | ||
print("read data by id: application data id ...") | ||
data = uds_client.read_data_by_identifier(DATA_IDENTIFIER_TYPE.APPLICATION_DATA_IDENTIFICATION) | ||
print(data.decode('utf-8')) | ||
except NegativeResponseError as e: | ||
print(e) | ||
|
||
try: | ||
print("") | ||
print("read data by id: boot software fingerprint ...") | ||
data = uds_client.read_data_by_identifier(DATA_IDENTIFIER_TYPE.BOOT_SOFTWARE_FINGERPRINT) | ||
print(data.decode('utf-8')) | ||
except NegativeResponseError as e: | ||
print(e) | ||
|
||
try: | ||
print("") | ||
print("read data by id: application software fingerprint ...") | ||
data = uds_client.read_data_by_identifier(DATA_IDENTIFIER_TYPE.APPLICATION_SOFTWARE_FINGERPRINT) | ||
print(data.decode('utf-8')) | ||
except NegativeResponseError as e: | ||
print(e) | ||
|
||
try: | ||
print("") | ||
print("read data by id: application data fingerprint ...") | ||
data = uds_client.read_data_by_identifier(DATA_IDENTIFIER_TYPE.APPLICATION_DATA_FINGERPRINT) | ||
print(data.decode('utf-8')) | ||
except NegativeResponseError as e: | ||
print(e) |
Oops, something went wrong.