forked from M-Labs/kirdy
driver: end_session if ConnClose & Dfu is recv-ed
This commit is contained in:
parent
0b5fda2cd9
commit
6d4b1b0574
|
@ -811,7 +811,14 @@ class Kirdy:
|
|||
response = await self._read_response()
|
||||
|
||||
if response["msg_type"] == 'HardReset':
|
||||
logging.warn("Kirdy is being hard reset.")
|
||||
raise asyncio.exceptions.CancelledError
|
||||
if response["msg_type"] == 'Dfu':
|
||||
logging.warn("Kirdy enters Dfu Mode.")
|
||||
asyncio.create_task(self.end_session())
|
||||
if response["msg_type"] == 'ConnectionClose':
|
||||
logging.warn("Kirdy runs out of TCP sockets and closes this connected socket.")
|
||||
asyncio.create_task(self.end_session())
|
||||
if response["msg_type"] == 'Report' and not self._msg_queue_get_report:
|
||||
if self._report_sig is None:
|
||||
self._report_queue.put_nowait_overwrite(response)
|
||||
|
|
Loading…
Reference in New Issue