mirror of https://github.com/wb2osz/direwolf.git
Issue 298 - Add beacon SOURCE option to override AX.25 source.
This commit is contained in:
parent
4a1aa2b148
commit
a20728762b
|
@ -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) {
|
||||
|
|
13
src/config.c
13
src/config.c
|
@ -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++) {
|
||||
|
|
|
@ -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. */
|
||||
|
||||
|
|
Loading…
Reference in New Issue