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
|
tries -= 1
|
||||||
# clear the read buffer
|
# clear the read buffer
|
||||||
try:
|
try:
|
||||||
await self.node.read(1024, timeout=.1)
|
ret = await self.node.read(1024, timeout=.25)
|
||||||
except asyncio.TimeoutError:
|
except asyncio.TimeoutError:
|
||||||
pass
|
pass
|
||||||
|
else:
|
||||||
|
logging.info(f"Read Buffer Contents: {ret!r}")
|
||||||
await asyncio.sleep(.1)
|
await asyncio.sleep(.1)
|
||||||
raise FlashError("Error sending command [%s] to Device" % (cmdname))
|
raise FlashError("Error sending command [%s] to Device" % (cmdname))
|
||||||
|
|
||||||
@ -300,17 +302,17 @@ class CanNode:
|
|||||||
self._cansocket = cansocket
|
self._cansocket = cansocket
|
||||||
|
|
||||||
async def read(
|
async def read(
|
||||||
self, n: int = -1, timeout: Optional[float] = 2
|
self, n: int = -1, timeout: Optional[float] = 5.
|
||||||
) -> bytes:
|
) -> bytes:
|
||||||
return await asyncio.wait_for(self._reader.read(n), timeout)
|
return await asyncio.wait_for(self._reader.read(n), timeout)
|
||||||
|
|
||||||
async def readexactly(
|
async def readexactly(
|
||||||
self, n: int, timeout: Optional[float] = 2
|
self, n: int, timeout: Optional[float] = 5.
|
||||||
) -> bytes:
|
) -> bytes:
|
||||||
return await asyncio.wait_for(self._reader.readexactly(n), timeout)
|
return await asyncio.wait_for(self._reader.readexactly(n), timeout)
|
||||||
|
|
||||||
async def readuntil(
|
async def readuntil(
|
||||||
self, sep: bytes = b"\x03", timeout: Optional[float] = 2
|
self, sep: bytes = b"\x03", timeout: Optional[float] = 5.
|
||||||
) -> bytes:
|
) -> bytes:
|
||||||
return await asyncio.wait_for(self._reader.readuntil(sep), timeout)
|
return await asyncio.wait_for(self._reader.readuntil(sep), timeout)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user