mirror of
https://github.com/sweidac/kidsbox.git
synced 2026-10-28 06:52:57 +01:00
Extracts networking.
This commit is contained in:
1 parent
ebb6ec68c2
commit
b110a28d20
4 files changed
+28
-14
No files matched your search
+3
-13
@@ -2,24 +2,14 @@
|
||||
|
||||
#include <WiFi.h>
|
||||
|
||||
#include "Networking.hpp"
|
||||
#include "WebInterface.hpp"
|
||||
|
||||
extern "C" {
|
||||
void app_main();
|
||||
}
|
||||
|
||||
void connectWifi() {
|
||||
WiFi.begin(CONFIG_ESP_WIFI_SSID, CONFIG_ESP_WIFI_PASSWORD);
|
||||
|
||||
while (WiFi.status() != WL_CONNECTED) {
|
||||
delay(1000);
|
||||
Serial.println("Waiting for connection...");
|
||||
}
|
||||
|
||||
Serial.println("Connected.");
|
||||
Serial.println(WiFi.localIP());
|
||||
}
|
||||
|
||||
Networking networking;
|
||||
WebInterface webInterface;
|
||||
|
||||
void app_main(void) {
|
||||
@@ -27,7 +17,7 @@ void app_main(void) {
|
||||
|
||||
Serial.begin(115200);
|
||||
|
||||
connectWifi();
|
||||
networking.connectWifi();
|
||||
|
||||
webInterface.start();
|
||||
}
|
||||
Reference in new issue
Block a user