From a4ddcd422094f3e8fb4bdc17b0a3ea22e9992f62 Mon Sep 17 00:00:00 2001 From: lwvmobile Date: Fri, 13 Oct 2023 16:27:20 -0400 Subject: [PATCH] P25 -- Tweak to Synchronization Broadcast PDU; --- src/p25p2_vpdu.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/p25p2_vpdu.c b/src/p25p2_vpdu.c index dff1265..1db0336 100644 --- a/src/p25p2_vpdu.c +++ b/src/p25p2_vpdu.c @@ -1467,15 +1467,21 @@ void process_MAC_VPDU(dsd_opts * opts, dsd_state * state, int type, unsigned lon int seconds = slots / 135; //very rough estimation, but may be close enough for grins if (seconds > 59) seconds = 59; //sanity check for rounding error - fprintf (stderr, " Date: 20%02d.%02d.%02d Time: %02d:%02d:%02d UTC\n", - year, month, day, hour, min, seconds); - fprintf (stderr, " Local Time Offset: %.01f Hours;", offhour); - //if ist bit is set, then time on system may be considered invalid (i.e., no external time sync) - if (ist == 1) + + if (year != 0) //if time is synced in this PDU { - fprintf (stderr, " Invalid System Time "); + fprintf (stderr, " Date: 20%02d.%02d.%02d Time: %02d:%02d:%02d UTC\n", + year, month, day, hour, min, seconds); + fprintf (stderr, " Local Time Offset: %.01f Hours;", offhour); + //if ist bit is set, then time on system may be considered invalid (i.e., no external time sync) + if (ist == 1) + { + fprintf (stderr, " External System Time Sync; "); + } + else fprintf (stderr, " Local System Time Sync; "); } - else fprintf (stderr, " Valid System Time "); + fprintf (stderr, " Sync Slots: %d; ", slots); //Sync Slots -- This may not be accurate if out of scope of the PDU + }