diff options
| author | Dave Hibberd <hibby@debian.org> | 2024-12-03 00:27:57 +0000 |
|---|---|---|
| committer | Dave Hibberd <hibby@debian.org> | 2024-12-03 00:27:57 +0000 |
| commit | 96c573931d40b6b191614c96299d66ca6217d1d8 (patch) | |
| tree | f5673406ce7bf25a975179a903f2ca661bcba7b7 /config.c | |
| parent | 697fde312336b04129289ed268043e641ef284cb (diff) | |
New upstream version 6.0.24.53+repackupstream/6.0.24.53+repack
Diffstat (limited to 'config.c')
| -rw-r--r-- | config.c | 19 |
1 files changed, 17 insertions, 2 deletions
@@ -174,11 +174,16 @@ extern BOOL Loopflag; extern char NodeMapServer[80];
extern char ChatMapServer[80];
+double LatFromLOC;
+double LonFromLOC;
+
+
VOID * zalloc(int len);
int WritetoConsoleLocal(char * buff);
char * stristr (char *ch1, char *ch2);
+int FromLOC(char * Locator, double * pLat, double * pLon);
VOID Consoleprintf(const char * format, ...)
{
@@ -342,7 +347,7 @@ static int routine[] = 14, 14, 14, 14,
14, 14 ,14, 14,
15, 0, 2, 9, 9,
-2, 2, 2, 2, 2, 2,
+2, 2, 1, 2, 2, 2,
2, 2, 0, 1, 20, 20} ; // Routine to process param
int PARAMLIM = sizeof(routine)/sizeof(int);
@@ -924,11 +929,21 @@ NextAPRS: strcat(LOCATOR, ":");
strcat(LOCATOR, ptr2);
ToLOC(atof(ptr1), atof(ptr2), LOC);
+ LatFromLOC = atof(ptr1);
+ LonFromLOC = atof(ptr2);
+
}
else
{
if (strlen(ptr1) == 6)
+ {
strcpy(LOC, ptr1);
+ FromLOC(LOC, &LatFromLOC, &LonFromLOC);
+ // Randomise in square
+ LatFromLOC += ((rand() / 24.0) / RAND_MAX);
+ LonFromLOC += ((rand() / 12.0) / RAND_MAX);
+
+ }
}
}
return 0;
@@ -2409,7 +2424,7 @@ int doSerialPortName(int i, char * value, char * rec) if (IsNumeric(rec))
xxp.IOADDR = atoi(rec);
else
- strcpy(xxp.SerialPortName, rec);
+ xxp.SerialPortName = strdup(rec);
return 1;
}
|
