Skip to content

Commit a1bc256

Browse files
authored
Merge pull request #25 from LeeLeahy2/unicore-header
Expose the Unicore header data structure to the application layer
2 parents 8965e9b + 16b55e4 commit a1bc256

File tree

3 files changed

+27
-31
lines changed

3 files changed

+27
-31
lines changed

src/Parse_NMEA.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,5 +229,7 @@ const char * sempNmeaGetStateName(const SEMP_PARSE_STATE *parse)
229229
return "sempNmeaChecksumByte2";
230230
if (parse->state == sempNmeaLineTermination)
231231
return "sempNmeaLineTermination";
232+
if (parse->state == sempNmeaHashPreamble)
233+
return "sempNmeaHashPreamble";
232234
return nullptr;
233235
}

src/Parse_Unicore.cpp

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -15,37 +15,6 @@ should need to be listed in SparkFun_Extensible_Message_Parser.h.
1515
#include "SparkFun_Extensible_Message_Parser.h"
1616
#include "semp_crc32.h"
1717

18-
//----------------------------------------
19-
// Constants
20-
//----------------------------------------
21-
22-
#define UNICORE_HEADER_LENGTH ((uint16_t)24)
23-
#define UNICORE_OFFSET_HEADER_MESSAGE_LENGTH ((uint16_t)6)
24-
25-
//----------------------------------------
26-
// Structure definitions
27-
//----------------------------------------
28-
29-
typedef struct _SEMP_UNICORE_HEADER
30-
{
31-
uint8_t syncA; // 0xaa
32-
uint8_t syncB; // 0x44
33-
uint8_t syncC; // 0xb5
34-
uint8_t cpuIdlePercent; // CPU Idle Percentage 0-100
35-
uint16_t messageId; // Message ID
36-
uint16_t messageLength; // Message Length
37-
uint8_t referenceTime; // Reference time(GPST or BDST)
38-
uint8_t timeStatus; // Time status
39-
uint16_t weekNumber; // Reference week number
40-
uint32_t secondsOfWeek; // GPS seconds from the beginning of the
41-
// reference week, accurate to the millisecond
42-
uint32_t RESERVED;
43-
44-
uint8_t releasedVersion; // Release version
45-
uint8_t leapSeconds; // Leap sec
46-
uint16_t outputDelayMSec; // Output delay time, ms
47-
} SEMP_UNICORE_HEADER;
48-
4918
//----------------------------------------
5019
// Support routines
5120
//----------------------------------------

src/SparkFun_Extensible_Message_Parser.h

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,31 @@ typedef struct _SEMP_PARSE_STATE
115115
// parserCount means searching for preamble
116116
} SEMP_PARSE_STATE;
117117

118+
//----------------------------------------
119+
// Protocol specific types
120+
//----------------------------------------
121+
122+
// Define the Unicore message header
123+
typedef struct _SEMP_UNICORE_HEADER
124+
{
125+
uint8_t syncA; // 0xaa
126+
uint8_t syncB; // 0x44
127+
uint8_t syncC; // 0xb5
128+
uint8_t cpuIdlePercent; // CPU Idle Percentage 0-100
129+
uint16_t messageId; // Message ID
130+
uint16_t messageLength; // Message Length
131+
uint8_t referenceTime; // Reference time(GPST or BDST)
132+
uint8_t timeStatus; // Time status
133+
uint16_t weekNumber; // Reference week number
134+
uint32_t secondsOfWeek; // GPS seconds from the beginning of the
135+
// reference week, accurate to the millisecond
136+
uint32_t RESERVED;
137+
138+
uint8_t releasedVersion; // Release version
139+
uint8_t leapSeconds; // Leap sec
140+
uint16_t outputDelayMSec; // Output delay time, ms
141+
} SEMP_UNICORE_HEADER;
142+
118143
//----------------------------------------
119144
// Support routines
120145
//----------------------------------------

0 commit comments

Comments
 (0)