Changeset 11130 in ntrip for trunk/BNC/src
- Timestamp:
- Oct 28, 2026, 9:32:30 AM (10 days ago)
- Location:
- trunk/BNC/src
- Files:
-
- 10 edited
-
RTCM/RTCM2.cpp (modified) (2 diffs)
-
RTCM3/RTCM3Decoder.cpp (modified) (4 diffs)
-
RTCM3/bits.h (modified) (2 diffs)
-
RTCM3/clock_and_orbit/clock_orbit.h (modified) (1 diff)
-
RTCM3/clock_and_orbit/clock_orbit_rtcm_new.cpp (modified) (1 diff)
-
bnchelp.html (modified) (4 diffs)
-
bncmain.cpp (modified) (1 diff)
-
bncnetqueryrtp.cpp (modified) (3 diffs)
-
bncnetqueryv1.cpp (modified) (2 diffs)
-
src.pri (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/RTCM/RTCM2.cpp
r7629 r11130 667 667 }; 668 668 669 if ( 24*DW.size() < start+n -1 ) {669 if ( 24*DW.size() < start+n ) { // last bit read: start+n-1 670 670 #if (DEBUG>0) 671 671 cerr << "Debug output RTCM2packet::getUnsignedBits" << endl … … 727 727 }; 728 728 729 if ( 24*DW.size() < start+n -1 ) {729 if ( 24*DW.size() < start+n ) { // last bit read: start+n-1 730 730 #if (DEBUG>0) 731 731 cerr << "Debug output RTCM2packet::getUnsignedBits" << endl -
trunk/BNC/src/RTCM3/RTCM3Decoder.cpp
r11124 r11130 39 39 * -----------------------------------------------------------------------*/ 40 40 41 #include <atomic> 41 42 #include <iostream> 42 43 #include <iomanip> … … 241 242 /** 242 243 * Frequency numbers of GLONASS with an offset of 100 to detect unset values. 243 * Gets filled by ephemeris and data blocks and shared between different streams. 244 * Gets filled by ephemeris and data blocks and shared between different streams 245 * (MSM4/6 streams without channel numbers use those of an ephemeris stream). 246 * Atomic, as the streams are decoded in different threads. 244 247 */ 245 static intGLOFreq[RTCM3_MSM_NUMSAT];248 static std::atomic<int> GLOFreq[RTCM3_MSM_NUMSAT]; 246 249 247 250 /* … … 1998 2001 GETSTRING(antnum, antenna) 1999 2002 if ((antnum > -1 && antnum < 265) && 2000 (_antType.empty() || strncmp(_antType.back()._descriptor, antenna, recnum) != 0)) { 2003 (_antType.empty() || int(strlen(_antType.back()._descriptor)) != antnum || 2004 strncmp(_antType.back()._descriptor, antenna, antnum) != 0)) { 2001 2005 _antType.push_back(t_antInfo()); 2002 2006 memcpy(_antType.back()._descriptor, antenna, antnum); … … 2017 2021 GETSTRING(recsernum, recserialnum) 2018 2022 if ((recnum > -1 && recnum < 265) && 2019 (_recType.empty() || strncmp(_recType.back()._descriptor, receiver, recnum) != 0)) { 2023 (_recType.empty() || int(strlen(_recType.back()._descriptor)) != recnum || 2024 strncmp(_recType.back()._descriptor, receiver, recnum) != 0)) { 2020 2025 _recType.push_back(t_recInfo()); 2021 2026 memcpy(_recType.back()._descriptor, receiver, recnum); -
trunk/BNC/src/RTCM3/bits.h
r11023 r11130 104 104 b = variable to store size, s = variable to store string pointer */ 105 105 #define GETSTRING(b, s) { \ 106 if(size < 1) return false; \ 106 107 b = *(data++); \ 108 --size; \ 109 if((b) > size) return false; \ 107 110 s = (char *) data; \ 108 111 data += b; \ 109 size -= b +1; \112 size -= b; \ 110 113 } 111 114 … … 126 129 } 127 130 131 /* up to 56 bits: less than 8 bits are pending in the 64-bit bitbuffer */ 128 132 #define ADDBITS(a, b) { \ 129 bitbuffer = (bitbuffer<<(a))|(( b)&((1<<a)-1)); \133 bitbuffer = (bitbuffer<<(a))|((uint64_t)(b)&((1ULL<<(a))-1)); \ 130 134 numbits += (a); \ 131 135 STOREBITS \ -
trunk/BNC/src/RTCM3/clock_and_orbit/clock_orbit.h
r11124 r11130 605 605 #define E_NADIR_ANGLE_DEPENDENT_CORR_RANGE_EXTENSION(a) ADDBITS(4, a) /* DF+015 (new RTCM) to extend DF+021*/ 606 606 #define E_SATELLITE_SET_INDICATOR(a) ADDBITS(1, a) /* DF+016 (new RTCM) */ 607 /* ADDBITS' mask "(1<<a)-1" uses a 32-bit int literal, so a plain 608 ADDBITS(64, a) is broken the same way GETSSRBITS(a, 64) was on decode 609 (see D_SATELLITE_MASK) - here even ADDBITS(32, ...) is unsafe, since 610 shifting a 32-bit int by exactly its own width is undefined behavior 611 too. Stay well clear of that edge by writing four 16-bit chunks. */ 607 /* ADDBITS handles up to 56 bits, so the 64-bit mask is written as two 608 32-bit halves (as GETSSRBITS(a, 64) does not work either, see 609 D_SATELLITE_MASK). */ 612 610 #define E_SATELLITE_MASK(a) { \ 613 611 uint64_t mask64_ = (a); \ 614 ADDBITS(16, (mask64_ >> 48) & 0xFFFFU) \ 615 ADDBITS(16, (mask64_ >> 32) & 0xFFFFU) \ 616 ADDBITS(16, (mask64_ >> 16) & 0xFFFFU) \ 617 ADDBITS(16, mask64_ & 0xFFFFU) \ 612 ADDBITS(32, mask64_ >> 32) \ 613 ADDBITS(32, mask64_ & 0xFFFFFFFFU) \ 618 614 } /* DF394 */ 619 615 #define E_FREQUENCY_SET_INDICATOR(a) ADDBITS(1, a) /* DF+017 (new RTCM) */ -
trunk/BNC/src/RTCM3/clock_and_orbit/clock_orbit_rtcm_new.cpp
r11126 r11130 489 489 if (md->Entries[i].nonDefaultIndicator && 490 490 md->Entries[i].additionalParameterIndicator) { 491 /* up to 255 bits, only 32 stored (leadingbits zero); in pieces of492 16 bits, as ADDBITS cannot handle more than 30 bits*/491 /* up to 255 bits, only 32 stored: leading zero bits (ADDBITS 492 handles at most 56 bits at a time), then the value */ 493 493 unsigned int k = md->Entries[i].additionalParameterNumBits; 494 while (k) { 495 unsigned int n = (k > 16) ? 16 : k; 494 while (k > 32) { 495 unsigned int n = (k - 32 > 56) ? 56 : k - 32; 496 ADDBITS(n, 0) 496 497 k -= n; 497 E_ADDITIONAL_MODEL_PARAMETER_DATA((k < 32) ? (md->Entries[i].additionalParameterData >> k) : 0, n) 498 } 498 } 499 if (k) 500 E_ADDITIONAL_MODEL_PARAMETER_DATA(md->Entries[i].additionalParameterData, k) 499 501 } 500 502 } -
trunk/BNC/src/bnchelp.html
r11128 r11130 147 147 2.8.2 <a href="#corrint">Interval</a><br> 148 148 2.8.3 <a href="#corrport">Port</a><br> 149 2.8.4 <a href="#ssrqc">QC Directory, QC Streams, QC Reference, QC Interval, QC Bias File</a><br> 149 2.8.4 <a href="#ssrqc">QC Directory, QC Streams, QC Reference, QC Interval, QC Bias File, QC ANTEX File</a><br> 150 150 2.8.4 <a href="#corrwait">Wait for Full Corr Epoch</a><br> 151 151 2.9 <a href="#syncout"><b>Feed Engine</b></a><br> … … 5097 5097 5098 5098 <p> 5099 <h4 id="ssrqc">2.8.4 QC Directory, QC Streams, QC Reference, QC Interval, QC Bias File - optional</h4> 5099 <h4 id="ssrqc">2.8.4 QC Directory, QC Streams, QC Reference, QC Interval, QC Bias File, QC ANTEX File - optional</h4> 5100 5100 </p> 5101 5101 <p> … … 5106 5106 e.g. 'ALL,!SIRGAS200001' for a stream referring to another reference frame than the ITRF. 'QC Reference' selects the reference of the stream comparison (see below). Select 5107 5107 the 'QC Interval' for the reports (default: 1 hour). A 'QC Bias File' (Bias SINEX, OSB or DSB, e.g. a CAS DCB or 5108 a GFZ OSB product) is an optional reference for the code bias check (see below). One daily file 5108 a GFZ OSB product) is an optional reference for the code bias check (see below). A 'QC ANTEX File' (e.g. the 5109 current igs20.atx) enables the attitude check (see below). One daily file 5109 5110 '<stream>_S_<YYYYDDD>0000_01D_QC.txt' is written per stream; at the end of each interval and at the 5110 5111 end of the program, a report per system is appended. Broadcast ephemerides must be received as well, e.g. via … … 5241 5242 clock 0.689 (STD 0.008), radial 0.020, along 0.036, cross 0.022, SIS (radial - clock) 0.687 (STD 0.008) 5242 5243 G satellites deviating from the reference, RMS SIS [m]: G02(0.38) G16(0.33) G20(0.91) G26(3.36) 5244 </pre> 5245 <p> 5246 <b>Attitude check:</b> With a 'QC ANTEX File', BNC checks for every stream sending the satellite yaw angle whether 5247 its clocks are consistent with its yaw angles during noon and midnight turns. In every stream comparison (30 5248 seconds), the difference of the yaw angle of BNC's attitude model ('Computed', see section 'Combination') minus the 5249 yaw angle of the stream is followed continuously over time; the phase wind-up predicts a clock difference of the 5250 stream to an AC following the model of lambda_IF * dpsi / 2pi (lambda_IF: ionosphere-free wavelength of the 5251 reference signals, about 10.7 cm for GPS). A turn starts when the yaw difference changes by more than 20 degrees 5252 against the samples 5 to 15 minutes before, and ends when it is stable again within 2 degrees for 10 minutes. For 5253 each turn, the observed clock change of the stream relative to the consensus is compared with the predicted one: 5254 the changes at the end of the turn, the regression slope of the observed on the predicted changes, and the clock 5255 RMS during the turn without and with the predicted change. A slope between 0.7 and 1.3 with the RMS reduced by 5256 at least half means that the yaw angles in the stream describe the attitude the AC used for its clocks - the 5257 condition for selecting the attitude 'SSR' for this AC in the combination. Turns with a predicted change below 3 5258 cm are not assessed; a clock change of at least 3 cm is then reported as not explained by the yaw difference, 5259 which shows that the other ACs model this turn differently from BNC's model (the check assumes that the consensus 5260 follows it), e.g. 5261 </p> 5262 <pre> 5263 G attitude check G14 09:42:30-10:25:30: yaw difference to the model 362 deg, clock change vs. consensus 8.2 cm, predicted 10.7 cm (max 10.7 cm), slope 0.77, clock RMS 6.1 -> 2.0 cm: SSR yaw consistent with the clocks 5264 G attitude check G25 07:53:00-08:51:30: yaw difference to the model 39 deg, clock change vs. consensus -9.8 cm, predicted -0.0 cm (max 1.2 cm), slope 1.84, clock RMS 5.9 -> 5.8 cm: clock change not explained by the yaw difference (the other ACs model this turn differently?) 5243 5265 </pre> 5244 5266 <p> -
trunk/BNC/src/bncmain.cpp
r11087 r11130 215 215 " ssrQcIntr {SSR QC report interval [character string: 5 min|15 min|30 min|1 hour|1 day]}\n" 216 216 " ssrQcBiasFile {Bias SINEX file (OSB or DSB) as reference for the SSR QC code bias check, full path [character string]}\n" 217 " ssrQcAntexFile {ANTEX file for the SSR QC attitude check (SSR yaw vs. clocks during turns), full path [character string]}\n" 217 218 "\n" 218 219 "Feed Engine Panel keys:\n" -
trunk/BNC/src/bncnetqueryrtp.cpp
r11128 r11130 110 110 111 111 const int timeOut = 5000; 112 const int maxHeaderLines = 100; // of an RTSP answer 112 113 113 114 _status = running; … … 177 178 QByteArray serverPort; 178 179 QString line = in.readLine(); 179 while (!line.isEmpty()) { 180 int nLines = 0; 181 while (!line.isEmpty() && ++nLines <= maxHeaderLines) { 180 182 if (line.indexOf("Session:") == 0) { 181 183 _session = line.mid(9).toLatin1(); … … 226 228 QTextStream in(_socket); 227 229 line = in.readLine(); 228 while (!line.isEmpty()) { 230 nLines = 0; 231 while (!line.isEmpty() && ++nLines <= maxHeaderLines) { 229 232 if (line.indexOf("200 OK") != -1) { 230 233 emit newMessage(_url.toEncoded(QUrl::RemoveUserInfo).replace(0,1,"") -
trunk/BNC/src/bncnetqueryv1.cpp
r11124 r11130 253 253 bool proxyResponse = false; 254 254 QStringList response; 255 const int maxResponseSize = 16384; 256 int responseSize = 0; 255 257 while (true) { 256 258 if (_socket->canReadLine()) { 257 259 QString line = _socket->readLine(); 260 261 // a caster response header is short; do not collect an endless one 262 responseSize += line.size(); 263 if (responseSize > maxResponseSize) { 264 delete _socket; 265 _socket = 0; 266 _status = error; 267 emit newMessage(_url.path().toLatin1().replace(0,1,"") 268 + ": Caster response header too long", true); 269 return; 270 } 258 271 259 272 if (line.indexOf("ICY 200 OK") == -1 && … … 289 302 break; 290 303 } 304 } 305 else if (_socket->bytesAvailable() > maxResponseSize) { // no line end 306 delete _socket; 307 _socket = 0; 308 _status = error; 309 emit newMessage(_url.path().toLatin1().replace(0,1,"") 310 + ": Caster response header too long", true); 311 return; 291 312 } 292 313 else if (!_socket->waitForReadyRead(_timeOut)) { -
trunk/BNC/src/src.pri
r11087 r11130 19 19 20 20 win32:QMAKE_CXXFLAGS += /std:c++17 21 22 # Hardening, independent of the distribution's compiler defaults: stack 23 # protector, bounds checks of the std containers (abort instead of memory 24 # corruption), read-only relocations. _FORTIFY_SOURCE is not set, it requires 25 # optimization, which is switched off above. 26 linux:QMAKE_CXXFLAGS += -fstack-protector-strong -D_GLIBCXX_ASSERTIONS 27 linux:QMAKE_LFLAGS += -Wl,-z,relro,-z,now 21 28 22 29 debug:OBJECTS_DIR=.obj/debug
Note:
See TracChangeset
for help on using the changeset viewer.
