|
21 | 21 | Connect a dual or triband GNSS antenna: https://www.sparkfun.com/products/21801 |
22 | 22 | */ |
23 | 23 |
|
24 | | -int pin_UART_TX = 4; |
25 | | -int pin_UART_RX = 13; |
26 | | - |
27 | 24 | #include <SparkFun_Unicore_GNSS_Arduino_Library.h> //http://librarymanager/All#SparkFun_Unicore_GNSS |
28 | 25 | #include <SparkFun_Extensible_Message_Parser.h> //http://librarymanager/All#SparkFun_Extensible_Message_Parser |
29 | 26 |
|
30 | 27 | //---------------------------------------- |
31 | 28 | // Constants |
32 | 29 | //---------------------------------------- |
33 | 30 |
|
| 31 | +#define pin_UART_TX 4 |
| 32 | +#define pin_UART_RX 13 |
| 33 | + |
34 | 34 | // Build the table listing all of the parsers |
35 | 35 | SEMP_PARSE_ROUTINE const parserTable[] = |
36 | 36 | { |
@@ -61,11 +61,12 @@ void setup() |
61 | 61 | Serial.println("SparkFun UM980 Example"); |
62 | 62 |
|
63 | 63 | // 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"); |
67 | 67 | if (!parse) |
68 | 68 | reportFatalError("Failed to initialize the parser"); |
| 69 | + sempEnableDebugOutput(parse); |
69 | 70 |
|
70 | 71 | //We must start the serial port before using it in the library |
71 | 72 | SerialGNSS.begin(115200, SERIAL_8N1, pin_UART_RX, pin_UART_TX); |
@@ -102,15 +103,9 @@ void loop() |
102 | 103 | sempParseNextByte(parse, SerialGNSS.read()); |
103 | 104 | } |
104 | 105 |
|
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 | | - |
111 | 106 | // Call back from within parser, for end of message |
112 | 107 | // 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) |
114 | 109 | { |
115 | 110 | SEMP_SCRATCH_PAD *scratchPad = (SEMP_SCRATCH_PAD *)parse->scratchPad; |
116 | 111 | static bool displayOnce = true; |
|
0 commit comments