Skip to content

Commit

Permalink
add to nvmgen
Browse files Browse the repository at this point in the history
  • Loading branch information
brentru committed Dec 13, 2021
1 parent 95e5608 commit 5ce1fa7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/provisioning/Wippersnapper_ESP32_nvs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ bool Wippersnapper_ESP32_nvs::validateNVSConfig() {
_ssidPass = nvs.getString("wsNetPass", "");
_aioUser = nvs.getString("wsAIOUser", "");
_aioPass = nvs.getString("wsAIOKey", "");
_aioURL = nvs.getString("wsAIOURL", "");

// validate config properly set in partition
if (_ssid == "" || _ssidPass == "" || _aioUser == "" || _aioPass == "") {
// TODO: Possibly LED blink/some external error handling around this
Expand All @@ -64,6 +66,7 @@ bool Wippersnapper_ESP32_nvs::setNVSConfig() {
WS._network_pass = _ssidPass.c_str();
WS._username = _aioUser.c_str();
WS._key = _aioPass.c_str();
WS._mqttBrokerURL = _aioURL.c_str();
return true;
}

Expand Down
1 change: 1 addition & 0 deletions src/provisioning/Wippersnapper_ESP32_nvs.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class Wippersnapper_ESP32_nvs {
String _ssidPass;
String _aioUser;
String _aioPass;
String _aioURL;
};

extern Wippersnapper WS;
Expand Down

0 comments on commit 5ce1fa7

Please sign in to comment.