mirror of
https://github.com/letscontrolit/ESPEasy.git
synced 2026-10-26 22:10:45 +00:00
Merge pull request #5642 from tonhuisman/bugfix/Command-udpport-argument-parsing
[Commands] UdpPort argument processing fix
This commit is contained in:
3 files changed
+9
-10
No files matched your search
@@ -213,10 +213,10 @@ String Command_GetORSetETH(struct EventStruct *event,
|
||||
}
|
||||
#endif
|
||||
|
||||
String Command_GetORSetInt8_t(struct EventStruct *event,
|
||||
String Command_GetORSetUInt32_t(struct EventStruct *event,
|
||||
const __FlashStringHelper * targetDescription,
|
||||
const char *Line,
|
||||
int8_t *value,
|
||||
uint32_t *value,
|
||||
int arg)
|
||||
{
|
||||
bool hasArgument = false;
|
||||
@@ -226,11 +226,10 @@ String Command_GetORSetInt8_t(struct EventStruct *event,
|
||||
|
||||
if (GetArgv(Line, TmpStr1, arg + 1)) {
|
||||
hasArgument = true;
|
||||
TmpStr1.toLowerCase();
|
||||
|
||||
int32_t tmp_int = 0;
|
||||
if (validIntFromString(TmpStr1, tmp_int)) {
|
||||
*value = static_cast<int8_t>(tmp_int);
|
||||
uint32_t tmp_int{};
|
||||
if (validUIntFromString(TmpStr1, tmp_int)) {
|
||||
*value = tmp_int;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,10 +62,10 @@ String Command_GetORSetETH(struct EventStruct *event,
|
||||
int arg);
|
||||
#endif
|
||||
|
||||
String Command_GetORSetInt8_t(struct EventStruct *event,
|
||||
String Command_GetORSetUInt32_t(struct EventStruct *event,
|
||||
const __FlashStringHelper * targetDescription,
|
||||
const char *Line,
|
||||
int8_t *value,
|
||||
uint32_t *value,
|
||||
int arg);
|
||||
|
||||
String Command_GetORSetFloatMinMax(struct EventStruct *event,
|
||||
|
||||
@@ -11,9 +11,9 @@
|
||||
|
||||
String Command_UDP_Port(struct EventStruct *event, const char *Line)
|
||||
{
|
||||
return Command_GetORSetBool(event, F("UDPPort:"),
|
||||
return Command_GetORSetUInt32_t(event, F("UDPPort:"),
|
||||
Line,
|
||||
(bool *)&Settings.UDPPort,
|
||||
&Settings.UDPPort,
|
||||
1);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user