Index: /trunk/BNC/CHANGELOG.md
===================================================================
--- /trunk/BNC/CHANGELOG.md	(revision 11214)
+++ /trunk/BNC/CHANGELOG.md	(revision 11215)
@@ -1,4 +1,6 @@
 # Changelog
 ## 2.13.9 (unreleased)
+- CHANGED: **Ephemerides of satellites outside the range supported by BNC** (e.g. G39, test signal of NTS-3 since 30 Sep 2026, not IS-GPS compliant, seen 19 Nov 2026 by many stations in Australia and the Pacific) are no longer written to RINEX navigation files or the ephemeris port, uploaded, or used in PPP, combination and SSR QC; each data set is logged once with its complete RINEX navigation record. Before, they were passed on unchanged (e.g. into an uploaded Broadcast Ephemeris stream), only the warning 'outside the range supported by BNC' was logged. RINEX Edit/Concatenate keeps such records of input files. New test case eph_out_of_range, test tool bncraw.py ephsats
+- ADDED: **Upload Ephemeris: majority vote over the copies of a data set.** The first copy of a data set (same TOC and IOD) received from any stream is uploaded immediately as before; every further stream counts as a vote for its copy, and a copy with different content (the RTCM3 message without the GLONASS frame time tk and the system time offsets tau_c/tau_GPS, which receivers take from the string 5 of any satellite) replaces the uploaded one as soon as more streams deliver it than the current one, i.e. with at least three streams. Each replacement is logged with the streams per copy and the differing fields. Before, the fastest stream decided all fields of a data set, e.g. BCEP00BKG0 18 Nov 2026 R19/R20 with Bn = 1 (unhealthy) from RIO200ARG0/ENAO00PRT0 while all other streams sent Bn = 0, and ln3 = 1 from CUT000AUS0; replay of 89 input streams (2 h): GLONASS health different from the majority of the streams in 1 of 156 data sets (a 2:2 tie in Cn of the unhealthy R27) instead of 63. New test case upload_eph_vote
 - ADDED: **SSR QC: code biases of APC and CoM streams.** For IGS-SSR and old RTCM-SSR (not new RTCM-SSR, which carries its own satellite antenna model), the code biases of an APC stream (SSRA...) are compared with those of the CoM stream of the same solution and format (SSRC...); following the IGS SSR convention (users reduce the satellite PCOs of all frequencies by the PCO of the reference frequency) they have to be equal. With 'QC ANTEX File' the differences are compared with the PCO differences z(f) - z(ref): 15 Oct 2026 SSRA00GMV0 GPS/Galileo/BDS biases shifted by z(f) - z(ref) (residuals 2/3/14 mm, up to 0.76 m, B_IF of GPS IIIA 0.78 m), GLONASS equal. New test case ssr_qc_apc_com
 - ADDED: **SSR QC: phase bias indicators and Melbourne-Wuebbena check.** Per stream and system the SSR format, the dispersive bias and MW consistency indicators, the integer and wide-lane integer indicators per signal and the satellites with discontinuity counter changes are reported. Every 300 s the MW combination of the phase and code biases of the reference signals (wide-lane cycles) is differenced with that of each other AC; the RMS of the fractional parts about the common offset shows whether the wide-lane biases are consistent (< 0.10 cycles) as required for a PPP-AR combination. 2 Oct 2026: MW consistency indicator 1 only for CNES and NRCan, CNES vs NRCan GPS 0.14 cycles (single satellites up to 0.3), all other pairs ~0.25 cycles (random). New test case ssr_qc_phase_bias
Index: /trunk/BNC/src/PPP/pppClient.cpp
===================================================================
--- /trunk/BNC/src/PPP/pppClient.cpp	(revision 11214)
+++ /trunk/BNC/src/PPP/pppClient.cpp	(revision 11215)
@@ -92,4 +92,7 @@
 //////////////////////////////////////////////////////////////////////////////
 void t_pppClient::putEphemeris(const t_eph* eph) {
+  if (eph->prn().toInt() == 0) {  // satellite outside the range supported by BNC (e.g. G39)
+    return;
+  }
   const t_ephGPS* ephGPS = dynamic_cast<const t_ephGPS*>(eph);
   const t_ephGlo* ephGlo = dynamic_cast<const t_ephGlo*>(eph);
Index: /trunk/BNC/src/bnccore.cpp
===================================================================
--- /trunk/BNC/src/bnccore.cpp	(revision 11214)
+++ /trunk/BNC/src/bnccore.cpp	(revision 11215)
@@ -287,4 +287,26 @@
 t_irc t_bncCore::checkPrintEph(t_eph* eph) {
   QMutexLocker locker(&_mutex);
+
+  // Satellite outside the range supported by BNC (e.g. G39, test signal of
+  // NTS-3, not IS-GPS compliant): the ephemeris is neither written to RINEX
+  // nor passed on (upload, PPP, combination, SSR QC); each data set is
+  // logged once as RINEX record instead
+  if (eph->prn().toInt() == 0) {
+    QString key = QString("%1 %2 %3 %4").arg(eph->prn().toInternalString().c_str())
+                  .arg(eph->TOC().datestr().c_str()).arg(eph->TOC().timestr(0).c_str()).arg(eph->IOD());
+    if (!_ephOutOfRange.contains(key)) {
+      _ephOutOfRange.insert(key);
+      double version = (_rinexVers == 2) ? defaultRnxNavVersion2 :
+                       (_rinexVers == 4) ? defaultRnxNavVersion4 : defaultRnxNavVersion3;
+      messagePrivate(t_logRecord::message(t_logRecord::warning,
+                     QString("%1: ephemeris of satellite %2 outside the range supported by BNC - not used, RINEX %3 record:")
+                     .arg(eph->receptStaID()).arg(eph->prn().toString().c_str()).arg(version, 0, 'f', 2).toLatin1(), "bce"));
+      QStringList lines = eph->toString(version).split('\n', Qt::SkipEmptyParts);
+      for (int ii = 0; ii < lines.size(); ii++) {
+        messagePrivate(t_logRecord::message(t_logRecord::warning, lines[ii].toLatin1(), "bce"));
+      }
+    }
+    return failure;
+  }
   t_irc ircPut = _ephUser.putNewEph(eph, true);
 #ifdef BNC_DEBUG_BCE
Index: /trunk/BNC/src/bnccore.h
===================================================================
--- /trunk/BNC/src/bnccore.h	(revision 11214)
+++ /trunk/BNC/src/bnccore.h	(revision 11215)
@@ -223,4 +223,5 @@
   t_ssrQc*               _ssrQc;
   bncEphUser             _ephUser;
+  QSet<QString>          _ephOutOfRange;  // data sets of satellites outside BNC's range, logged
 };
 
Index: /trunk/BNC/src/bncephuser.cpp
===================================================================
--- /trunk/BNC/src/bncephuser.cpp	(revision 11214)
+++ /trunk/BNC/src/bncephuser.cpp	(revision 11215)
@@ -44,4 +44,5 @@
 #include "bnccore.h"
 #include "bncsettings.h"
+#include "RTCM3/ephEncoder.h"
 
 using namespace std;
@@ -49,5 +50,5 @@
 // Constructor
 ////////////////////////////////////////////////////////////////////////////
-bncEphUser::bncEphUser(bool connectSlots, unsigned maxQueueSize) : _maxQueueSize(maxQueueSize) {
+bncEphUser::bncEphUser(bool connectSlots, unsigned maxQueueSize) : _maxQueueSize(maxQueueSize), _voting(false) {
   if (connectSlots) {
     connect(BNC_CORE, SIGNAL(newGPSEph(t_ephGPS)),
@@ -90,4 +91,5 @@
     }
   }
+  qDeleteAll(_votes);
 }
 
@@ -142,28 +144,11 @@
   }
 
-  const t_ephGPS*     ephGPS     = dynamic_cast<const t_ephGPS*>(eph);
-  const t_ephGlo*     ephGlo     = dynamic_cast<const t_ephGlo*>(eph);
-  const t_ephGal*     ephGal     = dynamic_cast<const t_ephGal*>(eph);
-  const t_ephSBAS*    ephSBAS    = dynamic_cast<const t_ephSBAS*>(eph);
-  const t_ephBDS*     ephBDS     = dynamic_cast<const t_ephBDS*>(eph);
-
-  t_eph* newEph = 0;
-
-  if      (ephGPS) {
-    newEph = new t_ephGPS(*ephGPS);
-  }
-  else if (ephGlo) {
-    newEph = new t_ephGlo(*ephGlo);
-  }
-  else if (ephGal) {
-    newEph = new t_ephGal(*ephGal);
-  }
-  else if (ephSBAS) {
-    newEph = new t_ephSBAS(*ephSBAS);
-  }
-  else if (ephBDS) {
-    newEph = new t_ephBDS(*ephBDS);
-  }
-  else {
+  // satellite outside the range supported by BNC (e.g. G39)
+  if (eph->prn().toInt() == 0) {
+    return failure;
+  }
+
+  t_eph* newEph = clone(eph);
+  if (newEph == 0) {
     return failure;
   }
@@ -177,4 +162,7 @@
       if (qq[ii]->sameDataSet(eph)) {
         delete newEph;
+        if (_voting && realTime) {
+          vote(prn, ii, eph);
+        }
         return failure;
       }
@@ -203,5 +191,13 @@
     newEph->setCheckState(eph->checkState());
     qq.push_back(newEph);
+    if (_voting && realTime) {
+      t_votes* votes = new t_votes;
+      votes->_content.append(votingContent(newEph));
+      votes->_eph.append(clone(newEph));
+      votes->_station[newEph->receptStaID()] = 0;
+      _votes[newEph] = votes;
+    }
     if (qq.size() > _maxQueueSize) {
+      delete _votes.take(qq.front());
       delete qq.front();
       qq.pop_front();
@@ -214,4 +210,191 @@
     return failure;
   }
+}
+
+// Copy of an ephemeris of any system
+////////////////////////////////////////////////////////////////////////////
+t_eph* bncEphUser::clone(const t_eph* eph) {
+  if (const t_ephGPS*  e = dynamic_cast<const t_ephGPS*>(eph))  return new t_ephGPS(*e);
+  if (const t_ephGlo*  e = dynamic_cast<const t_ephGlo*>(eph))  return new t_ephGlo(*e);
+  if (const t_ephGal*  e = dynamic_cast<const t_ephGal*>(eph))  return new t_ephGal(*e);
+  if (const t_ephSBAS* e = dynamic_cast<const t_ephSBAS*>(eph)) return new t_ephSBAS(*e);
+  if (const t_ephBDS*  e = dynamic_cast<const t_ephBDS*>(eph))  return new t_ephBDS(*e);
+  return 0;
+}
+
+// Content compared in the vote: the uploaded RTCM3 message without CRC and,
+// for GLONASS, without the fields differing legitimately between receivers
+////////////////////////////////////////////////////////////////////////////
+QByteArray bncEphUser::votingContent(const t_eph* eph) {
+  unsigned char buffer[80];
+  int size = 0;
+  if      (const t_ephGPS*  e = dynamic_cast<const t_ephGPS*>(eph))  size = t_ephEncoder::RTCM3(*e, buffer);
+  else if (const t_ephGlo*  e = dynamic_cast<const t_ephGlo*>(eph))  size = t_ephEncoder::RTCM3(*e, buffer);
+  else if (const t_ephGal*  e = dynamic_cast<const t_ephGal*>(eph))  size = t_ephEncoder::RTCM3(*e, buffer);
+  else if (const t_ephSBAS* e = dynamic_cast<const t_ephSBAS*>(eph)) size = t_ephEncoder::RTCM3(*e, buffer);
+  else if (const t_ephBDS*  e = dynamic_cast<const t_ephBDS*>(eph))  size = t_ephEncoder::RTCM3(*e, buffer);
+  if (size <= 6) {
+    return QByteArray();
+  }
+  if (eph->system() == t_eph::GLONASS) {
+    // message bits (after the 3 header bytes) of tk and of the system time
+    // offsets tau_c and tau_GPS: receivers take the latter from the string 5
+    // of any satellite, they differ within the same data set
+    const int field[3][2] = {{27, 12}, {293, 32}, {330, 22}};
+    for (int ii = 0; ii < 3; ii++) {
+      for (int bit = 24 + field[ii][0]; bit < 24 + field[ii][0] + field[ii][1]; bit++) {
+        buffer[bit / 8] &= ~(0x80 >> (bit % 8));
+      }
+    }
+  }
+  return QByteArray((const char*) buffer, size - 3);
+}
+
+// Names of the fields in which two vote contents (RTCM3 messages) differ
+////////////////////////////////////////////////////////////////////////////
+namespace {
+struct t_field {const char* name; int nbits;};
+const t_field fields1019[] = {{"type",12},{"sv",6},{"week",10},{"URA",4},{"L2code",2},{"IDOT",14},{"IODE",8},
+  {"toc",16},{"af2",8},{"af1",16},{"af0",22},{"IODC",10},{"Crs",16},{"dn",16},{"M0",32},{"Cuc",16},{"e",32},
+  {"Cus",16},{"sqrtA",32},{"toe",16},{"Cic",16},{"Omega0",32},{"Cis",16},{"i0",32},{"Crc",16},{"omega",32},
+  {"OmegaDot",24},{"TGD",8},{"health",6},{"L2P",1},{"fit",1},{0,0}};
+const t_field fields1020[] = {{"type",12},{"sv",6},{"fc",5},{"Cn",1},{"A",1},{"P1",2},{"tk",12},{"Bn",1},{"P2",1},
+  {"tb",7},{"xv",24},{"x",27},{"xa",5},{"yv",24},{"y",27},{"ya",5},{"zv",24},{"z",27},{"za",5},{"P3",1},
+  {"gamma",11},{"P",2},{"ln3",1},{"tau",22},{"dtau",5},{"En",5},{"P4",1},{"FT",4},{"NT",11},{"M",2},{"add",1},
+  {"NA",11},{"tauc",32},{"N4",5},{"tauGPS",22},{"ln5",1},{0,0}};
+const t_field fields1042[] = {{"type",12},{"sv",6},{"week",13},{"URAI",4},{"IDOT",14},{"AODE",5},{"toc",17},
+  {"a2",11},{"a1",22},{"a0",24},{"AODC",5},{"Crs",18},{"dn",16},{"M0",32},{"Cuc",18},{"e",32},{"Cus",18},
+  {"sqrtA",32},{"toe",17},{"Cic",18},{"Omega0",32},{"Cis",18},{"i0",32},{"Crc",18},{"omega",32},{"OmegaDot",24},
+  {"TGD1",10},{"TGD2",10},{"SatH1",1},{0,0}};
+const t_field fields1044[] = {{"type",12},{"sv",4},{"toc",16},{"af2",8},{"af1",16},{"af0",22},{"IODE",8},
+  {"Crs",16},{"dn",16},{"M0",32},{"Cuc",16},{"e",32},{"Cus",16},{"sqrtA",32},{"toe",16},{"Cic",16},{"Omega0",32},
+  {"Cis",16},{"i0",32},{"Crc",16},{"omega",32},{"OmegaDot",24},{"IDOT",14},{"L2code",2},{"week",10},{"URA",4},
+  {"health",6},{"TGD",8},{"IODC",10},{"fit",1},{0,0}};
+#define GAL_COMMON {"type",12},{"sv",6},{"week",12},{"IODnav",10},{"SISA",8},{"IDOT",14},{"toc",14},{"af2",6}, \
+  {"af1",21},{"af0",31},{"Crs",16},{"dn",16},{"M0",32},{"Cuc",16},{"e",32},{"Cus",16},{"sqrtA",32},{"toe",14}, \
+  {"Cic",16},{"Omega0",32},{"Cis",16},{"i0",32},{"Crc",16},{"omega",32},{"OmegaDot",24},{"BGDa",10}
+const t_field fields1045[] = {GAL_COMMON,{"E5aHS",2},{"E5aDVS",1},{0,0}};
+const t_field fields1046[] = {GAL_COMMON,{"BGDb",10},{"E5bHS",2},{"E5bDVS",1},{"E1BHS",2},{"E1BDVS",1},{0,0}};
+
+unsigned long long getBits(const QByteArray& buf, int pos, int nbits) {
+  unsigned long long val = 0;
+  for (int bit = pos; bit < pos + nbits; bit++) {
+    val = (val << 1) | ((static_cast<unsigned char>(buf[bit / 8]) >> (7 - bit % 8)) & 1);
+  }
+  return val;
+}
+}
+
+QString bncEphUser::differingFields(const QByteArray& c1, const QByteArray& c2) {
+  if (c1.size() != c2.size() || c1.size() < 5) {
+    return "content";
+  }
+  const t_field* fields = 0;
+  switch (getBits(c1, 24, 12)) {
+    case 1019: fields = fields1019; break;
+    case 1020: fields = fields1020; break;
+    case 1042: fields = fields1042; break;
+    case 1044: fields = fields1044; break;
+    case 1045: fields = fields1045; break;
+    case 1046: fields = fields1046; break;
+  }
+  if (!fields) {
+    return "content";
+  }
+  QStringList names;
+  int pos = 24;
+  for (int ii = 0; fields[ii].name; ii++) {
+    if (pos + fields[ii].nbits > 8 * c1.size()) {
+      break;
+    }
+    if (getBits(c1, pos, fields[ii].nbits) != getBits(c2, pos, fields[ii].nbits)) {
+      names << fields[ii].name;
+    }
+    pos += fields[ii].nbits;
+  }
+  return names.isEmpty() ? QString("content") : names.join(" ");
+}
+
+// Further copy of the buffered data set qq[index] received from a stream
+////////////////////////////////////////////////////////////////////////////
+void bncEphUser::vote(const QString& prn, unsigned index, const t_eph* eph) {
+  deque<t_eph*>& qq = _eph[prn];
+  t_votes* votes = _votes.value(qq[index], 0);
+  if (!votes) {
+    return;
+  }
+  QByteArray content = votingContent(eph);
+  int iVar = votes->_content.indexOf(content);
+  if (iVar < 0) {
+    iVar = votes->_content.size();
+    votes->_content.append(content);
+    votes->_eph.append(clone(eph));
+  }
+  votes->_station[eph->receptStaID()] = iVar;
+
+  QVector<int> count(votes->_content.size(), 0);
+  QMapIterator<QString, int> it(votes->_station);
+  while (it.hasNext()) {
+    it.next();
+    count[it.value()]++;
+  }
+  int iBest = votes->_current;
+  for (int ii = 0; ii < count.size(); ii++) {
+    if (count[ii] > count[iBest]) {
+      iBest = ii;
+    }
+  }
+  if (iBest == votes->_current) {
+    return;
+  }
+
+  t_eph* oldEph = qq[index];
+  t_eph* newEph = clone(votes->_eph[iBest]);
+  if (!radialDistanceOk(newEph)) {
+    delete newEph;
+    return;
+  }
+  if      (newEph->isUnhealthy()) {
+    newEph->setCheckState(t_eph::unhealthy);
+  }
+  else if (oldEph->checkState() == t_eph::unhealthy) {
+    newEph->setCheckState(t_eph::ok);
+  }
+  else {
+    newEph->setCheckState(oldEph->checkState());
+  }
+
+  QStringList stations;
+  for (int ii = 0; ii < count.size(); ii++) {
+    QStringList hlp;
+    QMapIterator<QString, int> is(votes->_station);
+    while (is.hasNext()) {
+      is.next();
+      if (is.value() == ii) {
+        hlp << is.key();
+      }
+    }
+    if (!hlp.isEmpty()) {
+      stations << (ii == iBest ? "+ " : "- ") + hlp.join(" ");
+    }
+  }
+  BNC_CORE->message(QString("ephemeris vote %1 %2 %3: copy of %4 replaced by that of %5 (%6 of %7 streams; %8; differing: %9)")
+                    .arg(prn.left(3))
+                    .arg(oldEph->TOC().datestr().c_str())
+                    .arg(oldEph->TOC().timestr(0).c_str())
+                    .arg(oldEph->receptStaID())
+                    .arg(newEph->receptStaID())
+                    .arg(count[iBest])
+                    .arg(votes->_station.size())
+                    .arg(stations.join(", "))
+                    .arg(differingFields(votes->_content[votes->_current], votes->_content[iBest])).toLatin1(),
+                    false, "bce", t_logRecord::info);
+
+  _votes.remove(oldEph);
+  delete oldEph;
+  qq[index] = newEph;
+  votes->_current = iBest;
+  _votes[newEph] = votes;
+  ephBufferChanged();
 }
 
Index: /trunk/BNC/src/bncephuser.h
===================================================================
--- /trunk/BNC/src/bncephuser.h	(revision 11214)
+++ /trunk/BNC/src/bncephuser.h	(revision 11215)
@@ -51,4 +51,11 @@
   t_irc putNewEph(t_eph* newEph, bool check);
 
+  // Majority vote over the copies of a data set received from different streams
+  // (real-time input only, used for the ephemeris upload): the first copy is
+  // accepted immediately; a copy with different content (RTCM3 encoding without
+  // the GLONASS frame time tk and the system time offsets tau_c, tau_GPS) replaces it as soon as more streams deliver it
+  // than the current one, i.e. with at least three streams.
+  void enableVoting() {_voting = true;}
+
   // Real-time input restricted to the ephemerides of the streams given in the
   // general option 'Ephemeris streams' (key ephMount; empty: all streams), used
@@ -97,5 +104,16 @@
 
  private:
-  void checkEphemeris(t_eph* eph, bool realTime);
+  struct t_votes {
+    ~t_votes() {for (int ii = 0; ii < _eph.size(); ii++) delete _eph[ii];}
+    QVector<QByteArray>  _content;  // per variant: encoded content
+    QVector<t_eph*>      _eph;      // per variant: copy of the first one received
+    QMap<QString, int>   _station;  // stream -> variant of its latest copy
+    int                  _current = 0;  // variant in the buffer
+  };
+  static t_eph*     clone(const t_eph* eph);
+  static QByteArray votingContent(const t_eph* eph);
+  static QString    differingFields(const QByteArray& content1, const QByteArray& content2);
+  void   vote(const QString& prn, unsigned index, const t_eph* eph);
+  void   checkEphemeris(t_eph* eph, bool realTime);
   bool fromEphMount(const t_eph& eph) const {
     return _ephMounts.isEmpty() || _ephMounts.contains(eph.receptStaID());
@@ -105,4 +123,6 @@
   unsigned                           _maxQueueSize;  // data sets kept per satellite
   QMap<QString, std::deque<t_eph*> > _eph;
+  bool                               _voting;
+  QHash<const t_eph*, t_votes*>      _votes;         // per buffered data set
 };
 
Index: /trunk/BNC/src/bnchelp.html
===================================================================
--- /trunk/BNC/src/bnchelp.html	(revision 11214)
+++ /trunk/BNC/src/bnchelp.html	(revision 11215)
@@ -10063,4 +10063,23 @@
     Unhealthy Broadcast Ephemeris will not be excluded. A note 'UNHEALTHY EPHEMERIS' will be added in the logfile.
   </p>
+  <p>
+    Ephemerides of satellites outside the range supported by BNC (e.g. G39, a test signal of NTS-3 which is not
+    IS-GPS compliant) are not uploaded, nor written to RINEX navigation files or used for any processing; each data
+    set is logged once with its complete RINEX navigation record.
+  </p>
+  <p>
+    If the same data set (same TOC and IOD) is received from several streams, BNC votes on its content: the
+    first copy received is uploaded immediately; every further stream counts as a vote for the copy it delivers, and
+    a copy with different content replaces the uploaded one as soon as more streams deliver it than the current one,
+    i.e. with at least three streams. The content compared is the RTCM Version 3 message as uploaded, for GLONASS
+    without the frame time tk and the system time offsets tau_c and tau_GPS, which differ legitimately between
+    receivers. This protects the uploaded stream against single receivers sending e.g. wrong health flags. Each
+    replacement is logged with the streams delivering each copy ('+' the new, '-' the other copies) and the fields
+    in which the old and the new copy differ, e.g.
+  </p>
+  <pre>
+ephemeris vote R19 2026-11-18 17:45:18: copy of RIO200ARG0 replaced by that of BRAZ00BRA0 (2 of 3 streams;
+  - RIO200ARG0, + BRAZ00BRA0 RGDG00ARG0; differing: Cn A Bn P3 NA N4)
+</pre>
   <p>
   <h4 id="brdcserver">2.16.1 Host &amp; Port - optional</h4>
Index: /trunk/BNC/src/upload/bncephuploadcaster.cpp
===================================================================
--- /trunk/BNC/src/upload/bncephuploadcaster.cpp	(revision 11214)
+++ /trunk/BNC/src/upload/bncephuploadcaster.cpp	(revision 11215)
@@ -26,4 +26,5 @@
 ////////////////////////////////////////////////////////////////////////////
 bncEphUploadCaster::bncEphUploadCaster() : bncEphUser(true) {
+  enableVoting();
   bncSettings settings;
   int sampl = settings.value("uploadSamplRtcmEph").toInt();
Index: /trunk/BNC/tests/README.md
===================================================================
--- /trunk/BNC/tests/README.md	(revision 11214)
+++ /trunk/BNC/tests/README.md	(revision 11215)
@@ -128,4 +128,12 @@
   `upload_raw` (raw forwarding to RINEX nav). `upload_rtnet_rtcm` encodes the same input to RTCM-SSR
   (message numbers 1057-1068, 1240-1270) and decodes it again.
+  `upload_eph_vote` replays the ephemerides of 89 uploader input streams
+  (`data/eph_vote_261118_20min.raw`, 18 Nov 2026 17:43-18:03, BCEP00BKG0
+  removed) and compares the log with the majority vote replacements
+  (e.g. R06/R19/R20 Bn = 1 from RIO200ARG0); the uploaded stream depends on
+  the wall-clock timing and is not compared. `eph_out_of_range` replays 6 min of
+  the same input with a G39 copy of the G24 ephemerides of 3 stations
+  (`tools/mk_eph_g39.py`): the G39 data set is logged once as RINEX record, the
+  RINEX navigation file and the uploaded stream (`bncraw.py ephsats`) have no G39.
 * SSR decoding (`ssr_*`): 3 min slices of real streams replayed through
   `03_BrdcCorr.bnc`. They compare the `.ssr` files and the `BNC_DEBUG_SSR`
Index: /trunk/BNC/tests/cases/eph_out_of_range/case.json
===================================================================
--- /trunk/BNC/tests/cases/eph_out_of_range/case.json	(revision 11215)
+++ /trunk/BNC/tests/cases/eph_out_of_range/case.json	(revision 11215)
@@ -0,0 +1,49 @@
+{
+  "description": "Satellite outside the range supported by BNC (G39, test signal of NTS-3 since 30 Sep 2026): 19_UploadEph replay of 6 min of uploader input streams (18 Nov 2026) with a G39 copy of each G24 ephemeris from 3 stations (tools/mk_eph_g39.py). The G39 data set is logged once as RINEX record and neither written to the RINEX navigation file nor uploaded (decoded upload checked to contain no G39 in the post step)",
+  "config": "Example_Configs/19_UploadEph.bnc",
+  "raw": "data/eph_g39_261118_6min.raw",
+  "exit_code": 5,
+  "timeout": 600,
+  "args": [
+    "-key",
+    "uploadEphMountpointsOut",
+    "127.0.0.1,21113,BCEP00TEST,2,user,pass,GRECJ,0 byte(s),",
+    "-key",
+    "mountPoints",
+    "",
+    "-key",
+    "ephPath",
+    "Output",
+    "-key",
+    "ephVersion",
+    "4"
+  ],
+  "fakecaster": {
+    "port": 21113,
+    "out": "Output/upload.raw",
+    "sta": "BCEP00TEST",
+    "time": "2026-11-18T17:43:00",
+    "timeout": 10
+  },
+  "outputs": [
+    {
+      "glob": "Output/UploadEph.log_261118",
+      "name": "UploadEph.log"
+    },
+    "Output/*.rnx",
+    {
+      "glob": "sats/stdout.txt",
+      "name": "upload_ephsats.txt"
+    }
+  ],
+  "post": [
+    {
+      "dir": "sats",
+      "tool": [
+        "bncraw.py",
+        "ephsats",
+        "Output/upload.raw"
+      ]
+    }
+  ]
+}
Index: /trunk/BNC/tests/cases/upload_eph_vote/case.json
===================================================================
--- /trunk/BNC/tests/cases/upload_eph_vote/case.json	(revision 11215)
+++ /trunk/BNC/tests/cases/upload_eph_vote/case.json	(revision 11215)
@@ -0,0 +1,28 @@
+{
+  "description": "19_UploadEph replay with the majority vote over the copies of a data set: GPS, GLONASS and BDS ephemerides of 89 uploader input streams (BCEP00BKG0 removed), 18 Nov 2026 17:43-18:03; the log lists each replaced copy, e.g. R06/R19/R20 of 18:15:18 GPS time with Bn=1 from RIO200ARG0 replaced as soon as two other streams agree. The uploaded content depends on the wall-clock timing and is not compared",
+  "config": "Example_Configs/19_UploadEph.bnc",
+  "raw": "data/eph_vote_261118_20min.raw",
+  "exit_code": 5,
+  "timeout": 600,
+  "args": [
+    "-key",
+    "uploadEphMountpointsOut",
+    "127.0.0.1,21112,BCEP00TEST,2,user,pass,GRECJ,0 byte(s),",
+    "-key",
+    "mountPoints",
+    ""
+  ],
+  "fakecaster": {
+    "port": 21112,
+    "out": "Output/upload.raw",
+    "sta": "BCEP00TEST",
+    "time": "2026-11-18T17:43:00",
+    "timeout": 10
+  },
+  "outputs": [
+    {
+      "glob": "Output/UploadEph.log_261118",
+      "name": "UploadEph.log"
+    }
+  ]
+}
Index: /trunk/BNC/tests/tools/bncraw.py
===================================================================
--- /trunk/BNC/tests/tools/bncraw.py	(revision 11214)
+++ /trunk/BNC/tests/tools/bncraw.py	(revision 11215)
@@ -10,4 +10,5 @@
     slice <raw> <out> [options]      cut a time window / subset of stations
     crs   <raw>                      decode RTCM 1300/1301/1302 (CRS messages)
+    ephsats <raw>                    satellite IDs of the ephemeris messages
 """
 
@@ -246,4 +247,24 @@
 
 
+EPH_SYS = {"1019": ("G", 6), "1020": ("R", 6), "1041": ("I", 6), "1042": ("C", 6),
+           "1044": ("J", 4), "1045": ("E", 6), "1046": ("E", 6)}
+
+
+def cmd_ephsats(args):
+    """Satellite IDs of the ephemeris messages per stream and message type."""
+    sats = collections.OrderedDict()
+    framers = {}
+    for t, sta, fmt, data in read_chunks(args.input):
+        for p in framers.setdefault(sta, Rtcm3Framer()).feed(data):
+            mt = msg_type(p)
+            if mt in EPH_SYS:
+                sy, nb = EPH_SYS[mt]
+                b = BitReader(p)
+                b.u(12)
+                sats.setdefault((sta, mt), set()).add("%s%02d" % (sy, b.u(nb)))
+    for (sta, mt), s in sorted(sats.items()):
+        print("%s %s %s" % (sta, mt, " ".join(sorted(s))))
+
+
 def main():
     ap = argparse.ArgumentParser(description=__doc__,
@@ -269,4 +290,8 @@
     p.set_defaults(func=cmd_crs)
 
+    p = sub.add_parser("ephsats", help="satellite IDs of the ephemeris messages")
+    p.add_argument("input")
+    p.set_defaults(func=cmd_ephsats)
+
     args = ap.parse_args()
     args.func(args)
Index: /trunk/BNC/tests/tools/mk_eph_g39.py
===================================================================
--- /trunk/BNC/tests/tools/mk_eph_g39.py	(revision 11215)
+++ /trunk/BNC/tests/tools/mk_eph_g39.py	(revision 11215)
@@ -0,0 +1,42 @@
+#!/usr/bin/env python3
+"""Test data for satellites outside BNC's range (case eph_out_of_range): the
+first 6 minutes of data/eph_vote_261118_20min.raw, where each GPS ephemeris
+(1019) of G24 from ASCG00SHN0, KERG00ATF0 and OWMG00NZL0 is followed by a copy
+with satellite ID 39 (as broadcast by the NTS-3 test signal since 30 Sep 2026).
+
+    mk_eph_g39.py data/eph_vote_261118_20min.raw data/eph_g39_261118_6min.raw
+"""
+import sys
+import bncraw
+
+STATIONS = {"ASCG00SHN0", "KERG00ATF0", "OWMG00NZL0"}
+
+
+def with_sv(payload, sv):
+    p = bytearray(payload)          # satellite ID: bits 12-17 after the message number
+    p[1] = (p[1] & 0xF0) | (sv >> 2)
+    p[2] = (p[2] & 0x3F) | ((sv & 0x03) << 6)
+    return bytes(p)
+
+
+def main():
+    src, out = sys.argv[1], sys.argv[2]
+    chunks = []
+    framers = {}
+    for t, sta, fmt, data in bncraw.read_chunks(src):
+        if t >= "2026-11-18T17:49":
+            break
+        chunks.append((t, sta, fmt, data))
+        if sta not in STATIONS:
+            continue
+        extra = b""
+        for p in framers.setdefault(sta, bncraw.Rtcm3Framer()).feed(data):
+            if bncraw.msg_type(p) == "1019" and bncraw.BitReader(p).u(18) & 0x3F == 24:
+                extra += bncraw.frame(with_sv(p, 39))
+        if extra:
+            chunks.append((t, sta, fmt, extra))
+    bncraw.write_chunks(out, chunks)
+
+
+if __name__ == "__main__":
+    main()
