CMPP DELIVER

王朝other·作者佚名  2008-05-31
窄屏简体版  字體: |||超大  

bool CSmsCmpp::DecodeDeliver(string& sMsgID, string& sDestID, string& sServiceID, int& nTP_pid, int& nTP_udhi,

int& nMsgFmt, string& sSrc_terminalID, int& nRegDel, int& nMsgLen, vector<BYTE>& sMsgContent,vector<BYTE>& vMsgID)

{

if(int(m_Body.size())<64) {

gRunInfo.error_package(m_Body);

return false;

}

std::copy(m_Body.begin(),m_Body.begin()+8,back_inserter(vMsgID));

sMsgID = gtMsgID(vMsgID);

sDestID = FetchOct(8,21);

sServiceID = FetchOct(29,10);

nTP_pid = FetchInt8(39);

nTP_udhi = FetchInt8(40);

nMsgFmt = FetchInt8(41);

sSrc_terminalID = FetchOct(42,21);

if(strlen(sSrc_terminalID.c_str()) == 13) {

sSrc_terminalID = sSrc_terminalID.substr(2,11);

}

nRegDel = FetchInt8(63);

nMsgLen = FetchInt8(64);

if(nMsgLen>160nMsgLen<0) return false;

if(int(m_Body.size()) >= (65+nMsgLen+8))

{

std::copy(m_Body.begin()+65,m_Body.begin()+65+nMsgLen,back_inserter(sMsgContent));

}

else {

gRunInfo.error_package(m_Body);

return false;

}

return true;

}

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
© 2005- 王朝網路 版權所有 導航