new option to silence aprs-is traffic

This commit is contained in:
Ryan 2018-07-13 20:07:33 -06:00
parent 4ecaf478cf
commit c446c8f5f3
3 changed files with 23 additions and 15 deletions

View File

@ -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__

View File

@ -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,6 +1472,7 @@ static void * igate_recv_thread (void *arg)
* channels, each with own client side filtering and via path.
* Loop here over all configured channels.
*/
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);
@ -1486,6 +1490,7 @@ static void * igate_recv_thread (void *arg)
// dw_printf("The TM-D710 will do this intermittently. A firmware upgrade is needed to fix it.\n");
//}
}
}
/*
* Record that we heard from the source address.

View File

@ -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. */