Networking and diagnostics52 — Software Diagnostics

Matter Cluster 52 — Software Diagnostics

Matter Cluster 52 (0x0034) Software Diagnostics: attributes, commands, events, data types, shadow paths and bridge payload examples.

Matter Cluster 52 — Software Diagnostics Cluster

Matter Cluster 52, also written as 0x0034, is the Software Diagnostics Cluster. The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that may be used by a Node to assist a user or Administrator in diagnosing potential problems. The Software Diagnostics Cluster attempts to centralize all metrics that are relevant to the software that may be running on a Node.

Cluster Identity

FieldValue
Cluster ID decimal52
Cluster ID hex0x0034
Cluster nameSoftware Diagnostics
Cluster revision (Matter 1.6.1)1
Roleutility
ScopeNode
PICS codeDGSW
Typical endpoint0

Revision history

RevisionChange
1Initial revision

Shadow Path Format

Cluster 52 values in the device shadow use this format:

endpoint_id / 52 / attribute_id

Example:

{
  "0/52/0": []
}
PartMeaning
0Endpoint ID
52Software Diagnostics cluster
0ThreadMetrics attribute

Cluster 52 Features

The FeatureMap attribute (0/52/65532) is a bitmap. Each bit set means the device implements that feature and the attributes and commands that depend on it.

BitCodeFeatureConformanceMeaning
0WTRMRKWatermarksONode makes available the metrics for high watermark related to memory consumption

Example: FeatureMap = 0 means no optional feature is enabled; 1 means every feature listed above is enabled.


Data Types

ThreadMetricsStruct (struct)

FieldNameTypeConformanceConstraintMeaning
0IDuint64M——
1NamestringOmax length 8The Name field is set to a vendor defined name or prefix of the software thread that is static for the duration of the thread.
2StackFreeCurrentuint32O—The StackFreeCurrent field indicates the current amount of stack memory, in bytes, that are not being utilized on the respective thread.
3StackFreeMinimumuint32O—The StackFreeMinimum field indicates the minimum amount of stack memory, in bytes, that has been available at any point between the current time and this attribute being reset or initialized on the respective thread.
4StackSizeuint32O—The StackSize field indicates the amount of stack memory, in bytes, that has been allocated for use by the respective thread.

Cluster 52 Attributes

Cluster 52 defines 4 attributes plus the global attributes. Conformance: M mandatory, O optional, a feature code means "mandatory when that feature is present", square brackets mean "optional when …".

IDHexAttributeTypeConformanceAccessQualitiesDefault
00x0000ThreadMetricslist of ThreadMetricsStructOR (read: view)change omitted—
10x0001CurrentHeapFreeuint64OR (read: view)change omitted—
20x0002CurrentHeapUseduint64OR (read: view)change omitted—
30x0003CurrentHeapHighWatermarkuint64WTRMRKR (read: view)change omitted—

Global attributes

IDHexAttributeMeaning
655280xFFF8GeneratedCommandListResponse command IDs this server generates.
655290xFFF9AcceptedCommandListCommand IDs this server accepts.
655310xFFFBAttributeListAttribute IDs implemented.
655320xFFFCFeatureMapImplemented optional features (see above).
655330xFFFDClusterRevisionCluster revision implemented; 1 for a Matter 1.6.1 device.

Attribute Details

Attribute 0 / 0x0000 — ThreadMetrics

Path example:

0/52/0

This attribute is a list of ThreadMetricsStruct structs. Each active thread on the Node is represented by a single entry within the ThreadMetrics attribute.

PropertyValue
Typelist of ThreadMetricsStruct
ConformanceO
AccessR (read: view)
Qualitieschange omitted
Constraintmax 64 entries

Each entry is a ThreadMetricsStruct (see Data Types).

Example:

{
  "0/52/0": []
}

Attribute 1 / 0x0001 — CurrentHeapFree

Path example:

0/52/1

Indicates the current amount of heap memory, in bytes, that are free for allocation. The effective amount may be smaller due to heap fragmentation or other reasons.

PropertyValue
Typeuint64
ConformanceO
AccessR (read: view)
Qualitieschange omitted

Example:

{
  "0/52/1": 1
}

Attribute 2 / 0x0002 — CurrentHeapUsed

Path example:

0/52/2

Indicates the current amount of heap memory, in bytes, that is being used.

PropertyValue
Typeuint64
ConformanceO
AccessR (read: view)
Qualitieschange omitted

Example:

{
  "0/52/2": 1
}

Attribute 3 / 0x0003 — CurrentHeapHighWatermark

Path example:

0/52/3

Indicates the maximum amount of heap memory, in bytes, that has been used by the Node. This value only be reset upon a Node reboot or upon receiving of the ResetWatermarks command.

PropertyValue
Typeuint64
ConformanceWTRMRK
AccessR (read: view)
Qualitieschange omitted

Example:

{
  "0/52/3": 1
}

Cluster 52 Commands

Cluster 52 has 1 client-to-server command and 0 responses.

IDHexCommandDirectionConformanceResponseDescription
00x00ResetWatermarksclient → serverWTRMRKstatusThis command is used to reset the high watermarks for heap and stack memory.

AcceptedCommandList

The AcceptedCommandList attribute lists the command IDs the endpoint actually implements:

endpoint_id / 52 / 65529
{
  "0/52/65529": [
    0
  ]
}

Before sending a Cluster 52 command, check that the command ID exists in endpoint/52/65529. Optional commands are only present when the matching feature is set in FeatureMap.


Bridge Command Payload Format

The bridge accepts Matter commands in this structure:

{
  "message_id": "1",
  "command": "device_command",
  "args": {
    "endpoint_id": 0,
    "cluster_id": 52,
    "command_name": "ResetWatermarks",
    "payload": {},
    "timed_request_timeout_ms": 1000
  }
}

For Cluster 52, always use "cluster_id": 52. Payload keys are the command field names in lowerCamelCase. Octet-string fields are base64-encoded. timed_request_timeout_ms is required for timed commands and ignored otherwise.


Command: ResetWatermarks

Purpose

This command is used to reset the high watermarks for heap and stack memory. Receipt of this command must reset the following values which track high and lower watermarks: - The StackFreeMinimum field of the ThreadMetrics attribute - The CurrentHeapHighWatermark attribute

Command Identity

FieldValue
Command ID0
Command hex0x00
Command nameResetWatermarks
Directionclient → server
ConformanceWTRMRK
Responsestatus
Access(invoke: manage)

Payload Fields

This command has no payload fields.

Bridge Command Example

{
  "message_id": "1",
  "command": "device_command",
  "args": {
    "endpoint_id": 0,
    "cluster_id": 52,
    "command_name": "ResetWatermarks",
    "payload": {}
  }
}

Cluster 52 Events

IDHexEventPriorityConformanceDescription
00x00SoftwareFaultinfoOThis Event is generated when a software fault occurs on the Node.

Event 0 — SoftwareFault

This Event is generated when a software fault occurs on the Node.

IDFieldTypeConformanceMeaning
0IDuint64M—
1NamestringOThis field is set to a manufacturer-specified name or prefix of the software thread in which the last software fault occurred.
2FaultRecordingoctstrOThis field is a manufacturer-specified payload intended to convey information to assist in further diagnosing or debugging a software fault.

SmartphoneKey Notes

  • Cluster 52 is not currently exposed by SmartphoneKey devices. This page documents the Matter 1.6.1 specification so that future devices can be interpreted without changes to the backend.
  • Shadow paths follow endpoint/52/attribute; attribute values that the device reports as unreadable are written as n/a.
  • Attribute IDs, command IDs and enum values on this page come from the CSA Matter 1.6.1 data model; descriptions are condensed from the specification text.