Changeset 1239 in ntrip for trunk/BNC/RTCM3


Ignore:
Timestamp:
Nov 26, 2008, 1:18:08 PM (15 years ago)
Author:
weber
Message:

* empty log message *

Location:
trunk/BNC/RTCM3
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/RTCM3/RTCM3Decoder.cpp

    r1218 r1239  
    220220      if (_Parser.MessageSize >= _Parser.NeedBytes) {
    221221
    222         // RTCMv3 message types
    223         // --------------------
    224         for (int kk = 0; kk < _Parser.typeSize; kk++) {
    225           _typeList.push_back(_Parser.typeList[kk]);
    226         }
    227         _Parser.typeSize = 0;
    228 
    229         // RTCMv3 antenna descriptor
    230         // -------------------------
    231         for (int kk = 0; kk < _Parser.antSize; kk++) {
    232           _antType.push_back(_Parser.antType[kk]);
    233         }
    234         _Parser.antSize = 0;
    235 
    236         // RTCMv3 antenna XYZ
    237         // ------------------
    238         for (int kk = 0; kk < _Parser.antSize5; kk += 3) {
    239           _antList5.push_back(_Parser.antList5[kk + 0]);
    240           _antList5.push_back(_Parser.antList5[kk + 1]);
    241           _antList5.push_back(_Parser.antList5[kk + 2]);
    242         }
    243         _Parser.antSize5 = 0;
    244 
    245         // RTCMv3 antenna XYZ-H
    246         // --------------------
    247         for (int kk = 0; kk < _Parser.antSize6; kk += 4) {
    248           _antList6.push_back(_Parser.antList6[kk + 0]);
    249           _antList6.push_back(_Parser.antList6[kk + 1]);
    250           _antList6.push_back(_Parser.antList6[kk + 2]);
    251           _antList6.push_back(_Parser.antList6[kk + 3]);
    252         }
    253         _Parser.antSize6 = 0;
    254  
    255222        while(int rr = RTCM3Parser(&_Parser)) {
     223
     224          // RTCMv3 message types
     225          // --------------------
     226          _typeList.push_back(_Parser.blocktype);
     227
     228          // RTCMv3 antenna descriptor
     229          // -------------------------
     230          if(rr == 1007 || rr == 1008 || rr == 1033)
     231          {
     232            _antType.push_back(_Parser.antenna); /* correct ? */
     233          }
     234
     235          // RTCMv3 antenna XYZ
     236          // ------------------
     237          else if(rr == 1005)
     238          {
     239            _antList5.push_back(_Parser.antX);
     240            _antList5.push_back(_Parser.antY);
     241            _antList5.push_back(_Parser.antZ);
     242          }
     243
     244          // RTCMv3 antenna XYZ-H
     245          // --------------------
     246          else if(rr == 1006)
     247          {
     248            _antList6.push_back(_Parser.antX);
     249            _antList6.push_back(_Parser.antY);
     250            _antList6.push_back(_Parser.antZ);
     251            _antList6.push_back(_Parser.antH);
     252          }
    256253
    257254          // GNSS Observations
    258255          // -----------------
    259           if (rr == 1 || rr == 2) {
     256          else if (rr == 1 || rr == 2) {
    260257            decoded = true;
    261258   
  • trunk/BNC/RTCM3/ephemeris.cpp

    r1098 r1239  
    22#include <sstream>
    33#include <iomanip>
     4#include <cstring>
    45
    56#include "ephemeris.h"
  • trunk/BNC/RTCM3/rtcm3torinex.c

    r1210 r1239  
    11/*
    22  Converter for RTCM3 data to RINEX.
    3   $Id: rtcm3torinex.c,v 1.18 2008/11/10 18:01:41 weber Exp $
     3  $Id: rtcm3torinex.c,v 1.34 2008/11/26 10:14:46 stoecker Exp $
    44  Copyright (C) 2005-2008 by Dirk Stöcker <stoecker@alberding.eu>
    55
     
    5151
    5252/* CVS revision and version */
    53 static char revisionstr[] = "$Revision: 1.18 $";
     53static char revisionstr[] = "$Revision: 1.34 $";
    5454
    5555#ifndef COMPILEDATE
     
    176176
    177177#define SKIPBITS(b) { LOADBITS(b) numbits -= (b); }
     178
     179/* extract byte-aligned byte from data stream,
     180   b = variable to store size, s = variable to store string pointer */
     181#define GETSTRING(b, s) \
     182{ \
     183  b = *(data++); \
     184  s = (char *) data; \
     185  data += b; \
     186  size -= b+1; \
     187}
    178188
    179189struct leapseconds { /* specify the day of leap second */
     
    273283  int ret=0;
    274284
     285#ifdef NO_RTCM3_MAIN
     286  if(GetMessage(handle)) /* don't repeat */
     287#else
    275288  while(!ret && GetMessage(handle))
     289#endif /* NO_RTCM3_MAIN */
    276290  {
    277291    /* using 64 bit integer types, as it is much easier than handling
     
    284298    GETBITS(type,12)
    285299#ifdef NO_RTCM3_MAIN
    286     handle->typeList[handle->typeSize] = type;           /* RTCM message types */
    287     if(handle->typeSize < 100) {handle->typeSize += 1;}  /* RTCM message types */
     300    handle->blocktype = type;
    288301#endif /* NO_RTCM3_MAIN */
    289302    switch(type)
    290303    {
    291304#ifdef NO_RTCM3_MAIN
    292     case 1005:
    293       {
    294         double antX, antY, antZ; /* Antenna XYZ */
     305    default:
     306      ret = type;
     307      break;
     308    case 1005: case 1006:
     309      {
    295310        SKIPBITS(22)
    296         GETBITSSIGN(antX, 38)
     311        GETBITSSIGN(handle->antX, 38)
    297312        SKIPBITS(2)
    298         GETBITSSIGN(antY, 38)
     313        GETBITSSIGN(handle->antY, 38)
    299314        SKIPBITS(2)
    300         GETBITSSIGN(antZ, 38)
    301         handle->antList5[handle->antSize5 + 0] = antX;
    302         handle->antList5[handle->antSize5 + 1] = antY;
    303         handle->antList5[handle->antSize5 + 2] = antZ;
    304         if(handle->antSize5 < 100 - 5 ) {handle->antSize5 += 3;}
    305         ret = 1005;
     315        GETBITSSIGN(handle->antZ, 38)
     316        if(type == 1006)
     317          GETBITS(handle->antH, 16)
     318        ret = type;
    306319      }
    307320      break;
    308     case 1006:
    309       {
    310         double antX, antY, antZ, antH; /* Antenna XYZ-H */
    311         SKIPBITS(22)
    312         GETBITSSIGN(antX, 38)
    313         SKIPBITS(2)
    314         GETBITSSIGN(antY, 38)
    315         SKIPBITS(2)
    316         GETBITSSIGN(antZ, 38)
    317         GETBITS(    antH, 16)
    318         handle->antList6[handle->antSize6 + 0] = antX;
    319         handle->antList6[handle->antSize6 + 1] = antY;
    320         handle->antList6[handle->antSize6 + 2] = antZ;
    321         handle->antList6[handle->antSize6 + 3] = antH;
    322         if(handle->antSize6 < 100 - 6 ) {handle->antSize6 += 4;}
    323         ret = 1006;
    324       }
    325       break;
    326     case 1007:
    327       {
    328         char *antC = '\0'; /* Antenna Descriptor */
    329         char *antS = '\0';
    330         antC = (char*) malloc(32);   
    331         antS  = (char*) malloc(32);   
    332         uint32_t antN;
    333         uint32_t antD;
    334         uint32_t jj;
     321    case 1007: case 1008: case 1033:
     322      {
     323        char *antenna;
     324        int antnum;
    335325
    336326        SKIPBITS(12)
    337         GETBITS(antN, 8)
    338         if ((antN>0) && (antN<32)) {
    339           for (jj = 0; jj < antN; jj++) {
    340             GETBITS(antD, 8)
    341             sprintf(antS,"%c",antD);
    342             if (jj<1) {
    343               strcpy(antC,antS);
    344             } else {
    345               strcat(antC,antS);
    346             }
    347           }
    348           handle->antType[handle->antSize] = antC;
    349           if(handle->antSize < 100) {handle->antSize += 1;}
    350         }
    351         free(antC);
    352         free(antS);
    353         ret = 1007;
    354       }
    355       break;
    356     case 1008:
    357       {
    358         char *antC = '\0'; /* Antenna Descriptor */
    359         char *antS = '\0';
    360         antC = (char*) malloc(32);   
    361         antS  = (char*) malloc(32);   
    362         uint32_t antN;
    363         uint32_t antD;
    364         uint32_t jj;
    365 
    366         SKIPBITS(12)
    367         GETBITS(antN, 8)
    368         if ((antN>0) && (antN<32)) {
    369           for (jj = 0; jj < antN; jj++) {
    370             GETBITS(antD, 8)
    371             sprintf(antS,"%c",antD);
    372             if (jj<1) {
    373               strcpy(antC,antS);
    374             } else {
    375               strcat(antC,antS);
    376             }
    377           }
    378           handle->antType[handle->antSize] = antC;
    379           if(handle->antSize < 100) {handle->antSize += 1;}
    380         }
    381         free(antC);
    382         free(antS);
    383         ret = 1008;
     327        GETSTRING(antnum,antenna)
     328        memcpy(handle->antenna, antenna, antnum);
     329        handle->antenna[antnum] = 0;
     330        ret = type;
    384331      }
    385332      break;
     
    17181665
    17191666#ifndef NO_RTCM3_MAIN
    1720 static char datestr[]     = "$Date: 2008/11/10 18:01:41 $";
     1667static char datestr[]     = "$Date: 2008/11/26 10:14:46 $";
    17211668
    17221669/* The string, which is send as agent in HTTP request */
  • trunk/BNC/RTCM3/rtcm3torinex.h

    r1185 r1239  
    44/*
    55  Converter for RTCM3 data to RINEX.
    6   $Id: rtcm3torinex.h,v 1.13 2008/09/22 09:39:58 weber Exp $
     6  $Id: rtcm3torinex.h,v 1.10 2008/11/26 10:14:46 stoecker Exp $
    77  Copyright (C) 2005-2006 by Dirk Stöcker <stoecker@alberding.eu>
    88
     
    195195  int    lastlockl2[64];
    196196#ifdef NO_RTCM3_MAIN
    197   int    typeSize;       /* Message types */
    198   int    typeList[101];  /* Message types */
    199   int    antSize;        /* Antenna descriptor */
    200   char   *antType[101];  /* Antenna descriptor */
    201   int    antSize5;       /* Antenna XYZ */
    202   double antList5[101];  /* Antenna XYZ */
    203   int    antSize6;       /* Antenna XYZ-H */
    204   double antList6[101];  /* Antenna XYZ-H */
     197  double antX;
     198  double antY;
     199  double antZ;
     200  double antH;
     201  char   antenna[256+1];
     202  int    blocktype;
    205203#endif /* NO_RTCM3_MAIN */
    206204  int    datapos[RINEXENTRY_NUMBER];
Note: See TracChangeset for help on using the changeset viewer.