pl.grzeslowski.jsupla.protocol.api.structs.sc.SuplaChannelGroupPackB Maven / Gradle / Ivy
package pl.grzeslowski.jsupla.protocol.api.structs.sc;
import pl.grzeslowski.jsupla.protocol.api.structs.*;
import pl.grzeslowski.jsupla.protocol.api.types.ProtoWithSize;
import static pl.grzeslowski.jsupla.protocol.api.JavaConsts.*;
import static pl.grzeslowski.jsupla.protocol.api.Preconditions.*;
import static pl.grzeslowski.jsupla.protocol.api.consts.ProtoConsts.*;
/**
* server -> client
Original code:
typedef struct {
// server -> client
_supla_int_t count;
_supla_int_t total_left;
TSC_SuplaChannelGroup_B
items[SUPLA_CHANNELGROUP_PACK_MAXCOUNT]; // Last variable in struct!
} TSC_SuplaChannelGroupPack_B;
*/
@lombok.EqualsAndHashCode @lombok.ToString
@javax.annotation.Generated(value="Struct original name: TSC_SuplaChannelGroupPack_B", date = "2024-08-03T11:49:42.274Z[Etc/UTC]")
public class SuplaChannelGroupPackB implements pl.grzeslowski.jsupla.protocol.api.structs.sc.ServerClient {
public final int count;
public final int totalLeft;
/**
* Last variable in struct!
*/
public final pl.grzeslowski.jsupla.protocol.api.structs.sc.SuplaChannelGroupB[] items;
public SuplaChannelGroupPackB(int count,
int totalLeft,
pl.grzeslowski.jsupla.protocol.api.structs.sc.SuplaChannelGroupB[] items) {
this.count = count;
this.totalLeft = totalLeft;
this.items = checkArrayLength(items, (int) SUPLA_CHANNELGROUP_PACK_MAXCOUNT);
}
@Override
public pl.grzeslowski.jsupla.protocol.api.calltypes.ServerClientCallType callType() {
return pl.grzeslowski.jsupla.protocol.api.calltypes.ServerClientCallType.SUPLA_SC_CALL_CHANNELVALUE_PACK_UPDATE_B;
}
@Override
public int size() {
return INT_SIZE // count
+ INT_SIZE // totalLeft
+ arraySize(items) // items
;
}
}