Browse Source

Updated to new codec2 version

master
Jeroen Vreeken 11 months ago
parent
commit
019fb9dfe1
4 changed files with 32 additions and 6 deletions
  1. +8
    -0
      analog_trx.c
  2. +6
    -0
      eth_ar_codec2.h
  3. +7
    -6
      freedv_eth.c
  4. +11
    -0
      freedv_eth.h

+ 8
- 0
analog_trx.c View File

@ -391,10 +391,14 @@ int main(int argc, char **argv)
mode = CODEC2_MODE_1300;
} else if (!strcmp(optarg, "1200")) {
mode = CODEC2_MODE_1200;
#if defined(CODEC2_MODE_700)
} else if (!strcmp(optarg, "700")) {
mode = CODEC2_MODE_700;
#endif
#if defined(CODEC2_MODE_700B)
} else if (!strcmp(optarg, "700B")) {
mode = CODEC2_MODE_700B;
#endif
} else if (!strcmp(optarg, "700C")) {
mode = CODEC2_MODE_700C;
} else if (!strcmp(optarg, "450")) {
@ -451,12 +455,16 @@ int main(int argc, char **argv)
case CODEC2_MODE_1200:
rx_type = ETH_P_CODEC2_1200;
break;
#if defined(CODEC2_MODE_700)
case CODEC2_MODE_700:
rx_type = ETH_P_CODEC2_700;
break;
#endif
#if defined(CODEC2_MODE_700B)
case CODEC2_MODE_700B:
rx_type = ETH_P_CODEC2_700B;
break;
#endif
case CODEC2_MODE_700C:
rx_type = ETH_P_CODEC2_700C;
break;


+ 6
- 0
eth_ar_codec2.h View File

@ -57,12 +57,18 @@ static inline int eth_ar_eth_p_codecmode(uint16_t type)
return CODEC2_MODE_1300;
case ETH_P_CODEC2_1200:
return CODEC2_MODE_1200;
#if defined(CODEC2_MODE_700)
case ETH_P_CODEC2_700:
return CODEC2_MODE_700;
#endif
#if defined(CODEC2_MODE_700B)
case ETH_P_CODEC2_700B:
return CODEC2_MODE_700B;
#endif
case ETH_P_CODEC2_700C:
return CODEC2_MODE_700C;
case ETH_P_CODEC2_450:
return CODEC2_MODE_450;
case ETH_P_LPCNET_1733:
return CODEC_MODE_LPCNET_1733;
case ETH_P_ALAW:


+ 7
- 6
freedv_eth.c View File

@ -357,12 +357,16 @@ int main(int argc, char **argv)
if (!strcmp(freedv_mode_str, "1600")) {
freedv_mode = FREEDV_MODE_1600;
freedv_hasdata = false;
#if defined(FREEDV_MODE_700)
} else if (!strcmp(freedv_mode_str, "700")) {
freedv_mode = FREEDV_MODE_700;
freedv_hasdata = false;
#endif
#if defined(FREEDV_MODE_700B)
} else if (!strcmp(freedv_mode_str, "700B")) {
freedv_mode = FREEDV_MODE_700B;
freedv_hasdata = false;
#endif
} else if (!strcmp(freedv_mode_str, "700C")) {
freedv_mode = FREEDV_MODE_700C;
} else if (!strcmp(freedv_mode_str, "700D")) {
@ -377,12 +381,9 @@ int main(int argc, char **argv)
} else if (!strcmp(freedv_mode_str, "800XA")) {
freedv_mode = FREEDV_MODE_800XA;
freedv_hasdata = true;
} else if (!strcmp(freedv_mode_str, "700C")) {
freedv_mode = FREEDV_MODE_700C;
freedv_hasdata = true;
} else if (!strcmp(freedv_mode_str, "700D")) {
freedv_mode = FREEDV_MODE_700D;
freedv_hasdata = true;
} else if (!strcmp(freedv_mode_str, "2020")) {
freedv_mode = FREEDV_MODE_2020;
freedv_hasdata = false;
} else {
printf("Invalid FreeDV mode\n");
return -1;


+ 11
- 0
freedv_eth.h View File

@ -32,12 +32,16 @@ static inline uint16_t freedv_eth_mode2type(int mode)
uint16_t type = ETH_P_CODEC2_700;
switch(mode) {
#if defined(CODEC2_MODE_700)
case FREEDV_MODE_700:
type = ETH_P_CODEC2_700;
break;
#endif
#if defined(CODEC2_MODE_700B)
case FREEDV_MODE_700B:
type = ETH_P_CODEC2_700B;
break;
#endif
case FREEDV_MODE_1600:
type = ETH_P_CODEC2_1300;
break;
@ -45,6 +49,13 @@ static inline uint16_t freedv_eth_mode2type(int mode)
case FREEDV_MODE_2400B:
type = ETH_P_CODEC2_1300;
break;
case FREEDV_MODE_2020:
type = ETH_P_LPCNET_1733;
break;
case FREEDV_MODE_700C:
case FREEDV_MODE_700D:
type = ETH_P_CODEC2_700C;
break;
default:
break;
}


Loading…
Cancel
Save