From 6673c4f2da0e04aa7e77da48c52d63465e1e597f Mon Sep 17 00:00:00 2001 From: fabian Date: Tue, 28 Nov 2023 17:15:21 +0100 Subject: [PATCH] refactor(ecu-reset): use leave_session --- src/gallia/commands/scan/uds/sessions.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/gallia/commands/scan/uds/sessions.py b/src/gallia/commands/scan/uds/sessions.py index 3803c7e47..2ab72cc5c 100644 --- a/src/gallia/commands/scan/uds/sessions.py +++ b/src/gallia/commands/scan/uds/sessions.py @@ -175,14 +175,8 @@ async def main(self, args: Namespace) -> None: ) await self.ecu.reconnect() - try: - logger.debug("Changing session to DefaultSession") - resp = await self.ecu.set_session(0x01, use_db=False) - if isinstance(resp, NegativeResponse): - logger.error(f"Could not change to default session: {resp}") - sys.exit(1) - except Exception as e: - logger.error(f"Could not change to default session: {e!r}") + if not (await self.ecu.leave_session(session)): + logger.error(f"Could not change to default session") sys.exit(1) logger.debug(