Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add general diagnostics cluster Matter 1.3 XML changes #30091

Merged
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ limitations under the License.
<item name="ThreadFault" value="0x03"/>
<item name="NFCFault" value="0x04"/>
<item name="BLEFault" value="0x05"/>
<item name="EthernetFault" value="0x06"/>
<item name="EthernetFault" value="0x06"/>
</enum>
<enum name="NetworkFaultEnum" type="enum8">
<cluster code="0x0033"/>
Expand All @@ -56,7 +56,7 @@ limitations under the License.
<item name="HardwareWatchdogReset" value="0x04"/>
<item name="SoftwareUpdateCompleted" value="0x05"/>
<item name="SoftwareReset" value="0x06"/>
</enum>
</enum>
<enum name="InterfaceTypeEnum" type="enum8">
<cluster code="0x0033"/>
<item name="Unspecified" value="0x00"/>
Expand All @@ -67,31 +67,33 @@ limitations under the License.
</enum>
<struct name="NetworkInterface">
<cluster code="0x0033"/>
<item name="Name" type="char_string" length="32"/>
<item name="IsOperational" type="boolean"/>
<item name="OffPremiseServicesReachableIPv4" type="boolean" isNullable="true"/>
<item name="OffPremiseServicesReachableIPv6" type="boolean" isNullable="true"/>
<item code="0x00" name="Name" type="char_string" length="32"/>
<item code="0x01" name="IsOperational" type="boolean"/>
<item code="0x02" name="OffPremiseServicesReachableIPv4" type="boolean" isNullable="true"/>
<item code="0x03" name="OffPremiseServicesReachableIPv6" type="boolean" isNullable="true"/>
<!-- TODO(#14075): HWADR not supported yet -->
<item name="HardwareAddress" type="octet_string" length="8"/>
<item name="IPv4Addresses" type="octet_string" array="true"/>
<item name="IPv6Addresses" type="octet_string" array="true"/>
<item name="Type" type="InterfaceTypeEnum"/>
<item code="0x04" name="HardwareAddress" type="octet_string" length="8"/>
<item code="0x05" name="IPv4Addresses" type="octet_string" array="true"/>
<item code="0x06" name="IPv6Addresses" type="octet_string" array="true"/>
<item code="0x07" name="Type" type="InterfaceTypeEnum"/>
</struct>
<cluster>
<domain>General</domain>
<name>General Diagnostics</name>
<code>0x0033</code>
<define>GENERAL_DIAGNOSTICS_CLUSTER</define>
<description>The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems.</description>
<attribute side="server" code="0x00" define="NETWORK_INTERFACES" type="ARRAY" entryType="NetworkInterface" length="254" writable="false" optional="false">NetworkInterfaces</attribute>
<attribute side="server" code="0x00" define="NETWORK_INTERFACES" type="ARRAY" entryType="NetworkInterface" length="8" writable="false" optional="false">NetworkInterfaces</attribute>
<attribute side="server" code="0x01" define="REBOOT_COUNT" type="int16u" writable="false" default="0x0000" optional="false">RebootCount</attribute>
<!-- TODO(#30023): Make Uptime conditionally mandatory at rev >= 2 -->
<attribute side="server" code="0x02" define="UP_TIME" type="int64u" writable="false" default="0x0000000000000000" optional="true">UpTime</attribute>
<attribute side="server" code="0x03" define="TOTAL_OPERATIONAL_HOURS" type="int32u" writable="false" default="0x00000000" optional="true">TotalOperationalHours</attribute>
<attribute side="server" code="0x04" define="BOOT_REASONS" type="BootReasonEnum" writable="false" optional="true">BootReason</attribute>
<attribute side="server" code="0x05" define="ACTIVE_HARDWARE_FAULTS" type="ARRAY" entryType="HardwareFaultEnum" writable="false" optional="true">ActiveHardwareFaults</attribute>
<attribute side="server" code="0x06" define="ACTIVE_RADIO_FAULTS" type="ARRAY" entryType="RadioFaultEnum" writable="false" optional="true">ActiveRadioFaults</attribute>
<attribute side="server" code="0x07" define="ACTIVE_NETWORK_FAULTS" type="ARRAY" entryType="NetworkFaultEnum" writable="false" optional="true">ActiveNetworkFaults</attribute>
<attribute side="server" code="0x08" define="TEST_EVENT_TRIGGERS_ENABLED" type="boolean" writable="false" optional="false">TestEventTriggersEnabled</attribute>
<!-- TODO(#30002): Remove AverageWearCount -->
<attribute side="server" code="0x09" define="AVERAGE_WEAR_COUNT" type="int32u" writable="false" default="0x00000000" optional="true">AverageWearCount</attribute>

<command source="client" code="0x00" name="TestEventTrigger" optional="false">
Expand All @@ -101,6 +103,16 @@ limitations under the License.
<access op="invoke" role="manage"/>
</command>

<command source="client" code="0x01" name="TimeSnapshot" optional="false" apiMaturity="provisional">
<description>Take a snapshot of system time and epoch time.</description>
</command>

<command source="server" code="0x02" name="TimeSnapshotResponse" optional="false" apiMaturity="provisional">
<description>Response for the TimeSnapshot command.</description>
<arg name="SystemTimeUs" type="systime_us" optional="false"/>
<arg name="UTCTimeUs" type="epoch_us" optional="false"/>
</command>

<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="HardwareFaultEnum" array="true"/>
Expand Down
7 changes: 7 additions & 0 deletions src/controller/data_model/controller-clusters.matter
Original file line number Diff line number Diff line change
Expand Up @@ -1795,8 +1795,15 @@ client cluster GeneralDiagnostics = 51 {
int64u eventTrigger = 1;
}

response struct TimeSnapshotResponse = 2 {
systime_us systemTimeUs = 0;
epoch_us UTCTimeUs = 1;
tcarmelveilleux marked this conversation as resolved.
Show resolved Hide resolved
}

/** Provide a means for certification tests to trigger some test-plan-specific events */
command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
/** Take a snapshot of system time and epoch time. */
command TimeSnapshot(): DefaultSuccess = 1;
tcarmelveilleux marked this conversation as resolved.
Show resolved Hide resolved
}

/** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6062,8 +6062,18 @@ public void testEventTrigger(DefaultClusterCallback callback, byte[] enableKey,
testEventTrigger(chipClusterPtr, callback, enableKey, eventTrigger, timedInvokeTimeoutMs);
}

public void timeSnapshot(DefaultClusterCallback callback) {
timeSnapshot(chipClusterPtr, callback, null);
}

public void timeSnapshot(DefaultClusterCallback callback, int timedInvokeTimeoutMs) {
timeSnapshot(chipClusterPtr, callback, timedInvokeTimeoutMs);
}

private native void testEventTrigger(long chipClusterPtr, DefaultClusterCallback callback, byte[] enableKey, Long eventTrigger, @Nullable Integer timedInvokeTimeoutMs);

private native void timeSnapshot(long chipClusterPtr, DefaultClusterCallback callback, @Nullable Integer timedInvokeTimeoutMs);

public interface NetworkInterfacesAttributeCallback {
void onSuccess(List<ChipStructs.GeneralDiagnosticsClusterNetworkInterface> value);
void onError(Exception ex);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3800,7 +3800,8 @@ public static Event value(long id) throws NoSuchFieldError {
}

public enum Command {
TestEventTrigger(0L),;
TestEventTrigger(0L),
TimeSnapshot(1L),;
private final long id;
Command(long id) {
this.id = id;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18933,6 +18933,18 @@ public Map<String, Map<String, InteractionInfo>> getCommandMap() {
);
generalDiagnosticsClusterInteractionInfoMap.put("testEventTrigger", generalDiagnosticstestEventTriggerInteractionInfo);

Map<String, CommandParameterInfo> generalDiagnosticstimeSnapshotCommandParams = new LinkedHashMap<String, CommandParameterInfo>();
InteractionInfo generalDiagnosticstimeSnapshotInteractionInfo = new InteractionInfo(
(cluster, callback, commandArguments) -> {
((ChipClusters.GeneralDiagnosticsCluster) cluster)
.timeSnapshot((DefaultClusterCallback) callback
);
},
() -> new DelegatedDefaultClusterCallback(),
generalDiagnosticstimeSnapshotCommandParams
);
generalDiagnosticsClusterInteractionInfoMap.put("timeSnapshot", generalDiagnosticstimeSnapshotInteractionInfo);

commandMap.put("generalDiagnostics", generalDiagnosticsClusterInteractionInfoMap);

Map<String, InteractionInfo> softwareDiagnosticsClusterInteractionInfoMap = new LinkedHashMap<>();
Expand Down
68 changes: 68 additions & 0 deletions src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp

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

15 changes: 15 additions & 0 deletions src/controller/java/zap-generated/CHIPInvokeCallbacks.h

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

6 changes: 6 additions & 0 deletions src/controller/python/chip/clusters/CHIPClusters.py

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

31 changes: 31 additions & 0 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.

8 changes: 8 additions & 0 deletions src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h

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

28 changes: 28 additions & 0 deletions src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm

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

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

3 changes: 3 additions & 0 deletions src/darwin/Framework/CHIP/zap-generated/MTRClusters.h

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

Loading
Loading