From a0d61f644175bf3e75bfd0979fb6c06b89cbf519 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Mon, 7 Oct 2024 20:55:34 +0200 Subject: [PATCH] Added error descriptions for modem communication timeout --- RNS/Interfaces/Android/RNodeInterface.py | 4 ++++ RNS/Interfaces/RNodeInterface.py | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/RNS/Interfaces/Android/RNodeInterface.py b/RNS/Interfaces/Android/RNodeInterface.py index d17b354..9594acc 100644 --- a/RNS/Interfaces/Android/RNodeInterface.py +++ b/RNS/Interfaces/Android/RNodeInterface.py @@ -89,6 +89,7 @@ class KISS(): ERROR_EEPROM_LOCKED = 0x03 ERROR_QUEUE_FULL = 0x04 ERROR_MEMORY_LOW = 0x05 + ERROR_MODEM_TIMEOUT = 0x06 ERROR_INVALID_FIRMWARE = 0x10 ERROR_INVALID_BLE_MTU = 0x20 @@ -1254,6 +1255,9 @@ class RNodeInterface(Interface): elif (byte == KISS.ERROR_MEMORY_LOW): RNS.log(str(self)+" hardware error (code "+RNS.hexrep(byte)+"): Memory exhausted", RNS.LOG_ERROR) self.hw_errors.append({"error": KISS.ERROR_MEMORY_LOW, "description": "Memory exhausted on connected device"}) + elif (byte == KISS.ERROR_MODEM_TIMEOUT): + RNS.log(str(self)+" hardware error (code "+RNS.hexrep(byte)+"): Modem communication timed out", RNS.LOG_ERROR) + self.hw_errors.append({"error": KISS.ERROR_MODEM_TIMEOUT, "description": "Modem communication timed out on connected device"}) else: RNS.log(str(self)+" hardware error (code "+RNS.hexrep(byte)+")", RNS.LOG_ERROR) raise IOError("Unknown hardware failure") diff --git a/RNS/Interfaces/RNodeInterface.py b/RNS/Interfaces/RNodeInterface.py index 99cf8d8..1755fe6 100644 --- a/RNS/Interfaces/RNodeInterface.py +++ b/RNS/Interfaces/RNodeInterface.py @@ -80,6 +80,7 @@ class KISS(): ERROR_EEPROM_LOCKED = 0x03 ERROR_QUEUE_FULL = 0x04 ERROR_MEMORY_LOW = 0x05 + ERROR_MODEM_TIMEOUT = 0x06 PLATFORM_AVR = 0x90 PLATFORM_ESP32 = 0x80 @@ -850,6 +851,9 @@ class RNodeInterface(Interface): elif (byte == KISS.ERROR_MEMORY_LOW): RNS.log(str(self)+" hardware error (code "+RNS.hexrep(byte)+"): Memory exhausted", RNS.LOG_ERROR) self.hw_errors.append({"error": KISS.ERROR_MEMORY_LOW, "description": "Memory exhausted on connected device"}) + elif (byte == KISS.ERROR_MODEM_TIMEOUT): + RNS.log(str(self)+" hardware error (code "+RNS.hexrep(byte)+"): Modem communication timed out", RNS.LOG_ERROR) + self.hw_errors.append({"error": KISS.ERROR_MODEM_TIMEOUT, "description": "Modem communication timed out on connected device"}) else: RNS.log(str(self)+" hardware error (code "+RNS.hexrep(byte)+")", RNS.LOG_ERROR) raise IOError("Unknown hardware failure")