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)
88
88
return nullptr ;
89
89
}
90
90
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
+
91
98
// ----------------------------------------
92
99
// Constants
93
100
// ----------------------------------------
@@ -204,15 +211,14 @@ void loop()
204
211
// Process a complete message incoming from parser
205
212
void userMessage (SEMP_PARSE_STATE *parse, uint16_t type)
206
213
{
207
- USER_SCRATCH_PAD *scratchPad = (USER_SCRATCH_PAD *)parse->scratchPad ;
208
214
static bool displayOnce = true ;
209
215
uint32_t offset;
210
216
211
217
// Display the raw message
212
218
Serial.println ();
213
219
offset = dataOffset + 1 - parse->length ;
214
220
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);
216
222
dumpBuffer (parse->buffer , parse->length );
217
223
218
224
// Display the parser state
You can’t perform that action at this time.
0 commit comments