@@ -628,6 +628,11 @@ void processConsumerMessage(PARSE_STATE *parse, uint8_t type)
628628 uint64_t unsigned64;
629629 } dblUnsigned64;
630630
631+ union {
632+ float flt;
633+ uint32_t unsigned32;
634+ } fltUnsigned32;
635+
631636 dblUnsigned64.unsigned64 = 0 ;
632637 for (int i = 0 ; i < 8 ; i++)
633638 dblUnsigned64.unsigned64 |= ((uint64_t )parse->buffer [16 + i]) << (i * 8 );
@@ -658,6 +663,15 @@ void processConsumerMessage(PARSE_STATE *parse, uint8_t type)
658663 if (gnssClockBias_ms > 999.999 )
659664 gnssClockBias_ms = 999.999 ;
660665
666+ fltUnsigned32.unsigned32 = 0 ;
667+ for (int i = 0 ; i < 4 ; i++)
668+ fltUnsigned32.unsigned32 |= ((uint32_t )parse->buffer [68 + i]) << (i * 8 );
669+ gnssClockDrift_ppm = fltUnsigned32.flt ;
670+ if (gnssClockDrift_ppm < -999999.999 )
671+ gnssClockDrift_ppm = -999999.999 ;
672+ if (gnssClockDrift_ppm > 999999.999 )
673+ gnssClockDrift_ppm = 999999.999 ;
674+
661675 gnssTimeSys = parse->buffer [72 ];
662676 }
663677 else if ((parse->message & 0x1FFF ) == 4058 ) // IPStatus
@@ -686,21 +700,35 @@ void processConsumerMessage(PARSE_STATE *parse, uint8_t type)
686700 uint8_t SysUsage = parse->buffer [20 + (b * SBLength) + 0 ];
687701 uint8_t TimeSystem = parse->buffer [20 + (b * SBLength) + 2 ];
688702
703+ // Convert uint64_t to double
689704 union {
690705 double dbl;
691706 uint64_t unsigned64;
692707 } dblUnsigned64;
693708
709+ // Extract RxClkBias_ms
694710 dblUnsigned64.unsigned64 = 0 ;
695711 for (int i = 0 ; i < 8 ; i++)
696712 dblUnsigned64.unsigned64 |= ((uint64_t )parse->buffer [20 + (b * SBLength) + 4 + i]) << (i * 8 );
697713
714+ // Convert uint32_t to float
715+ union {
716+ float flt;
717+ uint32_t unsigned32;
718+ } fltUnsigned32;
719+
720+ // Extract RxClkDrift_ppm
721+ fltUnsigned32.unsigned32 = 0 ;
722+ for (int i = 0 ; i < 4 ; i++)
723+ fltUnsigned32.unsigned32 |= ((uint32_t )parse->buffer [20 + (b * SBLength) + 12 + i]) << (i * 8 );
724+
698725 // If this block contains a non-composite clock indicator, store it
699726 for (int TS = 0 ; TS < NUM_FUGRO_CLK_BIASES; TS++)
700727 {
701728 if (fugroTimeSystems[TS].SysUsage == SysUsage)
702729 {
703730 fugroTimeSystems[TS].RxClkBias_ms = dblUnsigned64.dbl ;
731+ fugroTimeSystems[TS].RxClkDrift_ppm = fltUnsigned32.flt ;
704732 fugroTimeSystems[TS].updated = true ;
705733 break ;
706734 }
0 commit comments