MCPcopy Create free account
hub / github.com/AlexandreRouma/SDRPlusPlus / _INIT_

Function _INIT_

source_modules/spyserver_source/src/main.cpp:304–321  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

302};
303
304MOD_EXPORT void _INIT_() {
305 json def = json({});
306 def["hostname"] = "localhost";
307 def["port"] = 5555;
308 def["devices"] = json::object();
309 config.setPath(options::opts.root + "/spyserver_config.json");
310 config.load(def);
311 config.enableAutoSave();
312
313 // Check config in case a user has a very old version
314 config.acquire();
315 bool corrected = false;
316 if (!config.conf.contains("hostname") || !config.conf.contains("port") || !config.conf.contains("devices")) {
317 config.conf = def;
318 corrected = true;
319 }
320 config.release(corrected);
321}
322
323MOD_EXPORT ModuleManager::Instance* _CREATE_INSTANCE_(std::string name) {
324 return new SpyServerSourceModule(name);

Callers

nothing calls this directly

Calls 5

enableAutoSaveMethod · 0.80
setPathMethod · 0.45
loadMethod · 0.45
acquireMethod · 0.45
releaseMethod · 0.45

Tested by

no test coverage detected