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: ControlLampData
 * @Description: 控制灯闪烁数据
 * @date 2022/11/15
 **/
@Data
public class ControlLampData extends RequestData {

    /*启停闪烁性质*/
    private byte startStoptWinkle;


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

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