From 5dee206172a0c71ea7c60070f55c68031ac8d50d Mon Sep 17 00:00:00 2001 From: Mario Coray Date: Fri, 10 Sep 2021 17:15:43 +0200 Subject: [PATCH] clear also dlms data buffer if hdlc buffer get too large --- smartmeter_datacollector/smartmeter/hdlc_dlms_parser.py | 1 + 1 file changed, 1 insertion(+) diff --git a/smartmeter_datacollector/smartmeter/hdlc_dlms_parser.py b/smartmeter_datacollector/smartmeter/hdlc_dlms_parser.py index 561ce98..3da3c6c 100644 --- a/smartmeter_datacollector/smartmeter/hdlc_dlms_parser.py +++ b/smartmeter_datacollector/smartmeter/hdlc_dlms_parser.py @@ -41,6 +41,7 @@ def append_to_hdlc_buffer(self, data: bytes) -> None: LOGGER.warning("HDLC byte-buffer > %i. Buffer is cleared, some data is lost.", self.HDLC_BUFFER_MAX_SIZE) self._hdlc_buffer.clear() + self._dlms_data.clear() self._hdlc_buffer.set(data) def clear_hdlc_buffer(self) -> None: