diff --git a/direwolf.c b/direwolf.c index 58ffad9..87a6240 100644 --- a/direwolf.c +++ b/direwolf.c @@ -176,6 +176,7 @@ static int d_p_opt = 0; /* "-d p" option for dumping packets over radio. */ static int q_h_opt = 0; /* "-q h" Quiet, suppress the "heard" line with audio level. */ static int q_d_opt = 0; /* "-q d" Quiet, suppress the printing of decoded of APRS packets. */ +static int q_i_opt = 0; /* "-q i" Quiet, suppress the printing of APRS-IS packets. */ @@ -509,6 +510,7 @@ int main (int argc, char *argv[]) switch (*p) { case 'h': q_h_opt = 1; break; case 'd': q_d_opt = 1; break; + case 'i': q_i_opt = 1; break; default: break; } } @@ -782,7 +784,7 @@ int main (int argc, char *argv[]) * Initialize the digipeater and IGate functions. */ digipeater_init (&audio_config, &digi_config); - igate_init (&audio_config, &igate_config, &digi_config, d_i_opt); + igate_init (&audio_config, &igate_config, &digi_config, d_i_opt, q_i_opt); cdigipeater_init (&audio_config, &cdigi_config); pfilter_init (&igate_config, d_f_opt); ax25_link_init (&misc_config); @@ -1274,6 +1276,7 @@ static void usage (char **argv) dw_printf (" -q Quiet (suppress output) options:\n"); dw_printf (" h h = Heard line with the audio level.\n"); dw_printf (" d d = Decoding of APRS packets.\n"); + dw_printf (" i i = Display of APRS-IS packets.\n"); dw_printf (" -t n Text colors. 1=normal, 0=disabled.\n"); dw_printf (" -a n Audio statistics interval in seconds. 0 to disable.\n"); #if __WIN32__ diff --git a/igate.c b/igate.c index 1d73c19..2ff2581 100644 --- a/igate.c +++ b/igate.c @@ -291,6 +291,7 @@ static struct audio_s *save_audio_config_p; static struct igate_config_s *save_igate_config_p; static struct digi_config_s *save_digi_config_p; static int s_debug; +static int s_quiet; /* @@ -388,6 +389,7 @@ int igate_get_dnl_cnt (void) { * 1 plus packets sent TO server or why not. * 2 plus duplicate detection overview. * 3 plus duplicate detection details. + * quiet - Silence iGate Traffic from Logs * * Description: This starts two threads: * @@ -397,7 +399,7 @@ int igate_get_dnl_cnt (void) { *--------------------------------------------------------------------*/ -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) +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) { #if __WIN32__ HANDLE connnect_th; @@ -410,6 +412,7 @@ void igate_init (struct audio_s *p_audio_config, struct igate_config_s *p_igate_ int e; #endif s_debug = debug_level; + s_quiet = quiet; dp_queue_head = NULL; #if DEBUGx @@ -1469,22 +1472,24 @@ static void * igate_recv_thread (void *arg) * channels, each with own client side filtering and via path. * Loop here over all configured channels. */ - text_color_set(DW_COLOR_REC); - dw_printf ("\n[ig>tx] "); // formerly just [ig] - ax25_safe_print ((char *)message, len, 0); - dw_printf ("\n"); + if (s_quiet == 0) { + text_color_set(DW_COLOR_REC); + dw_printf ("\n[ig>tx] "); // formerly just [ig] + ax25_safe_print ((char *)message, len, 0); + dw_printf ("\n"); - if ((int)strlen((char*)message) != len) { + if ((int)strlen((char*)message) != len) { - // Invalid. Either drop it or pass it along as-is. Don't change. + // Invalid. Either drop it or pass it along as-is. Don't change. - text_color_set(DW_COLOR_ERROR); - dw_printf("'nul' character found in packet from IS. This should never happen.\n"); - dw_printf("The source station is probably transmitting with defective software.\n"); + text_color_set(DW_COLOR_ERROR); + dw_printf("'nul' character found in packet from IS. This should never happen.\n"); + dw_printf("The source station is probably transmitting with defective software.\n"); - //if (strcmp((char*)pinfo, "4P") == 0) { - // dw_printf("The TM-D710 will do this intermittently. A firmware upgrade is needed to fix it.\n"); - //} + //if (strcmp((char*)pinfo, "4P") == 0) { + // dw_printf("The TM-D710 will do this intermittently. A firmware upgrade is needed to fix it.\n"); + //} + } } /* diff --git a/igate.h b/igate.h index 8203ac7..765bb64 100644 --- a/igate.h +++ b/igate.h @@ -101,7 +101,7 @@ struct igate_config_s { /* Call this once at startup */ -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); +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); /* Call this with each packet received from the radio. */