49 int main(
int argc,
char *argv[]) {
52 fprintf(stderr,
"Usage: %s <file>\n", argv[0]);
57 FILE *testFile = fopen(argv[1],
"r");
58 if ((testFile == NULL) || errno) {
59 fprintf(stderr,
"Unable to open test file %s\n", argv[1]);
67 while (!(feof(testFile) || exit == 1)) {
73 if (f == NULL) {
return -1; }
74 if (strncmp(tmp.
message,
"ZDA", 3) == 0) {
83 fprintf(stdout,
"%s", asctime(t));
109 fprintf(stdout,
"%d messages read\n", count);
int main(int argc, char *argv[])
bool nmea_readMessage(int handle, nmea_msg_t *out)
Static wrapper around mp_readMessage_buf.
struct tm * nmea_parse_zda(const nmea_msg_t *msg)
Get date/time from NMEA ZDA message.
strarray * nmea_parse_fields(const nmea_msg_t *nmsg)
Parse raw data into fields.
void sa_destroy(strarray *sa)
Destroy array and contents.
Generic NMEA message structure.
char message[3]
Message ID.