Skip to content

Commit c446c8f

Browse files
committed
new option to silence aprs-is traffic
1 parent 4ecaf47 commit c446c8f

File tree

3 files changed

+23
-15
lines changed

3 files changed

+23
-15
lines changed

Diff for: direwolf.c

+4-1
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ static int d_p_opt = 0; /* "-d p" option for dumping packets over radio. */
176176

177177
static int q_h_opt = 0; /* "-q h" Quiet, suppress the "heard" line with audio level. */
178178
static int q_d_opt = 0; /* "-q d" Quiet, suppress the printing of decoded of APRS packets. */
179+
static int q_i_opt = 0; /* "-q i" Quiet, suppress the printing of APRS-IS packets. */
179180

180181

181182

@@ -509,6 +510,7 @@ int main (int argc, char *argv[])
509510
switch (*p) {
510511
case 'h': q_h_opt = 1; break;
511512
case 'd': q_d_opt = 1; break;
513+
case 'i': q_i_opt = 1; break;
512514
default: break;
513515
}
514516
}
@@ -782,7 +784,7 @@ int main (int argc, char *argv[])
782784
* Initialize the digipeater and IGate functions.
783785
*/
784786
digipeater_init (&audio_config, &digi_config);
785-
igate_init (&audio_config, &igate_config, &digi_config, d_i_opt);
787+
igate_init (&audio_config, &igate_config, &digi_config, d_i_opt, q_i_opt);
786788
cdigipeater_init (&audio_config, &cdigi_config);
787789
pfilter_init (&igate_config, d_f_opt);
788790
ax25_link_init (&misc_config);
@@ -1274,6 +1276,7 @@ static void usage (char **argv)
12741276
dw_printf (" -q Quiet (suppress output) options:\n");
12751277
dw_printf (" h h = Heard line with the audio level.\n");
12761278
dw_printf (" d d = Decoding of APRS packets.\n");
1279+
dw_printf (" i i = Display of APRS-IS packets.\n");
12771280
dw_printf (" -t n Text colors. 1=normal, 0=disabled.\n");
12781281
dw_printf (" -a n Audio statistics interval in seconds. 0 to disable.\n");
12791282
#if __WIN32__

Diff for: igate.c

+18-13
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,7 @@ static struct audio_s *save_audio_config_p;
291291
static struct igate_config_s *save_igate_config_p;
292292
static struct digi_config_s *save_digi_config_p;
293293
static int s_debug;
294+
static int s_quiet;
294295

295296

296297
/*
@@ -388,6 +389,7 @@ int igate_get_dnl_cnt (void) {
388389
* 1 plus packets sent TO server or why not.
389390
* 2 plus duplicate detection overview.
390391
* 3 plus duplicate detection details.
392+
* quiet - Silence iGate Traffic from Logs
391393
*
392394
* Description: This starts two threads:
393395
*
@@ -397,7 +399,7 @@ int igate_get_dnl_cnt (void) {
397399
*--------------------------------------------------------------------*/
398400

399401

400-
void igate_init (struct audio_s *p_audio_config, struct igate_config_s *p_igate_config, struct digi_config_s *p_digi_config, int debug_level)
402+
void igate_init (struct audio_s *p_audio_config, struct igate_config_s *p_igate_config, struct digi_config_s *p_digi_config, int debug_level, int quiet)
401403
{
402404
#if __WIN32__
403405
HANDLE connnect_th;
@@ -410,6 +412,7 @@ void igate_init (struct audio_s *p_audio_config, struct igate_config_s *p_igate_
410412
int e;
411413
#endif
412414
s_debug = debug_level;
415+
s_quiet = quiet;
413416
dp_queue_head = NULL;
414417

415418
#if DEBUGx
@@ -1469,22 +1472,24 @@ static void * igate_recv_thread (void *arg)
14691472
* channels, each with own client side filtering and via path.
14701473
* Loop here over all configured channels.
14711474
*/
1472-
text_color_set(DW_COLOR_REC);
1473-
dw_printf ("\n[ig>tx] "); // formerly just [ig]
1474-
ax25_safe_print ((char *)message, len, 0);
1475-
dw_printf ("\n");
1475+
if (s_quiet == 0) {
1476+
text_color_set(DW_COLOR_REC);
1477+
dw_printf ("\n[ig>tx] "); // formerly just [ig]
1478+
ax25_safe_print ((char *)message, len, 0);
1479+
dw_printf ("\n");
14761480

1477-
if ((int)strlen((char*)message) != len) {
1481+
if ((int)strlen((char*)message) != len) {
14781482

1479-
// Invalid. Either drop it or pass it along as-is. Don't change.
1483+
// Invalid. Either drop it or pass it along as-is. Don't change.
14801484

1481-
text_color_set(DW_COLOR_ERROR);
1482-
dw_printf("'nul' character found in packet from IS. This should never happen.\n");
1483-
dw_printf("The source station is probably transmitting with defective software.\n");
1485+
text_color_set(DW_COLOR_ERROR);
1486+
dw_printf("'nul' character found in packet from IS. This should never happen.\n");
1487+
dw_printf("The source station is probably transmitting with defective software.\n");
14841488

1485-
//if (strcmp((char*)pinfo, "4P") == 0) {
1486-
// dw_printf("The TM-D710 will do this intermittently. A firmware upgrade is needed to fix it.\n");
1487-
//}
1489+
//if (strcmp((char*)pinfo, "4P") == 0) {
1490+
// dw_printf("The TM-D710 will do this intermittently. A firmware upgrade is needed to fix it.\n");
1491+
//}
1492+
}
14881493
}
14891494

14901495
/*

Diff for: igate.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ struct igate_config_s {
101101

102102
/* Call this once at startup */
103103

104-
void igate_init (struct audio_s *p_audio_config, struct igate_config_s *p_igate_config, struct digi_config_s *p_digi_config, int debug_level);
104+
void igate_init (struct audio_s *p_audio_config, struct igate_config_s *p_igate_config, struct digi_config_s *p_digi_config, int debug_level, int quiet);
105105

106106
/* Call this with each packet received from the radio. */
107107

0 commit comments

Comments
 (0)