send unparsed data to client

This commit is contained in:
Kavish Devar
2024-09-29 00:26:06 +05:30
parent 2b8d6c5490
commit f54a5dc7ec

View File

@@ -53,7 +53,9 @@ def handle_client(connection, client_socket):
}
data: str = JSONEncoder().encode(earDetectionJSON)
else:
logging.warning(f"Unhandled notification type: {notif_key}")
logging.debug(f"Unhandled notification type: {notif_key}")
logging.debug(f"Data: {data}")
data: str = JSONEncoder().encode({"type": "unknown", "data": data})
continue
if not client_socket or not isinstance(client_socket, socket.socket):
@@ -160,6 +162,7 @@ def notification_handler(notification_type: int, data: bytes):
elif notification_type == Notifications.UNKNOWN:
logger = logging.getLogger("Unknown Notification")
hex_data = ' '.join(f'{byte:02x}' for byte in data)
globals()["notif_unknown"] = hex_data
logger.debug(hex_data)
def main():