From cc1783c1cd7f6fa1e31bfb7465306fafd8a79077 Mon Sep 17 00:00:00 2001 From: Uwe Seimet <48174652+uweseimet@users.noreply.github.com> Date: Tue, 26 Oct 2021 01:04:10 +0200 Subject: [PATCH] Improved remote connection error handling (#376) * Improved remote connection error handling * Improved error handling by adding a magic string to each message * Interface comment update * Interface comment update * Improve error messages * Clients send the magic word to authenticate Co-authored-by: Daniel Markstedt --- src/oled_monitor/rascsi_oled_monitor.py | 13 ++++++++----- src/raspberrypi/protobuf_util.cpp | 13 ++++++++----- src/raspberrypi/rascsi.cpp | 10 ++++++++++ src/raspberrypi/rascsi_interface.proto | 4 ++-- src/raspberrypi/rasctl_commands.cpp | 6 +++++- src/web/ractl_cmds.py | 2 ++ 6 files changed, 35 insertions(+), 13 deletions(-) diff --git a/src/oled_monitor/rascsi_oled_monitor.py b/src/oled_monitor/rascsi_oled_monitor.py index e87317d4..e974ba5e 100755 --- a/src/oled_monitor/rascsi_oled_monitor.py +++ b/src/oled_monitor/rascsi_oled_monitor.py @@ -235,6 +235,8 @@ def send_over_socket(s, payload): Reads data from socket in 2048 bytes chunks until all data is received. """ + # Sending the magic word "RASCSI" to authenticate with the server + s.send(b"RASCSI") # Prepending a little endian 32bit header with the message size s.send(pack("