Changeset 8755 in ntrip for trunk/BNC/src


Ignore:
Timestamp:
May 15, 2019, 1:54:55 PM (6 years ago)
Author:
stuerze
Message:

minor changes to read the RTNET data buffer

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/upload/bncrtnetuploadcaster.cpp

    r8742 r8755  
    247247    return;
    248248  }
     249  int iEpoBegEarlier = _rtnetStreamBuffer.indexOf('*');
     250  if (iEpoBegEarlier != -1 && iEpoBegEarlier < iEpoBeg) { // are there two epoch lines in buffer?
     251    _rtnetStreamBuffer = _rtnetStreamBuffer.mid(iEpoBegEarlier);
     252  }
    249253  else {
    250254    _rtnetStreamBuffer = _rtnetStreamBuffer.mid(iEpoBeg);
    251255  }
    252 
    253   int iEpoEnd = _rtnetStreamBuffer.indexOf("EOE"); // end of last epoch
     256  int iEpoEnd = _rtnetStreamBuffer.lastIndexOf("EOE"); // end of last epoch
    254257  if (iEpoEnd == -1) {
    255258    return;
    256259  }
    257   else {
    258     lines = _rtnetStreamBuffer.left(iEpoEnd).split('\n',
    259         QString::SkipEmptyParts);
    260     _rtnetStreamBuffer = _rtnetStreamBuffer.mid(iEpoEnd + 3);
    261   }
     260
     261  while (_rtnetStreamBuffer.count('*') > 1) { // is there more than 1 epoch line in buffer?
     262    QString rtnetStreamBuffer = _rtnetStreamBuffer.mid(1);
     263    int nextEpoch = rtnetStreamBuffer.indexOf('*');
     264    if (nextEpoch != -1 && nextEpoch < iEpoEnd) {
     265      _rtnetStreamBuffer = _rtnetStreamBuffer.mid(nextEpoch);
     266    }
     267  }
     268
     269  lines = _rtnetStreamBuffer.left(iEpoEnd).split('\n',
     270      QString::SkipEmptyParts);
     271  _rtnetStreamBuffer = _rtnetStreamBuffer.mid(iEpoEnd + 3);
     272
    262273
    263274  if (lines.size() < 2) {
Note: See TracChangeset for help on using the changeset viewer.