Skip to content

Commit

Permalink
Fixing reference and regen
Browse files Browse the repository at this point in the history
  • Loading branch information
abeck-riis committed Nov 6, 2023
1 parent 6851666 commit d4da8b6
Show file tree
Hide file tree
Showing 43 changed files with 3,521 additions and 62 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ This is because zap does not currently support generating code for clusters that
<cluster code="0x0055"/>
<cluster code="0x0059"/>
<cluster code="0x005E"/>
<cluster code="0x0049"/>
<!-- MfgCode has been deprecated -->
<item name="MfgCode" type="vendor_id" optional="true"/>
<item name="Value" type="enum16" optional="false"/>
Expand All @@ -42,6 +43,7 @@ This is because zap does not currently support generating code for clusters that
<cluster code="0x0055"/>
<cluster code="0x0059"/>
<cluster code="0x005E"/>
<cluster code="0x0049"/>
<item name="Label" type="char_string" length="64" optional="false"/>
<item name="Mode" type="int8u" optional="false"/>
<item name="ModeTags" type="ModeTagStruct" array="true" length="8" optional="false"/>
Expand Down Expand Up @@ -88,6 +90,7 @@ This is because zap does not currently support generating code for clusters that
<cluster code="0x0055"/>
<cluster code="0x0059"/>
<cluster code="0x005E"/>
<cluster code="0x0049"/>
<field name="OnOff" mask="0x1"/>
</bitmap>
</configurator>
22 changes: 21 additions & 1 deletion src/app/zap-templates/zcl/data-model/chip/oven-mode-cluster.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,28 @@ limitations under the License.
<item value="0x4008" name="Proofing"/>
</enum>

<dataTypes>
<struct name="ModeOptionStruct">
<field id="0" name="Label" type="string" default="MS">
<access read="true"/>
<mandatoryConform/>
<constraint type="maxLength" value="64"/>
</field>
<field id="1" name="Mode" type="uint8" default="MS">
<access read="true"/>
<mandatoryConform/>
</field>
<field id="2" name="SemanticTags" type="list" default="MS">
<entry type="SemanticTagStruct"/>
<access read="true"/>
<mandatoryConform/>
<constraint type="maxCount" value="64"/>
</field>
</struct>
</dataTypes>

<cluster apiMaturity="provisional">
<domain>Appliances</domain>
<domain>General</domain>
<name>Oven Mode</name>
<code>0x0049</code>
<define>OVEN_MODE_CLUSTER</define>
Expand Down
15 changes: 15 additions & 0 deletions src/controller/data_model/controller-clusters.matter
Original file line number Diff line number Diff line change
Expand Up @@ -2817,6 +2817,21 @@ provisional client cluster OvenMode = 73 {
kProofing = 16392;
}

bitmap Feature : bitmap32 {
kOnOff = 0x1;
}

struct ModeTagStruct {
optional vendor_id mfgCode = 0;
enum16 value = 1;
}

struct ModeOptionStruct {
char_string<64> label = 0;
int8u mode = 1;
ModeTagStruct modeTags[] = 2;
}

readonly attribute ModeOptionStruct supportedModes[] = 0;
readonly attribute int8u currentMode = 1;
attribute optional nullable int8u startUpMode = 2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11076,6 +11076,234 @@ public void subscribeClusterRevisionAttribute(
private native void subscribeClusterRevisionAttribute(long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval);
}

public static class OvenModeCluster extends BaseChipCluster {
public static final long CLUSTER_ID = 73L;

public OvenModeCluster(long devicePtr, int endpointId) {
super(devicePtr, endpointId);
}

@Override
public native long initWithDevice(long devicePtr, int endpointId);

public void changeToMode(ChangeToModeResponseCallback callback, Integer newMode) {
changeToMode(chipClusterPtr, callback, newMode, null);
}

public void changeToMode(ChangeToModeResponseCallback callback, Integer newMode, int timedInvokeTimeoutMs) {
changeToMode(chipClusterPtr, callback, newMode, timedInvokeTimeoutMs);
}

private native void changeToMode(long chipClusterPtr, ChangeToModeResponseCallback callback, Integer newMode, @Nullable Integer timedInvokeTimeoutMs);

public interface ChangeToModeResponseCallback {
void onSuccess(Integer status, Optional<String> statusText);
void onError(Exception error);
}

public interface SupportedModesAttributeCallback {
void onSuccess(List<ChipStructs.OvenModeClusterModeOptionStruct> value);
void onError(Exception ex);
default void onSubscriptionEstablished(long subscriptionId) {}
}

public interface StartUpModeAttributeCallback {
void onSuccess(@Nullable Integer value);
void onError(Exception ex);
default void onSubscriptionEstablished(long subscriptionId) {}
}

public interface OnModeAttributeCallback {
void onSuccess(@Nullable Integer value);
void onError(Exception ex);
default void onSubscriptionEstablished(long subscriptionId) {}
}

public interface GeneratedCommandListAttributeCallback {
void onSuccess(List<Long> value);
void onError(Exception ex);
default void onSubscriptionEstablished(long subscriptionId) {}
}

public interface AcceptedCommandListAttributeCallback {
void onSuccess(List<Long> value);
void onError(Exception ex);
default void onSubscriptionEstablished(long subscriptionId) {}
}

public interface EventListAttributeCallback {
void onSuccess(List<Long> value);
void onError(Exception ex);
default void onSubscriptionEstablished(long subscriptionId) {}
}

public interface AttributeListAttributeCallback {
void onSuccess(List<Long> value);
void onError(Exception ex);
default void onSubscriptionEstablished(long subscriptionId) {}
}

public void readSupportedModesAttribute(
SupportedModesAttributeCallback callback) {
readSupportedModesAttribute(chipClusterPtr, callback);
}

public void subscribeSupportedModesAttribute(
SupportedModesAttributeCallback callback, int minInterval, int maxInterval) {
subscribeSupportedModesAttribute(chipClusterPtr, callback, minInterval, maxInterval);
}

public void readCurrentModeAttribute(
IntegerAttributeCallback callback) {
readCurrentModeAttribute(chipClusterPtr, callback);
}

public void subscribeCurrentModeAttribute(
IntegerAttributeCallback callback, int minInterval, int maxInterval) {
subscribeCurrentModeAttribute(chipClusterPtr, callback, minInterval, maxInterval);
}

public void readStartUpModeAttribute(
StartUpModeAttributeCallback callback) {
readStartUpModeAttribute(chipClusterPtr, callback);
}

public void writeStartUpModeAttribute(DefaultClusterCallback callback, Integer value) {
writeStartUpModeAttribute(chipClusterPtr, callback, value, null);
}

public void writeStartUpModeAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) {
writeStartUpModeAttribute(chipClusterPtr, callback, value, timedWriteTimeoutMs);
}

public void subscribeStartUpModeAttribute(
StartUpModeAttributeCallback callback, int minInterval, int maxInterval) {
subscribeStartUpModeAttribute(chipClusterPtr, callback, minInterval, maxInterval);
}

public void readOnModeAttribute(
OnModeAttributeCallback callback) {
readOnModeAttribute(chipClusterPtr, callback);
}

public void writeOnModeAttribute(DefaultClusterCallback callback, Integer value) {
writeOnModeAttribute(chipClusterPtr, callback, value, null);
}

public void writeOnModeAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) {
writeOnModeAttribute(chipClusterPtr, callback, value, timedWriteTimeoutMs);
}

public void subscribeOnModeAttribute(
OnModeAttributeCallback callback, int minInterval, int maxInterval) {
subscribeOnModeAttribute(chipClusterPtr, callback, minInterval, maxInterval);
}

public void readGeneratedCommandListAttribute(
GeneratedCommandListAttributeCallback callback) {
readGeneratedCommandListAttribute(chipClusterPtr, callback);
}

public void subscribeGeneratedCommandListAttribute(
GeneratedCommandListAttributeCallback callback, int minInterval, int maxInterval) {
subscribeGeneratedCommandListAttribute(chipClusterPtr, callback, minInterval, maxInterval);
}

public void readAcceptedCommandListAttribute(
AcceptedCommandListAttributeCallback callback) {
readAcceptedCommandListAttribute(chipClusterPtr, callback);
}

public void subscribeAcceptedCommandListAttribute(
AcceptedCommandListAttributeCallback callback, int minInterval, int maxInterval) {
subscribeAcceptedCommandListAttribute(chipClusterPtr, callback, minInterval, maxInterval);
}

public void readEventListAttribute(
EventListAttributeCallback callback) {
readEventListAttribute(chipClusterPtr, callback);
}

public void subscribeEventListAttribute(
EventListAttributeCallback callback, int minInterval, int maxInterval) {
subscribeEventListAttribute(chipClusterPtr, callback, minInterval, maxInterval);
}

public void readAttributeListAttribute(
AttributeListAttributeCallback callback) {
readAttributeListAttribute(chipClusterPtr, callback);
}

public void subscribeAttributeListAttribute(
AttributeListAttributeCallback callback, int minInterval, int maxInterval) {
subscribeAttributeListAttribute(chipClusterPtr, callback, minInterval, maxInterval);
}

public void readFeatureMapAttribute(
LongAttributeCallback callback) {
readFeatureMapAttribute(chipClusterPtr, callback);
}

public void subscribeFeatureMapAttribute(
LongAttributeCallback callback, int minInterval, int maxInterval) {
subscribeFeatureMapAttribute(chipClusterPtr, callback, minInterval, maxInterval);
}

public void readClusterRevisionAttribute(
IntegerAttributeCallback callback) {
readClusterRevisionAttribute(chipClusterPtr, callback);
}

public void subscribeClusterRevisionAttribute(
IntegerAttributeCallback callback, int minInterval, int maxInterval) {
subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval);
}

private native void readSupportedModesAttribute(long chipClusterPtr, SupportedModesAttributeCallback callback);

private native void subscribeSupportedModesAttribute(long chipClusterPtr, SupportedModesAttributeCallback callback, int minInterval, int maxInterval);

private native void readCurrentModeAttribute(long chipClusterPtr, IntegerAttributeCallback callback);

private native void subscribeCurrentModeAttribute(long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval);

private native void readStartUpModeAttribute(long chipClusterPtr, StartUpModeAttributeCallback callback);

private native void writeStartUpModeAttribute(long chipClusterPtr, DefaultClusterCallback callback, Integer value, @Nullable Integer timedWriteTimeoutMs);

private native void subscribeStartUpModeAttribute(long chipClusterPtr, StartUpModeAttributeCallback callback, int minInterval, int maxInterval);

private native void readOnModeAttribute(long chipClusterPtr, OnModeAttributeCallback callback);

private native void writeOnModeAttribute(long chipClusterPtr, DefaultClusterCallback callback, Integer value, @Nullable Integer timedWriteTimeoutMs);

private native void subscribeOnModeAttribute(long chipClusterPtr, OnModeAttributeCallback callback, int minInterval, int maxInterval);

private native void readGeneratedCommandListAttribute(long chipClusterPtr, GeneratedCommandListAttributeCallback callback);

private native void subscribeGeneratedCommandListAttribute(long chipClusterPtr, GeneratedCommandListAttributeCallback callback, int minInterval, int maxInterval);

private native void readAcceptedCommandListAttribute(long chipClusterPtr, AcceptedCommandListAttributeCallback callback);

private native void subscribeAcceptedCommandListAttribute(long chipClusterPtr, AcceptedCommandListAttributeCallback callback, int minInterval, int maxInterval);

private native void readEventListAttribute(long chipClusterPtr, EventListAttributeCallback callback);

private native void subscribeEventListAttribute(long chipClusterPtr, EventListAttributeCallback callback, int minInterval, int maxInterval);

private native void readAttributeListAttribute(long chipClusterPtr, AttributeListAttributeCallback callback);

private native void subscribeAttributeListAttribute(long chipClusterPtr, AttributeListAttributeCallback callback, int minInterval, int maxInterval);

private native void readFeatureMapAttribute(long chipClusterPtr, LongAttributeCallback callback);

private native void subscribeFeatureMapAttribute(long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval);

private native void readClusterRevisionAttribute(long chipClusterPtr, IntegerAttributeCallback callback);

private native void subscribeClusterRevisionAttribute(long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval);
}

public static class ModeSelectCluster extends BaseChipCluster {
public static final long CLUSTER_ID = 80L;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1495,6 +1495,62 @@ public String toString() {
return output.toString();
}
}
public static class OvenModeClusterModeTagStruct {
public Optional<Integer> mfgCode;
public Integer value;
public OvenModeClusterModeTagStruct(
Optional<Integer> mfgCode,
Integer value
) {
this.mfgCode = mfgCode;
this.value = value;
}

@Override
public String toString() {
StringBuilder output = new StringBuilder();
output.append("OvenModeClusterModeTagStruct {\n");
output.append("\tmfgCode: ");
output.append(mfgCode);
output.append("\n");
output.append("\tvalue: ");
output.append(value);
output.append("\n");
output.append("}\n");
return output.toString();
}
}
public static class OvenModeClusterModeOptionStruct {
public String label;
public Integer mode;
public ArrayList<ChipStructs.OvenModeClusterModeTagStruct> modeTags;
public OvenModeClusterModeOptionStruct(
String label,
Integer mode,
ArrayList<ChipStructs.OvenModeClusterModeTagStruct> modeTags
) {
this.label = label;
this.mode = mode;
this.modeTags = modeTags;
}

@Override
public String toString() {
StringBuilder output = new StringBuilder();
output.append("OvenModeClusterModeOptionStruct {\n");
output.append("\tlabel: ");
output.append(label);
output.append("\n");
output.append("\tmode: ");
output.append(mode);
output.append("\n");
output.append("\tmodeTags: ");
output.append(modeTags);
output.append("\n");
output.append("}\n");
return output.toString();
}
}
public static class ModeSelectClusterSemanticTagStruct {
public Integer mfgCode;
public Integer value;
Expand Down
Loading

0 comments on commit d4da8b6

Please sign in to comment.