feat: implement modbus reset command and update docs/tool
This commit is contained in:
@@ -110,6 +110,12 @@ static int holding_reg_wr(uint16_t addr, uint16_t reg)
|
||||
k_timer_stop(&watchdog_timer);
|
||||
}
|
||||
break;
|
||||
case REG_HOLDING_DEVICE_RESET:
|
||||
if (reg == 1) {
|
||||
LOG_WRN("Modbus reset command received. Rebooting...");
|
||||
sys_reboot(SYS_REBOOT_WARM);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
fwu_handler(addr, reg);
|
||||
break;
|
||||
|
||||
@@ -223,6 +223,9 @@ def main_menu(stdscr, slave_id):
|
||||
except Exception as e: message = f"-> Error: {e}"
|
||||
elif selected_option == "Set Watchdog":
|
||||
input_mode, input_prompt, input_target_reg = True, "Enter Watchdog Timeout (s): ", REG_HOLDING_WATCHDOG_TIMEOUT_S
|
||||
elif selected_option == "Reset Node":
|
||||
client.write_register(REG_HOLDING_DEVICE_RESET, 1, slave=slave_id)
|
||||
message = "-> Sent RESET command"
|
||||
elif selected_option == "Firmware Update":
|
||||
filepath = file_browser(stdscr)
|
||||
if filepath:
|
||||
|
||||
Reference in New Issue
Block a user