Skip to content

Commit

Permalink
Fix #975 thanks to @dbuezas
Browse files Browse the repository at this point in the history
  • Loading branch information
luc-github committed Dec 4, 2023
1 parent c7957a2 commit f33f711
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion esp3d/src/core/commands/ESP401.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 92,23 @@ void ESP3DCommands::ESP401(int cmd_params_pos, ESP3DMessage* msg) {
hasError = true;
esp3d_log_e("Set failed");
}
} else {
error_msg = "Invalid value for T";
hasError = true;
esp3d_log_e("Invalid value for T");
}
break;
case 'I': // Integer value
if (ESP3DSettings::isValidByteSetting(sval.toInt(), spos.toInt())) {
if (ESP3DSettings::isValidIntegerSetting(sval.toInt(), spos.toInt())) {
if (!ESP3DSettings::writeUint32(spos.toInt(), sval.toInt())) {
error_msg = "Set failed";
hasError = true;
esp3d_log_e("Set failed");
}
} else {
error_msg = "Invalid value for T";
hasError = true;
esp3d_log_e("Invalid value for T");
}
break;
case 'S': // String value
Expand All @@ -110,6 118,10 @@ void ESP3DCommands::ESP401(int cmd_params_pos, ESP3DMessage* msg) {
hasError = true;
esp3d_log_e("Set failed");
}
} else {
error_msg = "Invalid value for T";
hasError = true;
esp3d_log_e("Invalid value for T");
}
break;
case 'A': // IP address
Expand All @@ -118,6 130,10 @@ void ESP3DCommands::ESP401(int cmd_params_pos, ESP3DMessage* msg) {
error_msg = "Set failed";
hasError = true;
}
} else {
error_msg = "Invalid value for T";
hasError = true;
esp3d_log_e("Invalid value for T");
}
break;
default:
Expand Down

0 comments on commit f33f711

Please sign in to comment.