From f22d61df62a9963323c5b927eecdcd96f27e17df Mon Sep 17 00:00:00 2001 From: lwvmobile <59371473+lwvmobile@users.noreply.github.com> Date: Sat, 13 Aug 2022 12:35:03 -0400 Subject: [PATCH] LRRP Patch 2 Attempt to Patch/Mitigate Corrupt Date Stamp in lrrp.txt file when using certain environments (cygwin) --- src/dmr_sync.c | 9 ++++++--- src/dsd_main.c | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/dmr_sync.c b/src/dmr_sync.c index 6f9faab..e1e4b31 100644 --- a/src/dmr_sync.c +++ b/src/dmr_sync.c @@ -144,7 +144,9 @@ void Process34Data(dsd_opts * opts, dsd_state * state, unsigned char tdibits[98] //hard code filename override for those wanting to use other software //pFile = fopen("DSDPlus.LRRP", "a"); - fprintf (pFile, "%s\t %s\t", getDateL(), getTimeL()); //current timestamp, may find a way to only add this IF no included timestamp in LRRP data? + //seperate these two values since they cause issues with garbage writing to files in some environments (cygwin) + fprintf (pFile, "%s\t ", getDateL() ); //current date, may find a way to only add this IF no included timestamp in LRRP data? + fprintf (pFile, "%s\t ", getTimeL()) ; //current timestamp, may find a way to only add this IF no included timestamp in LRRP data? fprintf (pFile, "%08lld\t", state->dmr_lrrp_source[state->currentslot]); //source address from data header } @@ -1216,8 +1218,9 @@ void Process12Data(dsd_opts * opts, dsd_state * state, uint8_t info[196], uint8_ //hard code filename override for those wanting to use other software //pFile = fopen("DSDPlus.LRRP", "a"); - - fprintf (pFile, "%s\t %s\t", getDateL(), getTimeL()); //current timestamp, may find a way to only add this IF no included timestamp in LRRP data? + //seperate these two values since they cause issues with garbage writing to files in some environments (cygwin) + fprintf (pFile, "%s\t ", getDateL() ); //current date, may find a way to only add this IF no included timestamp in LRRP data? + fprintf (pFile, "%s\t ", getTimeL() ); //current timestamp, may find a way to only add this IF no included timestamp in LRRP data? fprintf (pFile, "%08lld\t", state->dmr_lrrp_source[state->currentslot]); //source address from data header } diff --git a/src/dsd_main.c b/src/dsd_main.c index 37e6649..51ef4b9 100644 --- a/src/dsd_main.c +++ b/src/dsd_main.c @@ -931,7 +931,7 @@ main (int argc, char **argv) } opts.dmr_mute_encL = 0; opts.dmr_mute_encR = 0; - if (state.K == 1) + if (state.K == 0) { opts.dmr_mute_encL = 1; opts.dmr_mute_encR = 1;