From a2fded83407ce80a96463a94bd015c89ffd74466 Mon Sep 17 00:00:00 2001 From: lwvmobile Date: Sun, 4 Jun 2023 20:41:16 -0400 Subject: [PATCH] Revert Change to new NXDN FS; #123 --- CMakeLists.txt | 10 ++-- src/dsd_frame_sync.c | 131 ++++++++++++++++++++++--------------------- src/dsd_main.c | 2 +- src/dsd_ncurses.c | 4 +- 4 files changed, 74 insertions(+), 73 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9e43148..7ce21d3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,11 +32,11 @@ if (PVC) endif () #use cmake option -DNXDN=ON to enable new NXDN Sync Pattern Testing -# option(NXDN -# "Build with new NXDN Sync Pattern Testing Enabled" OFF) -# if (NXDN) -# add_definitions(-DNXDNTESTSYNC) -# endif () +option(NXDN + "Build with new NXDN Sync Pattern Testing Enabled" OFF) +if (NXDN) + add_definitions(-DNXDNTESTSYNC) +endif () #use cmake option -DLZ=ON to enable LimaZulu Requested NXDN Tweaks option(LZ diff --git a/src/dsd_frame_sync.c b/src/dsd_frame_sync.c index c4e0088..92009c0 100644 --- a/src/dsd_frame_sync.c +++ b/src/dsd_frame_sync.c @@ -453,10 +453,11 @@ getFrameSync (dsd_opts * opts, dsd_state * state) { if (opts->frame_nxdn48 == 1 || opts->frame_nxdn96 == 1 || opts->frame_dpmr == 1) { - goto SYNC_TEST_END; //should we update min/max here? yes or no? // state->max = ((state->max) + lmax) / 2; // state->min = ((state->min) + lmin) / 2; + + goto SYNC_TEST_END; } } @@ -1291,7 +1292,7 @@ getFrameSync (dsd_opts * opts, dsd_state * state) } - // #ifdef NXDNTESTSYNC // + #ifdef NXDNTESTSYNC // //NXDN FSW sync and handling - using more exact frame sync values else if ((opts->frame_nxdn96 == 1) || (opts->frame_nxdn48 == 1)) @@ -1408,79 +1409,79 @@ getFrameSync (dsd_opts * opts, dsd_state * state) } } - // #else //use previous NXDN Sync pattern detection + #else //use previous NXDN Sync pattern detection - // //NXDN FSW sync and handling - moved to very bottom of sync stack for falsing sanity - // else if ((opts->frame_nxdn96 == 1) || (opts->frame_nxdn48 == 1)) - // { - // strncpy (synctest10, (synctest_p - 9), 10); //FSW only - // strncpy (synctest19, (synctest_p - 18), 19); //Preamble + FSW + //NXDN FSW sync and handling - moved to very bottom of sync stack for falsing sanity + else if ((opts->frame_nxdn96 == 1) || (opts->frame_nxdn48 == 1)) + { + strncpy (synctest10, (synctest_p - 9), 10); //FSW only + strncpy (synctest19, (synctest_p - 18), 19); //Preamble + FSW - // //Preamble plus FSW, proceed right away - // if ( (strncmperr (synctest19, NXDN_PANDFSW, 19, 1) == 0) ) - // { - // state->carrier = 1; - // state->offset = synctest_pos; - // state->max = ((state->max) + lmax) / 2; - // state->min = ((state->min) + lmin) / 2; - // state->lastsynctype = 28; - // state->last_cc_sync_time = time(NULL); - // // if (opts->payload == 1) fprintf (stderr, "PANDF "); - // // fprintf (stderr, " %s ", synctest19); - // return (28); - // } + //Preamble plus FSW, proceed right away + if ( (strncmperr (synctest19, NXDN_PANDFSW, 19, 1) == 0) ) + { + state->carrier = 1; + state->offset = synctest_pos; + state->max = ((state->max) + lmax) / 2; + state->min = ((state->min) + lmin) / 2; + state->lastsynctype = 28; + state->last_cc_sync_time = time(NULL); + // if (opts->payload == 1) fprintf (stderr, "PANDF "); + // fprintf (stderr, " %s ", synctest19); + return (28); + } - // else if ( (strncmperr (synctest19, INV_NXDN_PANDFSW, 19, 1) == 0) ) - // { - // state->carrier = 1; - // state->offset = synctest_pos; - // state->max = ((state->max) + lmax) / 2; - // state->min = ((state->min) + lmin) / 2; - // state->lastsynctype = 29; - // state->last_cc_sync_time = time(NULL); - // // if (opts->payload == 1) fprintf (stderr, "PANDF "); - // // fprintf (stderr, " %s ", synctest19); - // return (29); - // } + else if ( (strncmperr (synctest19, INV_NXDN_PANDFSW, 19, 1) == 0) ) + { + state->carrier = 1; + state->offset = synctest_pos; + state->max = ((state->max) + lmax) / 2; + state->min = ((state->min) + lmin) / 2; + state->lastsynctype = 29; + state->last_cc_sync_time = time(NULL); + // if (opts->payload == 1) fprintf (stderr, "PANDF "); + // fprintf (stderr, " %s ", synctest19); + return (29); + } - // else if ( (strncmperr (synctest10, NXDN_FSW, 10, 1) == 0) ) - // { - // state->carrier = 1; - // state->offset = synctest_pos; - // state->max = ((state->max) + lmax) / 2; - // state->min = ((state->min) + lmin) / 2; + else if ( (strncmperr (synctest10, NXDN_FSW, 10, 1) == 0) ) + { + state->carrier = 1; + state->offset = synctest_pos; + state->max = ((state->max) + lmax) / 2; + state->min = ((state->min) + lmin) / 2; - // if (state->lastsynctype == 28) - // { - // state->last_cc_sync_time = time(NULL); - // // if (opts->payload == 1) fprintf (stderr, "FSW "); - // // fprintf (stderr, " %s ", synctest10); - // return (28); - // } - // state->lastsynctype = 28; //need two consecutive patterns to continue + if (state->lastsynctype == 28) + { + state->last_cc_sync_time = time(NULL); + // if (opts->payload == 1) fprintf (stderr, "FSW "); + // fprintf (stderr, " %s ", synctest10); + return (28); + } + state->lastsynctype = 28; //need two consecutive patterns to continue - // } + } - // else if ( (strncmperr (synctest10, INV_NXDN_FSW, 10, 1) == 0) ) - // { - // state->carrier = 1; - // state->offset = synctest_pos; - // state->max = ((state->max) + lmax) / 2; - // state->min = ((state->min) + lmin) / 2; + else if ( (strncmperr (synctest10, INV_NXDN_FSW, 10, 1) == 0) ) + { + state->carrier = 1; + state->offset = synctest_pos; + state->max = ((state->max) + lmax) / 2; + state->min = ((state->min) + lmin) / 2; - // if (state->lastsynctype == 29) - // { - // state->last_cc_sync_time = time(NULL); - // // if (opts->payload == 1) fprintf (stderr, "FSW "); - // // fprintf (stderr, " %s ", synctest10); - // return (29); - // } - // state->lastsynctype = 29; //need two consecutive patterns to continue + if (state->lastsynctype == 29) + { + state->last_cc_sync_time = time(NULL); + // if (opts->payload == 1) fprintf (stderr, "FSW "); + // fprintf (stderr, " %s ", synctest10); + return (29); + } + state->lastsynctype = 29; //need two consecutive patterns to continue - // } - // } + } + } - // #endif //NXDN Sync Type Selection + #endif //NXDN Sync Type Selection //Provoice Conventional -- Some False Positives due to shortened frame sync pattern, so use squelch if possible #ifdef PVCONVENTIONAL diff --git a/src/dsd_main.c b/src/dsd_main.c index 1b91954..1e0ca68 100644 --- a/src/dsd_main.c +++ b/src/dsd_main.c @@ -1358,7 +1358,7 @@ main (int argc, char **argv) } #ifdef AERO_BUILD - fprintf (stderr, "Build Version: v2.0.1-22 Win32 \n"); + fprintf (stderr, "Build Version: v2.0.1-23 Win32 \n"); #else fprintf (stderr, "Build Version: %s \n", GIT_TAG); #endif diff --git a/src/dsd_ncurses.c b/src/dsd_ncurses.c index 6b1b170..d5dfff3 100644 --- a/src/dsd_ncurses.c +++ b/src/dsd_ncurses.c @@ -2072,7 +2072,7 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state) if (opts->ncurses_compact == 1) { printw ("------------------------------------------------------------------------------\n"); - printw ("| Digital Speech Decoder: Florida Man Edition - Aero %s \n", "v2.0.1-22 Win32"); + printw ("| Digital Speech Decoder: Florida Man Edition - Aero %s \n", "v2.0.1-23 Win32"); printw ("------------------------------------------------------------------------------\n"); } #elif LIMAZULUTWEAKS @@ -2101,7 +2101,7 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state) if (i == 4) printw (" MBElib %s", versionstr); #ifdef AERO_BUILD if (i == 5) printw (" %s ", "Aero Win32"); - if (i == 6) printw (" v2.0.1-22 Win32 \n"); + if (i == 6) printw (" v2.0.1-23 Win32 \n"); #else if (i == 5) printw (" %s ", "zDEV BUILD"); // if (i == 5) printw (" %s ", "MAIN BUILD");