Index: /trunk/BNC/RTCM/GPSDecoder.h
===================================================================
--- /trunk/BNC/RTCM/GPSDecoder.h	(revision 1238)
+++ /trunk/BNC/RTCM/GPSDecoder.h	(revision 1239)
@@ -31,4 +31,5 @@
 #include <QPointer>
 #include <QList>
+#include <QStringList>
 
 #include "bncconst.h"
@@ -138,5 +139,5 @@
   QList<int> _typeList; // RTCMv3 message types
   QList<int> _epochList; // Broadcast corrections
-  QList<char*> _antType; // RTCMv3 antenna descriptor
+  QStringList _antType; // RTCMv3 antenna descriptor
   QList<double> _antList5; // RTCMv3 antenna XYZ
   QList<double> _antList6; // RTCMv3 antenna XYZ & H
Index: /trunk/BNC/RTCM3/RTCM3Decoder.cpp
===================================================================
--- /trunk/BNC/RTCM3/RTCM3Decoder.cpp	(revision 1238)
+++ /trunk/BNC/RTCM3/RTCM3Decoder.cpp	(revision 1239)
@@ -220,42 +220,39 @@
       if (_Parser.MessageSize >= _Parser.NeedBytes) {
 
-        // RTCMv3 message types
-        // --------------------
-        for (int kk = 0; kk < _Parser.typeSize; kk++) {
-          _typeList.push_back(_Parser.typeList[kk]);
-        }
-        _Parser.typeSize = 0;
-
-        // RTCMv3 antenna descriptor
-        // -------------------------
-        for (int kk = 0; kk < _Parser.antSize; kk++) {
-          _antType.push_back(_Parser.antType[kk]);
-        }
-        _Parser.antSize = 0;
-
-        // RTCMv3 antenna XYZ
-        // ------------------
-        for (int kk = 0; kk < _Parser.antSize5; kk += 3) {
-          _antList5.push_back(_Parser.antList5[kk + 0]);
-          _antList5.push_back(_Parser.antList5[kk + 1]);
-          _antList5.push_back(_Parser.antList5[kk + 2]);
-        }
-        _Parser.antSize5 = 0;
-
-        // RTCMv3 antenna XYZ-H
-        // --------------------
-        for (int kk = 0; kk < _Parser.antSize6; kk += 4) {
-          _antList6.push_back(_Parser.antList6[kk + 0]);
-          _antList6.push_back(_Parser.antList6[kk + 1]);
-          _antList6.push_back(_Parser.antList6[kk + 2]);
-          _antList6.push_back(_Parser.antList6[kk + 3]);
-        }
-        _Parser.antSize6 = 0;
- 
         while(int rr = RTCM3Parser(&_Parser)) {
+
+          // RTCMv3 message types
+          // --------------------
+          _typeList.push_back(_Parser.blocktype);
+
+          // RTCMv3 antenna descriptor
+          // -------------------------
+          if(rr == 1007 || rr == 1008 || rr == 1033)
+          {
+            _antType.push_back(_Parser.antenna); /* correct ? */
+          }
+
+          // RTCMv3 antenna XYZ
+          // ------------------
+          else if(rr == 1005)
+          {
+            _antList5.push_back(_Parser.antX);
+            _antList5.push_back(_Parser.antY);
+            _antList5.push_back(_Parser.antZ);
+          }
+
+          // RTCMv3 antenna XYZ-H
+          // --------------------
+          else if(rr == 1006)
+          {
+            _antList6.push_back(_Parser.antX);
+            _antList6.push_back(_Parser.antY);
+            _antList6.push_back(_Parser.antZ);
+            _antList6.push_back(_Parser.antH);
+          }
 
           // GNSS Observations
           // -----------------
-          if (rr == 1 || rr == 2) {
+          else if (rr == 1 || rr == 2) {
             decoded = true;
     
Index: /trunk/BNC/RTCM3/ephemeris.cpp
===================================================================
--- /trunk/BNC/RTCM3/ephemeris.cpp	(revision 1238)
+++ /trunk/BNC/RTCM3/ephemeris.cpp	(revision 1239)
@@ -2,4 +2,5 @@
 #include <sstream>
 #include <iomanip>
+#include <cstring>
 
 #include "ephemeris.h"
Index: /trunk/BNC/RTCM3/rtcm3torinex.c
===================================================================
--- /trunk/BNC/RTCM3/rtcm3torinex.c	(revision 1238)
+++ /trunk/BNC/RTCM3/rtcm3torinex.c	(revision 1239)
@@ -1,5 +1,5 @@
 /*
   Converter for RTCM3 data to RINEX.
-  $Id: rtcm3torinex.c,v 1.18 2008/11/10 18:01:41 weber Exp $
+  $Id: rtcm3torinex.c,v 1.34 2008/11/26 10:14:46 stoecker Exp $
   Copyright (C) 2005-2008 by Dirk Stöcker <stoecker@alberding.eu>
 
@@ -51,5 +51,5 @@
 
 /* CVS revision and version */
-static char revisionstr[] = "$Revision: 1.18 $";
+static char revisionstr[] = "$Revision: 1.34 $";
 
 #ifndef COMPILEDATE
@@ -176,4 +176,14 @@
 
 #define SKIPBITS(b) { LOADBITS(b) numbits -= (b); }
+
+/* extract byte-aligned byte from data stream,
+   b = variable to store size, s = variable to store string pointer */
+#define GETSTRING(b, s) \
+{ \
+  b = *(data++); \
+  s = (char *) data; \
+  data += b; \
+  size -= b+1; \
+}
 
 struct leapseconds { /* specify the day of leap second */
@@ -273,5 +283,9 @@
   int ret=0;
 
+#ifdef NO_RTCM3_MAIN
+  if(GetMessage(handle)) /* don't repeat */
+#else
   while(!ret && GetMessage(handle))
+#endif /* NO_RTCM3_MAIN */
   {
     /* using 64 bit integer types, as it is much easier than handling
@@ -284,102 +298,35 @@
     GETBITS(type,12)
 #ifdef NO_RTCM3_MAIN
-    handle->typeList[handle->typeSize] = type;           /* RTCM message types */
-    if(handle->typeSize < 100) {handle->typeSize += 1;}  /* RTCM message types */
+    handle->blocktype = type;
 #endif /* NO_RTCM3_MAIN */
     switch(type)
     {
 #ifdef NO_RTCM3_MAIN
-    case 1005:
-      {
-        double antX, antY, antZ; /* Antenna XYZ */
+    default:
+      ret = type;
+      break;
+    case 1005: case 1006:
+      {
         SKIPBITS(22)
-        GETBITSSIGN(antX, 38)
+        GETBITSSIGN(handle->antX, 38)
         SKIPBITS(2)
-        GETBITSSIGN(antY, 38)
+        GETBITSSIGN(handle->antY, 38)
         SKIPBITS(2)
-        GETBITSSIGN(antZ, 38)
-        handle->antList5[handle->antSize5 + 0] = antX;
-        handle->antList5[handle->antSize5 + 1] = antY;
-        handle->antList5[handle->antSize5 + 2] = antZ;
-        if(handle->antSize5 < 100 - 5 ) {handle->antSize5 += 3;}
-        ret = 1005;
+        GETBITSSIGN(handle->antZ, 38)
+        if(type == 1006)
+          GETBITS(handle->antH, 16)
+        ret = type;
       }
       break;
-    case 1006:
-      {
-        double antX, antY, antZ, antH; /* Antenna XYZ-H */
-        SKIPBITS(22)
-        GETBITSSIGN(antX, 38)
-        SKIPBITS(2)
-        GETBITSSIGN(antY, 38)
-        SKIPBITS(2)
-        GETBITSSIGN(antZ, 38)
-        GETBITS(    antH, 16)
-        handle->antList6[handle->antSize6 + 0] = antX;
-        handle->antList6[handle->antSize6 + 1] = antY;
-        handle->antList6[handle->antSize6 + 2] = antZ;
-        handle->antList6[handle->antSize6 + 3] = antH;
-        if(handle->antSize6 < 100 - 6 ) {handle->antSize6 += 4;}
-        ret = 1006;
-      }
-      break;
-    case 1007:
-      {
-        char *antC = '\0'; /* Antenna Descriptor */
-        char *antS = '\0';
-        antC = (char*) malloc(32);   
-        antS  = (char*) malloc(32);   
-        uint32_t antN;
-        uint32_t antD;
-        uint32_t jj;
+    case 1007: case 1008: case 1033:
+      {
+        char *antenna;
+        int antnum;
 
         SKIPBITS(12)
-        GETBITS(antN, 8)
-        if ((antN>0) && (antN<32)) {
-          for (jj = 0; jj < antN; jj++) {
-            GETBITS(antD, 8)
-            sprintf(antS,"%c",antD);
-            if (jj<1) {
-              strcpy(antC,antS);
-            } else {
-              strcat(antC,antS);
-            }
-          }
-          handle->antType[handle->antSize] = antC;
-          if(handle->antSize < 100) {handle->antSize += 1;}
-        }
-        free(antC);
-        free(antS);
-        ret = 1007;
-      }
-      break;
-    case 1008:
-      {
-        char *antC = '\0'; /* Antenna Descriptor */
-        char *antS = '\0';
-        antC = (char*) malloc(32);   
-        antS  = (char*) malloc(32);   
-        uint32_t antN;
-        uint32_t antD;
-        uint32_t jj;
-
-        SKIPBITS(12)
-        GETBITS(antN, 8)
-        if ((antN>0) && (antN<32)) {
-          for (jj = 0; jj < antN; jj++) {
-            GETBITS(antD, 8)
-            sprintf(antS,"%c",antD);
-            if (jj<1) {
-              strcpy(antC,antS);
-            } else {
-              strcat(antC,antS);
-            }
-          }
-          handle->antType[handle->antSize] = antC;
-          if(handle->antSize < 100) {handle->antSize += 1;}
-        }
-        free(antC);
-        free(antS);
-        ret = 1008;
+        GETSTRING(antnum,antenna)
+        memcpy(handle->antenna, antenna, antnum);
+        handle->antenna[antnum] = 0;
+        ret = type;
       }
       break;
@@ -1718,5 +1665,5 @@
 
 #ifndef NO_RTCM3_MAIN
-static char datestr[]     = "$Date: 2008/11/10 18:01:41 $";
+static char datestr[]     = "$Date: 2008/11/26 10:14:46 $";
 
 /* The string, which is send as agent in HTTP request */
Index: /trunk/BNC/RTCM3/rtcm3torinex.h
===================================================================
--- /trunk/BNC/RTCM3/rtcm3torinex.h	(revision 1238)
+++ /trunk/BNC/RTCM3/rtcm3torinex.h	(revision 1239)
@@ -4,5 +4,5 @@
 /*
   Converter for RTCM3 data to RINEX.
-  $Id: rtcm3torinex.h,v 1.13 2008/09/22 09:39:58 weber Exp $
+  $Id: rtcm3torinex.h,v 1.10 2008/11/26 10:14:46 stoecker Exp $
   Copyright (C) 2005-2006 by Dirk Stöcker <stoecker@alberding.eu>
 
@@ -195,12 +195,10 @@
   int    lastlockl2[64];
 #ifdef NO_RTCM3_MAIN
-  int    typeSize;       /* Message types */
-  int    typeList[101];  /* Message types */
-  int    antSize;        /* Antenna descriptor */
-  char   *antType[101];  /* Antenna descriptor */
-  int    antSize5;       /* Antenna XYZ */
-  double antList5[101];  /* Antenna XYZ */
-  int    antSize6;       /* Antenna XYZ-H */
-  double antList6[101];  /* Antenna XYZ-H */
+  double antX;
+  double antY;
+  double antZ;
+  double antH;
+  char   antenna[256+1];
+  int    blocktype;
 #endif /* NO_RTCM3_MAIN */
   int    datapos[RINEXENTRY_NUMBER];
Index: /trunk/BNC/bncgetthread.cpp
===================================================================
--- /trunk/BNC/bncgetthread.cpp	(revision 1238)
+++ /trunk/BNC/bncgetthread.cpp	(revision 1239)
@@ -819,5 +819,4 @@
             }
           }
-          _decoder->_typeList.clear();
 
           // RTCMv3 antenna descriptor
@@ -830,5 +829,4 @@
             }
           }
-          _decoder->_antType.clear();
 
           // RTCMv3 antenna XYZ
@@ -845,5 +843,4 @@
             }
           }
-          _decoder->_antList5.clear();
 
           // RTCMv3 antenna XYZ-H
@@ -862,6 +859,9 @@
             }
           }
-          _decoder->_antList6.clear();
-        }
+        }
+        _decoder->_typeList.clear();
+        _decoder->_antType.clear();
+        _decoder->_antList5.clear();
+        _decoder->_antList6.clear();
       }
 
