You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
590 B
29 lines
590 B
2 years ago
|
#include "rpcWiFi.h"
|
||
|
|
||
|
void wifiDebug(AppState *appState) {
|
||
|
Serial.printf("online: %d\n", appState->wifiOnline);
|
||
|
if (appState->wifiOnline) {
|
||
|
Serial.printf("IP: %s\n", WiFi.localIP().toString());
|
||
|
}
|
||
|
}
|
||
|
|
||
|
void wifiJoin(AppState *appState) {
|
||
|
WiFi.mode(WIFI_STA);
|
||
|
WiFi.disconnect();
|
||
|
WiFi.begin(WIFI_SSID, WIFI_PASS);
|
||
|
|
||
|
while (WiFi.status() != WL_CONNECTED) {
|
||
|
Serial.println("connecting...");
|
||
|
delay(5000);
|
||
|
}
|
||
|
|
||
|
appState->wifiOnline = true;
|
||
|
appState->wifiIP = WiFi.localIP();
|
||
|
}
|
||
|
|
||
|
void wifiLoop(AppState *appState) {
|
||
|
if (appState->wifiOnline) {
|
||
|
WiFi.localIP();
|
||
|
}
|
||
|
}
|