called from SMS::parseSMS.
| 188 | |
| 189 | // called from SMS::parseSMS. |
| 190 | void CPUserData::parseV(const L3Frame& src, size_t &rp, size_t expectedLength) |
| 191 | { |
| 192 | unsigned numBits = expectedLength*8; |
| 193 | // WARNING: segmentCopyTo does not modify the size of the target so we must do it. |
| 194 | mRPDU.resize(numBits); |
| 195 | int actualLength = (int) src.size() - rp; |
| 196 | if (actualLength < (int)numBits) { |
| 197 | // The length field (third byte) in the L3Frame was bogus, less than the remaining length of the frame. |
| 198 | LOG(ERR)<<"Invalid SMS frame:"<<LOGVAR(expectedLength*8) <<" (from L3 header)"<<LOGVAR(actualLength); |
| 199 | L3_READ_ERROR; |
| 200 | } |
| 201 | src.segmentCopyTo(mRPDU,rp,numBits); |
| 202 | rp += numBits; |
| 203 | } |
| 204 | |
| 205 | void CPUserData::writeV(L3Frame& dest, size_t &wp) const |
| 206 | { |