|
|
|
@ -106,18 +106,18 @@ int8_t ICACHE_FLASH_ATTR getUInt16Arg(HttpdConnData *connData, char *name, uint1 |
|
|
|
|
return 1; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int8_t ICACHE_FLASH_ATTR getBoolArg(HttpdConnData *connData, char *name, bool *config) { |
|
|
|
|
int8_t ICACHE_FLASH_ATTR getBoolArg(HttpdConnData *connData, char *name, uint8_t *config) { |
|
|
|
|
char buff[16]; |
|
|
|
|
int len = httpdFindArg(connData->getArgs, name, buff, sizeof(buff)); |
|
|
|
|
if (len < 0) return 0; // not found, skip
|
|
|
|
|
|
|
|
|
|
if (os_strcmp(buff, "1") == 0 || os_strcmp(buff, "true") == 0) { |
|
|
|
|
*config = true; |
|
|
|
|
*config = 1; |
|
|
|
|
return 1; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (os_strcmp(buff, "0") == 0 || os_strcmp(buff, "false") == 0) { |
|
|
|
|
*config = false; |
|
|
|
|
*config = 0; |
|
|
|
|
return 1; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|