Changeset 1438 in ntrip for trunk/BNC/GPSS
- Timestamp:
- Jan 3, 2009, 1:15:04 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/GPSS/gpssDecoder.cpp
r1437 r1438 80 80 _buffer += QByteArray(data, dataLen); 81 81 82 bool obsFound = false; 83 bool ephFound = false; 82 84 int iBeg; 83 85 while ( (iBeg = _buffer.indexOf(0x02)) != -1) { … … 89 91 // Observations 90 92 // ------------ 91 if ( char(_buffer[1]) == 0x00) {93 if (_buffer.length() > 0 && char(_buffer[1]) == 0x00) { 92 94 93 95 int reqLength = 2 + sizeof(recordSize) + sizeof(EPOCHHEADER); … … 109 111 if (crc == crcCal) { 110 112 for (int is = 0; is < epochHdr.n_svs; is++) { 113 obsFound = true; 111 114 t_obs* obs = new t_obs(); 112 115 memcpy(&(obs->_o), _buffer.data() + 2 + sizeof(recordSize) + … … 123 126 // Ephemeris 124 127 // --------- 125 else if ( char(_buffer[1]) == 0x01) {128 else if (_buffer.length() > 0 && char(_buffer[1]) == 0x01) { 126 129 int reqLength = 2 + sizeof(recordSize) + sizeof(gpsephemeris) + 127 sizeof(crc) + 1;130 sizeof(crc) + 1; 128 131 129 132 if (_buffer.length() >= reqLength) { … … 134 137 135 138 if (crc == crcCal) { 139 ephFound = true; 136 140 gpsephemeris* gpsEph = new gpsephemeris; 137 141 memcpy(gpsEph, _buffer.data() + 2 + sizeof(recordSize), … … 148 152 } 149 153 150 return success; 154 if (obsFound || ephFound) { 155 return success; 156 } 157 else { 158 return failure; 159 } 151 160 }
Note:
See TracChangeset
for help on using the changeset viewer.