Skip to content

Commit

Permalink
Make Diagnostics Wifi Cluster match the spec (#30154)
Browse files Browse the repository at this point in the history
* Fix name s/AssiciationFailure/AssociationFailureCause

* zap regen

* minor change to kick CI

* Fix Darwin availability annotations.

---------

Co-authored-by: Boris Zbarsky <[email protected]>
  • Loading branch information
2 people authored and pull[bot] committed Nov 2, 2023
1 parent 7b89eb2 commit 1077152
Show file tree
Hide file tree
Showing 39 changed files with 94 additions and 70 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -945,7 +945,7 @@ server cluster WiFiNetworkDiagnostics = 54 {
}

info event AssociationFailure = 1 {
AssociationFailureCauseEnum associationFailure = 0;
AssociationFailureCauseEnum associationFailureCause = 0;
int16u status = 1;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1924,7 +1924,7 @@ server cluster WiFiNetworkDiagnostics = 54 {
}

info event AssociationFailure = 1 {
AssociationFailureCauseEnum associationFailure = 0;
AssociationFailureCauseEnum associationFailureCause = 0;
int16u status = 1;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1689,7 +1689,7 @@ server cluster WiFiNetworkDiagnostics = 54 {
}

info event AssociationFailure = 1 {
AssociationFailureCauseEnum associationFailure = 0;
AssociationFailureCauseEnum associationFailureCause = 0;
int16u status = 1;
}

Expand Down
2 changes: 1 addition & 1 deletion examples/bridge-app/bridge-common/bridge-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -1252,7 +1252,7 @@ server cluster WiFiNetworkDiagnostics = 54 {
}

info event AssociationFailure = 1 {
AssociationFailureCauseEnum associationFailure = 0;
AssociationFailureCauseEnum associationFailureCause = 0;
int16u status = 1;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1128,7 +1128,7 @@ server cluster WiFiNetworkDiagnostics = 54 {
}

info event AssociationFailure = 1 {
AssociationFailureCauseEnum associationFailure = 0;
AssociationFailureCauseEnum associationFailureCause = 0;
int16u status = 1;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ server cluster WiFiNetworkDiagnostics = 54 {
}

info event AssociationFailure = 1 {
AssociationFailureCauseEnum associationFailure = 0;
AssociationFailureCauseEnum associationFailureCause = 0;
int16u status = 1;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ server cluster WiFiNetworkDiagnostics = 54 {
}

info event AssociationFailure = 1 {
AssociationFailureCauseEnum associationFailure = 0;
AssociationFailureCauseEnum associationFailureCause = 0;
int16u status = 1;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ server cluster WiFiNetworkDiagnostics = 54 {
}

info event AssociationFailure = 1 {
AssociationFailureCauseEnum associationFailure = 0;
AssociationFailureCauseEnum associationFailureCause = 0;
int16u status = 1;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1112,7 +1112,7 @@ server cluster WiFiNetworkDiagnostics = 54 {
}

info event AssociationFailure = 1 {
AssociationFailureCauseEnum associationFailure = 0;
AssociationFailureCauseEnum associationFailureCause = 0;
int16u status = 1;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,7 @@ server cluster WiFiNetworkDiagnostics = 54 {
}

info event AssociationFailure = 1 {
AssociationFailureCauseEnum associationFailure = 0;
AssociationFailureCauseEnum associationFailureCause = 0;
int16u status = 1;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1431,7 +1431,7 @@ server cluster WiFiNetworkDiagnostics = 54 {
}

info event AssociationFailure = 1 {
AssociationFailureCauseEnum associationFailure = 0;
AssociationFailureCauseEnum associationFailureCause = 0;
int16u status = 1;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1120,7 +1120,7 @@ server cluster WiFiNetworkDiagnostics = 54 {
}

info event AssociationFailure = 1 {
AssociationFailureCauseEnum associationFailure = 0;
AssociationFailureCauseEnum associationFailureCause = 0;
int16u status = 1;
}

Expand Down
2 changes: 1 addition & 1 deletion examples/lighting-app/lighting-common/lighting-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -1435,7 +1435,7 @@ server cluster WiFiNetworkDiagnostics = 54 {
}

info event AssociationFailure = 1 {
AssociationFailureCauseEnum associationFailure = 0;
AssociationFailureCauseEnum associationFailureCause = 0;
int16u status = 1;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1508,7 +1508,7 @@ server cluster WiFiNetworkDiagnostics = 54 {
}

info event AssociationFailure = 1 {
AssociationFailureCauseEnum associationFailure = 0;
AssociationFailureCauseEnum associationFailureCause = 0;
int16u status = 1;
}

Expand Down
2 changes: 1 addition & 1 deletion examples/lock-app/lock-common/lock-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -1350,7 +1350,7 @@ server cluster WiFiNetworkDiagnostics = 54 {
}

info event AssociationFailure = 1 {
AssociationFailureCauseEnum associationFailure = 0;
AssociationFailureCauseEnum associationFailureCause = 0;
int16u status = 1;
}

Expand Down
2 changes: 1 addition & 1 deletion examples/placeholder/linux/apps/app1/config.matter
Original file line number Diff line number Diff line change
Expand Up @@ -2102,7 +2102,7 @@ server cluster WiFiNetworkDiagnostics = 54 {
}

info event AssociationFailure = 1 {
AssociationFailureCauseEnum associationFailure = 0;
AssociationFailureCauseEnum associationFailureCause = 0;
int16u status = 1;
}

Expand Down
2 changes: 1 addition & 1 deletion examples/placeholder/linux/apps/app2/config.matter
Original file line number Diff line number Diff line change
Expand Up @@ -2061,7 +2061,7 @@ server cluster WiFiNetworkDiagnostics = 54 {
}

info event AssociationFailure = 1 {
AssociationFailureCauseEnum associationFailure = 0;
AssociationFailureCauseEnum associationFailureCause = 0;
int16u status = 1;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ server cluster WiFiNetworkDiagnostics = 54 {
}

info event AssociationFailure = 1 {
AssociationFailureCauseEnum associationFailure = 0;
AssociationFailureCauseEnum associationFailureCause = 0;
int16u status = 1;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1112,7 +1112,7 @@ server cluster WiFiNetworkDiagnostics = 54 {
}

info event AssociationFailure = 1 {
AssociationFailureCauseEnum associationFailure = 0;
AssociationFailureCauseEnum associationFailureCause = 0;
int16u status = 1;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ server cluster WiFiNetworkDiagnostics = 54 {
}

info event AssociationFailure = 1 {
AssociationFailureCauseEnum associationFailure = 0;
AssociationFailureCauseEnum associationFailureCause = 0;
int16u status = 1;
}

Expand Down
2 changes: 1 addition & 1 deletion examples/thermostat/nxp/zap/thermostat_matter_wifi.matter
Original file line number Diff line number Diff line change
Expand Up @@ -1320,7 +1320,7 @@ server cluster WiFiNetworkDiagnostics = 54 {
}

info event AssociationFailure = 1 {
AssociationFailureCauseEnum associationFailure = 0;
AssociationFailureCauseEnum associationFailureCause = 0;
int16u status = 1;
}

Expand Down
2 changes: 1 addition & 1 deletion examples/thermostat/thermostat-common/thermostat.matter
Original file line number Diff line number Diff line change
Expand Up @@ -1201,7 +1201,7 @@ server cluster WiFiNetworkDiagnostics = 54 {
}

info event AssociationFailure = 1 {
AssociationFailureCauseEnum associationFailure = 0;
AssociationFailureCauseEnum associationFailureCause = 0;
int16u status = 1;
}

Expand Down
2 changes: 1 addition & 1 deletion examples/tv-app/tv-common/tv-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -1355,7 +1355,7 @@ server cluster WiFiNetworkDiagnostics = 54 {
}

info event AssociationFailure = 1 {
AssociationFailureCauseEnum associationFailure = 0;
AssociationFailureCauseEnum associationFailureCause = 0;
int16u status = 1;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1035,7 +1035,7 @@ server cluster WiFiNetworkDiagnostics = 54 {
}

info event AssociationFailure = 1 {
AssociationFailureCauseEnum associationFailure = 0;
AssociationFailureCauseEnum associationFailureCause = 0;
int16u status = 1;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1494,7 +1494,7 @@ server cluster WiFiNetworkDiagnostics = 54 {
}

info event AssociationFailure = 1 {
AssociationFailureCauseEnum associationFailure = 0;
AssociationFailureCauseEnum associationFailureCause = 0;
int16u status = 1;
}

Expand Down
2 changes: 1 addition & 1 deletion examples/window-app/common/window-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -1333,7 +1333,7 @@ server cluster WiFiNetworkDiagnostics = 54 {
}

info event AssociationFailure = 1 {
AssociationFailureCauseEnum associationFailure = 0;
AssociationFailureCauseEnum associationFailureCause = 0;
int16u status = 1;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ limitations under the License.
<item name="WEP" value="0x02"/>
<item name="WPA" value="0x03"/>
<item name="WPA2" value="0x04"/>
<item name="WPA3" value="0x05"/>
<item name="WPA3" value="0x05"/>
</enum>
<enum name="WiFiVersionEnum" type="enum8">
<cluster code="0x0036"/>
Expand Down Expand Up @@ -80,12 +80,12 @@ limitations under the License.
</event>
<event side="server" code="0x01" name="AssociationFailure" priority="info" optional="true">
<description>Indicate that a Node has failed to connect, or reconnect, to a Wi-Fi access point.</description>
<field id="0" name="AssociationFailure" type="AssociationFailureCauseEnum"/>
<field id="1" name="Status" type="int16u"/>
<field id="0" name="AssociationFailureCause" type="AssociationFailureCauseEnum"/>
<field id="1" name="Status" type="int16u"/>
</event>
<event side="server" code="0x02" name="ConnectionStatus" priority="info" optional="true">
<description>Indicate that a Node’s connection status to a Wi-Fi network has changed.</description>
<field id="0" name="ConnectionStatus" type="ConnectionStatusEnum"/>
</event>
</event>
</cluster>
</configurator>
2 changes: 1 addition & 1 deletion src/controller/data_model/controller-clusters.matter
Original file line number Diff line number Diff line change
Expand Up @@ -2052,7 +2052,7 @@ client cluster WiFiNetworkDiagnostics = 54 {
}

info event AssociationFailure = 1 {
AssociationFailureCauseEnum associationFailure = 0;
AssociationFailureCauseEnum associationFailureCause = 0;
int16u status = 1;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -596,22 +596,22 @@ public String toString() {
}
}
public static class WiFiNetworkDiagnosticsClusterAssociationFailureEvent {
public Integer associationFailure;
public Integer associationFailureCause;
public Integer status;
public WiFiNetworkDiagnosticsClusterAssociationFailureEvent(
Integer associationFailure,
Integer associationFailureCause,
Integer status
) {
this.associationFailure = associationFailure;
this.associationFailureCause = associationFailureCause;
this.status = status;
}

@Override
public String toString() {
StringBuilder output = new StringBuilder();
output.append("WiFiNetworkDiagnosticsClusterAssociationFailureEvent {\n");
output.append("\tassociationFailure: ");
output.append(associationFailure);
output.append("\tassociationFailureCause: ");
output.append(associationFailureCause);
output.append("\n");
output.append("\tstatus: ");
output.append(status);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,40 +23,41 @@ import matter.tlv.TlvReader
import matter.tlv.TlvWriter

class WiFiNetworkDiagnosticsClusterAssociationFailureEvent(
val associationFailure: UInt,
val associationFailureCause: UInt,
val status: UInt
) {
override fun toString(): String = buildString {
append("WiFiNetworkDiagnosticsClusterAssociationFailureEvent {\n")
append("\tassociationFailure : $associationFailure\n")
append("\tassociationFailureCause : $associationFailureCause\n")
append("\tstatus : $status\n")
append("}\n")
}

fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) {
tlvWriter.apply {
startStructure(tlvTag)
put(ContextSpecificTag(TAG_ASSOCIATION_FAILURE), associationFailure)
put(ContextSpecificTag(TAG_ASSOCIATION_FAILURE_CAUSE), associationFailureCause)
put(ContextSpecificTag(TAG_STATUS), status)
endStructure()
}
}

companion object {
private const val TAG_ASSOCIATION_FAILURE = 0
private const val TAG_ASSOCIATION_FAILURE_CAUSE = 0
private const val TAG_STATUS = 1

fun fromTlv(
tlvTag: Tag,
tlvReader: TlvReader
): WiFiNetworkDiagnosticsClusterAssociationFailureEvent {
tlvReader.enterStructure(tlvTag)
val associationFailure = tlvReader.getUInt(ContextSpecificTag(TAG_ASSOCIATION_FAILURE))
val associationFailureCause =
tlvReader.getUInt(ContextSpecificTag(TAG_ASSOCIATION_FAILURE_CAUSE))
val status = tlvReader.getUInt(ContextSpecificTag(TAG_STATUS))

tlvReader.exitContainer()

return WiFiNetworkDiagnosticsClusterAssociationFailureEvent(associationFailure, status)
return WiFiNetworkDiagnosticsClusterAssociationFailureEvent(associationFailureCause, status)
}
}
}
18 changes: 9 additions & 9 deletions src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/controller/python/chip/clusters/Objects.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 1077152

Please sign in to comment.