pl.grzeslowski.jsupla.protocol.api.encoders.CalCfgZWaveWakeupSettingsReportEncoder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of protocol Show documentation
Show all versions of protocol Show documentation
Uploads all artifacts belonging to configuration ':protocol:archives'
The newest version!
package pl.grzeslowski.jsupla.protocol.api.encoders;
import lombok.val;
import pl.grzeslowski.jsupla.protocol.api.encoders.PrimitiveEncoder;
import pl.grzeslowski.jsupla.protocol.api.structs.CalCfgZWaveWakeupSettingsReport;
import static pl.grzeslowski.jsupla.protocol.api.JavaConsts.*;
import static pl.grzeslowski.jsupla.protocol.api.consts.ProtoConsts.*;
@javax.annotation.Generated(value="Struct original name: TCalCfg_ZWave_WakeupSettingsReport", date = "2024-09-06T08:44:37.841Z[Etc/UTC]")
@lombok.NoArgsConstructor(access = lombok.AccessLevel.PRIVATE)
public class CalCfgZWaveWakeupSettingsReportEncoder implements pl.grzeslowski.jsupla.protocol.api.encoders.ProtoWithSizeEncoder {
public static final CalCfgZWaveWakeupSettingsReportEncoder INSTANCE = new CalCfgZWaveWakeupSettingsReportEncoder();
@Override
public byte[] encode(CalCfgZWaveWakeupSettingsReport proto) {
final byte[] bytes = new byte[proto.size()];
int offset = 0;
offset += PrimitiveEncoder.INSTANCE.writeUnsignedInt(proto.minimumSec, bytes, offset);
offset += PrimitiveEncoder.INSTANCE.writeUnsignedInt(proto.maximumSec, bytes, offset);
offset += PrimitiveEncoder.INSTANCE.writeUnsignedInt(proto.valueSec, bytes, offset);
offset += PrimitiveEncoder.INSTANCE.writeUnsignedInt(proto.intervalStepSec, bytes, offset);
return bytes;
}
}