source: pacpusframework/branches/2.0-beta1/include/Pacpus/structure/structureSBAS.h@ 89

Last change on this file since 89 was 89, checked in by morasjul, 11 years ago

PACPUS 2.0 Beta deployed in new branch

Major changes:
-Add communication interface between components
-Add examples for communications interface (TestComponents)
-Move to Qt5 support

  • Property svn:executable set to *
File size: 17.3 KB
Line 
1#pragma warning( once : 4290 )
2#pragma warning( once : 4274 )
3
4#ifndef _SBAS_H
5#define _SBAS_H
6
7/*! \class SBAS
8 * \brief Allows to handle SBAS messages
9 * \author Olivier LE MARCHAND
10 * \version 1.0
11 * \date April 2008
12 * \bug None
13 * \warning None
14 *
15 *
16 */
17namespace SBAS{
18
19//4*4+2 premiers bits = message ID
20
21/*---------------------------------------------------------------------
22---------------------------------- MT1 --------------------------------
23-----------------------------------------------------------------------*/
24/*!\brief Message type 1 - mask*/
25/*! Message type 1 is used to transmit PRN mask for all satellites monitored by EGNOS system.
26 * That includes 37 GPS satellites, 24 GLONASS satellites, 58 future GNSS satellites, 19 GEO
27 * satellites and 72 future GNSS/GEO/WAAS/Pseudolites.\n
28 * Time out interval: 600s\n
29 * Maximum update interval: 120s*/
30struct structPRNMaskAssignement
31{
32 //bits 15 à 51 : mask pour le satellite GPS 1
33 uint8_t GPSSatMask[37];
34
35 //bits 52 à 75 : mask pour le satellite GLONASS
36 uint8_t GLONASSSatMask[24];
37
38 //bits 76 à 133 : mask pour les futures GNSS
39 uint8_t futGNSSSatMask[58];
40
41 //bits 134 à 152: mask pour les satellites SBAS 120 à 138
42 uint8_t GEOWAASSatMask[19];
43
44 //bits 153 à 224: mask pour les satellites SBAS 120 à 138
45 uint8_t futAllSatMask[72];
46
47 /*!\brief Issue Of Data PRN Mask*/
48 /*! IODP is changed each time the PRNMask is modified\n
49 * from bits 225 to 226*/
50 uint8_t IODP;
51};
52
53
54
55/*---------------------------------------------------------------------
56---------------------------------- MT2 --------------------------------
57-----------------------------------------------------------------------*/
58// MT2 : 1 - 13
59// MT3 : idem 14 - 26
60// MT4 : idem 27 - 39
61// MT5 : idem 40 - 51
62/*!\brief Message type 2 to 5 - Fast corrections*/
63/*! Fast corrections are necessary to correct the fast changing errors such as satellite
64 * clock error\n
65 * Time out interval: variable\n
66 * Maximum update interval: 60s*/
67
68struct structFastCorrections
69{
70 /*!\brief Issue Of Data Fast Corrections (IODFj)*/
71 /*! Identifies the current fast corrections, where j shows fast corrections message
72 * type (2-5). This parameter is used to associate fast corrections with integrity
73 * information from message type 6\n
74 * from bits 15 to 16*/
75 uint8_t IODF;
76
77 /*!\brief Issue Of Data PRN Mask*/
78 /*! Refers to the IODP of the message of type one in order to associate PRN mask
79 * with Satellite ID\n
80 * from bits 17 to 18*/
81 uint8_t IODP;
82
83 // bits 19 à 30 : 12 bits PR correction (m) satellite 1 in PRN Mask valeur à diviser par 32
84 // bits 31 à 42 : 12 bits PR correction (m) satellite 2 in PRN Mask
85 // bits 43 à 54 : 12 bits PR correction (m) satellite 3 in PRN Mask
86 // bits 55 à 66 : 12 bits PR correction (m) satellite 4 in PRN Mask
87 // bits 67 à 78 : 12 bits PR correction (m) satellite 5 in PRN Mask
88 // bits 79 à 90 : 12 bits PR correction (m) satellite 6 in PRN Mask
89 // bits 91 à 102 : 12 bits PR correction (m) satellite 7 in PRN Mask
90 // bits 103 à 114 : 12 bits PR correction (m) satellite 8 in PRN Mask
91 // bits 115 à 126 : 12 bits PR correction (m) satellite 9 in PRN Mask
92 // bits 127 à 138 : 12 bits PR correction (m) satellite 10 in PRN Mask
93 // bits 139 à 150 : 12 bits PR correction (m) satellite 11 in PRN Mask
94 // bits 151 à 162 : 12 bits PR correction (m) satellite 12 in PRN Mask
95 // bits 163 à 174 : 12 bits PR correction (m) satellite 13 in PRN Mask
96 double PRCorrectionPRNMask[13];
97
98 //43*4+2 = 174
99 // bits 175 à 178 : 1 octet User differential range estimate (m) satellite 1 in PRN mask valeur correspondante à un tableau
100 // bits 179 à 182 : 1 octet User differential range estimate (m) satellite 1 in PRN mask
101 // bits 183 à 186 : 1 octet User differential range estimate (m) satellite 1 in PRN mask
102 // bits 187 à 190 : 1 octet User differential range estimate (m) satellite 1 in PRN mask
103 // bits 191 à 194 : 1 octet User differential range estimate (m) satellite 1 in PRN mask
104 // bits 195 à 198 : 1 octet User differential range estimate (m) satellite 1 in PRN mask
105 // bits 199 à 202 : 1 octet User differential range estimate (m) satellite 1 in PRN mask
106 // bits 203 à 206 : 1 octet User differential range estimate (m) satellite 1 in PRN mask
107 // bits 207 à 210 : 1 octet User differential range estimate (m) satellite 1 in PRN mask
108 // bits 211 à 214 : 1 octet User differential range estimate (m) satellite 1 in PRN mask
109 // bits 215 à 218 : 1 octet User differential range estimate (m) satellite 1 in PRN mask
110 // bits 219 à 222 : 1 octet User differential range estimate (m) satellite 1 in PRN mask
111 // bits 223 à 226 : 1 octet User differential range estimate (m) satellite 1 in PRN mask
112 uint16_t UDREI[13];
113};
114
115//structFastCorrections fastCorrectionsExtract(uint8_t decodedDataBlock[32]);
116
117
118
119/*---------------------------------------------------------------------
120---------------------------------- MT6 --------------------------------
121-----------------------------------------------------------------------*/
122/*!\brief Message type 6 - */
123/*! \n
124 * Time out interval: 18s\n
125 * Maximum update interval: 12s*/
126struct structIntegrityInformation
127{
128 // bits 15 à 16
129 /*!\brief Issue of Data Fast correction corresponding to the one used in MT2*/
130 uint8_t IODF2;
131
132 // bits 17 à 18 : IODF3
133 /*!\brief Issue of Data Fast correction corresponding to the one used in MT3*/
134 uint8_t IODF3;
135
136 // bits 19 à 20 : IODF4
137 /*!\brief Issue of Data Fast correction corresponding to the one used in MT4*/
138 uint8_t IODF4;
139
140 // bits 21 à 22 : IDOF5
141 /*!\brief Issue of Data Fast correction corresponding to the one used in MT5*/
142 uint8_t IODF5;
143
144 // bits 23 à 27 : UDREI for sat 1 of mask
145 //et continue jusqu'au 51
146 /*!\brief User Data Differential Estimate Indicator*/
147 uint8_t UDREI[51];
148};
149
150//structIntegrityInformation IntegrityInformationExtract(uint8_t decodedDataBlock[32]);
151
152
153/*---------------------------------------------------------------------
154---------------------------------- MT7 --------------------------------
155-----------------------------------------------------------------------*/
156/*!\brief Message type 7 - Fast Correction Degradation Factor*/
157/*! \n
158 * Time out interval: 360s\n
159 * Maximum update interval: 120s*/
160struct structFastCorrectionDegradationFactor
161{
162 // bits 15 à 18 : latency in second
163 uint8_t systemLatency;
164
165 // bits 19 à 20 : IODP
166 uint8_t IODP;
167
168 // bits 23 à 26 : fast correction degradation factor of sat1 of mask
169 //et continue jusqu'au 51
170 uint8_t ai[51];
171};
172
173
174
175/*---------------------------------------------------------------------
176---------------------------------- MT8 --------------------------------
177-----------------------------------------------------------------------*/
178/*!\brief Message type 8 - */
179/*! \n
180 * Time out interval: \n
181 * Maximum update interval: */
182struct structGEONavigationMessage
183{
184 // bits 15 à 22 : IOD
185 uint8_t IOD;
186
187 // bits 23 à 35 : t0
188 uint32_t t0;
189
190 // bits 36 à 37 : accuracy URA
191 uint16_t accuracyURA;
192
193 // bits 38 à 67 : Xg(ECEF)
194 double XgECEF;
195
196 // bits 68 à 97 : Yg(ECEF)
197 double YgECEF;
198
199 // bits 98 à 122 : Zg(ECEF)
200 double ZgECEF;
201
202 // bits 123 à 139 : Xg rate of change
203 double XgRateOfChange;
204
205 // bits 140 à 156 : Yg rateof change
206 double YgRateOfChange;
207
208 // bits 157 à 174 : Zg rate of change
209 double ZgRateOfChange;
210
211 // bits 175 à 184 : Xg acceleration
212 double XgAcceleration;
213
214 // bits 185 à 194 : Yg acceleration
215 double YgAcceleration;
216
217 // bits 195 à 204 : Zg acceleration
218 double ZgAcceleration;
219
220 // bits 205 à 216 : agf0
221 double agf0;
222
223 // bits 217 à 228 : agf1
224 double agf1;
225};
226
227
228
229
230/*---------------------------------------------------------------------
231---------------------------------- MT10 -------------------------------
232-----------------------------------------------------------------------*/
233/*!\brief Message type 10 - */
234/*! \n
235 * Time out interval: 360s\n
236 * Maximum update interval: 120s*/
237struct structDegradationParameters
238{
239 // bits 15 à 24 : Brrc
240 double Brrc;
241
242 // bits 25 à 34 : Cltc_lsb
243 double Cltc_lsb;
244
245 // bits 35 à 44 : Cltc_v1
246 double Cltc_v1;
247
248 // bits 45 à 53 : Lltc_v1
249 uint16_t Lltc_v1;
250
251 // bits 54 à 63 : Cltc_v0
252 double Cltc_v0;
253
254 // bits 64 à 72 : Lltc_v0
255 uint16_t Lltc_v0;
256
257 // bits 73 à 82 : Cgeo_lsb
258 double Cgeo_lsb;
259
260 // bits 83 à 92 : Cgeo_v
261 double Cgeo_v;
262
263 // bits 93 à 101 : Igeo
264 uint16_t Igeo;
265
266 // bits 102 à 107 : Cer
267 double Cer;
268
269 // bits 108 à 117 : Ciono_step
270 double Ciono_step;
271
272 // bits 118 à 126 : Iiono
273 uint16_t Iiono;
274
275 // bits 127 à 136 : Ciono_ramp
276 double Ciono_ramp;
277
278 // bits 137 : RSSudre
279 bool RSSudre;
280
281 // bits 138 : RSSiono
282 bool RSSiono;
283
284 // bits 139 à 145 : Ccovariance
285 double Ccovariance;
286};
287
288
289/*---------------------------------------------------------------------
290---------------------------------- MT12 -------------------------------
291-----------------------------------------------------------------------*/
292/*!\brief Message type 12 - */
293/*! \n
294 * Time out interval: 1 day, 86400s\n
295 * Maximum update interval: 300s*/
296struct structWAASTime
297{
298 // bits 13 à 36
299 double A1wnt;
300
301 // bits 37 à 68
302 double A0wnt;
303
304 // bits 69 à 78
305 uint32_t t0t;
306
307 // bits 79 à 86
308 uint8_t WNt;
309
310 // bits 87 à 94
311 int16_t DeltaTLS;
312
313 // bits 95 à 103
314 int16_t WNlsf;
315
316 // bits 108 à 110
317 uint8_t DN;
318
319 // bits 111 à 118
320 int16_t DeltaTLsf;
321
322 // bits 119 à 121
323 uint8_t UTSstandardld;
324
325 // bits 122 à 141
326 uint32_t GPSTimeOfWeek;
327
328 // bits 142 à 149
329 uint16_t GPSWeekNumber;
330
331 // bits 150
332 bool GLONASSInd;
333};
334
335
336
337
338/*---------------------------------------------------------------------
339---------------------------------- MT17 -------------------------------
340-----------------------------------------------------------------------*/
341/*!\brief Message type 17 - */
342/*! \n
343 * Time out interval: none\n
344 * Maximum update interval: 300s*/
345struct structGEOSatelliteAlmanacs
346{
347 // bits
348 uint8_t DataID[3];
349
350 // bits
351 uint16_t SPRNNumber[3];
352
353 //bits
354 int32_t XgECEF[3];
355
356 //bits
357 int32_t YgECEF[3];
358
359 //bits
360 int32_t ZgECEF[3];
361
362 //bits
363 int8_t XgRateOfChange[3];
364
365 //bits
366 int8_t YgRateOfChange[3];
367
368 //bits
369 int8_t ZgRateOfChange[3];
370
371 //bits
372 bool ranging[3];
373
374 //bits
375 bool corrections[3];
376
377 //bits
378 bool broadcatsIntegrity[3];
379
380 //bits
381 bool reserved[3];
382
383 //bits
384 uint8_t ID[3];
385
386 //bits
387 uint32_t t0;
388};
389
390
391
392
393/*---------------------------------------------------------------------
394---------------------------------- MT18 --------------------------------
395-----------------------------------------------------------------------*/
396/*!\brief Message type 18 - Ionospheric Grid Point Mask*/
397/*! Message type 18 is used to ....\n
398 * Time out interval: 1200s\n
399 * Maximum update interval: 300s*/
400
401
402struct structIonosphericGridPointMask
403{
404 //bits
405 /* !\brief Ionosphere Issue of Data*/
406 /* ! between 0 and 3*/
407 uint8_t IODIonosphere;
408
409 //bits
410 /* !\brief Number of broadcasted bands*/
411 /* ! Value between 0 and 9. O means that no ionospheric will be provided*/
412 uint8_t numberOfBroadcastedBands;
413
414 //bits
415 /* !\brief Number of the current band*/
416 /* ! Value between 0 and 8. Only value between 3 and 5 are useful for EGNOS*/
417 uint8_t bandNumber;
418
419 bool IGPMask[201];
420};
421
422
423
424
425/*---------------------------------------------------------------------
426---------------------------------- MT24 -------------------------------
427-----------------------------------------------------------------------*/
428
429/*!\brief Message type 24 - */
430/*! \n
431 * Time out interval: \n
432 * Maximum update interval: */
433struct structMixedFastCorrectionLongTermError
434{
435 //bits
436 double PRCorrection[6];
437
438 //bits
439 uint8_t UDREI[6];
440
441 //bits
442 uint8_t blockID;
443
444 //bits
445 bool velocityCode;
446
447 //bits
448 uint8_t FCIODF;
449
450 //bits
451 uint8_t FCIODP;
452
453 //bits
454 uint8_t PRNMask[2];
455
456 //bits
457 uint8_t IODE[2];
458
459 //bits
460 double deltaXECEF[2];
461
462 //bits
463 double deltaYECEF[2];
464
465 //bits
466 double deltaZECEF[2];
467
468 //bits
469 double deltaXROC;
470
471 //bits
472 double deltaYROC;
473
474 //bits
475 double deltaZROC;
476
477 //bits
478 double deltaAf0[2];
479
480 //bits
481 double deltaAf1;
482
483 //bits
484 double t0;
485
486 //bits
487 uint8_t LTIODP;
488};
489
490
491
492/*---------------------------------------------------------------------
493---------------------------------- MT25 -------------------------------
494-----------------------------------------------------------------------*/
495/*!\brief Message type 25 - Long Term Corrections*/
496/*! \n
497 * Time out interval: 360s\n
498 * Maximum update interval: 120s*/
499struct structLongTermSatelliteErrorCorrections
500{
501 //bits
502 bool velocityCode[2];
503
504 //bits
505 uint8_t IODP[2];
506
507 //bits
508 uint8_t PRNMask[4];
509
510 //bits
511 uint8_t IODE[4];
512
513 //bits
514 double deltaXECEF[4];
515
516 //bits
517 double deltaYECEF[4];
518
519 //bits
520 double deltaZECEF[4];
521
522 //bits
523 double deltaXROC[4];
524
525 //bits
526 double deltaYROC[4];
527
528 //bits
529 double deltaZROC[4];
530
531 //bits
532 double deltaAf0[4];
533
534 //bits
535 double deltaAf1[4];
536
537 //bits
538 double t0[2];
539};
540
541
542
543/*---------------------------------------------------------------------
544---------------------------------- MT26 -------------------------------
545-----------------------------------------------------------------------*/
546/*!\brief Message type 26 - Ionospheric Delay Correction*/
547/*! Message type 26 is used to ....\n
548 * Time out interval: 600s\n
549 * Maximum update interval: 300s*/
550struct structIonosphericDelayCorrections
551{
552 /* !\brief Ionosphere Issue of Data*/
553 /* ! between 0 and 3*/
554 uint8_t IODIonosphere;
555
556 //bits
557 /* !\brief Number of the Band*/
558 /* ! between 0 and 9*/
559 uint8_t bandNumber;
560
561 //bits
562 /* !\brief Block Identifier*/
563 /* ! between 0 and 13*/
564 uint8_t blockID;
565
566 //bits
567 /* !\brief Grid Ionospheric Vertical Error Indicator*/
568 /* ! between 0 and 15\n
569 * GIVEI = 15 means "not monitored"*/
570 uint8_t GIVEI[15];
571
572 //bits
573 /* !\brief Vertical delay estimation of the IGP*/
574 /* ! between 0 and 63.875
575 * vertical delay = 63.750m means not monitored*/
576 double IGPVerticalDelayEstimate[15];
577};
578
579
580
581
582/*---------------------------------------------------------------------
583---------------------------------- MT27 -------------------------------
584-----------------------------------------------------------------------*/
585/*!\brief Message type 27- */
586/*! \n
587 * Time out interval: none\n
588 * Maximum update interval: 300s*/
589struct structWAASServiceMessage
590{
591 //bits
592 uint8_t numberOfRegions;
593
594 //bits
595 int8_t coordinate1Latitude[5];
596
597 //bits
598 int8_t coordinate1Longitude[5];
599
600 //bits
601 int8_t coordinate2Latitude[5];
602
603 //bits
604 int8_t coordinate2Longitude[5];
605
606 //bits
607 bool regionShape[5];
608
609 //bits
610 uint8_t IODService;
611
612 //bits
613 uint8_t numberOfServiceMsgs;
614
615 //bits
616 bool serviceMessageNumber;
617
618 //bits
619 uint8_t priorityCode;
620
621 //bits
622 uint8_t UDREIndicatorInside;
623
624 //bits
625 uint8_t UDREIndicatorOutside;
626};
627
628
629
630
631
632/*---------------------------------------------------------------------
633---------------------------------- MT28 -------------------------------
634-----------------------------------------------------------------------*/
635/*!\brief Message type 28 - */
636/*! \n
637 * Time out interval: \n
638 * Maximum update interval: */
639struct structClockEphCovMatrixMsg
640{
641 //bits
642 uint8_t PRNMask[2];
643
644 //bits
645 uint8_t ScaleExp[2];
646
647 //bits
648 uint16_t E11[2];
649
650 //bits
651 uint16_t E22[2];
652
653 //bits
654 uint16_t E33[2];
655
656 //bits
657 uint16_t E44[2];
658
659 //bits
660 int16_t E12[2];
661
662 //bits
663 int16_t E13[2];
664
665 //bits
666 int16_t E14[2];
667
668 //bits
669 int16_t E23[2];
670
671 //bits
672 int16_t E24[2];
673
674 //bits
675 int16_t E34[2];
676};
677
678uint8_t typeIDExtract(uint8_t decodedDataBlock[32]);
679
680uint8_t preambleExtract(uint8_t decodedDataBlock[32]);
681
682
683inline uint16_t bytesSpread(uint16_t startBit, uint16_t length)
684{
685 uint16_t nbBytes;
686 nbBytes = ((startBit+length-2)/8 - (startBit-1)/8 +1);
687 return nbBytes;
688}
689
690int8_t extractChar(uint8_t* dataBlock, uint16_t startBit, uint16_t length);
691
692int16_t extractShort(uint8_t* dataBlock, uint16_t startBit, uint16_t length);
693
694int32_t extractLong(uint8_t* dataBlock, uint16_t startBit, uint16_t length);
695
696uint16_t extractUShort(uint8_t* dataBlock, uint16_t startBit, uint16_t length);
697
698uint32_t extractULong(uint8_t* dataBlock, uint16_t startBit, uint16_t length);
699}
700
701#endif
Note: See TracBrowser for help on using the repository browser.