From d3096e68577f74cc305a597844f5a8ac306a5096 Mon Sep 17 00:00:00 2001 From: Nick Art Date: Wed, 13 Nov 2024 16:58:08 -0500 Subject: [PATCH] bug fix for message type bug fix --- software/networking/networking.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/software/networking/networking.py b/software/networking/networking.py index 6fbf400..2f53337 100644 --- a/software/networking/networking.py +++ b/software/networking/networking.py @@ -773,9 +773,9 @@ def __handle_inf(sender_mac, subtype, stimestamp, rtimestamp, payload_type, payl payload = __decode_payload(payload_type, payload) self.master._iprint(f"Message received from {sender_mac} ({self.peer_name(sender_mac)}): {payload}") self._received_messages.append((sender_mac, payload, rtimestamp)) - self.received_messages_size.append(payloadlength) - while len(self.received_messages) > 2048 or sum(self._received_messages_size) > 20000: - self.master._dprint(f"Maximum buffer size reached: {len(self.received_messages)}, {sum(self._received_messages_size)} bytes; Reducing!") + self._received_messages_size.append(payloadlength) + while len(self._received_messages) > 2048 or sum(self._received_messages_size) > 20000: + self.master._dprint(f"Maximum buffer size reached: {len(self._received_messages)}, {sum(self._received_messages_size)} bytes; Reducing!") self._received_messages.pop(0) self._received_messages_size.pop(0) #self._compose(sender_mac, ["Other (\x20)", payload], 0x03, 0x13) #confirm message recv @@ -815,7 +815,7 @@ def __handle_ack(sender_mac, subtype, stimestamp, rtimestamp, payload_type, payl if data: rtimestamp = time.ticks_ms() if sender_mac != None and data != None: - #self.received_messages.append((sender_mac, data, rtimestamp))#Messages will be saved here, this is only for debugging purposes + #self._received_messages.append((sender_mac, data, rtimestamp))#Messages will be saved here, this is only for debugging purposes __process_message(sender_mac, data, rtimestamp) if not self._aen.any():#this is necessary as the for loop gets stuck and does not exit properly. break