Skip to content

Commit

Permalink
Rename
Browse files Browse the repository at this point in the history
  • Loading branch information
亨睿 committed Feb 18, 2020
1 parent 31999f6 commit 4d9c691
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/espix-core/networking/WiFiNetwork.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ bool WiFiNetworkClass::isConnected() {
return WiFi.status() == WL_CONNECTED;
}

WiFiConnectionState WiFiNetworkClass::getStatus() {
WiFiConnectionState WiFiNetworkClass::getConnectionState() {
return _connectionState;
}

Expand Down
2 changes: 1 addition & 1 deletion src/espix-core/networking/WiFiNetwork.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class WiFiNetworkClass {
WiFiNetworkClass();

bool isConnected();
WiFiConnectionState getStatus();
WiFiConnectionState getConnectionState();
String getLocalIP();

void addToPreferredList(WiFiConnectionSetting setting);
Expand Down
11 changes: 10 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ SH1106Wire display(0x3c, OLED_SDA_PIN, OLED_CLK_PIN);

StatusBar statusBar;
RootView rootView;
ProgressView connectionView("Connecting to WiFi...", ProgressMode::INDETERMINATE);
ProgressView connectionView("Setup WiFi connections...", ProgressMode::INDETERMINATE);

void onConnected() {
connecting = false;
Expand Down Expand Up @@ -164,6 +164,15 @@ void loop() {
checkScreenBrightness();
#endif

if (connecting) {
auto state = WiFiNetwork.getConnectionState();
if (state == WiFiConnectionState::SCANNING) {
connectionView.setText("Scanning WiFi...");
} else if (state == WiFiConnectionState::CONNECTING) {
connectionView.setText("Connecting to WiFi...");
}
}

int timeBudget = Application.update();
if (timeBudget > 0) {
delay(timeBudget);
Expand Down

0 comments on commit 4d9c691

Please sign in to comment.