Index: /trunk/BNC/src/RTCM3/clock_and_orbit/clock_orbit_rtcm.c
===================================================================
--- /trunk/BNC/src/RTCM3/clock_and_orbit/clock_orbit_rtcm.c	(revision 8966)
+++ /trunk/BNC/src/RTCM3/clock_and_orbit/clock_orbit_rtcm.c	(revision 8967)
@@ -551,7 +551,7 @@
 
   for (s = 0; s < CLOCKORBIT_SATNUM; ++s) {
-    if (b->NumberOfSat[s] && (type == BTYPE_AUTO || type == corbase[s] + COBOFS_BIAS)) {
+    if (b->NumberOfSat[s] && (type == CBTYPE_AUTO || type == corbase[s] + COBOFS_CBIAS)) {
       INITBLOCK
-      T_MESSAGE_NUMBER(corbase[s] + COBOFS_BIAS)
+      T_MESSAGE_NUMBER(corbase[s] + COBOFS_CBIAS)
       switch (s) {
         case CLOCKORBIT_SATGPS:
@@ -1289,5 +1289,5 @@
           }
           break;
-        case COBOFS_BIAS:
+        case COBOFS_CBIAS:
           if (!b)
             return GCOBR_NOCODEBIASPARAMETER;
Index: /trunk/BNC/src/RTCM3/clock_and_orbit/clock_orbit_rtcm.h
===================================================================
--- /trunk/BNC/src/RTCM3/clock_and_orbit/clock_orbit_rtcm.h	(revision 8966)
+++ /trunk/BNC/src/RTCM3/clock_and_orbit/clock_orbit_rtcm.h	(revision 8967)
@@ -13,5 +13,8 @@
 #include <string.h>
 
-enum SatelliteReferenceDatum { DATUM_ITRF=0, DATUM_LOCAL=1 };
+enum SatelliteReferenceDatum {
+  DATUM_ITRF  = 0,
+  DATUM_LOCAL = 1
+};
 
 enum COR_BASE {
@@ -27,5 +30,5 @@
   COBOFS_ORBIT = 0,
   COBOFS_CLOCK,
-  COBOFS_BIAS,
+  COBOFS_CBIAS,
   COBOFS_COMBINED,
   COBOFS_URA,
@@ -35,7 +38,7 @@
 
 enum ClockOrbitType {
-  COTYPE_GPSORBIT    = COBBASE_GPS + COBOFS_ORBIT,
+  COTYPE_GPSORBIT        = COBBASE_GPS + COBOFS_ORBIT,
   COTYPE_GPSCLOCK,
-  COTYPE_GPSCOMBINED = COBBASE_GPS + COBOFS_COMBINED,
+  COTYPE_GPSCOMBINED     = COBBASE_GPS + COBOFS_COMBINED,
   COTYPE_GPSURA,
   COTYPE_GPSHR,
@@ -53,19 +56,19 @@
   COTYPE_GALILEOHR,
 
-  COTYPE_QZSSORBIT    = COBBASE_QZSS + COBOFS_ORBIT,
+  COTYPE_QZSSORBIT       = COBBASE_QZSS + COBOFS_ORBIT,
   COTYPE_QZSSCLOCK,
-  COTYPE_QZSSCOMBINED = COBBASE_QZSS + COBOFS_COMBINED,
+  COTYPE_QZSSCOMBINED    = COBBASE_QZSS + COBOFS_COMBINED,
   COTYPE_QZSSURA,
   COTYPE_QZSSHR,
 
-  COTYPE_SBASORBIT    = COBBASE_SBAS + COBOFS_ORBIT,
+  COTYPE_SBASORBIT       = COBBASE_SBAS + COBOFS_ORBIT,
   COTYPE_SBASCLOCK,
-  COTYPE_SBASCOMBINED = COBBASE_SBAS + COBOFS_COMBINED,
+  COTYPE_SBASCOMBINED    = COBBASE_SBAS + COBOFS_COMBINED,
   COTYPE_SBASURA,
   COTYPE_SBASHR,
 
-  COTYPE_BDSORBIT    = COBBASE_BDS + COBOFS_ORBIT,
+  COTYPE_BDSORBIT        = COBBASE_BDS + COBOFS_ORBIT,
   COTYPE_BDSCLOCK,
-  COTYPE_BDSCOMBINED = COBBASE_BDS + COBOFS_COMBINED,
+  COTYPE_BDSCOMBINED     = COBBASE_BDS + COBOFS_COMBINED,
   COTYPE_BDSURA,
   COTYPE_BDSHR,
@@ -75,16 +78,16 @@
 
 enum CodeBiasType {
-  BTYPE_GPS     = COBBASE_GPS     + COBOFS_BIAS,
-  BTYPE_GLONASS = COBBASE_GLONASS + COBOFS_BIAS,
-  BTYPE_GALILEO = COBBASE_GALILEO + COBOFS_BIAS,
-  BTYPE_QZSS    = COBBASE_QZSS    + COBOFS_BIAS,
-  BTYPE_SBAS    = COBBASE_SBAS    + COBOFS_BIAS,
-  BTYPE_BDS     = COBBASE_BDS     + COBOFS_BIAS,
-  BTYPE_AUTO = 0
+  CBTYPE_GPS     = COBBASE_GPS     + COBOFS_CBIAS,
+  CBTYPE_GLONASS = COBBASE_GLONASS + COBOFS_CBIAS,
+  CBTYPE_GALILEO = COBBASE_GALILEO + COBOFS_CBIAS,
+  CBTYPE_QZSS    = COBBASE_QZSS    + COBOFS_CBIAS,
+  CBTYPE_SBAS    = COBBASE_SBAS    + COBOFS_CBIAS,
+  CBTYPE_BDS     = COBBASE_BDS     + COBOFS_CBIAS,
+  CBTYPE_AUTO = 0
 };
 
 enum PhaseBiasType {
-  PBTYPE_BASE = 1265,
-  PBTYPE_GPS = PBTYPE_BASE,
+  PBTYPE_BASE    = 1265,
+  PBTYPE_GPS     = PBTYPE_BASE,
   PBTYPE_GLONASS,
   PBTYPE_GALILEO,
@@ -102,15 +105,15 @@
 for these systems to save space */
 enum COR_CONSTANTS {
-  CLOCKORBIT_BUFFERSIZE=8192,
-  CLOCKORBIT_NUMGPS=32,
-  CLOCKORBIT_NUMGLONASS=26,
-  CLOCKORBIT_NUMGALILEO=36,
-  CLOCKORBIT_NUMQZSS=10,
-  CLOCKORBIT_NUMSBAS=38,
-  CLOCKORBIT_NUMBDS=65,
-  CLOCKORBIT_NUMBIAS=100,
-  CLOCKORBIT_NUMIONOLAYERS=4,
-  CLOCKORBIT_MAXIONOORDER=16,
-  CLOCKORBIT_MAXIONODEGREE=16
+  CLOCKORBIT_BUFFERSIZE    = 8192,
+  CLOCKORBIT_NUMGPS        =   32,
+  CLOCKORBIT_NUMGLONASS    =   26,
+  CLOCKORBIT_NUMGALILEO    =   36,
+  CLOCKORBIT_NUMQZSS       =   10,
+  CLOCKORBIT_NUMBDS        =   65,
+  CLOCKORBIT_NUMSBAS       =   38,
+  CLOCKORBIT_NUMBIAS       =  100,
+  CLOCKORBIT_NUMIONOLAYERS =    4,
+  CLOCKORBIT_MAXIONOORDER  =   16,
+  CLOCKORBIT_MAXIONODEGREE =   16
 };
 
@@ -120,6 +123,6 @@
   CLOCKORBIT_SATGALILEO,
   CLOCKORBIT_SATQZSS,
+  CLOCKORBIT_SATBDS,
   CLOCKORBIT_SATSBAS,
-  CLOCKORBIT_SATBDS,
   CLOCKORBIT_SATNUM
 };
@@ -128,12 +131,12 @@
   CLOCKORBIT_OFFSETGPS     = 0,
   CLOCKORBIT_OFFSETGLONASS = CLOCKORBIT_NUMGPS,
-  CLOCKORBIT_OFFSETGALILEO = CLOCKORBIT_NUMGPS + CLOCKORBIT_NUMGLONASS,
-  CLOCKORBIT_OFFSETQZSS    = CLOCKORBIT_NUMGPS + CLOCKORBIT_NUMGLONASS + CLOCKORBIT_NUMGALILEO,
-  CLOCKORBIT_OFFSETSBAS    = CLOCKORBIT_NUMGPS + CLOCKORBIT_NUMGLONASS + CLOCKORBIT_NUMGALILEO
+  CLOCKORBIT_OFFSETGALILEO = CLOCKORBIT_NUMGPS  + CLOCKORBIT_NUMGLONASS,
+  CLOCKORBIT_OFFSETQZSS    = CLOCKORBIT_NUMGPS  + CLOCKORBIT_NUMGLONASS + CLOCKORBIT_NUMGALILEO,
+  CLOCKORBIT_OFFSETBDS     = CLOCKORBIT_NUMGPS  + CLOCKORBIT_NUMGLONASS + CLOCKORBIT_NUMGALILEO
                            + CLOCKORBIT_NUMQZSS,
-  CLOCKORBIT_OFFSETBDS     = CLOCKORBIT_NUMGPS + CLOCKORBIT_NUMGLONASS + CLOCKORBIT_NUMGALILEO
-                           + CLOCKORBIT_NUMQZSS + CLOCKORBIT_NUMSBAS,
-  CLOCKORBIT_COUNTSAT      = CLOCKORBIT_NUMGPS + CLOCKORBIT_NUMGLONASS + CLOCKORBIT_NUMGALILEO
-                           + CLOCKORBIT_NUMQZSS + CLOCKORBIT_NUMSBAS + CLOCKORBIT_NUMBDS
+  CLOCKORBIT_OFFSETSBAS    = CLOCKORBIT_NUMGPS  + CLOCKORBIT_NUMGLONASS + CLOCKORBIT_NUMGALILEO
+                           + CLOCKORBIT_NUMQZSS + CLOCKORBIT_NUMBDS,
+  CLOCKORBIT_COUNTSAT      = CLOCKORBIT_NUMGPS  + CLOCKORBIT_NUMGLONASS + CLOCKORBIT_NUMGALILEO
+                           + CLOCKORBIT_NUMSBAS + CLOCKORBIT_NUMQZSS    + CLOCKORBIT_NUMBDS
 };
 
Index: /trunk/BNC/src/upload/bncrtnetuploadcaster.cpp
===================================================================
--- /trunk/BNC/src/upload/bncrtnetuploadcaster.cpp	(revision 8966)
+++ /trunk/BNC/src/upload/bncrtnetuploadcaster.cpp	(revision 8967)
@@ -559,23 +559,24 @@
       else if (prn.system() == 'E') {
         sd = co.Sat + CLOCKORBIT_NUMGPS + CLOCKORBIT_NUMGLONASS
-            + co.NumberOfSat[CLOCKORBIT_SATGALILEO];
+           + co.NumberOfSat[CLOCKORBIT_SATGALILEO];
         ++co.NumberOfSat[CLOCKORBIT_SATGALILEO];
       }
       else if (prn.system() == 'J') {
         sd = co.Sat + CLOCKORBIT_NUMGPS + CLOCKORBIT_NUMGLONASS
-            + CLOCKORBIT_NUMGALILEO + co.NumberOfSat[CLOCKORBIT_SATQZSS];
+           + CLOCKORBIT_NUMGALILEO
+		   + co.NumberOfSat[CLOCKORBIT_SATQZSS];
         ++co.NumberOfSat[CLOCKORBIT_SATQZSS];
+      }
+      else if (prn.system() == 'C') {
+        sd = co.Sat + CLOCKORBIT_NUMGPS + CLOCKORBIT_NUMGLONASS
+           + CLOCKORBIT_NUMGALILEO + CLOCKORBIT_NUMQZSS
+           + co.NumberOfSat[CLOCKORBIT_SATBDS];
+        ++co.NumberOfSat[CLOCKORBIT_SATBDS];
       }
       else if (prn.system() == 'S') {
         sd = co.Sat + CLOCKORBIT_NUMGPS + CLOCKORBIT_NUMGLONASS
-            + CLOCKORBIT_NUMGALILEO + CLOCKORBIT_NUMQZSS
-            + co.NumberOfSat[CLOCKORBIT_SATSBAS];
+           + CLOCKORBIT_NUMGALILEO + CLOCKORBIT_NUMQZSS  + CLOCKORBIT_NUMSBAS
+           + co.NumberOfSat[CLOCKORBIT_SATSBAS];
         ++co.NumberOfSat[CLOCKORBIT_SATSBAS];
-      }
-      else if (prn.system() == 'C') {
-        sd = co.Sat + CLOCKORBIT_NUMGPS + CLOCKORBIT_NUMGLONASS
-            + CLOCKORBIT_NUMGALILEO + CLOCKORBIT_NUMQZSS + CLOCKORBIT_NUMSBAS
-            + co.NumberOfSat[CLOCKORBIT_SATBDS];
-        ++co.NumberOfSat[CLOCKORBIT_SATBDS];
       }
       if (sd) {
@@ -600,28 +601,29 @@
         else if (prn.system() == 'R') {
           biasSat = bias.Sat + CLOCKORBIT_NUMGPS
-              + bias.NumberOfSat[CLOCKORBIT_SATGLONASS];
+                  + bias.NumberOfSat[CLOCKORBIT_SATGLONASS];
           ++bias.NumberOfSat[CLOCKORBIT_SATGLONASS];
         }
         else if (prn.system() == 'E') {
           biasSat = bias.Sat + CLOCKORBIT_NUMGPS + CLOCKORBIT_NUMGLONASS
-              + bias.NumberOfSat[CLOCKORBIT_SATGALILEO];
+                   + bias.NumberOfSat[CLOCKORBIT_SATGALILEO];
           ++bias.NumberOfSat[CLOCKORBIT_SATGALILEO];
         }
         else if (prn.system() == 'J') {
           biasSat = bias.Sat + CLOCKORBIT_NUMGPS + CLOCKORBIT_NUMGLONASS
-              + CLOCKORBIT_NUMGALILEO + bias.NumberOfSat[CLOCKORBIT_SATQZSS];
+                  + CLOCKORBIT_NUMGALILEO
+			      + bias.NumberOfSat[CLOCKORBIT_SATQZSS];
           ++bias.NumberOfSat[CLOCKORBIT_SATQZSS];
+        }
+        else if (prn.system() == 'C') {
+          biasSat = bias.Sat + CLOCKORBIT_NUMGPS + CLOCKORBIT_NUMGLONASS
+                   + CLOCKORBIT_NUMGALILEO + CLOCKORBIT_NUMQZSS
+                   + bias.NumberOfSat[CLOCKORBIT_SATBDS];
+          ++bias.NumberOfSat[CLOCKORBIT_SATBDS];
         }
         else if (prn.system() == 'S') {
           biasSat = bias.Sat + CLOCKORBIT_NUMGPS + CLOCKORBIT_NUMGLONASS
-              + CLOCKORBIT_NUMGALILEO + CLOCKORBIT_NUMQZSS
-              + bias.NumberOfSat[CLOCKORBIT_SATSBAS];
+                  + CLOCKORBIT_NUMGALILEO + CLOCKORBIT_NUMQZSS + CLOCKORBIT_NUMBDS
+                  + bias.NumberOfSat[CLOCKORBIT_SATSBAS];
           ++bias.NumberOfSat[CLOCKORBIT_SATSBAS];
-        }
-        else if (prn.system() == 'C') {
-          biasSat = bias.Sat + CLOCKORBIT_NUMGPS + CLOCKORBIT_NUMGLONASS
-              + CLOCKORBIT_NUMGALILEO + CLOCKORBIT_NUMQZSS + CLOCKORBIT_NUMSBAS
-              + bias.NumberOfSat[CLOCKORBIT_SATBDS];
-          ++bias.NumberOfSat[CLOCKORBIT_SATBDS];
         }
       }
@@ -1371,27 +1373,25 @@
         }
         else if (prn.system() == 'E') {
-          phasebiasSat = phasebias.Sat + CLOCKORBIT_NUMGPS
-              + CLOCKORBIT_NUMGLONASS
+          phasebiasSat = phasebias.Sat + CLOCKORBIT_NUMGPS  + CLOCKORBIT_NUMGLONASS
               + phasebias.NumberOfSat[CLOCKORBIT_SATGALILEO];
           ++phasebias.NumberOfSat[CLOCKORBIT_SATGALILEO];
         }
         else if (prn.system() == 'J') {
-          phasebiasSat = phasebias.Sat + CLOCKORBIT_NUMGPS
-              + CLOCKORBIT_NUMGLONASS + CLOCKORBIT_NUMGALILEO
-              + phasebias.NumberOfSat[CLOCKORBIT_SATQZSS];
+          phasebiasSat = phasebias.Sat + CLOCKORBIT_NUMGPS  + CLOCKORBIT_NUMGLONASS
+        		       + CLOCKORBIT_NUMGALILEO
+                       + phasebias.NumberOfSat[CLOCKORBIT_SATQZSS];
           ++phasebias.NumberOfSat[CLOCKORBIT_SATQZSS];
         }
+        else if (prn.system() == 'C') {
+          phasebiasSat = phasebias.Sat + CLOCKORBIT_NUMGPS  + CLOCKORBIT_NUMGLONASS
+        		       + CLOCKORBIT_NUMGALILEO + CLOCKORBIT_NUMQZSS
+                       + phasebias.NumberOfSat[CLOCKORBIT_SATBDS];
+          ++phasebias.NumberOfSat[CLOCKORBIT_SATBDS];
+        }
         else if (prn.system() == 'S') {
-          phasebiasSat = phasebias.Sat + CLOCKORBIT_NUMGPS
-              + CLOCKORBIT_NUMGLONASS + CLOCKORBIT_NUMGALILEO
-              + CLOCKORBIT_NUMQZSS + phasebias.NumberOfSat[CLOCKORBIT_SATSBAS];
+          phasebiasSat = phasebias.Sat + CLOCKORBIT_NUMGPS  + CLOCKORBIT_NUMGLONASS
+        		       + CLOCKORBIT_NUMGALILEO + CLOCKORBIT_NUMQZSS + CLOCKORBIT_NUMBDS
+					   + phasebias.NumberOfSat[CLOCKORBIT_SATSBAS];
           ++phasebias.NumberOfSat[CLOCKORBIT_SATSBAS];
-        }
-        else if (prn.system() == 'C') {
-          phasebiasSat = phasebias.Sat + CLOCKORBIT_NUMGPS
-              + CLOCKORBIT_NUMGLONASS + CLOCKORBIT_NUMGALILEO
-              + CLOCKORBIT_NUMQZSS + CLOCKORBIT_NUMSBAS
-              + phasebias.NumberOfSat[CLOCKORBIT_SATBDS];
-          ++phasebias.NumberOfSat[CLOCKORBIT_SATBDS];
         }
       //}
@@ -2533,5 +2533,5 @@
       || bias.NumberOfSat[CLOCKORBIT_SATBDS] > 0) {
     char obuffer[CLOCKORBIT_BUFFERSIZE];
-    int len = MakeCodeBias(&bias, BTYPE_AUTO, 0, obuffer, sizeof(obuffer));
+    int len = MakeCodeBias(&bias, CBTYPE_AUTO, 0, obuffer, sizeof(obuffer));
     if (len > 0) {
       hlpBufferBias = QByteArray(obuffer, len);
