package safeluck.drive.evaluation.platformMessage;
|
|
import com.anyun.im_lib.util.ByteUtil;
|
|
public class ClientCommonRsp extends DriveExamProtocol {
|
private static final int BODY_LENGTH = 5;
|
|
private short result;//结果
|
private short msgId;//对应的服务器端消息id
|
private short msg_serial;//服务器消息给的流水号
|
|
private int curPos = 0;
|
|
/**
|
* 构造函数
|
*
|
*
|
*/
|
public ClientCommonRsp() {
|
super((short) 0x0001);
|
}
|
|
@Override
|
protected byte[] createMessageBody() {
|
byte[] messageBody = new byte[BODY_LENGTH];
|
byte[] msg_serialBytes= ByteUtil.shortGetBytes(msg_serial);
|
byte[] msgidBytes = ByteUtil.shortGetBytes(msgId);
|
System.arraycopy(msg_serialBytes,0,messageBody,curPos,2);
|
curPos += 2;
|
System.arraycopy(msgidBytes,0,messageBody,curPos,2);
|
curPos += 2;
|
System.arraycopy(ByteUtil.shortGetByte(result),0,messageBody,curPos,1);
|
return messageBody;
|
}
|
|
@Override
|
protected short msgBodyLength() {
|
return BODY_LENGTH;
|
}
|
|
public short getResult() {
|
return result;
|
}
|
|
public void setResult(short result) {
|
this.result = result;
|
}
|
|
public short getMsgId() {
|
return msgId;
|
}
|
|
public void setMsgId(short msgId) {
|
this.msgId = msgId;
|
}
|
|
public short getMsg_serial() {
|
return msg_serial;
|
}
|
|
public void setMsg_serial(short msg_serial) {
|
this.msg_serial = msg_serial;
|
}
|
}
|