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

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

@Data
@EqualsAndHashCode
public class HeartBeatData extends RequestData {

    /***
     * 锁止状态: 1 unlocked, 2 locked
     */
    private byte lockStatus;

    /**
     * 钥匙状态: 0 OFF, 1 ACC, 2 ON, 0XFF 不支持
     */
    private byte keyStatus;

    @Override
    protected void encodeInternal(ByteBuf byteBuf) {
        byteBuf.writeByte(lockStatus);
        byteBuf.writeByte(keyStatus);
    }

    @Override
    protected void decodeInternal(ByteBuf byteBuf) {
        this.lockStatus = byteBuf.readByte();
        this.keyStatus = byteBuf.readByte();
    }
}
