Issue 298 - Add beacon SOURCE option to override AX.25 source.

This commit is contained in:
wb2osz 2020-11-07 17:43:47 -05:00
parent 4a1aa2b148
commit a20728762b
3 changed files with 22 additions and 1 deletions

View File

@ -804,7 +804,12 @@ static void beacon_send (int j, dwgps_info_t *gpsinfo)
* src > dest [ , via ]
*/
strlcpy (beacon_text, mycall, sizeof(beacon_text));
if (bp->source != NULL) {
strlcpy (beacon_text, bp->source, sizeof(beacon_text));
}
else {
strlcpy (beacon_text, mycall, sizeof(beacon_text));
}
strlcat (beacon_text, ">", sizeof(beacon_text));
if (bp->dest != NULL) {

View File

@ -5273,6 +5273,8 @@ static int beacon_options(char *cmd, struct beacon_s *b, int line, struct audio_
b->freq = G_UNKNOWN;
b->tone = G_UNKNOWN;
b->offset = G_UNKNOWN;
b->source = NULL;
b->dest = NULL;
while ((t = split(NULL,0)) != NULL) {
@ -5344,6 +5346,17 @@ static int beacon_options(char *cmd, struct beacon_s *b, int line, struct audio_
b->sendto_chan = n;
}
}
else if (strcasecmp(keyword, "SOURCE") == 0) {
b->source = strdup(value);
for (p = b->source; *p != '\0'; p++) {
if (islower(*p)) {
*p = toupper(*p); /* silently force upper case. */
}
}
if (strlen(b->source) > 9) {
b->source[9] = '\0';
}
}
else if (strcasecmp(keyword, "DEST") == 0) {
b->dest = strdup(value);
for (p = b->dest; *p != '\0'; p++) {

View File

@ -160,6 +160,9 @@ struct misc_config_s {
time_t next; /* Unix time to transmit next one. */
char *source; /* NULL or explicit AX.25 source address to use */
/* instead of the mycall value for the channel. */
char *dest; /* NULL or explicit AX.25 destination to use */
/* instead of the software version such as APDW11. */