Changeset 9843 in ntrip
- Timestamp:
- Oct 4, 2022, 11:30:02 AM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/upload/bncrtnetuploadcaster.cpp
r9842 r9843 264 264 QMutexLocker locker(&_mutex); 265 265 266 267 266 // Append to internal buffer 268 267 // ------------------------- … … 275 274 if (iEpoBeg == -1) { 276 275 _rtnetStreamBuffer.clear(); 276 emit(newMessage( 277 "bncRtnetUploadCaster: no Epoch line found " + _casterID.toLatin1(), false)); 277 278 return; 278 279 } 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 } 323 279 324 int iEpoBegEarlier = _rtnetStreamBuffer.indexOf('*'); 280 325 if (iEpoBegEarlier != -1 && iEpoBegEarlier < iEpoBeg) { // are there two epoch lines in buffer? … … 284 329 _rtnetStreamBuffer = _rtnetStreamBuffer.mid(iEpoBeg); 285 330 } 331 286 332 int iEpoEnd = _rtnetStreamBuffer.lastIndexOf("EOE"); // end of last epoch 287 333 if (iEpoEnd == -1) { 334 _rtnetStreamBuffer.clear(); 335 emit(newMessage( 336 "bncRtnetUploadCaster: no EOE found " + _casterID.toLatin1(), false)); 288 337 return; 289 338 } … … 309 358 return; 310 359 } 311 360 */ 312 361 // Read first line (with epoch time) 313 362 // ---------------------------------
Note:
See TracChangeset
for help on using the changeset viewer.