Skip to content

new option to silence aprs-is traffic #161

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion direwolf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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. */



Expand Down Expand Up @@ -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;
}
}
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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__
Expand Down
31 changes: 18 additions & 13 deletions igate.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;


/*
Expand Down Expand Up @@ -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:
*
Expand All @@ -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;
Expand All @@ -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
Expand Down Expand Up @@ -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");
//}
}
}

/*
Expand Down
2 changes: 1 addition & 1 deletion igate.h
Original file line number Diff line number Diff line change
Expand Up @@ -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. */

Expand Down