Index: /branches/BNC_2.12/src/PPP/pppSatObs.cpp
===================================================================
--- /branches/BNC_2.12/src/PPP/pppSatObs.cpp	(revision 8540)
+++ /branches/BNC_2.12/src/PPP/pppSatObs.cpp	(revision 8541)
@@ -62,4 +62,5 @@
   // ------------------------------------------
   const string preferredAttrib = "CWPXI_";
+  //const string preferredAttrib = "G:12&PWCSLXYN G:5&IQX R:12&PC R:3&IQX E:16&BCX E:578&IQX J:1&SLXCZ J:26&SLX J:5&IQX C:IQX I:ABCX S:1&C S:5&IQX";
 
   for (unsigned iFreq = 1; iFreq < t_frequency::max; iFreq++) {
@@ -106,8 +107,8 @@
   // Compute Satellite Coordinates at Time of Transmission
   // -----------------------------------------------------
-  _xcSat.ReSize(7); _xcSat = 0.0;
+  _xcSat.ReSize(6); _xcSat = 0.0;
   _vvSat.ReSize(3); _vvSat = 0.0;
   bool totOK  = false;
-  ColumnVector satPosOld(7); satPosOld = 0.0;
+  ColumnVector satPosOld(6); satPosOld = 0.0;
   t_lc::type tLC = isValid(t_lc::cIF) ? t_lc::cIF : t_lc::c1;
   double prange = obsValue(tLC);
Index: /branches/BNC_2.12/src/PPP_SSR_I/pppClient.cpp
===================================================================
--- /branches/BNC_2.12/src/PPP_SSR_I/pppClient.cpp	(revision 8540)
+++ /branches/BNC_2.12/src/PPP_SSR_I/pppClient.cpp	(revision 8541)
@@ -408,5 +408,5 @@
     bncTime ToT = satData->tt - prange / t_CST::c - clkSat;
 
-    ColumnVector xc(7);
+    ColumnVector xc(6);
     ColumnVector vv(3);
     if (getSatPos(ToT, satData->prn, xc, vv) != success) {
Index: /branches/BNC_2.12/src/RTCM/rtcm_utils.cpp
===================================================================
--- /branches/BNC_2.12/src/RTCM/rtcm_utils.cpp	(revision 8540)
+++ /branches/BNC_2.12/src/RTCM/rtcm_utils.cpp	(revision 8541)
@@ -35,5 +35,5 @@
   // --------------
   rho = 0.0;
-  ColumnVector xc(7);
+  ColumnVector xc(6);
   ColumnVector vv(3);
   eph->getCrd(bncTime(GPSWeek, GPSWeeks), xc, vv, false);
Index: /branches/BNC_2.12/src/bncephuser.cpp
===================================================================
--- /branches/BNC_2.12/src/bncephuser.cpp	(revision 8540)
+++ /branches/BNC_2.12/src/bncephuser.cpp	(revision 8541)
@@ -189,5 +189,5 @@
   // Simple Check - check satellite radial distance
   // ----------------------------------------------
-  ColumnVector xc(7);
+  ColumnVector xc(6);
   ColumnVector vv(3);
   if (eph->getCrd(eph->TOC(), xc, vv, false) != success) {
Index: /branches/BNC_2.12/src/combination/bnccomb.cpp
===================================================================
--- /branches/BNC_2.12/src/combination/bnccomb.cpp	(revision 8540)
+++ /branches/BNC_2.12/src/combination/bnccomb.cpp	(revision 8541)
@@ -449,9 +449,9 @@
   }
 
-  ColumnVector oldXC(7);
+  ColumnVector oldXC(6);
   ColumnVector oldVV(3);
   corr->_eph->getCrd(corr->_time, oldXC, oldVV, false);
 
-  ColumnVector newXC(7);
+  ColumnVector newXC(6);
   ColumnVector newVV(3);
   lastEph->getCrd(corr->_time, newXC, newVV, false);
@@ -688,5 +688,5 @@
     const t_eph* eph = corr->_eph;
     if (eph) {
-      ColumnVector xc(7);
+      ColumnVector xc(6);
       ColumnVector vv(3);
       eph->getCrd(_resTime, xc, vv, false);
@@ -740,5 +740,5 @@
     clkCorrections.push_back(clkCorr);
 
-    ColumnVector xc(7);
+    ColumnVector xc(6);
     ColumnVector vv(3);
     corr->_eph->setClkCorr(dynamic_cast<const t_clkCorr*>(&clkCorr));
Index: /branches/BNC_2.12/src/ephemeris.cpp
===================================================================
--- /branches/BNC_2.12/src/ephemeris.cpp	(revision 8540)
+++ /branches/BNC_2.12/src/ephemeris.cpp	(revision 8541)
@@ -65,5 +65,5 @@
                                                  << 900 << 1800 << 3600 << 7200
                                                  << 10800;
-  xc.ReSize(7);
+  xc.ReSize(6);
   vv.ReSize(3);
   if (position(tt.gpsw(), tt.gpssec(), xc.data(), vv.data()) != success) {
@@ -320,5 +320,5 @@
   static const double gmGRS      = 398.6005e12;
 
-  memset(xc, 0, 7*sizeof(double));
+  memset(xc, 0, 6*sizeof(double));
   memset(vv, 0, 3*sizeof(double));
 
@@ -368,8 +368,4 @@
   double tc = tt - _TOC;
   xc[3] = _clock_bias + _clock_drift*tc + _clock_driftrate*tc*tc;
-
-  xc[4] = _clock_bias;
-  xc[5] = _clock_drift;
-  xc[6] = _clock_driftrate;
 
   // Velocity
@@ -402,4 +398,7 @@
   xc[3] -= 2.0 * (xc[0]*vv[0] + xc[1]*vv[1] + xc[2]*vv[2]) / t_CST::c / t_CST::c;
 
+  xc[4] = _clock_drift + _clock_driftrate*tc;
+  xc[5] = _clock_driftrate;
+
   return success;
 }
@@ -618,5 +617,5 @@
   static const double nominalStep = 10.0;
 
-  memset(xc, 0, 7*sizeof(double));
+  memset(xc, 0, 6*sizeof(double));
   memset(vv, 0, 3*sizeof(double));
 
@@ -655,7 +654,6 @@
   xc[3] = -_tau + _gamma * dtClk;
 
-  xc[4] = -_tau;
-  xc[5] = _gamma;
-  xc[6] = 0.0;
+  xc[4] = _gamma;
+  xc[5] = 0.0;
 
   return success;
@@ -922,5 +920,5 @@
   static const double gmWGS = 398.6004418e12;
 
-  memset(xc, 0, 7*sizeof(double));
+  memset(xc, 0, 6*sizeof(double));
   memset(vv, 0, 3*sizeof(double));
 
@@ -970,8 +968,4 @@
   double tc = tt - _TOC;
   xc[3] = _clock_bias + _clock_drift*tc + _clock_driftrate*tc*tc;
-
-  xc[4] = _clock_bias;
-  xc[5] = _clock_drift;
-  xc[6] = _clock_driftrate;
 
   // Velocity
@@ -1006,4 +1000,7 @@
   //xc[3] -= 2.0 * (xc[0]*vv[0] + xc[1]*vv[1] + xc[2]*vv[2]) / t_CST::c / t_CST::c;
 
+  xc[4] = _clock_drift + _clock_driftrate*tc;
+  xc[5] = _clock_driftrate;
+
   return success;
 }
@@ -1317,7 +1314,6 @@
   xc[3] = _agf0 + _agf1 * dt;
 
-  xc[4] = _agf0;
-  xc[5] = _agf1;
-  xc[6] = 0.0;
+  xc[4] = _agf1;
+  xc[5] = 0.0;
 
   return success;
@@ -1698,8 +1694,4 @@
   xc[3] = _clock_bias + _clock_drift*tc + _clock_driftrate*tc*tc;
 
-  xc[4] = _clock_bias;
-  xc[5] = _clock_drift;
-  xc[6] = _clock_driftrate;
-
   // dotC  = _clock_drift + _clock_driftrate*tc
   //       - 4.442807633e-10*_e*sqrt(a0)*cos(E) * dEdM * n;
@@ -1708,7 +1700,10 @@
   // -----------------------
   // correspondent to BDS ICD and to SSR standard
-    xc[3] -= 4.442807633e-10 * _e * sqrt(a0) *sin(E);
+  xc[3] -= 4.442807633e-10 * _e * sqrt(a0) *sin(E);
   // correspondent to IGS convention
   // xc[3] -= 2.0 * (xc[0]*vv[0] + xc[1]*vv[1] + xc[2]*vv[2]) / t_CST::c / t_CST::c;
+
+  xc[4] = _clock_drift + _clock_driftrate*tc;
+  xc[5] = _clock_driftrate;
 
   return success;
Index: /branches/BNC_2.12/src/rinex/reqcanalyze.cpp
===================================================================
--- /branches/BNC_2.12/src/rinex/reqcanalyze.cpp	(revision 8540)
+++ /branches/BNC_2.12/src/rinex/reqcanalyze.cpp	(revision 8541)
@@ -288,5 +288,5 @@
     }
     if (eph) {
-      ColumnVector xSat(7);
+      ColumnVector xSat(6);
       ColumnVector vv(3);
       if (eph->getCrd(_currEpo->tt, xSat, vv, false) == success) {
@@ -351,5 +351,5 @@
   }
   if (eph) {
-    ColumnVector xc(7);
+    ColumnVector xc(6);
     ColumnVector vv(3);
     if ( xyzSta.size() == 3 && (xyzSta[0] != 0.0 || xyzSta[1] != 0.0 || xyzSta[2] != 0.0) &&
@@ -1101,5 +1101,5 @@
       for (epoTime = startTime - interval; epoTime < endTime;
            epoTime = epoTime + interval) {
-        ColumnVector xc(7);
+        ColumnVector xc(6);
         ColumnVector vv(3);
         if ( xyzSta.size() == 3 && (xyzSta[0] != 0.0 || xyzSta[1] != 0.0 || xyzSta[2] != 0.0) &&
Index: /branches/BNC_2.12/src/upload/bncrtnetuploadcaster.cpp
===================================================================
--- /branches/BNC_2.12/src/upload/bncrtnetuploadcaster.cpp	(revision 8540)
+++ /branches/BNC_2.12/src/upload/bncrtnetuploadcaster.cpp	(revision 8541)
@@ -337,5 +337,5 @@
     ColumnVector rtnClkSig; // [m, m/s, m/s²]
     t_prn prn;
-
+    
     QTextStream in(lines[ii].toAscii());
 
@@ -373,4 +373,5 @@
     int number = key.mid(1, 2).toInt();
     int flags = 0;
+
     if (sys == 'E') { // I/NAV
       flags = 1;
@@ -503,9 +504,10 @@
         }
         else {
-          in >> numVal;
-          for (int ii = 0; ii < numVal; ii++) {
-            double dummy;
-            in >> dummy;
-          }
+          emit(newMessage("                      RTNET format error: "
+                          +  lines[ii].toAscii(), false));
+          qDebug() << "bncRtnetUploadCaster: decode " + QByteArray(epoTime.datestr().c_str())
+                      + " " + QByteArray(epoTime.timestr().c_str()) + " "
+                      + _casterID.toAscii();
+          qDebug() << "                      RTNET format error: " + lines[ii].toAscii();
         }
       }
@@ -544,6 +546,9 @@
       if (sd) {
         QString outLine;
-        processSatellite(eph, epoTime.gpsw(), epoTime.gpssec(), prnStr, rtnAPC, rtnUra,
-            rtnClk, rtnVel, rtnCoM, rtnClkSig, sd, outLine);
+        t_irc irc = processSatellite(eph, epoTime.gpsw(), epoTime.gpssec(), prnStr, rtnAPC,
+                                     rtnUra, rtnClk, rtnVel, rtnCoM, rtnClkSig, sd, outLine);
+        if (irc != success) {
+          continue;
+        }
       }
 
@@ -2259,5 +2264,5 @@
 //
 ////////////////////////////////////////////////////////////////////////////
-void bncRtnetUploadCaster::processSatellite(const t_eph* eph, int GPSweek,
+t_irc bncRtnetUploadCaster::processSatellite(const t_eph* eph, int GPSweek,
     double GPSweeks, const QString& prn, const ColumnVector& rtnAPC,
     double rtnUra, const ColumnVector& rtnClk, const ColumnVector& rtnVel,
@@ -2267,11 +2272,19 @@
   // Broadcast Position and Velocity
   // -------------------------------
-  ColumnVector xB(7);
+  ColumnVector xB(6);
   ColumnVector vB(3);
-  eph->getCrd(bncTime(GPSweek, GPSweeks), xB, vB, false);
+  t_irc irc = eph->getCrd(bncTime(GPSweek, GPSweeks), xB, vB, false);
+
+  if (irc != success) {
+    return irc;
+  }
 
   // Precise Position
   // ----------------
   ColumnVector xP = _CoM ? rtnCoM : rtnAPC;
+
+  if (xP.size() == 0) {
+    return failure;
+  }
 
   double dc = 0.0;
@@ -2296,13 +2309,6 @@
   // ----------------
   double dClkA0 = rtnClk(1) - (xB(4) - dc) * t_CST::c;
-  double dClkA1 = 0.0;
-  double dClkA2 = 0.0;
-  if (rtnClk(2)) {
-    dClkA0 = rtnClk(1) - (xB(5) - dc) * t_CST::c;
-    dClkA1 = rtnClk(2) -  xB(6) * t_CST::c;
-  }
-  if (rtnClk(3)) {
-    dClkA2 = rtnClk(3) - xB(7) * t_CST::c;
-  }
+  double dClkA1 = rtnClk(2) -  xB(5) * t_CST::c;
+  double dClkA2 = rtnClk(3) -  xB(6) * t_CST::c;
 
   if (sd) {
@@ -2358,4 +2364,5 @@
     _sp3->write(GPSweek, GPSweeks, prn, rtnCoM, clkRnx, rtnVel, clkRnxRate);
   }
+  return success;
 }
 
Index: /branches/BNC_2.12/src/upload/bncrtnetuploadcaster.h
===================================================================
--- /branches/BNC_2.12/src/upload/bncrtnetuploadcaster.h	(revision 8540)
+++ /branches/BNC_2.12/src/upload/bncrtnetuploadcaster.h	(revision 8541)
@@ -29,5 +29,5 @@
   virtual ~bncRtnetUploadCaster();
  private:
-  void processSatellite(const t_eph* eph, int GPSweek,
+  t_irc processSatellite(const t_eph* eph, int GPSweek,
                         double GPSweeks, const QString& prn,
                         const ColumnVector& rtnAPC,
