mirror of
https://github.com/meshcore-dev/meshcore_py.git
synced 2026-06-11 11:56:18 +00:00
reader: return and warns if packet is empty
This commit is contained in:
@@ -51,7 +51,11 @@ class MessageReader:
|
||||
|
||||
async def handle_rx(self, data: bytearray):
|
||||
dbuf = io.BytesIO(data)
|
||||
try:
|
||||
packet_type_value = dbuf.read(1)[0]
|
||||
except IndexError as e:
|
||||
logger.warning(f"Received empty packet: {e}")
|
||||
return
|
||||
logger.debug(f"Received data: {data.hex()}")
|
||||
|
||||
# Handle command responses
|
||||
|
||||
Reference in New Issue
Block a user