Changeset 11074 in ntrip for trunk/BNC/src/RTCM3


Ignore:
Timestamp:
Oct 5, 2026, 1:55:39 PM (13 days ago)
Author:
stuerze
Message:

update test suite and further findings

Location:
trunk/BNC/src/RTCM3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/RTCM3/RTCM3coDecoder.cpp

    r11068 r11074  
    223223    int bytesused = 0;
    224224
     225    // message type of the frame at the start of the buffer (RTCM number,
     226    // IGS-SSR 4076: 4076000 + subtype)
     227    int msgType = -1;
     228    if (_buffer.size() >= 6 && (unsigned char)_buffer[0] == 0xD3) {
     229      const unsigned char* bb = reinterpret_cast<const unsigned char*>(_buffer.constData());
     230      msgType = (bb[3] << 4) | (bb[4] >> 4);
     231      if (msgType == 4076) {
     232        msgType = 4076000 + (((bb[4] & 0x01) << 7) | (bb[5] >> 1));
     233      }
     234    }
     235
    225236    GCOB_RETURN irc = _ssrCorr->GetSSR(&_clkOrb, &_codeBias, &_vTEC, &_phaseBias, &_metaData, &_antenna,
    226237                                       _buffer.data(), _buffer.size(), &bytesused);
    … …  
    272283          checkProviderID();
    273284          sendResults();
     285          // Pass on the epoch as soon as it is complete, not only when the
     286          // next epoch arrives (one update interval later): complete when
     287          // all message types of the previous epoch have arrived with
     288          // Multiple Message Indicator 0. Consumers (PPP, combination) must
     289          // not see an epoch partly, e.g. new clocks with old orbits.
     290          if (irc == GCOBR_OK) {
     291            checkEpochComplete(msgType);
     292          }
    274293          retCode = success;
    275294        }
    … …  
    788807}
    789808
     809// Pass the current epoch on as soon as it is complete: every message type
     810// due at this epoch has arrived with Multiple Message Indicator 0. A type is
     811// due if its interval (learned from its previous epochs) has passed since
     812// its last epoch; types missing for more than three intervals are no longer
     813// expected. Until the intervals are known, and if a due type is missing,
     814// the epoch is passed on when the next epoch arrives. Types arriving after
     815// the epoch was passed on are passed on as soon as they are complete.
     816////////////////////////////////////////////////////////////////////////////
     817void RTCM3coDecoder::checkEpochComplete(int msgType) {
     818  const bncTime& epoch = _lastTime;
     819  if (_typeLast.contains(msgType)) {
     820    if (!(_typeLast[msgType] < epoch)) {
     821      if (epoch == _flushedEpoch) {
     822        dumpEpochs(true);  // repeated type of an epoch already passed on
     823      }
     824      return;
     825    }
     826    _typeInt[msgType] = epoch - _typeLast[msgType];
     827  }
     828  _typeLast[msgType] = epoch;
     829
     830  if (epoch == _flushedEpoch) {
     831    dumpEpochs(true);
     832    return;
     833  }
     834  bool complete = !_typeInt.isEmpty();
     835  QMapIterator<int, double> it(_typeInt);
     836  while (it.hasNext()) {
     837    it.next();
     838    double sinceLast = epoch - _typeLast[it.key()];
     839    if (sinceLast > 0.0 && sinceLast >= it.value() - 0.1 && sinceLast <= 3.0 * it.value()) {
     840      complete = false;
     841      break;
     842    }
     843  }
     844  if (complete) {
     845    dumpEpochs(true);
     846    _flushedEpoch = epoch;
     847  }
     848}
     849
    790850// Emit and write the collected corrections of all epochs older than
    791851// _lastTime (all epochs if all is set, e.g. at the end of a replay)
  • trunk/BNC/src/RTCM3/RTCM3coDecoder.h

    r11068 r11074  
    7575  void sendResults();
    7676  void dumpEpochs(bool all);
     77  void checkEpochComplete(int msgType);
    7778  void reopen();
    7879  void checkProviderID();
    … …  
    8687  // convention of old encoders (GLONASS: UTC seconds of day, BDS: BDT)
    8788  double                                _igsRefEpoSec = -1.0;
     89  // Per message type (RTCM number, IGS-SSR 4076000 + subtype): latest epoch
     90  // completed (Multiple Message Indicator 0) and interval between epochs
     91  QMap<int, bncTime>                    _typeLast;
     92  QMap<int, double>                     _typeInt;
     93  bncTime                               _flushedEpoch; // latest epoch passed on as complete
    8894  QMap<QChar, bncTime>                  _legacyEpochWarned; // warned at most once per hour
    8995  QMap<QChar, bncTime>                  _epochDiffWarned;   // warned at most once per hour
Note: See TracChangeset for help on using the changeset viewer.