3 /* @(#) $Header: /pub/NetBSD/misc/repositories/cvsroot/src/dist/ntp/ntpd/jupiter.h,v 1.2 2003/12/04 16:23:37 drochner Exp $ (LBL) */
6 * Rockwell Jupiter GPS receiver definitions
8 * This is all based on the "Zodiac GPS Receiver Family Designer's
12 #define JUPITER_SYNC 0x81ff /* sync word (book says 0xff81 !?!?) */
13 #define JUPITER_ALL 0xffff /* disable all output messages */
15 /* Output messages (sent by the Jupiter board) */
16 #define JUPITER_O_GPOS 1000 /* geodetic position status */
17 #define JUPITER_O_EPOS 1001 /* ECEF position status */
18 #define JUPITER_O_CHAN 1002 /* channel summary */
19 #define JUPITER_O_VIS 1003 /* visible satellites */
20 #define JUPITER_O_DGPS 1005 /* differential GPS status */
21 #define JUPITER_O_MEAS 1007 /* channel measurement */
22 #define JUPITER_O_ID 1011 /* receiver id */
23 #define JUPITER_O_USER 1012 /* user-settings output */
24 #define JUPITER_O_TEST 1100 /* built-in test results */
25 #define JUPITER_O_MARK 1102 /* measurement time mark */
26 #define JUPITER_O_PULSE 1108 /* UTC time mark pulse output */
27 #define JUPITER_O_PORT 1130 /* serial port com parameters in use */
28 #define JUPITER_O_EUP 1135 /* EEPROM update */
29 #define JUPITER_O_ESTAT 1136 /* EEPROM status */
31 /* Input messages (sent to the Jupiter board) */
32 #define JUPITER_I_PVTINIT 1200 /* geodetic position and velocity */
33 #define JUPITER_I_USER 1210 /* user-defined datum */
34 #define JUPITER_I_MAPSEL 1211 /* map datum select */
35 #define JUPITER_I_ELEV 1212 /* satellite elevation mask control */
36 #define JUPITER_I_CAND 1213 /* satellite candidate select */
37 #define JUPITER_I_DGPS 1214 /* differential GPS control */
38 #define JUPITER_I_COLD 1216 /* cold start control */
39 #define JUPITER_I_VALID 1217 /* solution validity criteria */
40 #define JUPITER_I_ALT 1219 /* user-entered altitude input */
41 #define JUPITER_I_PLAT 1220 /* application platform control */
42 #define JUPITER_I_NAV 1221 /* nav configuration */
43 #define JUPITER_I_TEST 1300 /* preform built-in test command */
44 #define JUPITER_I_RESTART 1303 /* restart command */
45 #define JUPITER_I_PORT 1330 /* serial port com parameters */
46 #define JUPITER_I_PROTO 1331 /* message protocol control */
47 #define JUPITER_I_RDGPS 1351 /* raw DGPS RTCM SC-104 data */
50 u_short sync
; /* (JUPITER_SYNC) */
51 u_short id
; /* message id */
52 u_short len
; /* number of data short wordss (w/o cksum) */
53 u_char reqid
; /* JUPITER_REQID_MASK bits available as id */
54 u_char flags
; /* flags */
55 u_short hsum
; /* header cksum */
58 #define JUPITER_REQID_MASK 0x3f /* bits available as id */
59 #define JUPITER_FLAG_NAK 0x01 /* negative acknowledgement */
60 #define JUPITER_FLAG_ACK 0x02 /* acknowledgement */
61 #define JUPITER_FLAG_REQUEST 0x04 /* request ACK or NAK */
62 #define JUPITER_FLAG_QUERY 0x08 /* request one shot output message */
63 #define JUPITER_FLAG_LOG 0x20 /* request periodic output message */
64 #define JUPITER_FLAG_CONN 0x40 /* enable periodic message */
65 #define JUPITER_FLAG_DISC 0x80 /* disable periodic message */
67 #define JUPITER_H_FLAG_BITS \
68 "\020\1NAK\2ACK\3REQUEST\4QUERY\5MBZ\6LOG\7CONN\10DISC"
70 /* Log request messages (data payload when using JUPITER_FLAG_LOG) */
72 u_short trigger
; /* if 0, trigger on time trigger on
73 update (e.g. new almanac) */
74 u_short interval
; /* frequency in seconds */
75 u_short offset
; /* offset into minute */
76 u_short dsum
; /* checksum */
79 /* JUPITER_O_GPOS (1000) */
81 u_short stime
[2]; /* set time (10 ms ticks) */
82 u_short seq
; /* sequence number */
83 u_short sseq
; /* sat measurement sequence number */
84 u_short navval
; /* navigation soltuion validity */
85 u_short navtype
; /* navigation solution type */
86 u_short nmeas
; /* # of measurements used in solution */
87 u_short polar
; /* if 1 then polar navigation */
88 u_short gweek
; /* GPS week number */
89 u_short sweek
[2]; /* GPS seconds into week */
90 u_short nsweek
[2]; /* GPS nanoseconds into second */
91 u_short utcday
; /* 1 to 31 */
92 u_short utcmon
; /* 1 to 12 */
93 u_short utcyear
; /* 1980 to 2079 */
94 u_short utchour
; /* 0 to 23 */
95 u_short utcmin
; /* 0 to 59 */
96 u_short utcsec
; /* 0 to 59 */
97 u_short utcnsec
[2]; /* 0 to 999999999 */
98 u_short lat
[2]; /* latitude (radians) */
99 u_short lon
[2]; /* longitude (radians) */
100 u_short height
[2]; /* height (meters) */
101 u_short gsep
; /* geoidal separation */
102 u_short speed
[2]; /* ground speed (meters/sec) */
103 u_short course
; /* true course (radians) */
115 u_short dsum
; /* checksum */
117 #define JUPITER_O_GPOS_NAV_NOALT 0x01 /* altitude used */
118 #define JUPITER_O_GPOS_NAV_NODGPS 0x02 /* no differential GPS */
119 #define JUPITER_O_GPOS_NAV_NOSAT 0x04 /* not enough satellites */
120 #define JUPITER_O_GPOS_NAV_MAXH 0x08 /* exceeded max EHPE */
121 #define JUPITER_O_GPOS_NAV_MAXV 0x10 /* exceeded max EVPE */
123 /* JUPITER_O_CHAN (1002) */
125 u_short stime
[2]; /* set time (10 ms ticks) */
126 u_short seq
; /* sequence number */
127 u_short sseq
; /* sat measurement sequence number */
128 u_short gweek
; /* GPS week number */
129 u_short sweek
[2]; /* GPS seconds into week */
130 u_short gpsns
[2]; /* GPS nanoseconds from epoch */
132 u_short flags
; /* flags */
133 u_short prn
; /* satellite PRN */
134 u_short chan
; /* channel number */
139 /* JUPITER_O_VIS (1003) */
141 u_short stime
[2]; /* set time (10 ms ticks) */
142 u_short seq
; /* sequence number */
143 u_short gdop
; /* best possible GDOP */
144 u_short pdop
; /* best possible PDOP */
145 u_short hdop
; /* best possible HDOP */
146 u_short vdop
; /* best possible VDOP */
147 u_short tdop
; /* best possible TDOP */
148 u_short nvis
; /* number of visible satellites */
150 u_short prn
; /* satellite PRN */
151 u_short azi
; /* satellite azimuth (radians) */
152 u_short elev
; /* satellite elevation (radians) */
154 u_short dsum
; /* checksum */
157 /* JUPITER_O_ID (1011) */
159 u_short stime
[2]; /* set time (10 ms ticks) */
160 u_short seq
; /* sequence number */
161 char chans
[20]; /* number of channels (ascii) */
162 char vers
[20]; /* software version (ascii) */
163 char date
[20]; /* software date (ascii) */
164 char opts
[20]; /* software options (ascii) */
166 u_short dsum
; /* checksum */
169 /* JUPITER_O_USER (1012) */
171 u_short stime
[2]; /* set time (10 ms ticks) */
172 u_short seq
; /* sequence number */
173 u_short status
; /* operatinoal status */
174 u_short coldtmo
; /* cold start time-out */
175 u_short dgpstmo
; /* DGPS correction time-out*/
176 u_short emask
; /* elevation mask */
177 u_short selcand
[2]; /* selected candidate */
178 u_short solflags
; /* solution validity criteria */
179 u_short nsat
; /* number of satellites in track */
180 u_short herr
[2]; /* minimum expected horizontal error */
181 u_short verr
[2]; /* minimum expected vertical error */
182 u_short platform
; /* application platform */
183 u_short dsum
; /* checksum */
186 /* JUPITER_O_PULSE (1108) */
188 u_short stime
[2]; /* set time (10 ms ticks) */
189 u_short seq
; /* sequence number */
191 u_short sweek
[2]; /* GPS seconds into week */
192 short offs
; /* GPS to UTC time offset (seconds) */
193 u_short offns
[2]; /* GPS to UTC offset (nanoseconds) */
194 u_short flags
; /* flags */
195 u_short dsum
; /* checksum */
197 #define JUPITER_O_PULSE_VALID 0x1 /* time mark validity */
198 #define JUPITER_O_PULSE_UTC 0x2 /* GPS/UTC sync */
200 /* JUPITER_O_EUP (1135) */
202 u_short stime
[2]; /* set time (10 ms ticks) */
203 u_short seq
; /* sequence number */
204 u_char dataid
; /* data id */
205 u_char prn
; /* satellite PRN */
206 u_short dsum
; /* checksum */
209 /* JUPITER_I_RESTART (1303) */
211 u_short seq
; /* sequence number */
213 u_short dsum
; /* checksum */
215 #define JUPITER_I_RESTART_INVRAM 0x01
216 #define JUPITER_I_RESTART_INVEEPROM 0x02
217 #define JUPITER_I_RESTART_INVRTC 0x04
218 #define JUPITER_I_RESTART_COLD 0x80
220 /* JUPITER_I_PVTINIT (1200) */
223 u_short gweek
; /* GPS week number */
224 u_short sweek
[2]; /* GPS seconds into week */
225 u_short utcday
; /* 1 to 31 */
226 u_short utcmon
; /* 1 to 12 */
227 u_short utcyear
; /* 1980 to 2079 */
228 u_short utchour
; /* 0 to 23 */
229 u_short utcmin
; /* 0 to 59 */
230 u_short utcsec
; /* 0 to 59 */
231 u_short lat
[2]; /* latitude (radians) */
232 u_short lon
[2]; /* longitude (radians) */
233 u_short height
[2]; /* height (meters) */
234 u_short speed
[2]; /* ground speed (meters/sec) */
235 u_short course
; /* true course (radians) */
239 #define JUPITER_I_PVTINIT_FORCE 0x01
240 #define JUPITER_I_PVTINIT_GPSVAL 0x02
241 #define JUPITER_I_PVTINIT_UTCVAL 0x04
242 #define JUPITER_I_PVTINIT_POSVAL 0x08
243 #define JUPITER_I_PVTINIT_ALTVAL 0x10
244 #define JUPITER_I_PVTINIT_SPDVAL 0x12
245 #define JUPITER_I_PVTINIT_MAGVAL 0x14
246 #define JUPITER_I_PVTINIT_CLIMBVAL 0x18
248 /* JUPITER_I_PLAT (1220) */
250 u_short seq
; /* sequence number */
251 u_short platform
; /* application platform */
254 #define JUPITER_I_PLAT_DEFAULT 0 /* default dynamics */
255 #define JUPITER_I_PLAT_LOW 2 /* pedestrian */
256 #define JUPITER_I_PLAT_MED 5 /* land (e.g. automobile) */
257 #define JUPITER_I_PLAT_HIGH 6 /* air */