Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

show current DID being scanned #99

Merged
merged 1 commit into from
Nov 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions caringcaribou/modules/uds.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from caringcaribou.utils.constants import ARBITRATION_ID_MIN
from caringcaribou.utils.iso15765_2 import IsoTp
from caringcaribou.utils.iso14229_1 import Constants, Iso14229_1, NegativeResponseCodes, Services, ServiceID
from sys import stdout, version_info
from sys import stdout, version_info, stderr
import argparse
import datetime
import time
Expand Down Expand Up @@ -1072,6 +1072,7 @@ def dump_dids(arb_id_request, arb_id_response, timeout,
print('Identified DIDs:')
print('DID Value (hex)')
for identifier in range(min_did, max_did + 1):
print(f'0x{identifier:04x}', end='\r', file=stderr)
response = uds.read_data_by_identifier(identifier=[identifier])

# Only keep positive responses
Expand All @@ -1080,7 +1081,8 @@ def dump_dids(arb_id_request, arb_id_response, timeout,
if print_results:
print('0x{:04x}'.format(identifier), list_to_hex_str(response))
if print_results:
print("\nDone!")
print("\033[K", file=stderr) # clear line
print("Done!")
return responses


Expand Down