5 #include "oXs_config_basic.h"
6 #include "oXs_config_advanced.h"
7 #include "oXs_config_macros.h"
11 // from the UBlox6 document, the largest payout we receive i the NAV-SVINFO and the payload size
12 // is calculated as 8 + 12*numCh. numCh in the case of a Glonass receiver is 28.
13 #define UBLOX_PAYLOAD_SIZE 344 // 344 is the absolute max size
14 #define UBLOX_BUFFER_SIZE 50 // but the message that we read should not exceed about 50 bytes
17 //typedef struct { // not used I think
26 uint32_t time
; // GPS msToW
27 int32_t longitude
; // in degree with 7 decimals
28 int32_t latitude
; // in degree with 7 decimals
29 int32_t altitude_ellipsoid
; // in mm
30 int32_t altitude_msl
; // in mm
31 uint32_t horizontal_accuracy
;
32 uint32_t vertical_accuracy
; // in mm
36 uint32_t time
; // GPS msToW
39 uint8_t differential_status
;
41 uint32_t time_to_first_fix
;
42 uint32_t uptime
; // milliseconds
54 uint32_t position_accuracy_3d
;
55 int32_t ecef_x_velocity
;
56 int32_t ecef_y_velocity
;
57 int32_t ecef_z_velocity
;
58 uint32_t speed_accuracy
;
59 uint16_t position_DOP
;
78 uint8_t additional_flags
;
83 int32_t height_above_sea_level
;
84 uint32_t hacc
; // horizontal accuracy
85 uint32_t vacc
; // vertical accuracy
86 int32_t velocity_noord
;
87 int32_t velocity_east
;
88 int32_t velocity_down
;
89 int32_t gspeed_2d_mm
; // speed 2D in mm/sec
91 uint32_t speed_accuracy
;
92 uint32_t head_accuracy
;
93 uint16_t position_DOP
;
96 int32_t head_velocity
;
97 int16_t magnetic_declination
;
98 uint16_t magnetic_accuracy
;
103 uint32_t time
; // GPS msToW
110 uint32_t speed_accuracy
;
111 uint32_t heading_accuracy
;
115 uint8_t chn
; // Channel number, 255 for SVx not assigned to channel
116 uint8_t svid
; // Satellite ID
117 uint8_t flags
; // Bitmask
118 uint8_t quality
; // Bitfield
119 uint8_t cno
; // Carrier to Noise Ratio (Signal Strength) // dbHz, 0-55.
120 uint8_t elev
; // Elevation in integer degrees
121 int16_t azim
; // Azimuth in integer degrees
122 int32_t prRes
; // Pseudo range residual in centimetres
123 } ubx_nav_svinfo_channel
;
126 uint32_t time
; // GPS Millisecond time of week
127 uint8_t numCh
; // Number of channels
128 uint8_t globalFlags
; // Bitmask, Chip hardware generation 0:Antaris, 1:u-blox 5, 2:u-blox 6
129 uint16_t reserved2
; // Reserved
130 ubx_nav_svinfo_channel channel
[16]; // 16 satellites * 12 byte
133 #if defined(GPS_TRANSMIT_TIME)
135 uint32_t time
; // GPS msToW
148 // GPS codes that could be used
149 #define PREAMBLE1 0xb5
150 #define PREAMBLE2 0x62
151 #define CLASS_NAV 0x01
152 #define CLASS_ACK 0x05
153 #define CLASS_CFG 0x06
154 #define MSG_ACK_NACK 0x00
155 #define MSG_ACK_ACK 0x01
156 #define MSG_POSLLH 0x2
157 #define MSG_STATUS 0x3
158 #define MSG_SOL 0x6 // not supported in ublox10
159 #define MSG_PVT 0x7 // not supported in ublox6
160 #define MSG_VELNED 0x12
161 #if defined GPS_TRANSMIT_TIME
162 #define MSG_TIMEUTC 0x21
164 #define MSG_SVINFO 0x30
165 #define MSG_CFG_PRT 0x00
166 #define MSG_CFG_RATE 0x08
167 #define MSG_CFG_SET_RATE 0x01
168 #define MSG_CFG_NAV_SETTINGS 0x24
171 #define FIX_DEAD_RECKONING 1
174 #define FIX_GPS_DEAD_RECKONING 4
177 #define NAV_STATUS_FIX_VALID 1
185 OXS_GPS( HardwareSerial
&print
);
187 OXS_GPS( uint8_t x
);
191 // void OXS_GPS::_update_checksum(uint8_t *data, uint8_t len, uint8_t *ck_a, uint8_t *ck_b) ;
192 bool UBLOX_parse_gps(void) ;
193 bool gpsNewFrameUBLOX(uint8_t data
) ;
198 HardwareSerial
* printer
;