pl.grzeslowski.jsupla.protocol.api.decoders.sc.SuplaChannelGroupDecoder 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'
package pl.grzeslowski.jsupla.protocol.api.decoders.sc;
import lombok.val;
import pl.grzeslowski.jsupla.protocol.api.decoders.PrimitiveDecoder;
import pl.grzeslowski.jsupla.protocol.api.structs.sc.SuplaChannelGroup;
import static pl.grzeslowski.jsupla.protocol.api.JavaConsts.*;
import static pl.grzeslowski.jsupla.protocol.api.consts.ProtoConsts.*;
@javax.annotation.Generated(value="Struct original name: TSC_SuplaChannelGroup", date = "2024-07-06T18:57:04.512Z[Etc/UTC]")
@lombok.NoArgsConstructor(access = lombok.AccessLevel.PRIVATE)
public class SuplaChannelGroupDecoder implements pl.grzeslowski.jsupla.protocol.api.decoders.sc.ServerClientDecoder {
public static final SuplaChannelGroupDecoder INSTANCE = new SuplaChannelGroupDecoder();
@Override
public SuplaChannelGroup decode(byte[] bytes, int offset) {
val eOL = PrimitiveDecoder.INSTANCE.parseByte(bytes, offset);
offset += BYTE_SIZE;
val id = PrimitiveDecoder.INSTANCE.parseInt(bytes, offset);
offset += INT_SIZE;
val locationId = PrimitiveDecoder.INSTANCE.parseInt(bytes, offset);
offset += INT_SIZE;
val func = PrimitiveDecoder.INSTANCE.parseInt(bytes, offset);
offset += INT_SIZE;
val altIcon = PrimitiveDecoder.INSTANCE.parseInt(bytes, offset);
offset += INT_SIZE;
val flags = PrimitiveDecoder.INSTANCE.parseUnsignedInt(bytes, offset);
offset += INT_SIZE;
val captionSize = PrimitiveDecoder.INSTANCE.parseUnsignedInt(bytes, offset);
offset += INT_SIZE;
val caption = PrimitiveDecoder.INSTANCE.copyOfRangeByte(bytes, offset, offset + (int) captionSize);
offset += captionSize * BYTE_SIZE;
return new SuplaChannelGroup(eOL, id, locationId, func, altIcon, flags, captionSize, caption);
}
}