From 16d102e6012bb7dd9a37de701aa458df58a39dd0 Mon Sep 17 00:00:00 2001 From: "David E. Tiller" <3858971+dtiller@users.noreply.github.com> Date: Wed, 6 Apr 2022 07:57:08 -0400 Subject: [PATCH] Cleanup and changes to fix DTMF message. --- src/config.c | 11 ++++++++++- src/decode_aprs.c | 3 +++ src/demod.c | 2 +- src/version.h | 4 +++- 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/config.c b/src/config.c index 8588a8c..407650c 100644 --- a/src/config.c +++ b/src/config.c @@ -1282,12 +1282,15 @@ void config_init (char *fname, struct audio_s *p_audio_config, else if (strcasecmp(t,"EAS") == 0) { n = MAX_BAUD-2; // Hack - See special case later. } + else if (strcasecmp(t,"EOTD") == 0) { + n = MAX_BAUD-3; // Hack - See special case later. + } else { n = atoi(t); } if (n >= MIN_BAUD && n <= MAX_BAUD) { p_audio_config->achan[channel].baud = n; - if (n != 300 && n != 1200 && n != 2400 && n != 4800 && n != 9600 && n != 19200 && n != MAX_BAUD-1 && n != MAX_BAUD-2) { + if (n != 300 && n != 1200 && n != 2400 && n != 4800 && n != 9600 && n != 19200 && n != MAX_BAUD-1 && n != MAX_BAUD-2 && n != MAX_BAUD-3) { text_color_set(DW_COLOR_ERROR); dw_printf ("Line %d: Warning: Non-standard data rate of %d bits per second. Are you sure?\n", line, n); } @@ -1339,6 +1342,12 @@ void config_init (char *fname, struct audio_s *p_audio_config, p_audio_config->achan[channel].space_freq = 1563; // Actually 1562.5 - logic 0. // ? strlcpy (p_audio_config->achan[channel].profiles, "D", sizeof(p_audio_config->achan[channel].profiles)); } + else if (p_audio_config->achan[channel].baud == MAX_BAUD-3) { + p_audio_config->achan[channel].modem_type = MODEM_EOTD; + p_audio_config->achan[channel].mark_freq = 1200; + p_audio_config->achan[channel].space_freq = 1200; + p_audio_config->achan[channel].baud = 1200; + } else { p_audio_config->achan[channel].modem_type = MODEM_SCRAMBLE; p_audio_config->achan[channel].mark_freq = 0; diff --git a/src/decode_aprs.c b/src/decode_aprs.c index 3afa377..5df125c 100644 --- a/src/decode_aprs.c +++ b/src/decode_aprs.c @@ -2350,6 +2350,9 @@ static void aprs_user_defined (decode_aprs_t *A, char *info, int ilen) A->g_altitude_ft = DW_METERS_TO_FEET(alt_meters); strcpy (A->g_mfr, ""); } + else if (info[0] == '{' && info[1] == USER_DEF_USER_ID && info[2] == USER_DEF_TYPE_EOTD) { + snprintf (A->g_msg_type, sizeof(A->g_msg_type), "End-of-Train Device CSV Data"); + } else if (strncmp(info, "{{", 2) == 0) { snprintf (A->g_msg_type, sizeof(A->g_msg_type), "User-Defined Experimental"); } diff --git a/src/demod.c b/src/demod.c index ddf3a13..0340096 100644 --- a/src/demod.c +++ b/src/demod.c @@ -134,7 +134,7 @@ int demod_init (struct audio_s *pa) case MODEM_AFSK: case MODEM_EAS: - case MODEM_EOTD: // TODO DET + case MODEM_EOTD: if (save_audio_config_p->achan[chan].modem_type == MODEM_EAS) { if (save_audio_config_p->achan[chan].fix_bits != RETRY_NONE) { diff --git a/src/version.h b/src/version.h index feaa6c9..2b58115 100644 --- a/src/version.h +++ b/src/version.h @@ -19,4 +19,6 @@ #define USER_DEF_TYPE_AIS 'A' // data type A for AIS NMEA sentence #define USER_DEF_TYPE_EAS 'E' // data type E for EAS broadcasts -#define USER_DEF_TYPE_EOTD 'T' // data type T for 'T'rain broadcasts +#define USER_DEF_TYPE_EOTD 'R' // data type R for 'Railroad' broadcasts +#define USER_DEF_TYPE_DTMF 'T' // 'T' is used without constant in the code. +