summaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorDave Hibberd <hibby@debian.org>2024-11-05 21:03:15 +0000
committerDave Hibberd <hibby@debian.org>2024-11-05 21:03:15 +0000
commit424c0bd3e14d3ddda6c2d945b6465d51c462c76b (patch)
tree80b44cbe3f5fc19de1c057e37c761a95a0518a44 /config.c
parenteb0d36d3f67be13de74023adb6d30362d47805fe (diff)
New upstream version 6.0.24.49upstream/6.0.24.49
Diffstat (limited to 'config.c')
-rw-r--r--config.c34
1 files changed, 30 insertions, 4 deletions
diff --git a/config.c b/config.c
index 81586b6..6408e25 100644
--- a/config.c
+++ b/config.c
@@ -302,7 +302,7 @@ static char *keywords[] =
"APPL5QUAL", "APPL6QUAL", "APPL7QUAL", "APPL8QUAL",
"BTEXT:", "NETROMCALL", "C_IS_CHAT", "MAXRTT", "MAXHOPS", // IPGATEWAY= no longer allowed
"LogL4Connects", "LogAllConnects", "SAVEMH", "ENABLEADIFLOG", "ENABLEEVENTS", "SAVEAPRSMSGS",
-"EnableM0LTEMap"
+"EnableM0LTEMap", "MQTT", "MQTT_HOST", "MQTT_PORT", "MQTT_USER", "MQTT_PASS"
}; /* parameter keywords */
static void * offset[] =
@@ -323,7 +323,7 @@ static void * offset[] =
&xxcfg.C_APPL[4].ApplQual, &xxcfg.C_APPL[5].ApplQual, &xxcfg.C_APPL[6].ApplQual, &xxcfg.C_APPL[7].ApplQual,
&xxcfg.C_BTEXT, &xxcfg.C_NETROMCALL, &xxcfg.C_C, &xxcfg.C_MAXRTT, &xxcfg.C_MAXHOPS, // IPGATEWAY= no longer allowed
&xxcfg.C_LogL4Connects, &xxcfg.C_LogAllConnects, &xxcfg.C_SaveMH, &xxcfg.C_ADIF, &xxcfg.C_EVENTS, &xxcfg.C_SaveAPRSMsgs,
-&xxcfg.C_M0LTEMap}; /* offset for corresponding data in config file */
+&xxcfg.C_M0LTEMap, &xxcfg.C_MQTT, &xxcfg.C_MQTT_HOST, &xxcfg.C_MQTT_PORT, &xxcfg.C_MQTT_USER, &xxcfg.C_MQTT_PASS}; /* offset for corresponding data in config file */
static int routine[] =
{
@@ -343,7 +343,7 @@ static int routine[] =
14, 14 ,14, 14,
15, 0, 2, 9, 9,
2, 2, 2, 2, 2, 2,
-2} ; // Routine to process param
+2, 2, 0, 1, 20, 20} ; // Routine to process param
int PARAMLIM = sizeof(routine)/sizeof(int);
//int NUMBEROFKEYWORDS = sizeof(routine)/sizeof(int);
@@ -365,7 +365,8 @@ static char *pkeywords[] =
"BCALL", "DIGIMASK", "NOKEEPALIVES", "COMPORT", "DRIVER", "WL2KREPORT", "UIONLY",
"UDPPORT", "IPADDR", "I2CBUS", "I2CDEVICE", "UDPTXPORT", "UDPRXPORT", "NONORMALIZE",
"IGNOREUNLOCKEDROUTES", "INP3ONLY", "TCPPORT", "RIGPORT", "PERMITTEDAPPLS", "HIDE",
-"SMARTID", "KISSCOMMAND", "SendtoM0LTEMap", "PortFreq", "M0LTEMapInfo", "QTSMPort"}; /* parameter keywords */
+"SMARTID", "KISSCOMMAND", "SendtoM0LTEMap", "PortFreq", "M0LTEMapInfo", "QTSMPort",
+"MQTT", "MQTT_HOST", "MQTT_PORT", "MQTT_USER", "MQTT_PASS"}; /* parameter keywords */
static void * poffset[] =
{
@@ -606,6 +607,11 @@ BOOL ProcessConfig()
paramok[79]=1; // SaveAPRSMsgs optional
paramok[79]=1; // SaveAPRSMsgs optional
paramok[80]=1; // EnableM0LTEMap optional
+ paramok[81]=1; // MQTT Params
+ paramok[82]=1; // MQTT Params
+ paramok[83]=1; // MQTT Params
+ paramok[84]=1; // MQTT Params
+ paramok[85]=1; // MQTT Params
for (i=0; i < PARAMLIM; i++)
{
@@ -1153,6 +1159,26 @@ NextAPRS:
}
+ if (_memicmp("MQTT_HOST=", rec, 10) == 0)
+ {
+ strcpy(xxcfg.C_MQTT_HOST, &rec[10]);
+ xxcfg.C_MQTT_HOST[strlen(xxcfg.C_MQTT_HOST)-1] = '\0';
+ return 0;
+ }
+ if (_memicmp("MQTT_USER=", rec, 10) == 0)
+ {
+ strcpy(xxcfg.C_MQTT_USER, &rec[10]);
+ xxcfg.C_MQTT_USER[strlen(xxcfg.C_MQTT_USER)-1] = '\0';
+ return 0;
+ }
+ if (_memicmp("MQTT_PASS=", rec, 10) == 0)
+ {
+ strcpy(xxcfg.C_MQTT_PASS, &rec[10]);
+ xxcfg.C_MQTT_PASS[strlen(xxcfg.C_MQTT_PASS)-1] = '\0';
+ return 0;
+}
+
+
if (xindex(rec,"=") >= 0)
sscanf(rec,"%[^=]=%s",key_word,value);
else