Changeset 9846 in ntrip


Ignore:
Timestamp:
Oct 4, 2022, 12:52:39 PM (2 years ago)
Author:
stuerze
Message:

restore RTNET buffer reading code

File:
1 edited

Legend:

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

    r9843 r9846  
    278278    return;
    279279  }
    280   _rtnetStreamBuffer = _rtnetStreamBuffer.mid(iEpoBeg);
    281 
    282   int iEpoEnd = _rtnetStreamBuffer.lastIndexOf("EOE"); // end   of last epoch
    283   if (iEpoEnd == -1) {
    284     emit(newMessage(
    285           "bncRtnetUploadCaster: no EOE found " + _casterID.toLatin1(), false));
    286     return;
    287   }
    288   else {
    289     lines = _rtnetStreamBuffer.left(iEpoEnd).split('\n', QString::SkipEmptyParts);
    290     _rtnetStreamBuffer = _rtnetStreamBuffer.mid(iEpoEnd+3);
    291   }
    292 
    293   if (lines.size() < 2) {
    294       emit(newMessage(
    295             "bncRtnetUploadCaster: less than 2 lines to decode " + _casterID.toLatin1(), false));
    296     return;
    297   }
    298 
    299   // Keep the last unfinished line in buffer
    300   // ---------------------------------------
    301   int iLastEOL = _rtnetStreamBuffer.lastIndexOf('\n');
    302   if (iLastEOL != -1) {
    303     _rtnetStreamBuffer = _rtnetStreamBuffer.mid(iLastEOL+1);
    304     emit(newMessage(
    305           "bncRtnetUploadCaster: keep the last unfinished line in buffer " + _casterID.toLatin1(), false));
    306   }
    307 
    308 
    309   /* Append to internal buffer
    310   // -------------------------
    311   _rtnetStreamBuffer.append(QByteArray(buffer, bufLen));
    312 
    313   // Select buffer part that contains last epoch
    314   // -------------------------------------------
    315   QStringList lines;
    316   int iEpoBeg = _rtnetStreamBuffer.lastIndexOf('*');   // begin of last epoch
    317   if (iEpoBeg == -1) {
    318     _rtnetStreamBuffer.clear();
    319     emit(newMessage(
    320           "bncRtnetUploadCaster: no Epoch line found " + _casterID.toLatin1(), false));
    321     return;
    322   }
    323280
    324281  int iEpoBegEarlier = _rtnetStreamBuffer.indexOf('*');
     
    339296
    340297  while (_rtnetStreamBuffer.count('*') > 1) { // is there more than 1 epoch line in buffer?
     298    emit(newMessage(
     299          "bncRtnetUploadCaster: more than 1 epoch line in buffer " + _rtnetStreamBuffer.count('*'), false));
    341300    QString rtnetStreamBuffer = _rtnetStreamBuffer.mid(1);
    342301    int nextEpoch = rtnetStreamBuffer.indexOf('*');
     
    358317    return;
    359318  }
    360 */
     319
    361320  // Read first line (with epoch time)
    362321  // ---------------------------------
Note: See TracChangeset for help on using the changeset viewer.