From 5d44425b10b9b470b756d1a00c238ed6f33a0397 Mon Sep 17 00:00:00 2001 From: lwvmobile <59371473+lwvmobile@users.noreply.github.com> Date: Tue, 9 Aug 2022 18:43:44 -0400 Subject: [PATCH] Cleanup Straggler Code and Language Cleanup Straggler Code and Language --only dropped one F-Bomb this time --- include/dsd.h | 4 ++-- src/dsd_file.c | 4 ++-- src/dsd_ncurses.c | 1 - src/nxdn_lib.c | 10 +--------- src/p25p1_ldu1.c | 1 - src/p25p1_ldu2.c | 1 - 6 files changed, 5 insertions(+), 16 deletions(-) diff --git a/include/dsd.h b/include/dsd.h index 122311e..cfe7067 100644 --- a/include/dsd.h +++ b/include/dsd.h @@ -254,13 +254,13 @@ typedef struct uint32_t rtlsdr_center_freq; int rtlsdr_ppm_error; //was int, changed to float - int audio_in_type; // 0 for device, 1 for file, 2 for portaudio, 3 for rtlsdr + int audio_in_type; // 0 for device, 1 for file, 3 for rtlsdr char audio_out_dev[1024]; int audio_out_fd; SNDFILE *audio_out_file; SF_INFO *audio_out_file_info; - int audio_out_type; // 0 for device, 1 for file, 2 for portaudio + int audio_out_type; // 0 for device, 1 for file, int split; int playoffset; int playoffsetR; diff --git a/src/dsd_file.c b/src/dsd_file.c index eb5c691..e15d24c 100644 --- a/src/dsd_file.c +++ b/src/dsd_file.c @@ -146,7 +146,7 @@ PrintAMBEData (dsd_opts * opts, dsd_state * state, char *ambe_d) //For DMR Stere err = (unsigned char) state->errs2; k = 0; - if (opts->dmr_stereo == 0) //was 0, switched while working out des + if (opts->dmr_stereo == 0) { fprintf (stderr, "\n"); } @@ -181,7 +181,7 @@ PrintAMBEData (dsd_opts * opts, dsd_state * state, char *ambe_d) //For DMR Stere b = ambe_d[48]; if (opts->dmr_stereo == 1) //need to fix the printouts again { - fprintf (stderr, "\n"); //temp disable while I work on DES + fprintf (stderr, "\n"); } } diff --git a/src/dsd_ncurses.c b/src/dsd_ncurses.c index 622200f..a68fb7e 100644 --- a/src/dsd_ncurses.c +++ b/src/dsd_ncurses.c @@ -677,7 +677,6 @@ void ncursesMenu (dsd_opts * opts, dsd_state * state) } if (S_ISREG(stat_buf.st_mode)) { - //state->symbolfile = fopen("adp_fdma.bin", "r"); opts->symbolfile = fopen(opts->audio_in_dev, "r"); opts->audio_in_type = 4; //symbol capture bin files } diff --git a/src/nxdn_lib.c b/src/nxdn_lib.c index fdd6ef5..e892caa 100644 --- a/src/nxdn_lib.c +++ b/src/nxdn_lib.c @@ -779,14 +779,6 @@ void NXDN_decode_VCALL(dsd_opts * opts, dsd_state * state, uint8_t * Message) //state->nxdn_key = (KeyID & 0xFF); } - //print scrambler key value if manually inserted - if (state->nxdn_cipher_type == 0x01 && state->R > 0) //scrambler - { - fprintf (stderr, "%s", KYEL); - fprintf(stderr, "Value: 0x%04llX", state->R); //use R and not miN - fprintf (stderr, "%s", KNRM); - } - if(state->NxdnElementsContent.VCallCrcIsGood) { if ( (SourceUnitID & 0xFFFF) > 0 ) @@ -841,7 +833,7 @@ void NXDN_decode_VCALL_IV(dsd_opts * opts, dsd_state * state, uint8_t * Message) for(i = 0; i < 8; i++) { state->NxdnElementsContent.IV[i] = (uint8_t)ConvertBitIntoBytes(&Message[(i + 1) * 8], 8); - //let's load this mother fucker up then lol + state->payload_miN = state->payload_miN << 8 | state->NxdnElementsContent.IV[i]; } diff --git a/src/p25p1_ldu1.c b/src/p25p1_ldu1.c index f309fc6..aa73be6 100644 --- a/src/p25p1_ldu1.c +++ b/src/p25p1_ldu1.c @@ -168,7 +168,6 @@ processLDU1 (dsd_opts* opts, dsd_state* state) { lsd2[i] = lsd[i] + '0'; } - //skip two octets since LSD is part of the encryption portion // TODO: error correction of the LSD bytes... // TODO: do something useful with the LSD bytes... diff --git a/src/p25p1_ldu2.c b/src/p25p1_ldu2.c index 5ff8e3d..d5fe4d2 100644 --- a/src/p25p1_ldu2.c +++ b/src/p25p1_ldu2.c @@ -169,7 +169,6 @@ processLDU2 (dsd_opts * opts, dsd_state * state) { lsd2[i] = lsd[i] + '0'; } - //skip two octets since LSD is part of the encryption portion // TODO: error correction of the LSD bytes... // TODO: do something useful with the LSD bytes...