Index: /trunk/BNS/bnseph.cpp
===================================================================
--- /trunk/BNS/bnseph.cpp	(revision 2617)
+++ /trunk/BNS/bnseph.cpp	(revision 2618)
@@ -18,5 +18,4 @@
 
 #include "bnseph.h" 
-#include "bnsutils.h" 
 #include "bnssettings.h" 
 #include "bnctime.h" 
@@ -149,7 +148,11 @@
     numlines = 4;
   }
-  else {
+  else if (prn.indexOf('G') != -1) {
     eph = new t_ephGPS();
     numlines = 8;
+  }
+  else {
+    emit(newMessage(QString("Ephemeris server: line not recognized: %1")
+                    .arg(line.data()).toAscii().data()));
   }
 
@@ -172,8 +175,14 @@
     lines << line;
   }
-
-  eph->read(lines);
-
-  emit(newEph(eph, nBytes));
+   
+  if (eph->read(lines) == success) {
+    emit(newEph(eph, nBytes));
+  } 
+  else {
+    emit(newMessage(QString("Broadcast message too new, excluded.\n%1")
+                    .arg(lines.join("")).toAscii().data()));
+    delete eph;
+    return;
+  } 
 }
 
@@ -192,5 +201,5 @@
 // Read GPS Ephemeris
 ////////////////////////////////////////////////////////////////////////////
-void t_ephGPS::read(const QStringList& lines) {
+t_irc t_ephGPS::read(const QStringList& lines) {
 
   for (int ii = 1; ii <= lines.size(); ii++) {
@@ -207,4 +216,11 @@
                                           QTime(int(hour), int(minute), int(second)), Qt::UTC);
 
+      // do not allow too new message (actually 12h) ! /JD
+      QDateTime currTime = QDateTime::currentDateTime();
+      if( dateTime->secsTo(currTime) < -3600*12 ){
+         delete dateTime;
+         return failure; 
+      }
+       
       GPSweekFromDateAndTime(*dateTime, _GPSweek, _GPSweeks); 
 
@@ -236,4 +252,5 @@
     }
   }
+  return success;
 }
 
@@ -489,5 +506,5 @@
 // Read Glonass Ephemeris
 ////////////////////////////////////////////////////////////////////////////
-void t_ephGlo::read(const QStringList& lines) {
+t_irc t_ephGlo::read(const QStringList& lines) {
 
   static const double secPerWeek = 7 * 86400.0;
@@ -505,4 +522,11 @@
       if (year < 100) year += 2000;
 
+      // do not allow too new message (actually 24h) ! /JD
+      QDateTime mesgTime = QDateTime::fromString(QString("%1-%2-%3 %4").arg(year).arg(month).arg(day).arg(hour), "yyyy-MM-dd hh");
+      QDateTime currTime = QDateTime::currentDateTime();
+      if (mesgTime.secsTo(currTime) < -3600*24) {
+        return failure;
+      }
+       
       bncTime tHlp; 
       tHlp.set(int(year), int(month), int(day), 
@@ -542,4 +566,6 @@
   _xv(5) = _y_velocity * 1.e3; 
   _xv(6) = _z_velocity * 1.e3; 
+
+  return success;
 }
 
Index: /trunk/BNS/bnseph.h
===================================================================
--- /trunk/BNS/bnseph.h	(revision 2617)
+++ /trunk/BNS/bnseph.h	(revision 2618)
@@ -9,4 +9,5 @@
 #include <QtNetwork>
 
+#include "bnsutils.h" 
 
 class t_eph {
@@ -19,7 +20,8 @@
   virtual void position(int GPSweek, double GPSweeks, ColumnVector& xc,
                         ColumnVector& vv) const = 0;
-  virtual void read(const QStringList& lines) = 0;
+  virtual t_irc read(const QStringList& lines) = 0;
   virtual int  IOD() const = 0;
   virtual int  RTCM3(unsigned char *) = 0;
+
  protected:  
   QString _prn;
@@ -35,5 +37,5 @@
   };
   virtual ~t_ephGlo() {};
-  virtual void read(const QStringList& lines);
+  virtual t_irc  read(const QStringList& lines);
   virtual void position(int GPSweek, double GPSweeks, ColumnVector& xc,
                         ColumnVector& vv) const;
@@ -69,5 +71,5 @@
   t_ephGPS() {};
   virtual ~t_ephGPS() {};
-  virtual void read(const QStringList& lines);
+  virtual t_irc  read(const QStringList& lines);
   virtual void position(int GPSweek, double GPSweeks, ColumnVector& xc,
                         ColumnVector& vv) const;
