Index: branches/BNC_LM/RTCM/GPSDecoder.h
===================================================================
--- branches/BNC_LM/RTCM/GPSDecoder.h	(revision 3572)
+++ branches/BNC_LM/RTCM/GPSDecoder.h	(revision 3573)
@@ -33,4 +33,5 @@
 
 #include "bncconst.h"
+#include "bncrinex.h"
 
 class t_obs {
@@ -119,9 +120,21 @@
 class GPSDecoder {
  public:
-  virtual t_irc Decode(char* buffer, int bufLen, std::vector<std::string>& errmsg) = 0;
+  GPSDecoder();
 
-  virtual ~GPSDecoder() {}
+  virtual ~GPSDecoder() {delete _rnx;}
+
+  virtual t_irc Decode(char* buffer, int bufLen, 
+                       std::vector<std::string>& errmsg) = 0;
+
 
   virtual int corrGPSEpochTime() const {return -1;}
+
+  void initRinex(const QByteArray& staID, const QUrl& mountPoint,
+                 const QByteArray& latitude, const QByteArray& longitude, 
+                 const QByteArray& nmea, const QByteArray& ntripVersion);
+
+  void dumpRinexEpoch(const t_obs& obs, const QByteArray& format);
+
+  void setRinexReconnectFlag(bool flag);
 
   struct t_antInfo {
@@ -145,7 +158,8 @@
 
   QList<t_obs>     _obsList;
-  QList<int>       _typeList;  // RTCM   message types
-  QStringList      _antType;   // RTCM   antenna descriptor
-  QList<t_antInfo> _antList;   // RTCM   antenna XYZ
+  QList<int>       _typeList;  // RTCM message types
+  QStringList      _antType;   // RTCM antenna descriptor
+  QList<t_antInfo> _antList;   // RTCM antenna XYZ
+  bncRinex*        _rnx;       // RINEX writer
 };
 
Index: branches/BNC_LM/bnc.pro
===================================================================
--- branches/BNC_LM/bnc.pro	(revision 3572)
+++ branches/BNC_LM/bnc.pro	(revision 3573)
@@ -82,5 +82,5 @@
           upload/bncrtnetuploadcaster.cpp upload/bnccustomtrafo.cpp   \
           upload/bncephuploadcaster.cpp                               \
-          RTCM/RTCM2.cpp RTCM/RTCM2Decoder.cpp                        \
+          RTCM/GPSDecoder.cpp RTCM/RTCM2.cpp RTCM/RTCM2Decoder.cpp    \
           RTCM/RTCM2_2021.cpp RTCM/rtcm_utils.cpp                     \
           RTCM3/RTCM3Decoder.cpp RTCM3/rtcm3torinex/rtcm3torinex.c    \
Index: branches/BNC_LM/bncgetthread.cpp
===================================================================
--- branches/BNC_LM/bncgetthread.cpp	(revision 3572)
+++ branches/BNC_LM/bncgetthread.cpp	(revision 3573)
@@ -317,6 +317,6 @@
   msleep(100); //sleep 0.1 sec
   
-////  _decoder->initRinex(_staID, _mountPoint, _latitude, _longitude, 
-////                               _nmea, _ntripVersion);
+  _decoder->initRinex(_staID, _mountPoint, _latitude, _longitude, 
+                               _nmea, _ntripVersion);
 
   if (_rawFile) {
@@ -542,5 +542,5 @@
         }
 
-	////        decoder()->dumpRinexEpoch(obs, _format);
+        decoder()->dumpRinexEpoch(obs, _format);
 
         // PPP Client
@@ -585,9 +585,9 @@
         itDec.next();
         GPSDecoder* decoder = itDec.value();
-	///        decoder->setRinexReconnectFlag(false);
+        decoder->setRinexReconnectFlag(false);
       }
     }
     else {
-      ///      _decoder->setRinexReconnectFlag(false);
+      _decoder->setRinexReconnectFlag(false);
     }
     return success;
@@ -656,9 +656,9 @@
       itDec.next();
       GPSDecoder* decoder = itDec.value();
-      ///      decoder->setRinexReconnectFlag(false);
+      decoder->setRinexReconnectFlag(false);
     }
   }
   else {
-    ///   _decoder->setRinexReconnectFlag(false);
+   _decoder->setRinexReconnectFlag(false);
   }
 
