kopia lustrzana https://github.com/PiInTheSky/lora-gateway
Added MQTT config to header and reading config into gateway
rodzic
23d0e022cc
commit
2765c91854
10
gateway.c
10
gateway.c
|
@ -2113,6 +2113,16 @@ void LoadConfigFile(void)
|
|||
RegisterConfigBoolean(MainSection, -1, "DumpBuffer", &Config.DumpBuffer, NULL);
|
||||
RegisterConfigString(MainSection, -1, "DumpFile", Config.DumpFile, sizeof(Config.DumpFile), NULL);
|
||||
|
||||
// MQTT
|
||||
RegisterConfigBoolean(MainSection, -1, "EnableMQTT", &Config.EnableMQTT, NULL);
|
||||
RegisterConfigString(MainSection, -1, "MQTTHost", Config.MQTTHost, sizeof(Config.MQTTHost), NULL);
|
||||
RegisterConfigString(MainSection, -1, "MQTTPort", Config.MQTTPort, sizeof(Config.MQTTPort), NULL);
|
||||
RegisterConfigString(MainSection, -1, "MQTTUser", Config.MQTTUser, sizeof(Config.MQTTUser), NULL);
|
||||
RegisterConfigString(MainSection, -1, "MQTTPass", Config.MQTTPass, sizeof(Config.MQTTPass), NULL);
|
||||
RegisterConfigString(MainSection, -1, "MQTTClient", Config.MQTTClient, sizeof(Config.MQTTClient), NULL);
|
||||
RegisterConfigString(MainSection, -1, "MQTTTopic", Config.MQTTTopic, sizeof(Config.MQTTTopic), NULL);
|
||||
|
||||
|
||||
for (Channel = 0; Channel <= 1; Channel++)
|
||||
{
|
||||
RegisterConfigDouble(MainSection, Channel, "frequency", &Config.LoRaDevices[Channel].Frequency, LoRaCallback);
|
||||
|
|
7
global.h
7
global.h
|
@ -145,6 +145,13 @@ struct TConfig
|
|||
char Version[16];
|
||||
int DumpBuffer;
|
||||
char DumpFile[64];
|
||||
int EnableMQTT;
|
||||
char MQTTHost;
|
||||
char MQTTPort;
|
||||
char MQTTUser;
|
||||
char MQTTPass;
|
||||
char MQTTClient;
|
||||
char MQTTTopic;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
|
|
Ładowanie…
Reference in New Issue