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

import com.pwt.netty.common.charger.RequestData;
import io.netty.buffer.ByteBuf;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

/**
 * 配置命令数据
 */
@Getter
@Setter
@ToString
@EqualsAndHashCode(callSuper = true)
public class ConfigurationCmdData extends RequestData {

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

    @Override
    public void encode(ByteBuf byteBuf) {
        byteBuf.writeShort(getCurrentChargeStatusUploadInterval());
    }


    @Override
    public void decode(ByteBuf byteBuf) {
        setCurrentChargeStatusUploadInterval(byteBuf.readShort());
    }

    @Override
    public int getProtocolLength() {
        return 0;
    }

    @Override
    public byte getEnd() {
        return 0;
    }
}
