summaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorDave Hibberd <hibby@debian.org>2024-11-30 21:42:45 +0000
committerDave Hibberd <hibby@debian.org>2024-11-30 21:42:45 +0000
commit3a600bee231fc20c7a71bcc78465a28447ac1bb4 (patch)
tree9b1a58a5069afbd52a1044537ce29483c21934f0 /config.c
parentd09a1686084e26be230cbddc38a2b4f435975041 (diff)
parentd1c36fce6e52b94d2df9c0eb969c1d72947d1284 (diff)
Update upstream source from tag 'upstream/6.0.24.52+repack'
Update to upstream version '6.0.24.52+repack' with Debian dir 0b34b91ce1e12fbb6ea021c31ba7daa6c49e3c49
Diffstat (limited to 'config.c')
-rw-r--r--config.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/config.c b/config.c
index 6408e25..1c549b7 100644
--- a/config.c
+++ b/config.c
@@ -174,15 +174,20 @@ 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, ...)
{
- char Mess[255];
+ char Mess[512];
va_list(arglist);
va_start(arglist, 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;
@@ -2397,11 +2412,11 @@ int doSerialPortName(int i, char * value, char * rec)
{
rec += 8;
- if (strlen(rec) > 79)
+ if (strlen(rec) > 250)
{
Consoleprintf("Serial Port Name too long - Truncated");
Consoleprintf("%s\r\n",rec);
- rec[79] = 0;
+ rec[250] = 0;
}
strlop(rec, ' ');