mirror of
https://github.com/andreili/katapult.git
synced 2025-08-23 19:34:06 +02:00
flashtool: increase default read timeout
Signed-off-by: Eric Callahan <arksine.code@gmail.com
This commit is contained in:
parent
730fde48ab
commit
10abb2a086
@ -207,9 +207,11 @@ class CanFlasher:
|
||||
tries -= 1
|
||||
# clear the read buffer
|
||||
try:
|
||||
await self.node.read(1024, timeout=.1)
|
||||
ret = await self.node.read(1024, timeout=.25)
|
||||
except asyncio.TimeoutError:
|
||||
pass
|
||||
else:
|
||||
logging.info(f"Read Buffer Contents: {ret!r}")
|
||||
await asyncio.sleep(.1)
|
||||
raise FlashError("Error sending command [%s] to Device" % (cmdname))
|
||||
|
||||
@ -300,17 +302,17 @@ class CanNode:
|
||||
self._cansocket = cansocket
|
||||
|
||||
async def read(
|
||||
self, n: int = -1, timeout: Optional[float] = 2
|
||||
self, n: int = -1, timeout: Optional[float] = 5.
|
||||
) -> bytes:
|
||||
return await asyncio.wait_for(self._reader.read(n), timeout)
|
||||
|
||||
async def readexactly(
|
||||
self, n: int, timeout: Optional[float] = 2
|
||||
self, n: int, timeout: Optional[float] = 5.
|
||||
) -> bytes:
|
||||
return await asyncio.wait_for(self._reader.readexactly(n), timeout)
|
||||
|
||||
async def readuntil(
|
||||
self, sep: bytes = b"\x03", timeout: Optional[float] = 2
|
||||
self, sep: bytes = b"\x03", timeout: Optional[float] = 5.
|
||||
) -> bytes:
|
||||
return await asyncio.wait_for(self._reader.readuntil(sep), timeout)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user