Skip to content

Commit

Permalink
refactor(ecu-reset): use leave_session
Browse files Browse the repository at this point in the history
  • Loading branch information
fkglr committed Nov 28, 2023
1 parent 9d15735 commit 6673c4f
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/gallia/commands/scan/uds/sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 6673c4f

Please sign in to comment.