mirror of https://github.com/wb2osz/direwolf.git
Better keyword for preemptive digipeating.
This commit is contained in:
parent
6b76e1d98d
commit
88e2222db6
|
@ -2523,7 +2523,7 @@ void config_init (char *fname, struct audio_s *p_audio_config,
|
||||||
text_color_set(DW_COLOR_ERROR);
|
text_color_set(DW_COLOR_ERROR);
|
||||||
dw_printf ("Config file, line %d: Preemptive digipeating DROP option is discouraged.\n", line);
|
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 ("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;
|
p_digi_config->preempt[from_chan][to_chan] = PREEMPT_DROP;
|
||||||
t = split(NULL,0);
|
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);
|
text_color_set(DW_COLOR_ERROR);
|
||||||
dw_printf ("Config file, line %d: Preemptive digipeating MARK option is discouraged.\n", line);
|
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 ("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;
|
p_digi_config->preempt[from_chan][to_chan] = PREEMPT_MARK;
|
||||||
t = split(NULL,0);
|
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;
|
p_digi_config->preempt[from_chan][to_chan] = PREEMPT_TRACE;
|
||||||
t = split(NULL,0);
|
t = split(NULL,0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,6 +49,7 @@
|
||||||
* Preemptive Digipeating (new in version 0.8)
|
* Preemptive Digipeating (new in version 0.8)
|
||||||
*
|
*
|
||||||
* http://www.aprs.org/aprs12/preemptive-digipeating.txt
|
* 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
|
* If preemptive digipeating is enabled, try matching my call
|
||||||
* and aliases against all remaining unused digipeaters.
|
* 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) {
|
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) {
|
switch (preempt) {
|
||||||
case PREEMPT_DROP: /* remove all prior */
|
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) {
|
while (r2 > AX25_REPEATER_1) {
|
||||||
ax25_remove_addr (result, r2-1);
|
ax25_remove_addr (result, r2-1);
|
||||||
r2--;
|
r2--;
|
||||||
}
|
}
|
||||||
break;
|
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--;
|
r2--;
|
||||||
while (r2 >= AX25_REPEATER_1 && ax25_get_h(result,r2) == 0) {
|
while (r2 >= AX25_REPEATER_1 && ax25_get_h(result,r2) == 0) {
|
||||||
ax25_set_h (result, r2);
|
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;
|
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:
|
default:
|
||||||
while (r2 > AX25_REPEATER_1 && ax25_get_h(result,r2-1) == 0) {
|
while (r2 > AX25_REPEATER_1 && ax25_get_h(result,r2-1) == 0) {
|
||||||
ax25_remove_addr (result, r2-1);
|
ax25_remove_addr (result, r2-1);
|
||||||
|
|
Loading…
Reference in New Issue