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

pl.grzeslowski.jsupla.protocol.api.decoders.sd.FirmwareUpdateUrlResultDecoder Maven / Gradle / Ivy

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

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

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

    @Override
	public FirmwareUpdateUrlResult decode(byte[] bytes, int offset) {
		val exists = PrimitiveDecoder.INSTANCE.parseByte(bytes, offset);
		offset += BYTE_SIZE;

		val url = pl.grzeslowski.jsupla.protocol.api.decoders.sd.FirmwareUpdateUrlDecoder.INSTANCE.decode(bytes, offset);
		offset += url.size();
		
	    return new FirmwareUpdateUrlResult(exists, url);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy