diff --git a/pykirdy/driver/kirdy.py b/pykirdy/driver/kirdy.py index 90f6030..7767dd3 100644 --- a/pykirdy/driver/kirdy.py +++ b/pykirdy/driver/kirdy.py @@ -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)