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

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

/**
 * @author linyun
 * @version V1.0
 * @Title: ChargerAlarmData
 * @Description: 充电机报警数据
 * @date 2022/11/15
 **/
@Data
public class ChargerAlarmData extends RequestData {

    /*故障信息*/
    private short alarmInfo;

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

    /**
     * 子类解码
     *
     * @param byteBuf
     */
    @Override
    protected void decodeInternal(ByteBuf byteBuf)
    {
        setAlarmInfo(byteBuf.readShort());
    }
}
