mirror of
https://github.com/lwvmobile/dsd-fme.git
synced 2026-11-15 02:07:24 -05:00
Initialize RRC Input Filter Memory; Misc Work; Change input/output CLI for M17 UDP IP Frames to prevent accidental triggers on input files that are named with m17;
This commit is contained in:
13
src/m17.c
13
src/m17.c
@@ -1229,6 +1229,8 @@ float m17_rrc[81] =
|
||||
-0.001940667871554463f, -0.002930279157647190f, -0.003195702904062073f
|
||||
};
|
||||
|
||||
static float mem[81];
|
||||
|
||||
//convert bit array into symbols and RF/Audio
|
||||
void encodeM17RF (dsd_opts * opts, dsd_state * state, uint8_t * input, int type)
|
||||
{
|
||||
@@ -1344,7 +1346,7 @@ void encodeM17RF (dsd_opts * opts, dsd_state * state, uint8_t * input, int type)
|
||||
//version w/ filtering lifted from M17_Implementations / libM17
|
||||
else if (opts->use_cosine_filter == 1)
|
||||
{
|
||||
float mem[81]; memset (mem, 0.0f, 81*sizeof(float));
|
||||
|
||||
float mac = 0.0f;
|
||||
x = 0;
|
||||
for (i = 0; i < 192; i++)
|
||||
@@ -1435,6 +1437,9 @@ void encodeM17RF (dsd_opts * opts, dsd_state * state, uint8_t * input, int type)
|
||||
void encodeM17STR(dsd_opts * opts, dsd_state * state)
|
||||
{
|
||||
|
||||
//initialize RRC memory buffer
|
||||
memset (mem, 0, 81*sizeof(float));
|
||||
|
||||
//set stream type value here so we can change 3200 or 1600 accordingly
|
||||
uint8_t st = 2; //stream type: 0 = res; 1 = data; 2 = voice(3200); 3 = voice(1600) + data;
|
||||
if (state->m17_str_dt == 3) st = 3; //this is set to 3 IF -S user text string is called at CLI
|
||||
@@ -2454,6 +2459,9 @@ void encodeM17STR(dsd_opts * opts, dsd_state * state)
|
||||
void encodeM17BRT(dsd_opts * opts, dsd_state * state)
|
||||
{
|
||||
|
||||
//initialize RRC memory buffer
|
||||
memset (mem, 0, 81*sizeof(float));
|
||||
|
||||
//NOTE: BERT will not use the nucrses terminal,
|
||||
//just strictly for making a BERT test signal
|
||||
|
||||
@@ -2582,6 +2590,9 @@ void encodeM17BRT(dsd_opts * opts, dsd_state * state)
|
||||
void encodeM17PKT(dsd_opts * opts, dsd_state * state)
|
||||
{
|
||||
|
||||
//initialize RRC memory buffer
|
||||
memset (mem, 0, 81*sizeof(float));
|
||||
|
||||
uint8_t nil[368]; //empty array
|
||||
memset (nil, 0, sizeof(nil));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user