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

pl.grzeslowski.jsupla.protocol.api.decoders.cs.SuplaRegisterClientCDecoder 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.SuplaRegisterClientC;
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_SuplaRegisterClient_C", date = "2024-09-06T08:44:37.653Z[Etc/UTC]")
@lombok.NoArgsConstructor(access = lombok.AccessLevel.PRIVATE)
public class SuplaRegisterClientCDecoder implements pl.grzeslowski.jsupla.protocol.api.decoders.cs.ClientServerDecoder {
	public static final SuplaRegisterClientCDecoder INSTANCE = new SuplaRegisterClientCDecoder();

    @Override
	public SuplaRegisterClientC decode(byte[] bytes, int offset) {
		val email = PrimitiveDecoder.INSTANCE.copyOfRangeByte(bytes, offset, offset + (int) SUPLA_EMAIL_MAXSIZE);
		offset += SUPLA_EMAIL_MAXSIZE * BYTE_SIZE;

		val authKey = PrimitiveDecoder.INSTANCE.copyOfRangeByte(bytes, offset, offset + (int) SUPLA_AUTHKEY_SIZE);
		offset += SUPLA_AUTHKEY_SIZE * BYTE_SIZE;

		val guid = PrimitiveDecoder.INSTANCE.copyOfRangeByte(bytes, offset, offset + (int) SUPLA_GUID_SIZE);
		offset += SUPLA_GUID_SIZE * BYTE_SIZE;

		val name = PrimitiveDecoder.INSTANCE.copyOfRangeByte(bytes, offset, offset + (int) SUPLA_CLIENT_NAME_MAXSIZE);
		offset += SUPLA_CLIENT_NAME_MAXSIZE * BYTE_SIZE;

		val softVer = PrimitiveDecoder.INSTANCE.copyOfRangeByte(bytes, offset, offset + (int) SUPLA_SOFTVER_MAXSIZE);
		offset += SUPLA_SOFTVER_MAXSIZE * BYTE_SIZE;

		val serverName = PrimitiveDecoder.INSTANCE.copyOfRangeByte(bytes, offset, offset + (int) SUPLA_SERVER_NAME_MAXSIZE);
		offset += SUPLA_SERVER_NAME_MAXSIZE * BYTE_SIZE;
		
	    return new SuplaRegisterClientC(email, authKey, guid, name, softVer, serverName);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy