Changeset 1436 in ntrip for trunk/BNC/GPSS


Ignore:
Timestamp:
Jan 3, 2009, 12:59:35 PM (15 years ago)
Author:
mervart
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/GPSS/gpssDecoder.cpp

    r1435 r1436  
    109109                         epochHdr.n_svs * sizeof(t_obsInternal);
    110110          memcpy(&crc, _buffer.data() + checkLen, sizeof(crc));
    111           int crdCal = cal_crc((unsigned char*) _buffer.data(), checkLen);
     111          int crcCal = cal_crc((unsigned char*) _buffer.data(), checkLen);
    112112
    113           cout << "Obs: " << crc << " " << crdCal << endl;
    114 
    115           for (int is = 0; is < epochHdr.n_svs; is++) {
    116             t_obs* obs = new t_obs();
    117             memcpy(&(obs->_o), _buffer.data() + 2 + sizeof(recordSize) +
    118                                sizeof(epochHdr) + is * sizeof(t_obsInternal),
    119                    sizeof(t_obsInternal));
    120             _obsList.push_back(obs);
     113          if (crc == crcCal) {
     114            for (int is = 0; is < epochHdr.n_svs; is++) {
     115              t_obs* obs = new t_obs();
     116              memcpy(&(obs->_o), _buffer.data() + 2 + sizeof(recordSize) +
     117                                 sizeof(epochHdr) + is * sizeof(t_obsInternal),
     118                     sizeof(t_obsInternal));
     119              _obsList.push_back(obs);
     120            }
    121121          }
    122122        }
     
    135135        int checkLen = 2 + sizeof(recordSize) + sizeof(gpsephemeris);
    136136        memcpy(&crc, _buffer.data() + checkLen, sizeof(crc));
    137         int crdCal = cal_crc((unsigned char*) _buffer.data(), checkLen);
     137        int crcCal = cal_crc((unsigned char*) _buffer.data(), checkLen);
    138138
    139         cout << "Eph: " << crc << " " << crdCal << endl;
    140 
    141         gpsephemeris* gpsEph = new gpsephemeris;
    142         memcpy(gpsEph, _buffer.data() + 2 + sizeof(recordSize),
    143                sizeof(gpsephemeris));
    144         emit newGPSEph(gpsEph);
     139        if (crc == crcCal) {
     140          gpsephemeris* gpsEph = new gpsephemeris;
     141          memcpy(gpsEph, _buffer.data() + 2 + sizeof(recordSize),
     142                 sizeof(gpsephemeris));
     143          emit newGPSEph(gpsEph);
     144        }
    145145      }
    146146      _buffer = _buffer.mid(reqLength);
Note: See TracChangeset for help on using the changeset viewer.