Added persistent config for the rfspace source's hostname and port

pull/582/head
AlexandreRouma 2022-01-02 19:56:27 +01:00
rodzic 290bf5e32a
commit 1185e4e114
1 zmienionych plików z 7 dodań i 2 usunięć

Wyświetl plik

@ -37,7 +37,12 @@ public:
handler.tuneHandler = tune;
handler.stream = &stream;
strcpy(hostname, "192.168.0.111");
// Load config
config.acquire();
std::string hostStr = config.conf["hostname"];
strcpy(hostname, hostStr.c_str());
port = config.conf["port"];
config.release();
sigpath::sourceManager.registerSource("RFspace", &handler);
}
@ -313,7 +318,7 @@ private:
MOD_EXPORT void _INIT_() {
json def = json({});
def["hostname"] = "localhost";
def["hostname"] = "192.168.0.111";
def["port"] = 50000;
def["devices"] = json::object();
config.setPath(options::opts.root + "/rfspace_config.json");