Tezzeret  1
Tezzeret
GmTivaGpsUartSensor.hpp
1 /*
2  * GmTivaGpsUart.hpp
3  *
4  * Created on: May 10, 2016
5  * Author: rcram
6  */
7 
8 
9 #ifndef GM_TIVA_GPS_UART_SENSOR_HPP_
10 #define GM_TIVA_GPS_UART_SENSOR_HPP_
11 
12 /* RTOS Driver Header files */
13 //#include <ti/drivers/UART.h>
14 //#include <ti/drivers/GPIO.h>
15 
16 #include <GmBufferedSensor.hpp>
17 
18 #ifndef GMMFAMDATA_HPP_
19 #include <GmMfamData.hpp>
20 #endif
21 #include <GmError.hpp>
22 
23 #include <GmRingBuffer.hpp>
24 #include <GmManagedRingBuffer.hpp>
25 #include <GmChildRingBuffer.hpp>
26 #include "GmUartLineSensor.hpp"
27 #include <ti/sysbios/knl/Clock.h>
28 
29 
30 // TODO RHC write some code to analyze the correct number
31 // of buffers in the circle.
32 
33 #define GPS_STRING_SIZE 100
34 typedef char GpsString[GPS_STRING_SIZE+2];
35 
36 typedef struct _IndexedGpsString
37 {
38  uint64_t m_uiIndex;
39  GpsString m_gsData;
41 
42 #define COUNT_GPS_UART_BUFFERS 5// Not sure this is really a global thing.
43 
44 // ========== Master records for GPS meta data ==============================
45 #define GM_GPS_RMC_RAW_DATA01 GM_DATA_DOMAIN_LOCATION | 0x01
46 #define GM_GPS_INDEXED_STRING_WITH_HEADER_01 GM_DATA_DOMAIN_LOCATION | 0x02
47 
49  DWORD m_dwRecordType;
50  UInt32 m_uRecordSize;
51  IndexedGpsString m_igsData;
53 
54 namespace Geometrics
55 {
57  {
58  public:
59  CTivaGpsUartSensor (UInt8 iSubject,
61  virtual int Initialize (int iBoardID) = 0;
62  virtual Void OnPreProcessUartString (char* pscString);
63  virtual int WriteToStorage (UInt32 ui32Topic,
64  char *pData,
65  UInt32 iSize,
66  GmStorage *psStorage,
67  UInt32 ui32FormatId);
68  int TimeSinceLastGga ();
69  int TimeSinceLastRmc ();
70  double LastHorizontalDilutionOfPrecision ();
71  uint8_t LastFixQuality ();
72 
73  long m_iLastGpgga,
74  m_iLastGprmc;
75  uint8_t mLastFixQuality;
76  double m_dLastHorizontalDilutionOfPrecision;
77  uint32_t m_uiScaleTicksToSeconds;
78 
79  static double convertGpsPseudoFloat(double dPseudoFloat);
80  virtual int ConvertToCustomRecord (UInt8 *pscUartData,
81  UInt8 *pcCustomRecordBuffer);
82  };
83 
84 } // End namespace Geometrics
85 
86 #endif
Definition: GmTivaGpsUartSensor.hpp:57
virtual int WriteToStorage(UInt32 ui32Topic, char *pData, UInt32 iSize, GmStorage *psStorage, UInt32 ui32FormatId)
Definition: GmTivaGpsUartSensor.cpp:71
Definition: GmStorage.hpp:81
Definition: GmUartLineSensor.hpp:32
GmApp/GmLoggingApp.hpp>
Definition: Analogs.hpp:47
Definition: GmTivaGpsUartSensor.hpp:37
Definition: GmTivaGpsUartSensor.hpp:48