Index: trunk/BNC/src/GPSDecoder.h
===================================================================
--- trunk/BNC/src/GPSDecoder.h	(revision 10687)
+++ trunk/BNC/src/GPSDecoder.h	(revision 10688)
@@ -60,4 +60,14 @@
   void setRinexReconnectFlag(bool flag);
 
+  struct t_typeInfo {
+    t_typeInfo() {
+      type = 0;
+      size = 0;
+    };
+    int    type;
+    size_t size;
+  };
+
+
   struct t_antRefPoint {
     enum t_type { ARP, APC };
@@ -94,7 +104,68 @@
   };
 
+  class t_GloBiasInfo {
+  public:
+    t_GloBiasInfo() {
+      clear();
+    };
+    bool operator==(const t_GloBiasInfo& biasInfo2) const {
+      if (staID     == biasInfo2.staID &&
+          indicator == biasInfo2.indicator &&
+          L1C_value == biasInfo2.L1C_value &&
+          L1P_value == biasInfo2.L1P_value &&
+          L2C_value == biasInfo2.L2C_value &&
+          L2P_value == biasInfo2.L2P_value  ) {
+        return true;
+      }
+      else {
+        return false;
+      }
+    }
+
+    void set(const t_GloBiasInfo& biasInfo) {
+      staID     = biasInfo.staID;
+      indicator = biasInfo.indicator;
+      L1C_value = biasInfo.L1C_value;
+      L1P_value = biasInfo.L1P_value;
+      L2C_value = biasInfo.L2C_value;
+      L2P_value = biasInfo.L2P_value;
+      changed = true;
+    }
+
+    void clear() {cout << "init" <<  endl;
+      staID = 0;
+      indicator = 0;
+      L1C_value = 0.0;
+      L1P_value = 0.0;
+      L2C_value = 0.0;
+      L2P_value = 0.0;
+      changed = false;
+    }
+    QString toString() {
+      QString biasIndicator =  (indicator == 1) ? QString("aligned") : QString("unaligned");
+      QString biasesStr =
+          QString(": GLONASS L1/L2 Code-Phase Biases: staID=%1 indicator=%2 L1C=%3 L1P=%4 L2C=%5 L2P=%6")
+          .arg(staID).arg(biasIndicator)
+          .arg(L1C_value, 0, 'f', 2)
+          .arg(L1P_value, 0, 'f', 2)
+          .arg(L2C_value, 0, 'f', 2)
+          .arg(L2P_value, 0, 'f', 2);
+
+      return biasesStr;
+    }
+    int      staID;
+    int      indicator;
+    double   L1C_value;
+    double   L1P_value;
+    double   L2C_value;
+    double   L2P_value;
+    bool     changed;
+
+
+  };
+
   /** List of observations */
   QList<t_satObs>         _obsList;
-  QList<int>              _typeList;           // RTCM message types
+  QList<t_typeInfo>       _typeList;           // RTCM message type as message size
   QList<t_antInfo>        _antType;            // RTCM antenna descriptor
   QList<t_recInfo>        _recType;            // RTCM receiver descriptor
@@ -104,4 +175,5 @@
   QList<t_rtcmCrs>        _rtcmCrs;            // RTCM CRS
   QString                 _gloFrq;             // GLONASS slot
+  t_GloBiasInfo           _gloBiases;          // RTCM GLO bias information message
   bncRinex*               _rnx;                // RINEX writer
 };
Index: trunk/BNC/src/RTCM/RTCM2Decoder.cpp
===================================================================
--- trunk/BNC/src/RTCM/RTCM2Decoder.cpp	(revision 10687)
+++ trunk/BNC/src/RTCM/RTCM2Decoder.cpp	(revision 10688)
@@ -119,5 +119,7 @@
 
     // Store message number
-    _typeList.push_back(_PP.ID());
+    _typeList.push_back(t_typeInfo());
+    _typeList.back().type = _PP.ID();
+    //_typeList.back().size = 0;
 
     if (_PP.ID() == 18 || _PP.ID() == 19) {
Index: trunk/BNC/src/RTCM3/RTCM3Decoder.cpp
===================================================================
--- trunk/BNC/src/RTCM3/RTCM3Decoder.cpp	(revision 10687)
+++ trunk/BNC/src/RTCM3/RTCM3Decoder.cpp	(revision 10688)
@@ -1690,5 +1690,5 @@
   bool decoded = false;
   uint64_t numbits = 0, bitfield = 0;
-  int i, week, mnum;
+  int i, week;
 
   data += 3; /* header */
@@ -1704,5 +1704,5 @@
     eph._inav = (i == 1046);
     eph._fnav = (i == 1045);
-    mnum = i;
+    int mnum = i;
     GETBITS(i, 6)
     if (i < 1 || i > 36 ) { // max. constellation within I/NAV / F/NAV frames is 36
@@ -2046,4 +2046,44 @@
 //
 ////////////////////////////////////////////////////////////////////////////
+bool RTCM3Decoder::DecodeGLONASSCodePhaseBiases(unsigned char* data, int size) {
+  t_GloBiasInfo gloBiases;
+  uint64_t numbits = 0, bitfield = 0;
+
+  data += 3; // header
+  size -= 6; // header + crc
+
+  SKIPBITS(12) // Message Number
+  GETBITS(gloBiases.staID, 12)
+  GETBITS(gloBiases.indicator, 1) // 0.. not aligned, 1.. aligned
+  SKIPBITS(3) // reserved bits
+  unsigned bitmask;
+  GETBITS(bitmask, 4)
+  bool L1C_valid = bitExtracted(unsigned(bitmask), 1, 0);
+  bool L1P_valid = bitExtracted(unsigned(bitmask), 1, 1);
+  bool L2C_valid = bitExtracted(unsigned(bitmask), 1, 2);
+  bool L2P_valid = bitExtracted(unsigned(bitmask), 1, 3);
+
+  if (L1C_valid) {
+    GETBITS(gloBiases.L1C_value, 16)
+  }
+  if (L1P_valid) {
+    GETBITS(gloBiases.L1P_value, 16)
+  }
+  if (L2C_valid) {
+    GETBITS(gloBiases.L2C_value, 16)
+  }
+  if (L2P_valid) {
+    GETBITS(gloBiases.L2P_value, 16)
+  }
+
+  if (!(_gloBiases == gloBiases)) {
+    _gloBiases.set(gloBiases);
+  }
+
+  return true;
+}
+
+//
+////////////////////////////////////////////////////////////////////////////
 bool RTCM3Decoder::DecodeServiceCRS(unsigned char* data, int size) {
   t_serviceCrs serviceCrs;
@@ -2209,6 +2249,8 @@
       if (_rawFile)
         _staID = _rawFile->staID();
-      /* store the id into the list of loaded blocks */
-      _typeList.push_back(id);
+      /* store the id and message size into the list of loaded blocks */
+      _typeList.push_back(t_typeInfo());
+      _typeList.back().type = id;
+      _typeList.back().size = _BlockSize -6; /* header + crc */
 
       /* SSR I+II data handled in another function, already pass the
@@ -2300,4 +2342,7 @@
             DecodeAntennaPosition(_Message, _BlockSize);
             break;
+          case 1230:
+            DecodeGLONASSCodePhaseBiases(_Message, _BlockSize);
+            break;
           case 1300:
             DecodeServiceCRS(_Message, _BlockSize);
Index: trunk/BNC/src/RTCM3/RTCM3Decoder.h
===================================================================
--- trunk/BNC/src/RTCM3/RTCM3Decoder.h	(revision 10687)
+++ trunk/BNC/src/RTCM3/RTCM3Decoder.h	(revision 10688)
@@ -176,4 +176,11 @@
   bool DecodeServiceCRS(unsigned char* buffer, int bufLen);
   /**
+   * Extract GLONASS L1 and L2 Code-Phase bias messages from 1230 RTCM3 messages
+   * @param buffer the buffer containing CLONASS L1 and L2 Code-Phase biases per station
+   * @param bufLen the length of the buffer (the message length including header+crc)
+   * @return <code>true</code> when data block was decodable
+   */
+  bool DecodeGLONASSCodePhaseBiases(unsigned char* buffer, int bufLen);
+  /**
    * Extract Helmert transformation parameters from 1301 RTCM3 messages
    * @param buffer the buffer containing Helmert transformation parameters RTCM block
Index: trunk/BNC/src/bncgetthread.cpp
===================================================================
--- trunk/BNC/src/bncgetthread.cpp	(revision 10687)
+++ trunk/BNC/src/bncgetthread.cpp	(revision 10688)
@@ -531,5 +531,5 @@
       if (_latencyChecker) {
         _latencyChecker->checkOutage(irc);
-        QListIterator<int> it(decoder()->_typeList);
+        QListIterator<GPSDecoder::t_typeInfo> it(decoder()->_typeList);
         _ssrEpoch = static_cast<int>(decoder()->corrGPSEpochTime());
         if (_ssrEpoch != -1) {
@@ -572,5 +572,5 @@
         }
         while (it.hasNext()) {
-          int rtcmType = it.next();
+          int rtcmType = it.next().type;
           if ((rtcmType >= 1001 && rtcmType <= 1004) || // legacy RTCM OBS
               (rtcmType >= 1009 && rtcmType <= 1012) || // legacy RTCM OBS
@@ -818,6 +818,7 @@
       // ------------------
       for (int ii = 0; ii < decoder()->_typeList.size(); ii++) {
-        QString type = QString("%1 ").arg(decoder()->_typeList[ii]);
-        emit(newMessage(_staID + ": Received message type " + type.toLatin1(), true));
+        QString type = QString("%1 ").arg(decoder()->_typeList[ii].type);
+        QString size = (decoder()->_typeList[ii].size) ? QString("(size %1)").arg(decoder()->_typeList[ii].size) : "";
+        emit(newMessage(_staID + ": Received message type " + type.toLatin1() +  size.toLatin1(), true));
       }
 
@@ -959,7 +960,16 @@
         }
       }
+
+      // RTCM GLONASS Code-Phase biases (MT 1230)
+      // ----------------------------------------
+      if (decoder()->_gloBiases.changed) {
+        QString gloCodePhaseBiases = decoder()->_gloBiases.toString();
+        emit(newMessage(_staID + gloCodePhaseBiases.toLatin1(), true));
+      }
+
+      // Service CRS / RTCM CRS
+      // ------------------------
       if (fmod(decoder()->corrGPSEpochTime(), 60.0) == 0.0) {
         // Service CRS
-        // -----------
         for (int ii = 0; ii < decoder()->_serviceCrs.size(); ii++) {
           QString servicecrsname  = QString(": Service CRS Name: %1 ").arg(decoder()->_serviceCrs[ii]._name);
@@ -970,7 +980,5 @@
           //emit(newMessage(_staID + ce.toLatin1(), true));
         }
-
         // RTCM CRS
-        // -----------
         for (int ii = 0; ii < decoder()->_rtcmCrs.size(); ii++) {
           QString rtcmcrsname = QString(": RTCM CRS Name: %1 ").arg(decoder()->_rtcmCrs[ii]._name);
@@ -1040,4 +1048,5 @@
 
   decoder()->_gloFrq.clear();
+ // decoder()->_gloBiases.clear();
   decoder()->_typeList.clear();
   decoder()->_antType.clear();
Index: trunk/BNC/src/ephemeris.cpp
===================================================================
--- trunk/BNC/src/ephemeris.cpp	(revision 10687)
+++ trunk/BNC/src/ephemeris.cpp	(revision 10688)
@@ -620,8 +620,8 @@
           _flags_unknown = false;
           // Bit 0:
-          _intSF = double(bitExtracted(int(statusflags), 1, 0));
+          _intSF = double(bitExtracted(unsigned(statusflags), 1, 0));
           if (system() == t_eph::QZSS) {
             // Bit 1:
-            _ephSF = double(bitExtracted(int(statusflags), 1, 1));
+            _ephSF = double(bitExtracted(unsigned(statusflags), 1, 1));
           }
         }
@@ -1269,15 +1269,15 @@
           // ============
           // bit 0-1
-          _M_P =  double(bitExtracted(int(statusflags), 2, 0));
+          _M_P =  double(bitExtracted(unsigned(statusflags), 2, 0));
           // bit 2-3
-          _P1 =   double(bitExtracted(int(statusflags), 2, 2));
+          _P1 =   double(bitExtracted(unsigned(statusflags), 2, 2));
           // bit 4
-          _P2 =   double(bitExtracted(int(statusflags), 1, 4));
+          _P2 =   double(bitExtracted(unsigned(statusflags), 1, 4));
           // bit 5
-          _P3 =   double(bitExtracted(int(statusflags), 1, 5));
+          _P3 =   double(bitExtracted(unsigned(statusflags), 1, 5));
           // bit 6
-          _M_P4 = double(bitExtracted(int(statusflags), 1, 6));
+          _M_P4 = double(bitExtracted(unsigned(statusflags), 1, 6));
           // bit 7-8
-          _M_M =  double(bitExtracted(int(statusflags), 2, 7));
+          _M_M =  double(bitExtracted(unsigned(statusflags), 2, 7));
           /// GLO M/K exclusive flags/values only valid if flag M is set to '01'
           if (!_M_M) {
@@ -1312,10 +1312,10 @@
           // ============
           // bit 0 (is to be ignored, if bit 1 is zero)
-          _almanac_health = double(bitExtracted(int(healthflags), 1, 0));
+          _almanac_health = double(bitExtracted(unsigned(healthflags), 1, 0));
           // bit 1
           _almanac_health_availablility_indicator =
-                            double(bitExtracted(int(healthflags), 1, 1));
+                            double(bitExtracted(unsigned(healthflags), 1, 1));
           //  bit 2; GLO-M/K only, health bit of string 3
-          _M_l3 =           double(bitExtracted(int(healthflags), 1, 2));
+          _M_l3 =           double(bitExtracted(unsigned(healthflags), 1, 2));
         }
       }
@@ -1332,7 +1332,7 @@
         // ============
         // bit 0-1
-        _RT = double(bitExtracted(int(sourceflags), 2, 0));
+        _RT = double(bitExtracted(unsigned(sourceflags), 2, 0));
         // bit 2-3:
-        _RE = double(bitExtracted(int(sourceflags), 2, 2));
+        _RE = double(bitExtracted(unsigned(sourceflags), 2, 2));
       }
     }
@@ -1904,15 +1904,15 @@
       } else {
         // Bit 0
-        _E1B_DataInvalid = bitExtracted(int(SVhealth), 1, 0);
+        _E1B_DataInvalid = bitExtracted(unsigned(SVhealth), 1, 0);
         // Bit 1-2
-        _E1B_HS =   double(bitExtracted(int(SVhealth), 2, 1));
+        _E1B_HS =   double(bitExtracted(unsigned(SVhealth), 2, 1));
         // Bit 3
-        _E5a_DataInvalid = bitExtracted(int(SVhealth), 1, 3);
+        _E5a_DataInvalid = bitExtracted(unsigned(SVhealth), 1, 3);
         // Bit 4-5
-        _E5a_HS =   double(bitExtracted(int(SVhealth), 2, 4));
+        _E5a_HS =   double(bitExtracted(unsigned(SVhealth), 2, 4));
         // Bit 6
-        _E5b_DataInvalid = bitExtracted(int(SVhealth), 1, 6);
+        _E5b_DataInvalid = bitExtracted(unsigned(SVhealth), 1, 6);
         // Bit 7-8
-        _E5b_HS =   double(bitExtracted(int(SVhealth), 2, 7));
+        _E5b_HS =   double(bitExtracted(unsigned(SVhealth), 2, 7));
         if (_fnav) {
           _BGD_1_5B = 0.0;
@@ -2379,5 +2379,5 @@
 
 // Bit 5
-  bool URAindexIs15 =  bitExtracted(int(_health), 1, 5);
+  bool URAindexIs15 =  bitExtracted(unsigned(_health), 1, 5);
   if (URAindexIs15) {
     // in this case it is recommended
@@ -2387,5 +2387,5 @@
 
   // Bit 4
-  bool MT17HealthIsUnavailable = bitExtracted(int(_health), 1, 4);
+  bool MT17HealthIsUnavailable = bitExtracted(unsigned(_health), 1, 4);
   if (MT17HealthIsUnavailable) {
     return 0;
@@ -2393,5 +2393,5 @@
 
   // Bit 0-3
-  int MT17health = bitExtracted(int(_health), 4, 0);
+  int MT17health = bitExtracted(unsigned(_health), 4, 0);
   if (MT17health) {
     return 1;
Index: trunk/BNC/src/orbComp/sp3Comp.cpp
===================================================================
--- trunk/BNC/src/orbComp/sp3Comp.cpp	(revision 10687)
+++ trunk/BNC/src/orbComp/sp3Comp.cpp	(revision 10688)
@@ -282,5 +282,5 @@
             epo->_dr[sat1->_prn]  = sat1->_xyz - sat2->_xyz;
             // temporarily included START
-            if (epo->_dr[sat1->_prn].NormFrobenius() > 1.0) {
+            if (epo->_dr[sat1->_prn].NormFrobenius() > 10.0) {
               epochOK = false;
                out << "! " << epo->_tt.timestr().c_str() << "  "  << sat1->_prn.toString().c_str() << "excluded \n"
