Changeset 7053 in ntrip for trunk/BNC/src/bncutils.cpp


Ignore:
Timestamp:
Jul 16, 2015, 9:43:15 AM (9 years ago)
Author:
stuerze
Message:

CRC24 calculation as well as some definitions required for ephemeris encoding were shifted to have them also somewhere else available

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/bncutils.cpp

    r6812 r7053  
    867867  return (type == t_eph::Galileo) ? 255 : 15;
    868868}
     869
     870// Returns CRC24
     871////////////////////////////////////////////////////////////////////////////
     872unsigned long CRC24(long size, const unsigned char *buf) {
     873  unsigned long crc = 0;
     874  int ii;
     875  while (size--) {
     876    crc ^= (*buf++) << (16);
     877    for(ii = 0; ii < 8; ii++) {
     878      crc <<= 1;
     879      if (crc & 0x1000000) {
     880        crc ^= 0x01864cfb;
     881      }
     882    }
     883  }
     884  return crc;
     885}
     886
Note: See TracChangeset for help on using the changeset viewer.