void initConfig(char *cfgName) { if (parseConfigFile(cfgName, &psresportConfig, false /*trimQuotes*/) < 0) { mlog("%s: failed to open '%s'\n", __func__, cfgName); } traverseConfig(&psresportConfig, verifyVisitor, psresportConfDef); setConfigDefaults(&psresportConfig, psresportConfDef); }
bool initConfig(char *cfgName) { if (parseConfigFile(cfgName, &config, false /* trimQuotes */) < 0) { mlog("%s: failed to open '%s'\n", __func__, cfgName); return false; } if (traverseConfig(&config, verifyVisitor, confDef)) { return false; } setConfigDefaults(&config, confDef); return true; }
//------------------------------------------------------------------------------- // start //------------------------------------------------------------------------------- void Controller::start() { // // bootstrapping // // start the clock clock.start(); // enable the logging subsystem logging.start(); logging.info(SysUtils::fullVersion()); // framework version // start esp tools espTools.start(); // fire up the FFS ffs.mount(); // show the versioning logging.info("version: "+ffs.vers.readItem("version")); logging.info("date : "+ffs.vers.readItem("date")); logging.info("config : "+fwConfig()); // set config defaults setConfigDefaults(); // start FTP-Server and Web-server startFtp(); // topicQueue.put("~/set/webserver/state", 1); // start WiFi for the first time wifi.start(); // startup the device device.start(); logging.info("controller started"); topicQueue.put("~/event/wifi/start"); // web server will start here }