Changeset 9195 in ntrip for branches/BNC_2.12/src/RTCM3/clock_and_orbit
- Timestamp:
- Oct 31, 2020, 10:50:07 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/BNC_2.12/src/RTCM3/clock_and_orbit/clock_orbit.h
r9051 r9195 404 404 virtual CodeType rnxTypeToCodeType(char system, std::string type) = 0; 405 405 406 static uint32_t CRC24(long size, const unsigned char *buf) {407 uint32_t crc = 0;408 int ii;409 while (size--) {410 crc ^= (*buf++) << (16);411 for (ii = 0; ii < 8; ii++) {412 crc <<= 1;413 if (crc & 0x1000000)414 crc ^= 0x01864cfb;415 }416 }417 return crc;418 }419 420 406 //#ifndef NOENCODE 421 407 #define STOREBITS \ … … 454 440 if(len > 1023) \ 455 441 return 0; \ 456 len = SsrCorr::CRC24(len+3, (const unsigned char *) blockstart); \442 len = CRC24(len+3, (const unsigned char *) blockstart); \ 457 443 ADDBITS(24, len) \ 458 444 } … … 532 518 #define T_VTEC_QUALITY_INDICATOR(a) SCALEADDBITS( 9, 20.0, a) /* DF478, IDF041 */ 533 519 520 static uint32_t CRC24(long size, const unsigned char *buf) { 521 uint32_t crc = 0; 522 int ii; 523 while (size--) { 524 crc ^= (*buf++) << (16); 525 for (ii = 0; ii < 8; ii++) { 526 crc <<= 1; 527 if (crc & 0x1000000) 528 crc ^= 0x01864cfb; 529 } 530 } 531 return crc; 532 } 534 533 535 534 static double URAToValue(int ura) {
Note:
See TracChangeset
for help on using the changeset viewer.