Skip to content

Commit

Permalink
Add info about layer 2 transmit per channel.
Browse files Browse the repository at this point in the history
  • Loading branch information
wb2osz committed Oct 18, 2024
1 parent 88cf0ba commit 3ba464d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
11 changes: 4 additions & 7 deletions src/audio.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,6 @@ struct audio_s {
float recv_ber; /* Receive Bit Error Rate (BER). */
/* Probability of inverting a bit coming out of the modem. */

//int fx25_xmit_enable; /* Enable transmission of FX.25. */
/* See fx25_init.c for explanation of values. */
/* Initially this applies to all channels. */
/* This should probably be per channel. One step at a time. */
/* v1.7 - replaced by layer2_xmit==LAYER2_FX25 */

int fx25_auto_enable; /* Turn on FX.25 for current connected mode session */
/* under poor conditions. */
/* Set to 0 to disable feature. */
Expand Down Expand Up @@ -198,7 +192,7 @@ struct audio_s {
/* Might try MFJ-2400 / CCITT v.26 / Bell 201 someday. */
/* No modem. Might want this for DTMF only channel. */

enum layer2_t { LAYER2_AX25 = 0, LAYER2_FX25, LAYER2_IL2P } layer2_xmit;
enum layer2_t { LAYER2_AX25 = 0, LAYER2_FX25, LAYER2_IL2P } layer2_xmit; // Must keep in sync with layer2_tx, below.

// IL2P - New for version 1.7.
// New layer 2 with FEC. Much less overhead than FX.25 but no longer backward compatible.
Expand Down Expand Up @@ -405,6 +399,9 @@ struct audio_s {

};

#if DEMOD_C
const static char *layer2_tx[3] = {"AX.25", "FX.25", "IL2P"}; // Must keep in sync with enum layer2_t above.
#endif

#if __WIN32__
#define DEFAULT_ADEVICE "" /* Windows: Empty string = default audio device. */
Expand Down
7 changes: 6 additions & 1 deletion src/demod.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
*
*---------------------------------------------------------------*/

#define DEMOD_C 1

#include "direwolf.h"

#include <stdlib.h>
Expand Down Expand Up @@ -306,6 +308,7 @@ int demod_init (struct audio_s *pa)
save_audio_config_p->adev[ACHAN2ADEV(chan)].samples_per_sec);
if (save_audio_config_p->achan[chan].decimate != 1)
dw_printf (" / %d", save_audio_config_p->achan[chan].decimate);
dw_printf (", Tx %s", layer2_tx[(int)(save_audio_config_p->achan[chan].layer2_xmit)]);
if (save_audio_config_p->achan[chan].dtmf_decode != DTMF_DECODE_OFF)
dw_printf (", DTMF decoder enabled");
dw_printf (".\n");
Expand Down Expand Up @@ -540,7 +543,7 @@ int demod_init (struct audio_s *pa)
save_audio_config_p->adev[ACHAN2ADEV(chan)].samples_per_sec);
if (save_audio_config_p->achan[chan].decimate != 1)
dw_printf (" / %d", save_audio_config_p->achan[chan].decimate);

dw_printf (", Tx %s", layer2_tx[(int)(save_audio_config_p->achan[chan].layer2_xmit)]);
if (save_audio_config_p->achan[chan].v26_alternative == V26_B)
dw_printf (", compatible with MFJ-2400");
else
Expand Down Expand Up @@ -601,6 +604,7 @@ int demod_init (struct audio_s *pa)
save_audio_config_p->adev[ACHAN2ADEV(chan)].samples_per_sec);
if (save_audio_config_p->achan[chan].decimate != 1)
dw_printf (" / %d", save_audio_config_p->achan[chan].decimate);
dw_printf (", Tx %s", layer2_tx[(int)(save_audio_config_p->achan[chan].layer2_xmit)]);
if (save_audio_config_p->achan[chan].dtmf_decode != DTMF_DECODE_OFF)
dw_printf (", DTMF decoder enabled");
dw_printf (".\n");
Expand Down Expand Up @@ -736,6 +740,7 @@ int demod_init (struct audio_s *pa)
save_audio_config_p->achan[chan].profiles,
save_audio_config_p->adev[ACHAN2ADEV(chan)].samples_per_sec,
save_audio_config_p->achan[chan].upsample);
dw_printf (", Tx %s", layer2_tx[(int)(save_audio_config_p->achan[chan].layer2_xmit)]);
if (save_audio_config_p->achan[chan].dtmf_decode != DTMF_DECODE_OFF)
dw_printf (", DTMF decoder enabled");
dw_printf (".\n");
Expand Down

0 comments on commit 3ba464d

Please sign in to comment.