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

pl.grzeslowski.jsupla.protocol.api.decoders.cs.GetDeviceConfigRequestDecoder Maven / Gradle / Ivy

The newest version!
package pl.grzeslowski.jsupla.protocol.api.decoders.cs;

import lombok.val;
import pl.grzeslowski.jsupla.protocol.api.decoders.PrimitiveDecoder;
import pl.grzeslowski.jsupla.protocol.api.structs.cs.GetDeviceConfigRequest;
import static pl.grzeslowski.jsupla.protocol.api.JavaConsts.*;
import static pl.grzeslowski.jsupla.protocol.api.consts.ProtoConsts.*;

@javax.annotation.Generated(value="Struct original name: TCS_GetDeviceConfigRequest", date = "2024-09-06T08:44:37.647Z[Etc/UTC]")
@lombok.NoArgsConstructor(access = lombok.AccessLevel.PRIVATE)
public class GetDeviceConfigRequestDecoder implements pl.grzeslowski.jsupla.protocol.api.decoders.cs.ClientServerDecoder {
	public static final GetDeviceConfigRequestDecoder INSTANCE = new GetDeviceConfigRequestDecoder();

    @Override
	public GetDeviceConfigRequest decode(byte[] bytes, int offset) {
		val deviceId = PrimitiveDecoder.INSTANCE.parseInt(bytes, offset);
		offset += INT_SIZE;

		val fields = PrimitiveDecoder.INSTANCE.parseUnsignedLong(bytes, offset);
		offset += LONG_SIZE;

		val zero = PrimitiveDecoder.INSTANCE.copyOfRangeByteUnsigned(bytes, offset, offset + (int) 8);
		offset += 8 * BYTE_SIZE;
		
	    return new GetDeviceConfigRequest(deviceId, fields, zero);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy