Skip to content

Commit 3017767

Browse files
authored
Merge pull request #8 from LeeLeahy2/ex-5
Example 5: Update the calls to the SparkFun Extensible Message Parser
2 parents e316a67 + 4fe4257 commit 3017767

File tree

1 file changed

+8
-13
lines changed

1 file changed

+8
-13
lines changed

examples/Example5_EnableRTCM/Example5_EnableRTCM.ino

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,16 @@
2121
Connect a dual or triband GNSS antenna: https://www.sparkfun.com/products/21801
2222
*/
2323

24-
int pin_UART_TX = 4;
25-
int pin_UART_RX = 13;
26-
2724
#include <SparkFun_Unicore_GNSS_Arduino_Library.h> //http://librarymanager/All#SparkFun_Unicore_GNSS
2825
#include <SparkFun_Extensible_Message_Parser.h> //http://librarymanager/All#SparkFun_Extensible_Message_Parser
2926

3027
//----------------------------------------
3128
// Constants
3229
//----------------------------------------
3330

31+
#define pin_UART_TX 4
32+
#define pin_UART_RX 13
33+
3434
// Build the table listing all of the parsers
3535
SEMP_PARSE_ROUTINE const parserTable[] =
3636
{
@@ -61,11 +61,12 @@ void setup()
6161
Serial.println("SparkFun UM980 Example");
6262

6363
// Initialize the parser
64-
parse = sempInitParser(parserTable, parserCount,
65-
parserNames, parserNameCount,
66-
0, 3000, processMessage, "RTCM_Test");
64+
parse = sempBeginParser(parserTable, parserCount,
65+
parserNames, parserNameCount,
66+
0, 3000, processMessage, "RTCM_Test");
6767
if (!parse)
6868
reportFatalError("Failed to initialize the parser");
69+
sempEnableDebugOutput(parse);
6970

7071
//We must start the serial port before using it in the library
7172
SerialGNSS.begin(115200, SERIAL_8N1, pin_UART_RX, pin_UART_TX);
@@ -102,15 +103,9 @@ void loop()
102103
sempParseNextByte(parse, SerialGNSS.read());
103104
}
104105

105-
// Output a line of text for the SparkFun Extensible Message Parser
106-
void sempExtPrintLineOfText(const char *string)
107-
{
108-
Serial.println(string);
109-
}
110-
111106
// Call back from within parser, for end of message
112107
// Process a complete message incoming from parser
113-
void processMessage(SEMP_PARSE_STATE *parse, uint8_t type)
108+
void processMessage(SEMP_PARSE_STATE *parse, uint16_t type)
114109
{
115110
SEMP_SCRATCH_PAD *scratchPad = (SEMP_SCRATCH_PAD *)parse->scratchPad;
116111
static bool displayOnce = true;

0 commit comments

Comments
 (0)