Tezzeret  1
Tezzeret
GmLocation.hpp
1 #ifndef GM_LOCATION_HPP_
2 #define GM_LOCATION_HPP_
3 
4 #include <geotypes.hpp>
5 #include <GmMeta.hpp>
6 
7 #ifdef acs
8 #include <xdc/std.h>
9 #endif
10 
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
14 
15 /****************************** Data formats **************************************/
16 #define GM_GPS_FORMAT_SIMPLE_TEXT_01 (GM_DATA_DOMAIN_LOCATION | 0x01)
17 #define GM_GPS_FORMAT_LEGACY_TEXT (GM_DATA_DOMAIN_LOCATION | 0x02)
18 
19 /****************************************************************************/
20 /* Basic typed and sized data record for binary transmission of GPS data. */
21 /****************************************************************************/
22 #define GM_GPS_FORMAT_BINARY (GM_DATA_DOMAIN_LOCATION | 0x03)
23 
24 #define GM_GEOMETRY_4_3D_POINTS (GM_DATA_DOMAIN_LOCATION | 0x04)
25 
26 /***************************************************************************/
27 /* Typed and sized data record for binary transmission of GPS data, along */
28 /* with the original text sentence from the GPS. */
29 /***************************************************************************/
30 #define GM_GPS_FORMAT_BINARY_WITH_SENTENCE (GM_DATA_DOMAIN_LOCATION | 0x05)
31 #define GM_GPS_TIMESTAMPED (GM_DATA_DOMAIN_LOCATION | 0x06)
32 
33 #define NO_LOCATION_SOURCE 0
34 #define GPGGA_STRING 1
35 #define GPRMC_STRING 2
36 #define ERROR_LOCATION_SOURCE 3
37 #define NO_FIX_YET 4
38 #define GNGGA_STRING 5
39 #define GNRMC_STRING 6
40 
41 
42 /* This structure contains most of the GPS information. When transmitted
43  * over the network, it's part of a larger structure, with different offsets.
44  * When part of GM_GPS_FORMAT_BINARY or _GeoGpsRecordWithString add 16 to offsets. */
45 PACKED_PRAGMA
46 struct PACKED_SPEC _GeoGpsDatum
47 {
48  double m_dLatitude, // Offset 0
49  m_dLongitude, // 8
50  m_dAltitude, // 16
51  m_dGeoid, //24
52  m_dSeconds, //32
53  m_dHorizontalDilutionOfPrecision, // 40
54  m_dSpeedOverGround, // 48
55  m_dTrackAngle, // 56
56  m_dMagneticVariation; // 64
57  UInt8 m_iHour, // 72
58  m_iMinute, // 73
59  m_iYear, // 74
60  m_iMonth, // 75
61  m_iDay, // 76
62  m_iLatitudeHemisphere, // 77
63  m_iLongitudeHemisphere, // 78
64  m_iNumberSatellitesUsed, // 79
65  m_iFixQuality, // 80
66  m_iMagneticVariationDirection, // 81
67  m_iModeIndicator, // 82
68  m_iSource; // 83 size 1
69  int m_iSecondsSinceLastDiffGps; // Offset 84, size 4.
70  char m_differentialGpsStationId[8]; // Offset 88, size 8, total record size 96
71 } ALIGN_4_SPEC;
72 
73 PACKED_PRAGMA
74 struct PACKED_SPEC _GeoIndexedGpsDatum
75 {
76  uint64_t m_ui64PacketIndex; // Offset 0
77  struct _GeoGpsDatum m_ggdGpsDatum; // Offset 8, size 96.
78  // Total size = 104
79 } ALIGN_4_SPEC;
80 
81 PACKED_PRAGMA
82 struct PACKED_SPEC _GeoGpsRecord
83 {
84  int m_iRecordType; // Offset 0
85  int m_iRecordSize; // Offset 4
86  struct _GeoIndexedGpsDatum m_Datum; // Offset 8, size 104
87  // Total size 112
88 } ALIGN_4_SPEC;
89 
90 PACKED_PRAGMA
91 struct PACKED_SPEC _GeoGpsRecordWithString
92 {
93  // If this is used, recordtype will be GM_GPS_FORMAT_BINARY_WITH_SENTENCE and size will be for the RecordWithString.
94  struct _GeoGpsRecord m_Record; // Offset 0, size 112
95  char m_strOriginalString[100]; // Offset 112, size 100, total record size 212
96 } ALIGN_4_SPEC;
97 
98 PACKED_PRAGMA
99 struct PACKED_SPEC _GpsTimestamped
100 {
101  // In this case, the recordType will be for the timestamped
102  struct _GeoGpsRecordWithString mBaseRecord;
103  // Offset 0, size 212
104  uint64_t mTimestamp;
105 } GpsTimestamped ALIGN_4_SPEC;
106 
107 
108 #define GEOMETRY_LEFT_OFFSET_INDEX 0
109 #define GEOMETRY_FORWARD_OFFSET_INDEX 1
110 #define GEOMETRY_Z_OFFSET_INDEX 2
111 
112 PACKED_PRAGMA
113 struct PACKED_SPEC Geometry4Points
114 {
115  int m_dataType; // Data type = GM_GEOMETRY_4_3D_POINTS
116  int m_recordSize; // = 56 (sizeof this record)
117  float m_offsets[4][3];
118 };
119 
120 
121 #ifdef __cplusplus
122 }
123 #endif
124 
125 #endif /* GMMETA_HPP_ */
Definition: GmLocation.hpp:114
Definition: GmLocation.hpp:47
Definition: GmLocation.hpp:92
Definition: GmLocation.hpp:83
Definition: GmLocation.hpp:75
Definition: GmLocation.hpp:100