Skip to content

Commit

Permalink
fix: Add accidentally removed return value of wait_for_ecu()
Browse files Browse the repository at this point in the history
  • Loading branch information
rumpelsepp committed Jul 1, 2022
1 parent 8b1ed17 commit 6c13105
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/gallia/uds/ecu.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,14 +332,16 @@ async def _wait_for_ecu(self, sleep_time: float) -> None:
async def wait_for_ecu(
self,
timeout: Optional[float] = None,
) -> None:
) -> bool:
"""wait for ecu to be alive again (eg. after reset)
Wait at most timeout"""
t = timeout if timeout is not None else self.timeout
try:
await asyncio.wait_for(self._wait_for_ecu(t * 0.8), timeout=t)
return True
except asyncio.TimeoutError:
self.logger.log_critical("Timeout while waiting for ECU!")
return False

async def update_state(
self, request: service.UDSRequest, response: service.UDSResponse
Expand Down

0 comments on commit 6c13105

Please sign in to comment.