All Downloads are FREE. Search and download functionalities are using the official Maven repository.

pl.grzeslowski.jsupla.protocol.api.encoders.dsc.RollerShutterValueEncoder Maven / Gradle / Ivy

The newest version!
package pl.grzeslowski.jsupla.protocol.api.encoders.dsc;

import lombok.val;
import pl.grzeslowski.jsupla.protocol.api.encoders.PrimitiveEncoder;
import pl.grzeslowski.jsupla.protocol.api.structs.dsc.RollerShutterValue;
import static pl.grzeslowski.jsupla.protocol.api.JavaConsts.*;
import static pl.grzeslowski.jsupla.protocol.api.consts.ProtoConsts.*;

@javax.annotation.Generated(value="Struct original name: TDSC_RollerShutterValue", date = "2024-09-06T08:44:37.854Z[Etc/UTC]")
@lombok.NoArgsConstructor(access = lombok.AccessLevel.PRIVATE)
public class RollerShutterValueEncoder implements pl.grzeslowski.jsupla.protocol.api.encoders.dsc.DeviceServerClientEncoder {
	public static final RollerShutterValueEncoder INSTANCE = new RollerShutterValueEncoder();

   @Override
	public byte[] encode(RollerShutterValue proto) {
final byte[] bytes = new byte[proto.size()];
int offset = 0;

		offset += PrimitiveEncoder.INSTANCE.writeByte(proto.position, bytes, offset);
		offset += PrimitiveEncoder.INSTANCE.writeByte(proto.reserved1, bytes, offset);
		offset += PrimitiveEncoder.INSTANCE.writeByte(proto.bottomPosition, bytes, offset);
		offset += PrimitiveEncoder.INSTANCE.writeShort(proto.flags, bytes, offset);
		offset += PrimitiveEncoder.INSTANCE.writeByte(proto.reserved2, bytes, offset);
		offset += PrimitiveEncoder.INSTANCE.writeByte(proto.reserved3, bytes, offset);
		offset += PrimitiveEncoder.INSTANCE.writeByte(proto.reserved4, bytes, offset);
		
	    return bytes;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy