Cleanup and changes to fix DTMF message.

This commit is contained in:
David E. Tiller 2022-04-06 07:57:08 -04:00
parent 27c97e3e2e
commit 16d102e601
4 changed files with 17 additions and 3 deletions

View File

@ -1282,12 +1282,15 @@ void config_init (char *fname, struct audio_s *p_audio_config,
else if (strcasecmp(t,"EAS") == 0) { else if (strcasecmp(t,"EAS") == 0) {
n = MAX_BAUD-2; // Hack - See special case later. 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 { else {
n = atoi(t); n = atoi(t);
} }
if (n >= MIN_BAUD && n <= MAX_BAUD) { if (n >= MIN_BAUD && n <= MAX_BAUD) {
p_audio_config->achan[channel].baud = n; 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); 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); 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. 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)); // ? 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 { else {
p_audio_config->achan[channel].modem_type = MODEM_SCRAMBLE; p_audio_config->achan[channel].modem_type = MODEM_SCRAMBLE;
p_audio_config->achan[channel].mark_freq = 0; p_audio_config->achan[channel].mark_freq = 0;

View File

@ -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); A->g_altitude_ft = DW_METERS_TO_FEET(alt_meters);
strcpy (A->g_mfr, ""); 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) { else if (strncmp(info, "{{", 2) == 0) {
snprintf (A->g_msg_type, sizeof(A->g_msg_type), "User-Defined Experimental"); snprintf (A->g_msg_type, sizeof(A->g_msg_type), "User-Defined Experimental");
} }

View File

@ -134,7 +134,7 @@ int demod_init (struct audio_s *pa)
case MODEM_AFSK: case MODEM_AFSK:
case MODEM_EAS: 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].modem_type == MODEM_EAS) {
if (save_audio_config_p->achan[chan].fix_bits != RETRY_NONE) { if (save_audio_config_p->achan[chan].fix_bits != RETRY_NONE) {

View File

@ -19,4 +19,6 @@
#define USER_DEF_TYPE_AIS 'A' // data type A for AIS NMEA sentence #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_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.