File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -88,6 +88,13 @@ const char * userParserStateName(const SEMP_PARSE_STATE *parse)
8888 return nullptr ;
8989}
9090
91+ // Return the message number value
92+ uint32_t userParserGetMessageNumber (const SEMP_PARSE_STATE *parse)
93+ {
94+ USER_SCRATCH_PAD *scratchPad = (USER_SCRATCH_PAD *)parse->scratchPad ;
95+ return scratchPad->messageNumber ;
96+ }
97+
9198// ----------------------------------------
9299// Constants
93100// ----------------------------------------
@@ -204,15 +211,14 @@ void loop()
204211// Process a complete message incoming from parser
205212void userMessage (SEMP_PARSE_STATE *parse, uint16_t type)
206213{
207- USER_SCRATCH_PAD *scratchPad = (USER_SCRATCH_PAD *)parse->scratchPad ;
208214 static bool displayOnce = true ;
209215 uint32_t offset;
210216
211217 // Display the raw message
212218 Serial.println ();
213219 offset = dataOffset + 1 - parse->length ;
214220 Serial.printf (" Valid Message %d, %d bytes at 0x%08x (%d)\r\n " ,
215- scratchPad-> messageNumber , parse->length , offset, offset);
221+ userParserGetMessageNumber (parse) , parse->length , offset, offset);
216222 dumpBuffer (parse->buffer , parse->length );
217223
218224 // Display the parser state
You can’t perform that action at this time.
0 commit comments