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
;
66 uint32_t time
; // GPS msToW
73 uint32_t speed_accuracy
;
74 uint32_t heading_accuracy
;
78 uint8_t chn
; // Channel number, 255 for SVx not assigned to channel
79 uint8_t svid
; // Satellite ID
80 uint8_t flags
; // Bitmask
81 uint8_t quality
; // Bitfield
82 uint8_t cno
; // Carrier to Noise Ratio (Signal Strength) // dbHz, 0-55.
83 uint8_t elev
; // Elevation in integer degrees
84 int16_t azim
; // Azimuth in integer degrees
85 int32_t prRes
; // Pseudo range residual in centimetres
86 } ubx_nav_svinfo_channel
;
89 uint32_t time
; // GPS Millisecond time of week
90 uint8_t numCh
; // Number of channels
91 uint8_t globalFlags
; // Bitmask, Chip hardware generation 0:Antaris, 1:u-blox 5, 2:u-blox 6
92 uint16_t reserved2
; // Reserved
93 ubx_nav_svinfo_channel channel
[16]; // 16 satellites * 12 byte
96 // GPS codes that could be used
97 #define PREAMBLE1 0xb5
98 #define PREAMBLE2 0x62
99 #define CLASS_NAV 0x01
100 #define CLASS_ACK 0x05
101 #define CLASS_CFG 0x06
102 #define MSG_ACK_NACK 0x00
103 #define MSG_ACK_ACK 0x01
104 #define MSG_POSLLH 0x2
105 #define MSG_STATUS 0x3
107 #define MSG_VELNED 0x12
108 #define MSG_SVINFO 0x30
109 #define MSG_CFG_PRT 0x00
110 #define MSG_CFG_RATE 0x08
111 #define MSG_CFG_SET_RATE 0x01
112 #define MSG_CFG_NAV_SETTINGS 0x24
115 #define FIX_DEAD_RECKONING 1
118 #define FIX_GPS_DEAD_RECKONING 4
121 #define NAV_STATUS_FIX_VALID 1
129 OXS_GPS( HardwareSerial
&print
);
131 OXS_GPS( uint8_t x
);
135 // void OXS_GPS::_update_checksum(uint8_t *data, uint8_t len, uint8_t *ck_a, uint8_t *ck_b) ;
136 bool UBLOX_parse_gps(void) ;
137 bool gpsNewFrameUBLOX(uint8_t data
) ;
142 HardwareSerial
* printer
;