package com.pwt.netty.common.vehicle2old.server;

import com.pwt.netty.common.vehicle2old.ResponseData;
import io.netty.buffer.ByteBuf;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * @author linyun
 * @version V1.0
 * @Title: UnLockResponseData
 * @Description: 解锁数据响应
 * @date 2022/11/15
 **/
@Data
@EqualsAndHashCode
public class UnLockResponseData extends ResponseData {

    /**解锁状态:0解锁成功 1非ACC OFF状态 2车架号不匹配 3解锁识别 FF异常*/
    private int unLockStatus;

    /***
     * 子类编码
     * @param byteBuf
     */
    @Override
    protected void encodeInternal(ByteBuf byteBuf)
    {
        byteBuf.writeByte(unLockStatus);
    }

    /**
     * 子类解码
     *
     * @param byteBuf
     */
    @Override
    protected void decodeInternal(ByteBuf byteBuf)
    {
        this.unLockStatus = byteBuf.readUnsignedByte();
    }
}
