Skip to content

Commit

Permalink
Add IPv4 and IPv6 addresses to General Diagnostics cluster
Browse files Browse the repository at this point in the history
Currently the General Diagnostics cluster implementation
doesn't contain IPv4 and IPv6 addresses lists, so it's not
compatible with the spec.

* To cluster .xml:
   * Added missing IPv4Addresses and IPv6Addresses lists
   * Changed fabricConnected argument name to isOperational
   to be compatible with the spec.
   * Changed length field for ACTIVE_HARDWARRE_FAULTS,
   ACTIVE_RADIO_FAULTS and ACTIVE_NETWORK_FAULTS as defined
   in the spec.
* Regenerated files with zap_regen_all.py
* Added buffers to keep ip addresses to the NetworkInterface
* Added inserting IPv6 addresses in GetNetworkInterfaces
for the Zephyr platform
  • Loading branch information
kkasperczyk-no committed Feb 8, 2022
1 parent 0f7be8b commit 5dcb457
Show file tree
Hide file tree
Showing 36 changed files with 401 additions and 93 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1456,11 +1456,13 @@ server cluster GeneralDiagnostics = 51 {

struct NetworkInterfaceType {
CHAR_STRING<32> name = 0;
BOOLEAN fabricConnected = 1;
BOOLEAN isOperational = 1;
BOOLEAN offPremiseServicesReachableIPv4 = 2;
BOOLEAN offPremiseServicesReachableIPv6 = 3;
OCTET_STRING<8> hardwareAddress = 4;
InterfaceType type = 5;
OCTET_STRING IPv4Addresses[] = 5;
OCTET_STRING IPv6Addresses[] = 6;
InterfaceType type = 7;
}

critical event HardwareFaultChange = 0 {
Expand Down
6 changes: 4 additions & 2 deletions examples/bridge-app/bridge-common/bridge-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -388,11 +388,13 @@ server cluster GeneralDiagnostics = 51 {

struct NetworkInterfaceType {
CHAR_STRING<32> name = 0;
BOOLEAN fabricConnected = 1;
BOOLEAN isOperational = 1;
BOOLEAN offPremiseServicesReachableIPv4 = 2;
BOOLEAN offPremiseServicesReachableIPv6 = 3;
OCTET_STRING<8> hardwareAddress = 4;
InterfaceType type = 5;
OCTET_STRING IPv4Addresses[] = 5;
OCTET_STRING IPv6Addresses[] = 6;
InterfaceType type = 7;
}

critical event HardwareFaultChange = 0 {
Expand Down
6 changes: 4 additions & 2 deletions examples/door-lock-app/door-lock-common/door-lock-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -865,11 +865,13 @@ server cluster GeneralDiagnostics = 51 {

struct NetworkInterfaceType {
CHAR_STRING<32> name = 0;
BOOLEAN fabricConnected = 1;
BOOLEAN isOperational = 1;
BOOLEAN offPremiseServicesReachableIPv4 = 2;
BOOLEAN offPremiseServicesReachableIPv6 = 3;
OCTET_STRING<8> hardwareAddress = 4;
InterfaceType type = 5;
OCTET_STRING IPv4Addresses[] = 5;
OCTET_STRING IPv6Addresses[] = 6;
InterfaceType type = 7;
}

critical event HardwareFaultChange = 0 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -577,11 +577,13 @@ server cluster GeneralDiagnostics = 51 {

struct NetworkInterfaceType {
CHAR_STRING<32> name = 0;
BOOLEAN fabricConnected = 1;
BOOLEAN isOperational = 1;
BOOLEAN offPremiseServicesReachableIPv4 = 2;
BOOLEAN offPremiseServicesReachableIPv6 = 3;
OCTET_STRING<8> hardwareAddress = 4;
InterfaceType type = 5;
OCTET_STRING IPv4Addresses[] = 5;
OCTET_STRING IPv6Addresses[] = 6;
InterfaceType type = 7;
}

critical event HardwareFaultChange = 0 {
Expand Down
6 changes: 4 additions & 2 deletions examples/lighting-app/lighting-common/lighting-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -582,11 +582,13 @@ server cluster GeneralDiagnostics = 51 {

struct NetworkInterfaceType {
CHAR_STRING<32> name = 0;
BOOLEAN fabricConnected = 1;
BOOLEAN isOperational = 1;
BOOLEAN offPremiseServicesReachableIPv4 = 2;
BOOLEAN offPremiseServicesReachableIPv6 = 3;
OCTET_STRING<8> hardwareAddress = 4;
InterfaceType type = 5;
OCTET_STRING IPv4Addresses[] = 5;
OCTET_STRING IPv6Addresses[] = 6;
InterfaceType type = 7;
}

critical event HardwareFaultChange = 0 {
Expand Down
6 changes: 4 additions & 2 deletions examples/lock-app/lock-common/lock-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -326,11 +326,13 @@ server cluster GeneralDiagnostics = 51 {

struct NetworkInterfaceType {
CHAR_STRING<32> name = 0;
BOOLEAN fabricConnected = 1;
BOOLEAN isOperational = 1;
BOOLEAN offPremiseServicesReachableIPv4 = 2;
BOOLEAN offPremiseServicesReachableIPv6 = 3;
OCTET_STRING<8> hardwareAddress = 4;
InterfaceType type = 5;
OCTET_STRING IPv4Addresses[] = 5;
OCTET_STRING IPv6Addresses[] = 6;
InterfaceType type = 7;
}

critical event HardwareFaultChange = 0 {
Expand Down
6 changes: 4 additions & 2 deletions examples/pump-app/pump-common/pump-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -313,11 +313,13 @@ server cluster GeneralDiagnostics = 51 {

struct NetworkInterfaceType {
CHAR_STRING<32> name = 0;
BOOLEAN fabricConnected = 1;
BOOLEAN isOperational = 1;
BOOLEAN offPremiseServicesReachableIPv4 = 2;
BOOLEAN offPremiseServicesReachableIPv6 = 3;
OCTET_STRING<8> hardwareAddress = 4;
InterfaceType type = 5;
OCTET_STRING IPv4Addresses[] = 5;
OCTET_STRING IPv6Addresses[] = 6;
InterfaceType type = 7;
}

critical event HardwareFaultChange = 0 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -333,11 +333,13 @@ server cluster GeneralDiagnostics = 51 {

struct NetworkInterfaceType {
CHAR_STRING<32> name = 0;
BOOLEAN fabricConnected = 1;
BOOLEAN isOperational = 1;
BOOLEAN offPremiseServicesReachableIPv4 = 2;
BOOLEAN offPremiseServicesReachableIPv6 = 3;
OCTET_STRING<8> hardwareAddress = 4;
InterfaceType type = 5;
OCTET_STRING IPv4Addresses[] = 5;
OCTET_STRING IPv6Addresses[] = 6;
InterfaceType type = 7;
}

critical event HardwareFaultChange = 0 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -326,11 +326,13 @@ server cluster GeneralDiagnostics = 51 {

struct NetworkInterfaceType {
CHAR_STRING<32> name = 0;
BOOLEAN fabricConnected = 1;
BOOLEAN isOperational = 1;
BOOLEAN offPremiseServicesReachableIPv4 = 2;
BOOLEAN offPremiseServicesReachableIPv6 = 3;
OCTET_STRING<8> hardwareAddress = 4;
InterfaceType type = 5;
OCTET_STRING IPv4Addresses[] = 5;
OCTET_STRING IPv6Addresses[] = 6;
InterfaceType type = 7;
}

critical event HardwareFaultChange = 0 {
Expand Down
6 changes: 4 additions & 2 deletions examples/thermostat/thermostat-common/thermostat.matter
Original file line number Diff line number Diff line change
Expand Up @@ -347,11 +347,13 @@ server cluster GeneralDiagnostics = 51 {

struct NetworkInterfaceType {
CHAR_STRING<32> name = 0;
BOOLEAN fabricConnected = 1;
BOOLEAN isOperational = 1;
BOOLEAN offPremiseServicesReachableIPv4 = 2;
BOOLEAN offPremiseServicesReachableIPv6 = 3;
OCTET_STRING<8> hardwareAddress = 4;
InterfaceType type = 5;
OCTET_STRING IPv4Addresses[] = 5;
OCTET_STRING IPv6Addresses[] = 6;
InterfaceType type = 7;
}

critical event HardwareFaultChange = 0 {
Expand Down
6 changes: 4 additions & 2 deletions examples/tv-app/tv-common/tv-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -713,11 +713,13 @@ server cluster GeneralDiagnostics = 51 {

struct NetworkInterfaceType {
CHAR_STRING<32> name = 0;
BOOLEAN fabricConnected = 1;
BOOLEAN isOperational = 1;
BOOLEAN offPremiseServicesReachableIPv4 = 2;
BOOLEAN offPremiseServicesReachableIPv6 = 3;
OCTET_STRING<8> hardwareAddress = 4;
InterfaceType type = 5;
OCTET_STRING IPv4Addresses[] = 5;
OCTET_STRING IPv6Addresses[] = 6;
InterfaceType type = 7;
}

critical event HardwareFaultChange = 0 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1379,11 +1379,13 @@ server cluster GeneralDiagnostics = 51 {

struct NetworkInterfaceType {
CHAR_STRING<32> name = 0;
BOOLEAN fabricConnected = 1;
BOOLEAN isOperational = 1;
BOOLEAN offPremiseServicesReachableIPv4 = 2;
BOOLEAN offPremiseServicesReachableIPv6 = 3;
OCTET_STRING<8> hardwareAddress = 4;
InterfaceType type = 5;
OCTET_STRING IPv4Addresses[] = 5;
OCTET_STRING IPv6Addresses[] = 6;
InterfaceType type = 7;
}

critical event HardwareFaultChange = 0 {
Expand Down
6 changes: 4 additions & 2 deletions examples/window-app/common/window-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -296,11 +296,13 @@ server cluster GeneralDiagnostics = 51 {

struct NetworkInterfaceType {
CHAR_STRING<32> name = 0;
BOOLEAN fabricConnected = 1;
BOOLEAN isOperational = 1;
BOOLEAN offPremiseServicesReachableIPv4 = 2;
BOOLEAN offPremiseServicesReachableIPv6 = 3;
OCTET_STRING<8> hardwareAddress = 4;
InterfaceType type = 5;
OCTET_STRING IPv4Addresses[] = 5;
OCTET_STRING IPv6Addresses[] = 6;
InterfaceType type = 7;
}

critical event HardwareFaultChange = 0 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,13 @@ limitations under the License.
<struct name="NetworkInterfaceType">
<cluster code="0x0033"/>
<item name="Name" type="CHAR_STRING" length="32"/>
<item name="FabricConnected" type="BOOLEAN"/>
<item name="IsOperational" type="BOOLEAN"/>
<item name="OffPremiseServicesReachableIPv4" type="BOOLEAN"/>
<item name="OffPremiseServicesReachableIPv6" type="BOOLEAN"/>
<!-- TODO: HWADR not supported yet -->
<item name="HardwareAddress" type="OCTET_STRING" length="8"/>
<item name="IPv4Addresses" type="OCTET_STRING" array="true" length="4"/>
<item name="IPv6Addresses" type="OCTET_STRING" array="true" length="8"/>
<item name="Type" type="InterfaceType"/>
</struct>
<cluster>
Expand All @@ -86,9 +88,9 @@ limitations under the License.
<attribute side="server" code="0x02" define="UPTIME" type="INT64U" min="0x0000000000000000" max="0xFFFFFFFFFFFFFFFF" writable="false" default="0x0000000000000000" optional="true">UpTime</attribute>
<attribute side="server" code="0x03" define="TOTAL_OPERATIONAL_HOURS" type="INT32U" min="0x00000000" max="0xFFFFFFFF" writable="false" default="0x00000000" optional="true">TotalOperationalHours</attribute>
<attribute side="server" code="0x04" define="BOOT_REASONS" type="ENUM8" writable="false" optional="true">BootReasons</attribute>
<attribute side="server" code="0x05" define="ACTIVE_HARDWARE_FAULTS" type="ARRAY" entryType="ENUM8" length="254" writable="false" optional="true">ActiveHardwareFaults</attribute>
<attribute side="server" code="0x06" define="ACTIVE_RADIO_FAULTS" type="ARRAY" entryType="ENUM8" length="254" writable="false" optional="true">ActiveRadioFaults</attribute>
<attribute side="server" code="0x07" define="ACTIVE_NETWORK_FAULTS" type="ARRAY" entryType="ENUM8" length="254" writable="false" optional="true">ActiveNetworkFaults</attribute>
<attribute side="server" code="0x05" define="ACTIVE_HARDWARE_FAULTS" type="ARRAY" entryType="ENUM8" length="11" writable="false" optional="true">ActiveHardwareFaults</attribute>
<attribute side="server" code="0x06" define="ACTIVE_RADIO_FAULTS" type="ARRAY" entryType="ENUM8" length="7" writable="false" optional="true">ActiveRadioFaults</attribute>
<attribute side="server" code="0x07" define="ACTIVE_NETWORK_FAULTS" type="ARRAY" entryType="ENUM8" length="4" writable="false" optional="true">ActiveNetworkFaults</attribute>
<event side="server" code="0x00" name="HardwareFaultChange" priority="critical" optional="true">
<description>Indicate a change in the set of hardware faults currently detected by the Node.</description>
<field id="0" name="Current" type="HardwareFaultType" array="true"/>
Expand Down
6 changes: 4 additions & 2 deletions src/controller/data_model/controller-clusters.matter
Original file line number Diff line number Diff line change
Expand Up @@ -1768,11 +1768,13 @@ client cluster GeneralDiagnostics = 51 {

struct NetworkInterfaceType {
CHAR_STRING<32> name = 0;
BOOLEAN fabricConnected = 1;
BOOLEAN isOperational = 1;
BOOLEAN offPremiseServicesReachableIPv4 = 2;
BOOLEAN offPremiseServicesReachableIPv6 = 3;
OCTET_STRING<8> hardwareAddress = 4;
InterfaceType type = 5;
OCTET_STRING IPv4Addresses[] = 5;
OCTET_STRING IPv6Addresses[] = 6;
InterfaceType type = 7;
}

critical event HardwareFaultChange = 0 {
Expand Down
55 changes: 42 additions & 13 deletions src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp

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

Loading

0 comments on commit 5dcb457

Please sign in to comment.