diff --git a/src/dsd_file.c b/src/dsd_file.c index 7aea54c..a4ec9ca 100644 --- a/src/dsd_file.c +++ b/src/dsd_file.c @@ -242,10 +242,12 @@ closeMbeOutFile (dsd_opts * opts, dsd_state * state) strftime (datestr, 31, "%Y-%m-%d-%H%M%S", &timep); sprintf (newfilename, "%s%s", datestr, ext); //this one + if (state->lastsynctype == 0 || state->lastsynctype == 1) { sprintf (newfilename, "%s-nac%X-tg%i%s", datestr, state->nac, talkgroup, ext); } + sprintf (new_path, "%s%s", opts->mbe_out_dir, newfilename); #ifdef _WIN32 sprintf (shell, "move %s %s", opts->mbe_out_path, new_path); diff --git a/src/p25p1_hdu.c b/src/p25p1_hdu.c index 8cc9af2..8d7e9f7 100644 --- a/src/p25p1_hdu.c +++ b/src/p25p1_hdu.c @@ -452,17 +452,25 @@ processHDU(dsd_opts* opts, dsd_state* state) skipDibit (opts, state, 5); status = getDibit (opts, state); //TODO: Do something useful with the status bits... - /* - algidhex = strtol (algid, NULL, 2); - kidhex = strtol (kid, NULL, 2); - state->payload_algid = algidhex; - state->payload_keyid = kidhex; - if (opts->payload == 1) + if (state->carrier == 1 && state->errs == 0) //only update when carrier is present, and no errors?? + //if (state->carrier == 1) { - fprintf (stderr, "ALG ID: 0x%X KEY ID: 0x%X\n", algidhex, kidhex); + algidhex = strtol (algid, NULL, 2); + kidhex = strtol (kid, NULL, 2); + + state->payload_algid = algidhex; + state->payload_keyid = kidhex; } - */ + + //if (opts->payload == 1) + if (opts->payload == 1 && state->errs == 0) + { + //fprintf (stderr, "ALG ID: 0x%X KEY ID: 0x%X\n", algidhex, kidhex); + fprintf (stderr, "HDU ALG ID: 0x%X KEY ID: 0x%X MI: %s \n", algidhex, kidhex, mi); + //fprintf (stderr, "ALG ID: 0x%X KEY ID: 0x%X MI: 0x%016X%02X\n", algidhex, kidhex, mihex1, mihex2); + } + if (opts->p25enc == 1 && opts->payload == 0) { algidhex = strtol (algid, NULL, 2); diff --git a/src/p25p1_ldu2.c b/src/p25p1_ldu2.c index 218a131..b431385 100644 --- a/src/p25p1_ldu2.c +++ b/src/p25p1_ldu2.c @@ -521,7 +521,8 @@ processLDU2 (dsd_opts * opts, dsd_state * state) kid[15] = hex_data[ 0][5] + '0'; //if (state->carrier == 1 && state->errs2 == 0) //only update when carrier is present, and no errors?? - if (state->carrier == 1) + if (state->carrier == 1 && state->errs == 0) //only update when carrier is present, and no errors?? + //if (state->carrier == 1) { /* for (short i = 0; i < 64; i++) @@ -547,10 +548,11 @@ processLDU2 (dsd_opts * opts, dsd_state * state) } - if (opts->payload == 1) + //if (opts->payload == 1) + if (opts->payload == 1 && state->errs == 0) { //fprintf (stderr, "ALG ID: 0x%X KEY ID: 0x%X\n", algidhex, kidhex); - fprintf (stderr, "ALG ID: 0x%X KEY ID: 0x%X MI: %s \n", algidhex, kidhex, mi); + fprintf (stderr, "LDU2 ALG ID: 0x%X KEY ID: 0x%X MI: %s \n", algidhex, kidhex, mi); //fprintf (stderr, "ALG ID: 0x%X KEY ID: 0x%X MI: 0x%016X%02X\n", algidhex, kidhex, mihex1, mihex2); } //if (opts->p25enc == 1 && opts->payload == 0)