Subversion Repositories libNMEA

Rev

Rev 1 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. /*
  2.  * nmea.h
  3.  *
  4.  *  Created on: 6 Sep 2020
  5.  *      Author: mike
  6.  */
  7.  
  8. #ifndef INC_NMEA_H_
  9. #define INC_NMEA_H_
  10. #include <ctype.h>
  11. #include <time.h>
  12.  
  13. #include "libSerial/serial.h"
  14.  
  15. #if !defined (__cplusplus)
  16. #if !defined true
  17. #define true 1
  18. #define false !(true)
  19. #endif
  20.  
  21. typedef unsigned char bool;
  22. #endif
  23. #ifdef __cplusplus
  24. extern "C" {
  25. #endif
  26.  
  27.  
  28. typedef struct
  29. {
  30.   char valid;
  31.   char time[6];
  32.   char date[8];
  33.   bool good;
  34.   char ew;
  35.   char ns;
  36.   float lat;
  37.   float lon;
  38.   float heading;
  39.   float speed;
  40.   struct tm tv;
  41.   time_t utc;
  42. } Location;
  43.  
  44. // returns true when it gets an RMC based position
  45. typedef uint8_t  (*nmeaCallback)(uint8_t* buffer, uint16_t cnt);
  46.  
  47. extern bool
  48. updateLocation (Location *loc ,  usart_ctl * uc);
  49.  
  50. // set a callback
  51. extern void setRmcCallback(nmeaCallback callback);
  52.  
  53.  
  54.  
  55. #ifdef __cplusplus
  56. }
  57. #endif
  58.  
  59. #endif /* INC_NMEA_H_ */
  60.