Skip to content

Commit

Permalink
Added error on configured radio parameter mismatch on Android
Browse files Browse the repository at this point in the history
  • Loading branch information
markqvist committed Jan 18, 2025
1 parent 77519f1 commit d2cf3c2
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions RNS/Interfaces/Android/RNodeInterface.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,16 @@ class KISS():
RADIO_STATE_ON = 0x01
RADIO_STATE_ASK = 0xFF

CMD_ERROR = 0x90
ERROR_INITRADIO = 0x01
ERROR_TXFAILED = 0x02
ERROR_EEPROM_LOCKED = 0x03
ERROR_QUEUE_FULL = 0x04
ERROR_MEMORY_LOW = 0x05
ERROR_MODEM_TIMEOUT = 0x06
CMD_ERROR = 0x90
ERROR_INITRADIO = 0x01
ERROR_TXFAILED = 0x02
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
ERROR_INVALID_CONFIG = 0x40

PLATFORM_AVR = 0x90
PLATFORM_ESP32 = 0x80
Expand Down Expand Up @@ -724,6 +725,7 @@ def configure_device(self):
RNS.log("After configuring "+str(self)+", the reported radio parameters did not match your configuration.", RNS.LOG_ERROR)
RNS.log("Make sure that your hardware actually supports the parameters specified in the configuration", RNS.LOG_ERROR)
RNS.log("Aborting RNode startup", RNS.LOG_ERROR)
self.hw_errors.append({"error": KISS.ERROR_INVALID_CONFIG, "description": "The configuration parameters were not validated by the device. Make sure that the device actually supports the TX power, frequency, bandwidth, spreading factor and coding rate you configured."})

if self.serial != None:
self.serial.close()
Expand Down

0 comments on commit d2cf3c2

Please sign in to comment.