diff --git a/src/dmr_bs.c b/src/dmr_bs.c index 8c39478..728020b 100644 --- a/src/dmr_bs.c +++ b/src/dmr_bs.c @@ -50,6 +50,10 @@ void dmrBS (dsd_opts * opts, dsd_state * state) //memset(&state->TS1SuperFrame, 0, sizeof(TimeSlotVoiceSuperFrame_t)); //memset(&state->TS2SuperFrame, 0, sizeof(TimeSlotVoiceSuperFrame_t)); + //Init slot lights + sprintf (state->slot0light, " slot0 "); + sprintf (state->slot1light, " slot1 "); + //Init the color code status state->color_code_ok = 0; @@ -329,9 +333,9 @@ void dmrBS (dsd_opts * opts, dsd_state * state) //fprintf (stderr,"Sync: +DMR [slot1] slot2 | Color Code=%02d | DMRSTEREO | VC%d \n", state->dmr_color_code, vc1); if (opts->inverted_dmr == 0) { - fprintf (stderr,"Sync: +DMR [slot1] slot2 | | DMRSTEREO | VC%d \n",vc1); + fprintf (stderr,"Sync: +DMR [SLOT1] slot2 | | DMRSTEREO | VC%d \n",vc1); } - else fprintf (stderr,"Sync: -DMR [slot1] slot2 | | DMRSTEREO | VC%d \n",vc1); + else fprintf (stderr,"Sync: -DMR [SLOT1] slot2 | | DMRSTEREO | VC%d \n",vc1); } if (internalslot == 1) @@ -340,9 +344,9 @@ void dmrBS (dsd_opts * opts, dsd_state * state) //fprintf (stderr,"Sync: +DMR slot1 [slot2] | Color Code=%02d | DMRSTEREO | VC%d \n", state->dmr_color_code, vc2); if (opts->inverted_dmr == 0) { - fprintf (stderr,"Sync: +DMR [slot1] slot2 | | DMRSTEREO | VC%d \n",vc2); + fprintf (stderr,"Sync: +DMR slot1 [SLOT2] | | DMRSTEREO | VC%d \n",vc2); } - else fprintf (stderr,"Sync: -DMR [slot1] slot2 | | DMRSTEREO | VC%d \n",vc2); + else fprintf (stderr,"Sync: +DMR slot1 [SLOT2] | | DMRSTEREO | VC%d \n",vc2); } if (internalslot == 0 && vc1 == 6) //presumably when full (and no sync issues) { diff --git a/src/dmr_data.c b/src/dmr_data.c index e4195c0..7decf4b 100644 --- a/src/dmr_data.c +++ b/src/dmr_data.c @@ -78,14 +78,15 @@ processDMRdata (dsd_opts * opts, dsd_state * state) /* Change the current slot only if we are in relayed mode (not in direct mode) */ if(state->directmode == 0) state->currentslot = (1 & (dibit >> 1)); // bit 1 - if (state->currentslot == 0) + if (state->currentslot == 0 && state->dmr_ms_mode == 0) { state->slot1light[0] = '['; state->slot1light[6] = ']'; state->slot2light[0] = ' '; state->slot2light[6] = ' '; } - else + //else + if (state->currentslot == 1 && state->dmr_ms_mode == 0) { state->slot2light[0] = '['; state->slot2light[6] = ']'; @@ -97,8 +98,8 @@ processDMRdata (dsd_opts * opts, dsd_state * state) if(state->hardslot != 9 && state->hardslot != state->currentslot) //if(1==1) { - fprintf (stderr, " Current Slot = %d", state->currentslot + 1); - fprintf (stderr, "\n"); //line break after breaking out of jail + //fprintf (stderr, " Current Slot = %d", state->currentslot + 1); + //fprintf (stderr, "\n"); //line break after breaking out of jail //goto JUMP; } } @@ -255,7 +256,7 @@ processDMRdata (dsd_opts * opts, dsd_state * state) fprintf(stderr, "%s ", syncbits); #endif - if((strcmp (sync, DMR_BS_DATA_SYNC) == 0) || (strcmp (sync, DMR_MS_DATA_SYNC) == 0)) + if((strcmp (sync, DMR_BS_DATA_SYNC) == 0) )//|| (strcmp (sync, DMR_MS_DATA_SYNC) == 0)) { if (state->currentslot == 0) { @@ -279,7 +280,7 @@ processDMRdata (dsd_opts * opts, dsd_state * state) sprintf(state->slot2light, "[sLoT2]"); } - if (opts->errorbars == 1) + if (opts->errorbars == 1 && state->dmr_ms_mode == 0) { fprintf(stderr, "%s %s ", state->slot1light, state->slot2light); } diff --git a/src/dmr_ms.c b/src/dmr_ms.c index 5f9cc69..bb67bcd 100644 --- a/src/dmr_ms.c +++ b/src/dmr_ms.c @@ -294,7 +294,7 @@ void dmrMS (dsd_opts * opts, dsd_state * state) if (state->dmr_ms_mode == 1 ) //&& vc1 < 7 { //do something - fprintf (stderr, "MS MODE "); + //fprintf (stderr, "MS MODE "); } //don't know if we will catch an RC sync in here or not, should be on VC6 if it occurs @@ -305,7 +305,8 @@ void dmrMS (dsd_opts * opts, dsd_state * state) { sprintf(state->slot1light, "[slot1]"); sprintf(state->slot2light, " slot2 "); - fprintf (stderr,"Sync: +DMR [slot1] slot2 | Color Code=%02d | DMRSTEREO | RC ", state->color_code); + //fprintf (stderr,"Sync: +DMR [slot1] slot2 | Color Code=%02d | DMRSTEREO | RC ", state->color_code); + fprintf (stderr,"Sync: +DMR MS MODE | Color Code=%02d | DMRSTEREO | RC ", state->color_code); //test with vc1 reset disabled, if all is well, leave disabled //vc1 = 1; } @@ -313,7 +314,8 @@ void dmrMS (dsd_opts * opts, dsd_state * state) { sprintf(state->slot2light, "[slot2]"); sprintf(state->slot1light, " slot1 "); - fprintf (stderr,"Sync: +DMR slot1 [slot2] | Color Code=%02d | DMRSTEREO | RC ", state->color_code); + //fprintf (stderr,"Sync: +DMR slot1 [slot2] | Color Code=%02d | DMRSTEREO | RC ", state->color_code); + fprintf (stderr,"Sync: +DMR MS MODE | Color Code=%02d | DMRSTEREO | RC ", state->color_code); //test with vc1 reset disabled, if all is well, leave disabled //vc2 = 1; } @@ -350,9 +352,9 @@ void dmrMS (dsd_opts * opts, dsd_state * state) //fprintf (stderr,"Sync: +DMR slot1 [slot2] | Color Code=%02d | DMRSTEREO | Data ", state->color_code); if (opts->inverted_dmr == 0) { - fprintf (stderr,"Sync: +DMR "); + fprintf (stderr,"Sync: +DMR MS MODE "); } - else fprintf (stderr,"Sync: -DMR "); + else fprintf (stderr,"Sync: -DMR MS MODE "); //test with vc1 reset disabled, if all is well, leave disabled //vc2 = 1; } @@ -378,21 +380,21 @@ void dmrMS (dsd_opts * opts, dsd_state * state) fprintf (stderr,"%s ", getTime()); if (internalslot == 0 && opts->inverted_dmr == 0) { - fprintf (stderr,"Sync: +DMR [slot1] slot2 | Color Code=%02d | DMRSTEREO | VC%d \n", state->color_code, vc1); + fprintf (stderr,"Sync: +DMR MS MODE | Color Code=%02d | DMRSTEREO | VC%d \n", state->color_code, vc1); } if (internalslot == 0 && opts->inverted_dmr == 1) { - fprintf (stderr,"Sync: -DMR [slot1] slot2 | Color Code=%02d | DMRSTEREO | VC%d \n", state->color_code, vc1); + fprintf (stderr,"Sync: -DMR MS MODE | Color Code=%02d | DMRSTEREO | VC%d \n", state->color_code, vc1); } if (internalslot == 1 && opts->inverted_dmr == 0) { - fprintf (stderr,"Sync: +DMR slot1 [slot2] | Color Code=%02d | DMRSTEREO | VC%d \n", state->color_code, vc2); + fprintf (stderr,"Sync: +DMR MS MODE | Color Code=%02d | DMRSTEREO | VC%d \n", state->color_code, vc2); } if (internalslot == 1 && opts->inverted_dmr == 1) { - fprintf (stderr,"Sync: -DMR slot1 [slot2] | Color Code=%02d | DMRSTEREO | VC%d \n", state->color_code, vc2); + fprintf (stderr,"Sync: -DMR MS MODE | Color Code=%02d | DMRSTEREO | VC%d \n", state->color_code, vc2); } if (internalslot == 0 && vc1 == 6) //presumably when full (and no sync issues) { @@ -613,14 +615,14 @@ void dmrMSBootstrap (dsd_opts * opts, dsd_state * state) } - fprintf (stderr, "MS MODE "); + //fprintf (stderr, "MS MODE "); fprintf (stderr,"%s ", getTime()); //fprintf (stderr,"Sync: +DMR | Frame Sync | DMRSTEREO | VC1 FS \n"); if (opts->inverted_dmr == 0) { - fprintf (stderr,"Sync: +DMR | Frame Sync | DMRSTEREO | VC1 FS \n"); + fprintf (stderr,"Sync: +DMR MS MODE | Frame Sync | DMRSTEREO | VC1 FS \n"); } - else fprintf (stderr,"Sync: -DMR | Frame Sync | DMRSTEREO | VC1 FS \n"); + else fprintf (stderr,"Sync: -DMR MS MODE | Frame Sync | DMRSTEREO | VC1 FS \n"); processMbeFrame (opts, state, NULL, ambe_fr, NULL); processMbeFrame (opts, state, NULL, ambe_fr2, NULL); processMbeFrame (opts, state, NULL, ambe_fr3, NULL); @@ -672,19 +674,21 @@ void dmrMSData (dsd_opts * opts, dsd_state * state) } //fprintf(stderr, "\n"); //print nice pretty lines - fprintf (stderr, "MS MODE "); + //fprintf (stderr, "MS MODE "); fprintf (stderr, "%s ", getTime()); //fprintf (stderr, "Sync: +MS DATA | Color Code=XX | DMRSTEREO | Data "); if (opts->inverted_dmr == 0) { - fprintf (stderr,"Sync: +DMR "); + fprintf (stderr,"Sync: +DMR MS MODE "); } - else fprintf (stderr,"Sync: -DMR "); + else fprintf (stderr,"Sync: -DMR MS MODE "); //fprintf (stderr, "\n "); //sprintf for slot 1, doesn't matter, just makes print out of data look uniform setting ahead of time - sprintf(state->slot1light, "[slot1]"); - sprintf(state->slot2light, " slot2 "); + //sprintf(state->slot1light, "[slot1]"); + //sprintf(state->slot2light, " slot2 "); + sprintf(state->slot1light, ""); + sprintf(state->slot2light, ""); //process data state->dmr_stereo = 1; diff --git a/src/dmr_voice.c b/src/dmr_voice.c index e7322c3..c44598d 100644 --- a/src/dmr_voice.c +++ b/src/dmr_voice.c @@ -361,7 +361,7 @@ void processDMRvoice (dsd_opts * opts, dsd_state * state) state->directmode = 1; /* Direct mode */ sprintf(state->slot1light, "[sLoT2]"); } - else if((strcmp (sync, DMR_BS_VOICE_SYNC) == 0) || (strcmp (sync, DMR_MS_VOICE_SYNC) == 0)) + else if((strcmp (sync, DMR_BS_VOICE_SYNC) == 0) ) //|| (strcmp (sync, DMR_MS_VOICE_SYNC) == 0)) { mutecurrentslot = 0; state->directmode = 0; diff --git a/src/dsd_frame.c b/src/dsd_frame.c index 38dc782..16c4d7b 100644 --- a/src/dsd_frame.c +++ b/src/dsd_frame.c @@ -200,6 +200,8 @@ processFrame (dsd_opts * opts, dsd_state * state) sprintf (state->fsubtype, " VOICE "); if (opts->dmr_stereo == 0 && state->synctype < 32) // -T option for DMR (TDMA) stereo { + sprintf (state->slot0light, " slot0 "); + sprintf (state->slot1light, " slot1 "); processDMRvoice (opts, state); } if (opts->dmr_stereo == 0 && state->synctype == 32) @@ -239,12 +241,16 @@ processFrame (dsd_opts * opts, dsd_state * state) { closeMbeOutFile (opts, state); state->err_str[0] = 0; + sprintf (state->slot0light, " slot0 "); + sprintf (state->slot1light, " slot1 "); processDMRdata (opts, state); } //switch dmr_stereo to 0 when handling BS data frame syncs with processDMRdata if (opts->dmr_stereo == 1) { state->dmr_stereo = 0; //set the state to zero for handling pure data frames + sprintf (state->slot0light, " slot0 "); + sprintf (state->slot1light, " slot1 "); processDMRdata (opts, state); } } diff --git a/src/dsd_main.c b/src/dsd_main.c index 90796fa..2a0d8ed 100644 --- a/src/dsd_main.c +++ b/src/dsd_main.c @@ -102,8 +102,10 @@ noCarrier (dsd_opts * opts, dsd_state * state) state->repeat = 0; state->nac = 0; state->numtdulc = 0; - sprintf (state->slot0light, " slot0 "); - sprintf (state->slot1light, " slot1 "); + //sprintf (state->slot0light, " slot0 "); + //sprintf (state->slot0light, " slot0 "); + sprintf (state->slot0light, ""); + sprintf (state->slot1light, ""); state->firstframe = 0; if (opts->audio_gain == (float) 0) { @@ -126,6 +128,8 @@ noCarrier (dsd_opts * opts, dsd_state * state) sprintf (state->keyid, "________________"); mbe_initMbeParms (state->cur_mp, state->prev_mp, state->prev_mp_enhanced); mbe_initMbeParms (state->cur_mp2, state->prev_mp2, state->prev_mp_enhanced2); + + state->dmr_ms_mode = 0; } void @@ -307,8 +311,10 @@ initState (dsd_state * state) state->optind = 0; state->numtdulc = 0; state->firstframe = 0; - sprintf (state->slot0light, " slot0 "); - sprintf (state->slot1light, " slot1 "); + //sprintf (state->slot0light, " slot0 "); + //sprintf (state->slot1light, " slot1 "); + sprintf (state->slot0light, ""); + sprintf (state->slot1light, ""); state->aout_gain = 25; memset (state->aout_max_buf, 0, sizeof (float) * 200); state->aout_max_buf_p = state->aout_max_buf; @@ -394,6 +400,7 @@ initState (dsd_state * state) state->dmr_soR = 0; state->dmr_fid = 0; state->dmr_fidR = 0; + state->dmr_ms_mode = 0; memset(state->dstarradioheader, 0, 41);