| 248 | } // namespace |
| 249 | |
| 250 | void 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 | } |
nothing calls this directly
no test coverage detected