@@ -78,6 +78,7 @@ const int ringBufferConsumerEntries = sizeof(ringBufferConsumer) / sizeof(ringBu
78
78
#define RTK_RTCM_PARSER_INDEX 2
79
79
#define RTK_UBLOX_PARSER_INDEX 3
80
80
#define RTK_UNICORE_BINARY_PARSER_INDEX 4
81
+ #define RTK_SBF_PARSER_INDEX 5
81
82
82
83
// List the parsers to be included
83
84
SEMP_PARSE_ROUTINE const parserTable[] = {
@@ -86,6 +87,7 @@ SEMP_PARSE_ROUTINE const parserTable[] = {
86
87
sempRtcmPreamble,
87
88
sempUbloxPreamble,
88
89
sempUnicoreBinaryPreamble,
90
+ sempSbfPreamble,
89
91
};
90
92
const int parserCount = sizeof (parserTable) / sizeof (parserTable[0 ]);
91
93
@@ -96,6 +98,7 @@ const char *const parserNames[] = {
96
98
" RTCM" ,
97
99
" u-Blox" ,
98
100
" Unicore Binary" ,
101
+ " SBF" ,
99
102
};
100
103
const int parserNameCount = sizeof (parserNames) / sizeof (parserNames[0 ]);
101
104
@@ -391,7 +394,9 @@ void gnssReadTask(void *e)
391
394
if (settings.debugGnss )
392
395
sempEnableDebugOutput (rtkParse);
393
396
394
- if (present.gnss_mosaicX5 && (productVariant != RTK_FLEX))
397
+ bool sbfParserNeeded = present.gnss_mosaicX5 && (productVariant != RTK_FLEX);
398
+
399
+ if (sbfParserNeeded)
395
400
{
396
401
// Initialize the SBF parser for the mosaic-X5
397
402
sbfParse = sempBeginParser (sbfParserTable, sbfParserCount, sbfParserNames, sbfParserNameCount,
@@ -481,11 +486,11 @@ void gnssReadTask(void *e)
481
486
{
482
487
// Update the parser state based on the incoming byte
483
488
// On mosaic-X5, pass the byte to sbfParse. On all other platforms, pass it straight to rtkParse
484
- sempParseNextByte (present. gnss_mosaicX5 ? sbfParse : rtkParse, incomingData[x]);
489
+ sempParseNextByte (sbfParserNeeded ? sbfParse : rtkParse, incomingData[x]);
485
490
486
491
// See notes above. On the mosaic-X5, check that the incoming SBF blocks have expected IDs and
487
492
// lengths to help prevent raw L-Band data being misidentified as SBF
488
- if (present. gnss_mosaicX5 )
493
+ if (sbfParserNeeded )
489
494
{
490
495
SEMP_SCRATCH_PAD *scratchPad = (SEMP_SCRATCH_PAD *)sbfParse->scratchPad ;
491
496
@@ -633,6 +638,12 @@ void processUart1Message(SEMP_PARSE_STATE *parse, uint16_t type)
633
638
systemPrintf (" %s %s, 0x%04x (%d) bytes\r\n " , parse->parserName , parserNames[type], parse->length ,
634
639
parse->length );
635
640
break ;
641
+
642
+ case RTK_SBF_PARSER_INDEX:
643
+ message = sempSbfGetBlockNumber (parse);
644
+ systemPrintf (" %s %s %d, 0x%04x (%d) bytes\r\n " , parse->parserName , parserNames[type], message,
645
+ parse->length , parse->length );
646
+ break ;
636
647
}
637
648
}
638
649
@@ -678,6 +689,12 @@ void processUart1Message(SEMP_PARSE_STATE *parse, uint16_t type)
678
689
nmeaExtractStdDeviations ((char *)parse->buffer , parse->length );
679
690
}
680
691
692
+ // Facet Flex mosaic - pass the SBF to processUart1SBF
693
+ if ((present.gnss_mosaicX5 ) && (productVariant == RTK_FLEX) && (type == RTK_SBF_PARSER_INDEX))
694
+ {
695
+ processUart1SBF (parse, type);
696
+ }
697
+
681
698
// Determine where to send RTCM data
682
699
if (inBaseMode () && type == RTK_RTCM_PARSER_INDEX)
683
700
{
@@ -694,7 +711,7 @@ void processUart1Message(SEMP_PARSE_STATE *parse, uint16_t type)
694
711
if ((present.gnss_lg290p ) && (pointPerfectIsEnabled ()) && (mqttClientIsConnected () == true ))
695
712
usingPPL = true ;
696
713
// mosaic-X5 : Determine if we want to use corrections
697
- if ((present.gnss_mosaicX5 ) && (pointPerfectIsEnabled ()))
714
+ if ((present.gnss_mosaicX5 ) && (pointPerfectLbandNeeded ()))
698
715
usingPPL = true ;
699
716
700
717
if (usingPPL)
@@ -792,6 +809,14 @@ void processUart1Message(SEMP_PARSE_STATE *parse, uint16_t type)
792
809
parse->length = 0 ;
793
810
}
794
811
812
+ // Suppress SBF messages from mosaic. Not needed by end GIS apps.
813
+ if (type == RTK_SBF_PARSER_INDEX)
814
+ {
815
+ // Erase buffer
816
+ parse->buffer [0 ] = 0 ;
817
+ parse->length = 0 ;
818
+ }
819
+
795
820
// Determine if this message will fit into the ring buffer
796
821
bytesToCopy = parse->length ;
797
822
space = availableHandlerSpace;
0 commit comments