Changeset 869 in ntrip


Ignore:
Timestamp:
May 5, 2008, 6:22:49 PM (16 years ago)
Author:
mervart
Message:

* empty log message *

Location:
trunk/BNC/RTCM3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/RTCM3/RTCM3coDecoder.cpp

    r868 r869  
    5959t_irc RTCM3coDecoder::Decode(char* buffer, int bufLen) {
    6060
    61   memset(&_co, 0, sizeof(_co));
    62   int irc = GetClockOrbitBias(&_co, &_bias, buffer, bufLen);
    63  
    64   printf("EPOCH %d %d %d\n", irc, _co.GPSEpochTime, _co.NumberOfGPSSat);
     61  _buffer.append(buffer, bufLen);
    6562
    66   for(int ii = 0; ii < _co.NumberOfGPSSat; ++ii) {
    67     printf("%d G%d %d %f %f %f %f\n", _co.GPSEpochTime,
    68            _co.Sat[ii].ID, _co.Sat[ii].IOD, _co.Sat[ii].Clock.DeltaA0,
    69            _co.Sat[ii].Orbit.DeltaRadial, _co.Sat[ii].Orbit.DeltaAlongTrack,
    70            _co.Sat[ii].Orbit.DeltaCrossTrack);
     63  while (true) {
     64    memset(&_co, 0, sizeof(_co));
     65    int irc = GetClockOrbitBias(&_co, &_bias,
     66                                _buffer.data(), _buffer.size());
     67    if      (irc == -2) {  // not enough data
     68      return failure;
     69    }
     70    else if (irc == -3) {  // not synchronized
     71      _buffer = _buffer.substr(1);
     72    }
     73    else if (irc == 0) {
     74      for(int ii = 0; ii < _co.NumberOfGPSSat; ++ii) {
     75        printf("%d G%d %d %f %f %f %f\n", _co.GPSEpochTime,
     76               _co.Sat[ii].ID, _co.Sat[ii].IOD, _co.Sat[ii].Clock.DeltaA0,
     77               _co.Sat[ii].Orbit.DeltaRadial, _co.Sat[ii].Orbit.DeltaAlongTrack,
     78               _co.Sat[ii].Orbit.DeltaCrossTrack);
     79      }
     80      _buffer = _buffer.substr(1);
     81      return success;
     82    }
     83    else {
     84      return failure;
     85    }
    7186  }
    72 
    73   return success;
    7487}
  • trunk/BNC/RTCM3/RTCM3coDecoder.h

    r868 r869  
    3838  virtual t_irc Decode(char* buffer = 0, int bufLen = 0);
    3939private:
    40   ClockOrbit _co;
    41   Bias       _bias;
     40  std::string _buffer;
     41  ClockOrbit  _co;
     42  Bias        _bias;
    4243} ;
    4344
Note: See TracChangeset for help on using the changeset viewer.