add config switch
This commit is contained in:
@ -34,3 +34,24 @@
|
||||
buffer << std::uppercase << std::setfill('0') << std::setw(2) << std::hex << (int)myConfig.appKey[i];
|
||||
}
|
||||
buffer << "\">";
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
static void handleConfigSave() {
|
||||
char *arg1 = (char*)server.arg("AppEui").c_str();
|
||||
Serial.printf("AppEui: %s\n\r", arg1);
|
||||
parseField(arg1, 1, 8, myConfig.appEui);
|
||||
|
||||
if (!configParsingFailed) {
|
||||
char *arg2 = (char*)server.arg("AppKey").c_str();
|
||||
Serial.printf("AppKey: %s\n\r", arg2);
|
||||
parseField(arg2, 2, 16, myConfig.appKey);
|
||||
}
|
||||
|
||||
configSaved = !configParsingFailed;
|
||||
server.sendHeader("Location", String("/"), true);
|
||||
server.send(302, "text/plain", "");
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user