don't respond on error, only one line of output
authorDobrica Pavlinusic <dpavlin@rot13.org>
Sun, 23 Jul 2023 11:12:10 +0000 (13:12 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Sun, 23 Jul 2023 11:12:10 +0000 (13:12 +0200)
ser-kramer.py [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index 322316a..1ab5d9d
@@ -25,13 +25,14 @@ def read_and_respond():
         elif read_bytes == b"\x14\x81\x80\x81":
             response = b"\x54\x81\x80\x81"
         else:
-            response = b"\xDE\xAD\xBE\xEF"
+            response = b""
+            #response = b"\xDE\xAD\xBE\xEF"
+            print("ERROR no reponse for", read_bytes.hex())
 
         # Send the response back
         ser.write(response)
 
-        print("Received:", read_bytes, read_bytes.hex())
-        print("Response:", response, response.hex())
+        print("<<", read_bytes.hex(), ">>", response.hex())
 
 if __name__ == "__main__":
     read_and_respond()