Merge pull request #5642 from tonhuisman/bugfix/Command-udpport-argument-parsing

[Commands] UdpPort argument processing fix
This commit is contained in:
TD-er authored and GitHub committed 2026-10-07 21:54:56 +02:00
commit 06b2d3a037
3 files changed
+14 -15

No files matched your search

+5 -6
View File
@@ -213,10 +213,10 @@ String Command_GetORSetETH(struct EventStruct *event,
} }
#endif #endif
String Command_GetORSetInt8_t(struct EventStruct *event, String Command_GetORSetUInt32_t(struct EventStruct *event,
const __FlashStringHelper * targetDescription, const __FlashStringHelper * targetDescription,
const char *Line, const char *Line,
int8_t *value, uint32_t *value,
int arg) int arg)
{ {
bool hasArgument = false; bool hasArgument = false;
@@ -226,11 +226,10 @@ String Command_GetORSetInt8_t(struct EventStruct *event,
if (GetArgv(Line, TmpStr1, arg + 1)) { if (GetArgv(Line, TmpStr1, arg + 1)) {
hasArgument = true; hasArgument = true;
TmpStr1.toLowerCase();
int32_t tmp_int = 0; uint32_t tmp_int{};
if (validIntFromString(TmpStr1, tmp_int)) { if (validUIntFromString(TmpStr1, tmp_int)) {
*value = static_cast<int8_t>(tmp_int); *value = tmp_int;
} }
} }
} }
+5 -5
View File
@@ -62,11 +62,11 @@ String Command_GetORSetETH(struct EventStruct *event,
int arg); int arg);
#endif #endif
String Command_GetORSetInt8_t(struct EventStruct *event, String Command_GetORSetUInt32_t(struct EventStruct *event,
const __FlashStringHelper * targetDescription, const __FlashStringHelper * targetDescription,
const char *Line, const char *Line,
int8_t *value, uint32_t *value,
int arg); int arg);
String Command_GetORSetFloatMinMax(struct EventStruct *event, String Command_GetORSetFloatMinMax(struct EventStruct *event,
const __FlashStringHelper * targetDescription, const __FlashStringHelper * targetDescription,
+4 -4
View File
@@ -11,10 +11,10 @@
String Command_UDP_Port(struct EventStruct *event, const char *Line) String Command_UDP_Port(struct EventStruct *event, const char *Line)
{ {
return Command_GetORSetBool(event, F("UDPPort:"), return Command_GetORSetUInt32_t(event, F("UDPPort:"),
Line, Line,
(bool *)&Settings.UDPPort, &Settings.UDPPort,
1); 1);
} }
#if FEATURE_ESPEASY_P2P #if FEATURE_ESPEASY_P2P