📄 cmpp2connectresp.java
字号:
package com.khan.sms.cmpp2;
import com.khan.sms.MsgID;
import com.khan.util.SocketCommon;
/**
* <p>Title: </p>
*
* <p>Description: </p>
*
* <p>Copyright: Copyright (c) 2006</p>
*
* <p>Company: </p>
*
* @author not attributable
* @version 1.0
*/
public class Cmpp2ConnectResp extends Cmpp2Data {
public byte bStatus = 0x00;
byte[] AuthenticatorISMG = new byte[16];
byte bVersion = 0x00;
public Cmpp2ConnectResp(byte[] data) {
//MsgID.PrintDataHex(data);//
if (data.length < 12)
throw new ExceptionInInitializerError("数据包长度小于12字节,包错误!");
int ioffset = 0;
TotalLen = SocketCommon.getDWord(data, ioffset);//MsgID.ntohl( MsgID.getDWord(data, ioffset) );
//System.out.println(TotalLen);//
if (data.length < 12)
throw new ExceptionInInitializerError("数据包头Total_Len字段标示长度小于12字节,包头错误!");
ioffset += 4;
CommandID = SocketCommon.getDWord(data, ioffset);//MsgID.ntohl( MsgID.getDWord(data, ioffset) );
ioffset += 4;
SeqID = SocketCommon.getDWord(data, ioffset);//MsgID.ntohl( MsgID.getDWord(data, ioffset) );
ioffset += 4;
Data = new byte[TotalLen - ioffset];
System.arraycopy(data, ioffset, Data,0, TotalLen - ioffset);
}
/**
* decodeCmpp
*
* @return Cmpp2Data
* @todo Implement this com.khan.sms.cmpp2.Cmpp2Data method
*/
public Cmpp2Data decodeCmpp() {
int ioffset=0;
this.bStatus = this.Data[0];
ioffset += 1;
System.arraycopy(Data, ioffset, AuthenticatorISMG, 0, AuthenticatorISMG.length);
ioffset += AuthenticatorISMG.length;
bVersion = Data[ioffset];
Cmpp2Data connect_resp = this ;
return connect_resp;
}
/**
* encodeCmpp
*
* @return byte[]
* @todo Implement this com.khan.sms.cmpp2.Cmpp2Data method
*/
public byte[] encodeCmpp() {
return null;
}
public String toString() {
return "CMPP2_CONNECT_RESP:status="+this.bStatus+",Version="+ this.bVersion ;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -