package com.ruoyi.dataInterchange.model;
|
|
import io.netty.buffer.ByteBuf;
|
import io.netty.buffer.ByteBufUtil;
|
import io.netty.buffer.Unpooled;
|
import lombok.Data;
|
|
/**
|
* 主链路登录应答
|
*
|
* @author zhibing.pu
|
* @Date 2025/2/24 10:47
|
*/
|
@Data
|
public class UPConnectRsp {
|
/**
|
* 验证结果
|
* 0x00:成功
|
* 0x01:IP地址不正确
|
* 0x02:接入码不正确
|
* 0x03:用户没有注册
|
* 0x04:密码错误
|
* 0x05:资源紧张,超厚再连接(已经占用)
|
* 0xFF::其他
|
*/
|
private int result;
|
/**
|
* 校验码
|
*/
|
private int verifyCode;
|
|
/**
|
* 编码登录回复报文
|
*/
|
public byte[] encode() {
|
ByteBuf byteBuf = Unpooled.buffer(5);
|
byteBuf.writeByte(this.getResult());
|
byteBuf.writeInt(this.getVerifyCode());
|
byte[] bytes = ByteBufUtil.getBytes(byteBuf);
|
byteBuf.release();
|
return bytes;
|
}
|
}
|