pl.grzeslowski.jsupla.protocol.api.encoders.ChannelConfigFacadeBlindEncoder 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.ChannelConfigFacadeBlind;
import static pl.grzeslowski.jsupla.protocol.api.JavaConsts.*;
import static pl.grzeslowski.jsupla.protocol.api.consts.ProtoConsts.*;
@javax.annotation.Generated(value="Struct original name: TChannelConfig_FacadeBlind", date = "2024-09-06T08:44:37.843Z[Etc/UTC]")
@lombok.NoArgsConstructor(access = lombok.AccessLevel.PRIVATE)
public class ChannelConfigFacadeBlindEncoder implements pl.grzeslowski.jsupla.protocol.api.encoders.ProtoWithSizeEncoder {
public static final ChannelConfigFacadeBlindEncoder INSTANCE = new ChannelConfigFacadeBlindEncoder();
@Override
public byte[] encode(ChannelConfigFacadeBlind proto) {
final byte[] bytes = new byte[proto.size()];
int offset = 0;
offset += PrimitiveEncoder.INSTANCE.writeInt(proto.closingTimeMS, bytes, offset);
offset += PrimitiveEncoder.INSTANCE.writeInt(proto.openingTimeMS, bytes, offset);
offset += PrimitiveEncoder.INSTANCE.writeInt(proto.tiltingTimeMS, bytes, offset);
offset += PrimitiveEncoder.INSTANCE.writeUnsignedByte(proto.motorUpsideDown, bytes, offset);
offset += PrimitiveEncoder.INSTANCE.writeUnsignedByte(proto.buttonsUpsideDown, bytes, offset);
offset += PrimitiveEncoder.INSTANCE.writeByte(proto.timeMargin, bytes, offset);
offset += PrimitiveEncoder.INSTANCE.writeUnsignedShort(proto.tilt0Angle, bytes, offset);
offset += PrimitiveEncoder.INSTANCE.writeUnsignedShort(proto.tilt100Angle, bytes, offset);
offset += PrimitiveEncoder.INSTANCE.writeUnsignedByte(proto.tiltControlType, bytes, offset);
offset += PrimitiveEncoder.INSTANCE.writeUnsignedByte(proto.visualizationType, bytes, offset);
offset += PrimitiveEncoder.INSTANCE.writeUnsignedByteArray(proto.reserved, bytes, offset);
return bytes;
}
}