AP password now configurable

This commit is contained in:
CommanderRedYT
2021-12-02 15:04:56 +01:00
parent c2d8042182
commit 51e38fb6df
3 changed files with 5 additions and 1 deletions

View File

@ -1,4 +1,5 @@
#include "presets.h"
#include "macros_bobbycar.h"
namespace presets {
StringSettings makeDefaultStringSettings()
@ -49,6 +50,7 @@ StringSettings makeDefaultStringSettings()
},
.otaServerUrl = {},
#endif
.ap_password = STRING(AP_PASSWORD),
};
}
} // namespace presets

View File

@ -48,6 +48,7 @@ struct StringSettings
#ifdef FEATURE_DNS_NS
std::string dns_key;
#endif
std::string ap_password;
};
template<typename T>
@ -116,6 +117,7 @@ void StringSettings::executeForEveryCommonSetting(T &&callable)
#ifdef FEATURE_DNS_NS
callable("dnskey", dns_key);
#endif
callable("ap_pw", ap_password);
}
template<typename T>

View File

@ -93,7 +93,7 @@ std::optional<wifi_stack::ap_config> wifi_create_ap_config()
return wifi_stack::ap_config {
.hostname = deviceName,
.ssid = deviceName,
.key = STRING(AP_PASSWORD),
.key = stringSettings.ap_password,
.static_ip = {
.ip = {10, 0, 0, 1},
.subnet = {255, 255, 255, 0},