Better keyword for preemptive digipeating.

This commit is contained in:
wb2osz 2023-10-14 17:37:46 +01:00
parent 6b76e1d98d
commit 88e2222db6
2 changed files with 25 additions and 6 deletions

View File

@ -2523,7 +2523,7 @@ void config_init (char *fname, struct audio_s *p_audio_config,
text_color_set(DW_COLOR_ERROR);
dw_printf ("Config file, line %d: Preemptive digipeating DROP option is discouraged.\n", line);
dw_printf ("It can create a via path which is misleading about the actual path taken.\n");
dw_printf ("TRACE is the best choice for this feature.\n");
dw_printf ("PREEMPT is the best choice for this feature.\n");
p_digi_config->preempt[from_chan][to_chan] = PREEMPT_DROP;
t = split(NULL,0);
}
@ -2531,11 +2531,11 @@ void config_init (char *fname, struct audio_s *p_audio_config,
text_color_set(DW_COLOR_ERROR);
dw_printf ("Config file, line %d: Preemptive digipeating MARK option is discouraged.\n", line);
dw_printf ("It can create a via path which is misleading about the actual path taken.\n");
dw_printf ("TRACE is the best choice for this feature.\n");
dw_printf ("PREEMPT is the best choice for this feature.\n");
p_digi_config->preempt[from_chan][to_chan] = PREEMPT_MARK;
t = split(NULL,0);
}
else if (strcasecmp(t, "TRACE") == 0) {
else if ((strcasecmp(t, "TRACE") == 0) || (strncasecmp(t, "PREEMPT", 7) == 0)){
p_digi_config->preempt[from_chan][to_chan] = PREEMPT_TRACE;
t = split(NULL,0);
}

View File

@ -49,6 +49,7 @@
* Preemptive Digipeating (new in version 0.8)
*
* http://www.aprs.org/aprs12/preemptive-digipeating.txt
* I ignored the part about the RR bits.
*
*------------------------------------------------------------------*/
@ -440,6 +441,10 @@ static packet_t digipeat_match (int from_chan, packet_t pp, char *mycall_rec, ch
/*
* If preemptive digipeating is enabled, try matching my call
* and aliases against all remaining unused digipeaters.
*
* Bob says: "GENERIC XXXXn-N DIGIPEATING should not do preemptive digipeating."
*
* But consider this case: https://github.com/wb2osz/direwolf/issues/488
*/
if (preempt != PREEMPT_OFF) {
@ -465,13 +470,22 @@ static packet_t digipeat_match (int from_chan, packet_t pp, char *mycall_rec, ch
switch (preempt) {
case PREEMPT_DROP: /* remove all prior */
// TODO: deprecate this option. Result is misleading.
text_color_set (DW_COLOR_ERROR);
dw_printf ("The digipeat DROP option will be removed in a future release. Use PREEMPT for preemptive digipeating.\n");
while (r2 > AX25_REPEATER_1) {
ax25_remove_addr (result, r2-1);
r2--;
}
break;
case PREEMPT_MARK:
case PREEMPT_MARK: // TODO: deprecate this option. Result is misleading.
text_color_set (DW_COLOR_ERROR);
dw_printf ("The digipeat MARK option will be removed in a future release. Use PREEMPT for preemptive digipeating.\n");
r2--;
while (r2 >= AX25_REPEATER_1 && ax25_get_h(result,r2) == 0) {
ax25_set_h (result, r2);
@ -479,7 +493,12 @@ static packet_t digipeat_match (int from_chan, packet_t pp, char *mycall_rec, ch
}
break;
case PREEMPT_TRACE: /* remove prior unused */
case PREEMPT_TRACE: /* My enhancement - remove prior unused digis. */
/* this provides an accurate path of where packet traveled. */
// Uh oh. It looks like sample config files went out
// with this option. Should it be renamed as
// PREEMPT which is more descriptive?
default:
while (r2 > AX25_REPEATER_1 && ax25_get_h(result,r2-1) == 0) {
ax25_remove_addr (result, r2-1);