Index: /trunk/BNS/RTCM/clock_orbit_rtcm.c
===================================================================
--- /trunk/BNS/RTCM/clock_orbit_rtcm.c	(revision 1830)
+++ /trunk/BNS/RTCM/clock_orbit_rtcm.c	(revision 1831)
@@ -3,5 +3,5 @@
         Name:           clock_orbit_rtcm.c
         Project:        RTCM3
-        Version:        $Id: clock_orbit_rtcm.c,v 1.6 2009/05/04 12:53:42 stoecker Exp $
+        Version:        $Id: clock_orbit_rtcm.c,v 1.13 2009/05/06 14:02:39 stoecker Exp $
         Authors:        Dirk Stöcker
         Description:    state space approach for RTCM3
@@ -618,7 +618,7 @@
     G_RESERVED5
     G_NO_OF_SATELLITES(co->NumberOfGPSSat)
-    if(co->OrbitDataSupplied)
-      return GCOBR_DATAMISMATCH;
-    co->OrbitDataSupplied = 1;
+    if(co->OrbitDataSupplied&1)
+      return GCOBR_DATAMISMATCH;
+    co->OrbitDataSupplied |= 1;
 #ifdef DEBUG
 fprintf(stderr, "epochtime %d ui %d mmi %d sats %d\n",co->GPSEpochTime,co->UpdateInterval,mmi,co->NumberOfGPSSat);
@@ -663,7 +663,7 @@
     G_RESERVED5
     G_NO_OF_SATELLITES(co->NumberOfGPSSat)
-    if(co->ClockDataSupplied)
-      return GCOBR_DATAMISMATCH;
-    co->ClockDataSupplied = 1;
+    if(co->ClockDataSupplied & 1)
+      return GCOBR_DATAMISMATCH;
+    co->ClockDataSupplied |= 1;
     for(i = 0; i < co->NumberOfGPSSat; ++i)
     {
@@ -683,8 +683,8 @@
     G_RESERVED5
     G_NO_OF_SATELLITES(co->NumberOfGPSSat)
-    if(co->ClockDataSupplied || co->OrbitDataSupplied)
-      return GCOBR_DATAMISMATCH;
-    co->OrbitDataSupplied = 1;
-    co->ClockDataSupplied = 1;
+    if((co->ClockDataSupplied&1) || (co->OrbitDataSupplied&1))
+      return GCOBR_DATAMISMATCH;
+    co->OrbitDataSupplied |= 1;
+    co->ClockDataSupplied |= 1;
     for(i = 0; i < co->NumberOfGPSSat; ++i)
     {
@@ -715,7 +715,7 @@
     G_RESERVED5
     G_NO_OF_SATELLITES(co->NumberOfGPSSat)
-    if(co->URADataSupplied)
-      return GCOBR_DATAMISMATCH;
-    co->URADataSupplied = 1;
+    if(co->URADataSupplied&1)
+      return GCOBR_DATAMISMATCH;
+    co->URADataSupplied |= 1;
     for(i = 0; i < co->NumberOfGPSSat; ++i)
     {
@@ -733,7 +733,7 @@
     G_RESERVED5
     G_NO_OF_SATELLITES(co->NumberOfGPSSat)
-    if(co->HRDataSupplied)
-      return GCOBR_DATAMISMATCH;
-    co->HRDataSupplied = 1;
+    if(co->HRDataSupplied&1)
+      return GCOBR_DATAMISMATCH;
+    co->HRDataSupplied |= 1;
     for(i = 0; i < co->NumberOfGPSSat; ++i)
     {
@@ -749,7 +749,7 @@
     G_RESERVED5
     G_NO_OF_SATELLITES(co->NumberOfGLONASSSat)
-    if(co->OrbitDataSupplied)
-      return GCOBR_DATAMISMATCH;
-    co->OrbitDataSupplied = 1;
+    if(co->OrbitDataSupplied&2)
+      return GCOBR_DATAMISMATCH;
+    co->OrbitDataSupplied |= 2;
     for(i = CLOCKORBIT_NUMGPS;
     i < CLOCKORBIT_NUMGPS+co->NumberOfGLONASSSat; ++i)
@@ -777,7 +777,7 @@
     G_RESERVED5
     G_NO_OF_SATELLITES(co->NumberOfGLONASSSat)
-    if(co->ClockDataSupplied)
-      return GCOBR_DATAMISMATCH;
-    co->ClockDataSupplied = 1;
+    if(co->ClockDataSupplied&2)
+      return GCOBR_DATAMISMATCH;
+    co->ClockDataSupplied |= 2;
     for(i = CLOCKORBIT_NUMGPS;
     i < CLOCKORBIT_NUMGPS+co->NumberOfGLONASSSat; ++i)
@@ -796,8 +796,8 @@
     G_RESERVED5
     G_NO_OF_SATELLITES(co->NumberOfGLONASSSat)
-    if(co->ClockDataSupplied || co->OrbitDataSupplied)
-      return GCOBR_DATAMISMATCH;
-    co->OrbitDataSupplied = 1;
-    co->ClockDataSupplied = 1;
+    if((co->ClockDataSupplied&2) || (co->OrbitDataSupplied&2))
+      return GCOBR_DATAMISMATCH;
+    co->OrbitDataSupplied |= 2;
+    co->ClockDataSupplied |= 2;
     for(i = CLOCKORBIT_NUMGPS;
     i < CLOCKORBIT_NUMGPS+co->NumberOfGLONASSSat; ++i)
@@ -827,7 +827,7 @@
     G_RESERVED5
     G_NO_OF_SATELLITES(co->NumberOfGLONASSSat)
-    if(co->URADataSupplied)
-      return GCOBR_DATAMISMATCH;
-    co->URADataSupplied = 1;
+    if(co->URADataSupplied&2)
+      return GCOBR_DATAMISMATCH;
+    co->URADataSupplied |= 2;
     for(i = CLOCKORBIT_NUMGPS;
     i < CLOCKORBIT_NUMGPS+co->NumberOfGLONASSSat; ++i)
@@ -844,7 +844,7 @@
     G_RESERVED5
     G_NO_OF_SATELLITES(co->NumberOfGLONASSSat)
-    if(co->HRDataSupplied)
-      return GCOBR_DATAMISMATCH;
-    co->HRDataSupplied = 1;
+    if(co->HRDataSupplied&2)
+      return GCOBR_DATAMISMATCH;
+    co->HRDataSupplied |= 2;
     for(i = CLOCKORBIT_NUMGPS;
     i < CLOCKORBIT_NUMGPS+co->NumberOfGLONASSSat; ++i)
@@ -900,7 +900,7 @@
     OLD_G_RESERVED6
     OLD_G_NO_OF_SATELLITES(co->NumberOfGPSSat)
-    if(co->OrbitDataSupplied)
-      return GCOBR_DATAMISMATCH;
-    co->OrbitDataSupplied = 1;
+    if(co->OrbitDataSupplied&1)
+      return GCOBR_DATAMISMATCH;
+    co->OrbitDataSupplied |= 1;
     for(i = 0; i < co->NumberOfGPSSat; ++i)
     {
@@ -928,7 +928,7 @@
     OLD_G_RESERVED6
     OLD_G_NO_OF_SATELLITES(co->NumberOfGPSSat)
-    if(co->ClockDataSupplied)
-      return GCOBR_DATAMISMATCH;
-    co->ClockDataSupplied = 1;
+    if(co->ClockDataSupplied&1)
+      return GCOBR_DATAMISMATCH;
+    co->ClockDataSupplied |= 1;
     for(i = 0; i < co->NumberOfGPSSat; ++i)
     {
@@ -948,8 +948,8 @@
     OLD_G_RESERVED6
     OLD_G_NO_OF_SATELLITES(co->NumberOfGPSSat)
-    if(co->ClockDataSupplied || co->OrbitDataSupplied)
-      return GCOBR_DATAMISMATCH;
-    co->OrbitDataSupplied = 1;
-    co->ClockDataSupplied = 1;
+    if((co->ClockDataSupplied&1) || (co->OrbitDataSupplied&1))
+      return GCOBR_DATAMISMATCH;
+    co->OrbitDataSupplied |= 1;
+    co->ClockDataSupplied |= 1;
     for(i = 0; i < co->NumberOfGPSSat; ++i)
     {
@@ -978,7 +978,7 @@
     OLD_G_RESERVED6
     OLD_G_NO_OF_SATELLITES(co->NumberOfGLONASSSat)
-    if(co->OrbitDataSupplied)
-      return GCOBR_DATAMISMATCH;
-    co->OrbitDataSupplied = 1;
+    if(co->OrbitDataSupplied&2)
+      return GCOBR_DATAMISMATCH;
+    co->OrbitDataSupplied |= 2;
     for(i = CLOCKORBIT_NUMGPS;
     i < CLOCKORBIT_NUMGPS+co->NumberOfGLONASSSat; ++i)
@@ -1005,7 +1005,7 @@
     OLD_G_RESERVED6
     OLD_G_NO_OF_SATELLITES(co->NumberOfGLONASSSat)
-    if(co->ClockDataSupplied)
-      return GCOBR_DATAMISMATCH;
-    co->ClockDataSupplied = 1;
+    if(co->ClockDataSupplied&2)
+      return GCOBR_DATAMISMATCH;
+    co->ClockDataSupplied |= 2;
     for(i = CLOCKORBIT_NUMGPS;
     i < CLOCKORBIT_NUMGPS+co->NumberOfGLONASSSat; ++i)
@@ -1024,8 +1024,8 @@
     OLD_G_RESERVED6
     OLD_G_NO_OF_SATELLITES(co->NumberOfGLONASSSat)
-    if(co->ClockDataSupplied || co->OrbitDataSupplied)
-      return GCOBR_DATAMISMATCH;
-    co->OrbitDataSupplied = 1;
-    co->ClockDataSupplied = 1;
+    if((co->ClockDataSupplied&2) || (co->OrbitDataSupplied&2))
+      return GCOBR_DATAMISMATCH;
+    co->OrbitDataSupplied |= 2;
+    co->ClockDataSupplied |= 2;
     for(i = CLOCKORBIT_NUMGPS;
     i < CLOCKORBIT_NUMGPS+co->NumberOfGLONASSSat; ++i)
