package safeluck.drive.evaluation.platformMessage; import com.anyun.exam.lib.MyLog; import com.anyun.im_lib.util.ByteUtil; import safeluck.drive.evaluation.im.MessageProcessor; public class RegisterResp extends ServerProtocol { private String hexpwd; private short result; private int currPos = 0; public RegisterResp(byte[] rspBytes) { super(rspBytes); } @Override protected void parseMsgBody(byte[] msgbodyData) { currPos += 2; result = ByteUtil.getShort(ByteUtil.subArray(msgbodyData,currPos,1)); if (result == PlatFormConstant.SUCCESS){ MyLog.i(PlatFormConstant.TAG,"设备注册成功"); AuthMessage authMessage = new AuthMessage((short) 0x101); currPos +=1; hexpwd = ByteUtil.byte2HexStr(ByteUtil.subArray(msgbodyData,currPos,msgBodyLength-3)); MyLog.i(PlatFormConstant.TAG,"des pwd:"+hexpwd); authMessage.setHexStrPwd(hexpwd); MessageProcessor.getInstance().sendMessage(authMessage.toBytes()); }else{ MyLog.i(PlatFormConstant.TAG,"设备注册失败"); } } }