This repository has been archived by the owner on Nov 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 104
/
Copy pathu_gnss_dec_ubx_nav_hpposllh.h
159 lines (140 loc) · 6.55 KB
/
u_gnss_dec_ubx_nav_hpposllh.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
/*
* Copyright 2019-2024 u-blox
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef _U_GNSS_DEC_UBX_NAV_HPPOSLLH_H_
#define _U_GNSS_DEC_UBX_NAV_HPPOSLLH_H_
/* Only header files representing a direct and unavoidable
* dependency between the API of this module and the API
* of another module should be included here; otherwise
* please keep #includes to your .c files. */
/** \addtogroup _GNSS
* @{
*/
/** @file
* @brief This header file defines the types of a UBX-NAV-HPPOSLLH
* message.
*/
#ifdef __cplusplus
extern "C" {
#endif
/* ----------------------------------------------------------------
* COMPILE-TIME MACROS
* -------------------------------------------------------------- */
/** The message class of a UBX-NAV-HPPOSLLH message.
*/
#define U_GNSS_DEC_UBX_NAV_HPPOSLLH_MESSAGE_CLASS 0x01
/** The message ID of a UBX-NAV-HPPOSLLH message.
*/
#define U_GNSS_DEC_UBX_NAV_HPPOSLLH_MESSAGE_ID 0x14
/** The minimum length of the body of a UBX-NAV-HPPOSLLH message.
*/
#define U_GNSS_DEC_UBX_NAV_HPPOSLLH_BODY_MIN_LENGTH 36
/* ----------------------------------------------------------------
* TYPES
* -------------------------------------------------------------- */
/** Bit fields of the "flags" field of #uGnssDecUbxNavHpposllh_t; use
* these to mask specific bits, e.g.
*
* `if (flags & (1 << U_GNSS_DEC_UBX_NAV_HPPOSLLH_FLAGS_INVALID_LLH)) {`
*
* ...would determine if the lon, lat, height, hMSL, lonHp, latHp,
* heightHp and hMSLHp fields are invalid.
*/
typedef enum {
U_GNSS_DEC_UBX_NAV_HPPOSLLH_FLAGS_INVALID_LLH = 0 /**< the lon, lat,
height, hMSL,
lonHp, latHp,
heightHp and
hMSLHp fields
are invalid. */
} uGnssDecUbxNavHpposllhFlags_t;
/** UBX-NAV-HPPOSLLH message structure; the naming and type of each
* element follows that of the interface manual.
*/
typedef struct {
uint8_t version; /**< message version. */
uint8_t flags; /**< see #uGnssDecUbxNavHpposllhFlags_t. */
uint32_t iTOW; /**< GPS time of week of the navigation epoch
in milliseconds. */
int32_t lon; /**< longitude in degrees times 1e7; to get
high precision position from this
structure as a whole, see
uGnssDecUbxNavHpposllhGetPos(). */
int32_t lat; /**< latitude in degrees times 1e7; to get
high precision position from this
structure as a whole, see
uGnssDecUbxNavHpposllhGetPos(). */
int32_t height; /**< height above ellipsoid in mm; to get
high precision position from this
structure as a whole, see
uGnssDecUbxNavHpposllhGetPos(). */
int32_t hMSL; /**< height above mean sea level in mm; to get
high precision position from this
structure as a whole, see
uGnssDecUbxNavHpposllhGetPos(). */
int8_t lonHp; /**< high precision component of longitude;
add this to lon to get longitude in
degrees times 1e9, or alternatively
call uGnssDecUbxNavHpposllhGetPos() on
this structure to do it for you. */
int8_t latHp; /**< high precision component of latitude; add
this to lat to get latitude in degrees
times 1e9, or alternatively call
uGnssDecUbxNavHpposllhGetPos() on
this structure to do it for you. */
int8_t heightHp; /**< high precision component of height above
ellipsoid; add this to height to get
height in tenths of a mm, or alternatively
call uGnssDecUbxNavHpposllhGetPos() on
this structure to do it for you. */
int8_t hMSLHp; /**< high precision component of height above
mean sea level; add this to hMSL to get
hMSL in tenths of a mm, or alternatively
call uGnssDecUbxNavHpposllhGetPos() on
this structure to do it for you. */
uint32_t hAcc; /**< horizontal accuracy estimate in mm. */
uint32_t vAcc; /**< vertical accuracy estimate in mm. */
} uGnssDecUbxNavHpposllh_t;
/** High precision position; may be populated by calling
* uGnssDecUbxNavHpposllhGetPos() on #uGnssDecUbxNavHpposllh_t.
*/
typedef struct {
int64_t longitudeX1e9; /**< longitude in degrees times 1e9. */
int64_t latitudeX1e9; /**< latitude in degrees times 1e9. */
int64_t heightMillimetresX1e1; /**< height above ellipsoid in 10ths
of a millimetre. */
int64_t heightMeanSeaLevelMillimetresX1e1; /**< height above mean sea level
in 10ths of a millimetre. */
} uGnssDecUbxNavHpposllhPos_t;
/* ----------------------------------------------------------------
* FUNCTIONS: HELPERS
* -------------------------------------------------------------- */
/** Derive a high precision position structure from the components
* of #uGnssDecUbxNavHpposllh_t.
*
* @param[in] pHpposllh a pointer to a #uGnssDecUbxNavHpposllh_t
* structure returned by pUGnssDecAlloc();
* cannot be NULL.
* @param[out] pPos a pointer to a place to put the high
* precision position; cannot be NULL.
*/
void uGnssDecUbxNavHpposllhGetPos(const uGnssDecUbxNavHpposllh_t *pHpposllh,
uGnssDecUbxNavHpposllhPos_t *pPos);
#ifdef __cplusplus
}
#endif
/** @}*/
#endif // _U_GNSS_DEC_UBX_NAV_HPPOSLLH_H_
// End of file