Skip to content

Commit

Permalink
Log WiFi names saved on the box, prepare ap mode
Browse files Browse the repository at this point in the history
  • Loading branch information
SciLor committed Jun 29, 2020
1 parent 9a36f9f commit 8bd10ba
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
13 changes: 13 additions & 0 deletions WrapperWiFi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@ WrapperWiFi::WrapperWiFi(const char* ssid, const char* password, const byte ip[4
}

void WrapperWiFi::begin() {
WiFiClass::WlanProfile profiles[8];
WiFi.getSavedProfiles(profiles);

Log.info("Known WiFi Profiles:");
for (uint8_t i=0; i<7; i++) {
if (strlen(profiles[i].wifiName)>0)
Log.info(" -%i: Name=%s", i, profiles[i].wifiName);
}

reconnect();
}

Expand Down Expand Up @@ -76,6 +85,10 @@ void WrapperWiFi::reconnect() { //TODO: LED Stuff
Events.handleWiFiEvent(_state);
}

void WrapperWiFi::apMode() {
WiFi.beginNetwork("Hackiebox-");
}

WrapperWiFi::ConnectionState WrapperWiFi::getStatus() {
return _state;
}
2 changes: 2 additions & 0 deletions WrapperWiFi.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ class WrapperWiFi : public EnhancedThread {
void
reconnect();

void apMode();

WrapperWiFi::ConnectionState getStatus();

private:
Expand Down

0 comments on commit 8bd10ba

Please sign in to comment.