From 0078155ad7e8bdf090717ffd9441685381bdd71b Mon Sep 17 00:00:00 2001 From: Andreas Lauser Date: Thu, 26 Oct 2023 09:20:05 +0200 Subject: [PATCH] fix typo hit happens... Signed-off-by: Andreas Lauser Signed-off-by: Gerrit Ecke Signed-off-by: Florian Jost --- odxtools/cli/snoop.py | 2 +- odxtools/uds.py | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/odxtools/cli/snoop.py b/odxtools/cli/snoop.py index 43ca4c05..1ce120ae 100644 --- a/odxtools/cli/snoop.py +++ b/odxtools/cli/snoop.py @@ -30,7 +30,7 @@ def handle_telegram(telegram_id: int, payload: bytes) -> None: global last_request if telegram_id == ecu_tx_id: - if uds.is_reponse_pending(payload): + if uds.is_response_pending(payload): print(f" -> response pending") return diff --git a/odxtools/uds.py b/odxtools/uds.py index 9b8eb96f..677a94c4 100644 --- a/odxtools/uds.py +++ b/odxtools/uds.py @@ -3,6 +3,8 @@ from itertools import chain from typing import Optional +from deprecation import deprecated + import odxtools.obd as obd @@ -142,7 +144,7 @@ def negative_response_id(service_id: int) -> int: return NegativeResponseId -def is_reponse_pending(telegram_payload: bytes, request_sid: Optional[int] = None) -> bool: +def is_response_pending(telegram_payload: bytes, request_sid: Optional[int] = None) -> bool: # "response pending" responses exhibit at least three bytes if len(telegram_payload) < 3: return False @@ -168,3 +170,9 @@ def is_reponse_pending(telegram_payload: bytes, request_sid: Optional[int] = Non # if all of the above applies, we received a "stay tuned" response return True + + +# previous versions of odxtools had a typo here. hit happens! +@deprecated(details="use is_response_pending()") +def is_reponse_pending(telegram_payload: bytes, request_sid: Optional[int] = None) -> bool: + return is_reponse_pending(telegram_payload, request_sid)