pl.grzeslowski.jsupla.protocol.api.decoders.cs.GetChannelConfigRequestDecoder 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'
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.GetChannelConfigRequest;
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_GetChannelConfigRequest", date = "2024-09-06T08:44:37.646Z[Etc/UTC]")
@lombok.NoArgsConstructor(access = lombok.AccessLevel.PRIVATE)
public class GetChannelConfigRequestDecoder implements pl.grzeslowski.jsupla.protocol.api.decoders.cs.ClientServerDecoder {
public static final GetChannelConfigRequestDecoder INSTANCE = new GetChannelConfigRequestDecoder();
@Override
public GetChannelConfigRequest decode(byte[] bytes, int offset) {
val channelId = PrimitiveDecoder.INSTANCE.parseInt(bytes, offset);
offset += INT_SIZE;
val configType = PrimitiveDecoder.INSTANCE.parseUnsignedByte(bytes, offset);
offset += BYTE_SIZE;
val flags = PrimitiveDecoder.INSTANCE.parseUnsignedInt(bytes, offset);
offset += INT_SIZE;
return new GetChannelConfigRequest(channelId, configType, flags);
}
}