MCPcopy Create free account
hub / github.com/SmingHub/Sming / init

Function init

samples/HttpServer_ConfigNetwork/app/application.cpp:250–282  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

248} // namespace
249
250void init()
251{
252 Serial.begin(SERIAL_BAUD_RATE); // 115200 by default
253 Serial.systemDebugOutput(true); // Enable debug output to serial
254
255 spiffs_mount(); // Mount file system, in order to work with files
256
257 if(fileExist(".lastModified")) {
258 // The last modification
259 lastModified = fileGetContent(".lastModified");
260 lastModified.trim();
261 }
262
263 AppSettings.load();
264
265 WifiStation.enable(true);
266
267 if(AppSettings.exist()) {
268 WifiStation.config(AppSettings.ssid, AppSettings.password);
269 if(!AppSettings.dhcp && !AppSettings.ip.isNull()) {
270 WifiStation.setIP(AppSettings.ip, AppSettings.netmask, AppSettings.gateway);
271 }
272 }
273
274 scanNetworks();
275
276 // Start AP for configuration
277 WifiAccessPoint.enable(true);
278 WifiAccessPoint.config("Sming Configuration", "", AUTH_OPEN);
279
280 // Run WEB server on system ready
281 System.onReady(startServers);
282}

Callers

nothing calls this directly

Calls 14

spiffs_mountFunction · 0.85
fileExistFunction · 0.85
fileGetContentFunction · 0.85
scanNetworksFunction · 0.85
systemDebugOutputMethod · 0.80
existMethod · 0.80
onReadyMethod · 0.80
beginMethod · 0.45
trimMethod · 0.45
loadMethod · 0.45
enableMethod · 0.45
configMethod · 0.45

Tested by

no test coverage detected