本文整理汇总了C++中TLFrame类的典型用法代码示例。如果您正苦于以下问题:C++ TLFrame类的具体用法?C++ TLFrame怎么用?C++ TLFrame使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TLFrame类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: write
void TLUserData::write(TLFrame& dest, size_t& wp) const
{
#if 1
// First write TP-User-Data-Length
dest.writeField(wp,mLength,8);
// Then write TP-User-Data
// This tail() works because UD is always the last field in the PDU.
BitVector ud_dest = dest.tail(wp);
mRawData.copyTo(ud_dest);
ud_dest.LSB8MSB();
#else
// Stuff we don't support...
assert(!mUDHI);
assert(mDCS==0);
unsigned numChar = strlen(mData);
dest.writeField(wp,numChar,8);
// This tail() works because UD is always the last field in the PDU.
BitVector chars = dest.tail(wp);
chars.zero();
for (unsigned i=0; i<numChar; i++) {
char gsm = encodeGSMChar(mData[i]);
dest.writeFieldReversed(wp,gsm,7);
}
chars.LSB8MSB();
#endif
}
开发者ID:57-Wolve,项目名称:OpenBTS-UMTS,代码行数:27,代码来源:SMSMessages.cpp
示例2: writeBody
void TLDeliver::writeBody(TLFrame& dest, size_t& wp) const
{
writeMMS(dest);
writeRP(dest);
writeUDHI(dest, mUD.UDHI());
writeSRI(dest);
mOA.write(dest,wp);
dest.writeField(wp,mPID,8);
dest.writeField(wp,mUD.DCS(),8);
mSCTS.write(dest,wp);
writeUnused(dest);
mUD.write(dest,wp);
}
开发者ID:57-Wolve,项目名称:OpenBTS-UMTS,代码行数:13,代码来源:SMSMessages.cpp
示例3: writeBody
// (pat) See 3GPP 3.40 9.2.2
void TLDeliver::writeBody(TLFrame& dest, size_t& wp) const
{
writeMMS(dest); // more messages to send bit.
writeRP(dest); // reply path bit.
writeUDHI(dest, mUD.UDHI()); // User-data-header-indicator bit
writeSRI(dest); // status-report-indication bit
mOA.write(dest,wp); // originating address
dest.writeField(wp,mPID,8); // protocol id
dest.writeField(wp,mUD.DCS(),8); // Data-coding-scheme
mSCTS.write(dest,wp); // service-centre-time-stamp
writeUnused(dest); // user-data-length. (pat) Why empty?
mUD.write(dest,wp); // user data.
}
开发者ID:84danielwhite,项目名称:openbts,代码行数:14,代码来源:SMSMessages.cpp
示例4: parse
/** Parse a TL address field, including length. */
void TLAddress::parse(const TLFrame& src, size_t& rp)
{
// GSM 03.40.
// This is different from the BCD formats in GSM 04.08,
// even though it looks very similar.
// The difference is in the encoding of the length field.
size_t numDigits = src.readField(rp,8);
size_t length = numDigits/2 + (numDigits % 2);
if (src.readField(rp, 1) != 1) SMS_READ_ERROR;
mType = (TypeOfNumber)src.readField(rp, 3);
mPlan = (NumberingPlan)src.readField(rp, 4);
mDigits.parse(src,rp,length);
}
开发者ID:57-Wolve,项目名称:OpenBTS-UMTS,代码行数:15,代码来源:SMSMessages.cpp
示例5: parseBody
void TLSubmit::parseBody(const TLFrame& src, size_t& rp)
{
parseRD(src);
parseVPF(src);
parseRP(src);
parseUDHI(src);
parseSRR(src);
mMR = src.readField(rp,8);
mDA.parse(src,rp);
mPI = src.readField(rp,8);
mDCS = src.readField(rp,8);
mVP.VPF(mVPF);
mVP.parse(src,rp);
mUD.DCS(mDCS);
mUD.parse(src,rp);
}
开发者ID:5728136cs,项目名称:Mobile_Netze_HM_OpenBTS_Handover,代码行数:16,代码来源:SMSMessages.cpp
示例6: write
void TLUserData::write(TLFrame& dest, size_t& wp) const
{
// Stuff we don't support...
assert(!mUDHI);
assert(mDCS==0);
unsigned numChar = strlen(mData);
dest.writeField(wp,numChar,8);
// This tail() works because UD is always the last field in the PDU.
BitVector chars = dest.tail(wp);
chars.zero();
for (unsigned i=0; i<numChar; i++) {
char gsm = encodeGSMChar(mData[i]);
dest.writeFieldReversed(wp,gsm,7);
}
chars.LSB8MSB();
}
开发者ID:5728136cs,项目名称:Mobile_Netze_HM_OpenBTS_Handover,代码行数:16,代码来源:SMSMessages.cpp
示例7: parseBody
void TLDeliver::parseBody(const TLFrame &src, size_t &rp)
{
// Note that offset is reversed, i'=7-i.
// Ignore MTI, we already know it is DELIVER.
// Note that these header fields come from src ignoring rp.
parseMMS(src);
parseRP(src);
parseUDHI(src);
parseSRI(src);
// Now the 'body'
assert(rp == 8);
mOA.parse(src,rp); // originating address.
mPID = src.readField(rp,8); // protocol id
mUD.DCS(src.readField(rp,8)); // data coding scheme, stored in the TLUserData.
mSCTS.parse(src,rp); // time stamp
mUD.parse(src,rp); // user data.
}
开发者ID:84danielwhite,项目名称:openbts,代码行数:17,代码来源:SMSMessages.cpp
示例8: parse
void TLUserData::parse(const TLFrame& src, size_t& rp)
{
assert(!mUDHI); // We don't support user headers.
// The DCS is defined in GSM 03.38 4.
assert(mDCS<0x100); // Someone forgot to initialize the DCS.
unsigned numChar = src.readField(rp,8);
switch (mDCS) {
case 0:
case 244:
case 245:
case 246:
case 247:
{
// GSM 7-bit encoding, GSM 03.38 6.
// Check bounds.
if (numChar*7 > (src.size()-rp)) {
LOG(NOTICE) << "badly formatted TL-UD";
SMS_READ_ERROR;
}
BitVector chars(src.tail(rp));
chars.LSB8MSB();
size_t crp=0;
for (unsigned i=0; i<numChar; i++) {
char gsm = chars.readFieldReversed(crp,7);
mData[i] = decodeGSMChar(gsm);
}
mData[numChar]='\0';
if (crp%8) crp += 8 - crp%8;
rp += crp;
return;
}
default:
{
rp += numChar;
sprintf(mData,"unsupported DCS 0x%x", mDCS);
LOG(NOTICE) << mData;
SMS_READ_ERROR;
}
}
}
开发者ID:5728136cs,项目名称:Mobile_Netze_HM_OpenBTS_Handover,代码行数:40,代码来源:SMSMessages.cpp
示例9: LOG
void TLValidityPeriod::parse(const TLFrame& src, size_t& rp)
{
// FIXME -- Check remaining message length before reading!!
LOG(DEBUG) << "SMS: TLValidityPeriod::parse VPF=" << mVPF;
switch (mVPF) {
case 2: {
// Relative format.
// GSM 03.40 9.2.3.12.1
unsigned vp = src.readField(rp,8);
unsigned minutes = 0;
if (vp<144) minutes = (vp+1)*5;
else if (vp<168) minutes = 12*60 + (vp-143)*30;
else if (vp<197) minutes = 24*60*(vp-166);
else minutes = 7*24*60*(vp-192);
mExpiration = Timeval();
mExpiration.addMinutes(minutes);
return;
}
case 3: {
// Absolute format, borrowed from GSM 04.08 MM
// GSM 03.40 9.2.3.12.2
L3TimeZoneAndTime decoder;
decoder.parseV((TLFrame)(BitVector)src,rp);
mExpiration = decoder.time();
return;
}
case 1:
// Enhanced format.
// GSM 03.40 9.2.3.12.3
LOG(NOTICE) << "SMS: ignoring grossly complex \"enhanced\" TP-VP and assuming 1 week.";
rp += 7;
// fall through...
case 0:
// No validity period field.
LOG(DEBUG) << "SMS: no validity period, assuming 1 week";
mExpiration = Timeval(7*24*60*60*1000);
return;
default: assert(0); // someone forgot to initialize the VPF
}
}
开发者ID:57-Wolve,项目名称:OpenBTS-UMTS,代码行数:40,代码来源:SMSMessages.cpp
注:本文中的TLFrame类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论