
/*
 * nmea.h
 *
 *  Created on: 6 Sep 2020
 *      Author: mike
 */

#ifndef INC_NMEA_H_
#define INC_NMEA_H_
#include <ctype.h>
#include <time.h>

#include "libSerial/serial.h"

#if !defined (__cplusplus)
#if !defined true
#define true 1
#define false !(true)
#endif

typedef unsigned char bool;
#endif
#ifdef __cplusplus
extern "C" {
#endif


typedef struct
{
  char valid;
  char time[6];
  char date[8];
  bool good;
  char ew;
  char ns;
  float lat;
  float lon;
  float heading;
  float speed;
  struct tm tv;
  time_t utc;
} Location;

extern bool
updateLocation (Location *loc ,  usart_ctl * uc);

#ifdef __cplusplus
}
#endif

#endif /* INC_NMEA_H_ */
