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: ConfigurationCmdData
 * @Description: 配置命令数据
 * @date 2022/11/15
 **/
@Data
public class ConfigurationCmdData extends RequestData {

    /*当前充电状态包上传时间间隔*/
    private short currentChargeStatusUploadInterval;

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

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