Index: trunk/BNS/bns.cpp
===================================================================
--- trunk/BNS/bns.cpp	(revision 1866)
+++ trunk/BNS/bns.cpp	(revision 1867)
@@ -256,11 +256,16 @@
   if (_casterEph) {
     _casterEph->open();
-    // TODO encode ephemerides into RTCM v3 format
-    QByteArray buffer = "New Ephemeris " + ep->prn().toAscii() + "\n";
-    _casterEph->write(buffer.data(), buffer.length());
-    int len = buffer.length();
-    if (len > 0) {
-      emit(newOutEphBytes(len));
-    }
+    unsigned char Array[67];
+    int size = ep->RTCM3(Array);
+    if (size > 0) {
+      _casterEph->write((char*) Array, size);
+      emit(newOutEphBytes(size));
+    }
+    ////    QByteArray buffer = "New Ephemeris " + ep->prn().toAscii() + "\n";
+    ////    _casterEph->write(buffer.data(), buffer.length());
+    ////    int len = buffer.length();
+    ////    if (len > 0) {
+    ////      emit(newOutEphBytes(len));
+    ////    }
   }
 
Index: trunk/BNS/bnseph.cpp
===================================================================
--- trunk/BNS/bnseph.cpp	(revision 1866)
+++ trunk/BNS/bnseph.cpp	(revision 1867)
@@ -230,7 +230,4 @@
     }
   }
-  unsigned char Array[67];
-  int size = RTCM3GPS(Array);
-  fwrite(Array,size, 1, stdout);
 }
 
@@ -282,5 +279,5 @@
                              GPSADDBITS(a,i)};
 
-int t_ephGPS::RTCM3GPS(unsigned char *buffer)
+int t_ephGPS::RTCM3(unsigned char *buffer)
 {
 
@@ -340,5 +337,5 @@
   size += 3;
   return size;
-} /* RTCM3GPS */
+}
 
 // Compute GPS Satellite Position
@@ -481,7 +478,4 @@
   _xv(5) = _y_velocity * 1.e3; 
   _xv(6) = _z_velocity * 1.e3; 
-  unsigned char Array[51];
-  int size = RTCM3GLO(Array);
-  fwrite(Array,size, 1, stdout);
 }
 
@@ -511,5 +505,5 @@
                        GLONASSADDBITS(a-1,i)}
 
-int t_ephGlo::RTCM3GLO(unsigned char *buffer)
+int t_ephGlo::RTCM3(unsigned char *buffer)
 {
 
@@ -572,5 +566,5 @@
   size += 3;
   return size;
-} /* RTCM3GLO */
+}
 
 // Derivative of the state vector using a simple force model (static)
Index: trunk/BNS/bnseph.h
===================================================================
--- trunk/BNS/bnseph.h	(revision 1866)
+++ trunk/BNS/bnseph.h	(revision 1867)
@@ -21,4 +21,5 @@
   virtual void read(const QStringList& lines) = 0;
   virtual int  IOD() const = 0;
+  virtual int  RTCM3(unsigned char *) = 0;
  protected:  
   QString _prn;
@@ -38,5 +39,5 @@
                         ColumnVector& vv) const;
   virtual int  IOD() const;
-  virtual int  RTCM3GLO(unsigned char *);
+  virtual int  RTCM3(unsigned char *);
  private:
   static ColumnVector glo_deriv(double /* tt */, const ColumnVector& xv);
@@ -71,5 +72,5 @@
                         ColumnVector& vv) const;
   virtual int  IOD() const {return int(_IODE);}
-  virtual int  RTCM3GPS(unsigned char *);
+  virtual int  RTCM3(unsigned char *);
  private:
   double  _TOW;              //  [s]    
