Skip to content

Commit

Permalink
Add Software Diagnostics Cluster definition (#6943)
Browse files Browse the repository at this point in the history
* Add initial Software Diagnostics Cluster definition

* Update the configuration files

* Update gen folders
  • Loading branch information
yufengwangca authored and pull[bot] committed Aug 2, 2021
1 parent 8864dec commit 2218130
Show file tree
Hide file tree
Showing 122 changed files with 3,783 additions and 1,273 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1592,6 +1592,82 @@
}
]
},
{
"name": "Software Diagnostics",
"code": 52,
"mfgCode": null,
"define": "SOFTWARE_DIAGNOSTICS_CLUSTER",
"side": "client",
"enabled": 0,
"commands": [
{
"name": "ResetWatermarks",
"code": 0,
"mfgCode": null,
"source": "client",
"incoming": 0,
"outgoing": 1
}
],
"attributes": [
{
"name": "cluster revision",
"code": 65533,
"mfgCode": null,
"side": "client",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "0x0001",
"reportable": 0,
"minInterval": 0,
"maxInterval": 65344,
"reportableChange": 0
}
]
},
{
"name": "Software Diagnostics",
"code": 52,
"mfgCode": null,
"define": "SOFTWARE_DIAGNOSTICS_CLUSTER",
"side": "server",
"enabled": 1,
"commands": [],
"attributes": [
{
"name": "CurrentHeapHighWatermark",
"code": 3,
"mfgCode": null,
"side": "server",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "0x0000000000000000",
"reportable": 0,
"minInterval": 0,
"maxInterval": 65344,
"reportableChange": 0
},
{
"name": "cluster revision",
"code": 65533,
"mfgCode": null,
"side": "server",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "0x0001",
"reportable": 0,
"minInterval": 0,
"maxInterval": 65344,
"reportableChange": 0
}
]
},
{
"name": "Thread Network Diagnostics",
"code": 53,
Expand Down Expand Up @@ -10647,7 +10723,7 @@
],
"attributes": [
{
"name": "acceptsHeaderList",
"name": "accepts header list",
"code": 0,
"mfgCode": null,
"side": "server",
Expand Down
10 changes: 10 additions & 0 deletions examples/all-clusters-app/all-clusters-common/gen/af-structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,16 @@ typedef struct _ThreadInterfaceScanResult
chip::ByteSpan DiscoveryResponse;
} EmberAfThreadInterfaceScanResult;

// Struct for ThreadMetrics
typedef struct _ThreadMetrics
{
uint64_t Id;
chip::ByteSpan Name;
uint32_t StackFreeCurrent;
uint32_t StackFreeMinimum;
uint32_t StackSize;
} EmberAfThreadMetrics;

// Struct for TierLabelsPayload
typedef struct _TierLabelsPayload
{
Expand Down
10 changes: 10 additions & 0 deletions examples/all-clusters-app/all-clusters-common/gen/attribute-id.h
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,16 @@
#define ZCL_ACTIVE_RADIO_FAULTS_ATTRIBUTE_ID (0x0006)
#define ZCL_ACTIVE_NETWORK_FAULTS_ATTRIBUTE_ID (0x0007)

// Attribute ids for cluster: Software Diagnostics

// Client attributes

// Server attributes
#define ZCL_THREAD_METRICS_ATTRIBUTE_ID (0x0000)
#define ZCL_CURRENT_HEAP_FREE_ATTRIBUTE_ID (0x0001)
#define ZCL_CURRENT_HEAP_USED_ATTRIBUTE_ID (0x0002)
#define ZCL_CURRENT_HEAP_HIGH_WATERMARK_ATTRIBUTE_ID (0x0003)

// Attribute ids for cluster: Thread Network Diagnostics

// Client attributes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ EmberAfStatus emberAfOnOffClusterServerCommandParse(EmberAfClusterCommand * cmd)
EmberAfStatus emberAfOperationalCredentialsClusterServerCommandParse(EmberAfClusterCommand * cmd);
EmberAfStatus emberAfPumpConfigurationAndControlClusterServerCommandParse(EmberAfClusterCommand * cmd);
EmberAfStatus emberAfScenesClusterServerCommandParse(EmberAfClusterCommand * cmd);
EmberAfStatus emberAfSoftwareDiagnosticsClusterServerCommandParse(EmberAfClusterCommand * cmd);
EmberAfStatus emberAfSwitchClusterServerCommandParse(EmberAfClusterCommand * cmd);
EmberAfStatus emberAfTvChannelClusterServerCommandParse(EmberAfClusterCommand * cmd);
EmberAfStatus emberAfTargetNavigatorClusterServerCommandParse(EmberAfClusterCommand * cmd);
Expand Down Expand Up @@ -218,6 +219,10 @@ EmberAfStatus emberAfClusterSpecificCommandParse(EmberAfClusterCommand * cmd)
case ZCL_SCENES_CLUSTER_ID:
result = emberAfScenesClusterServerCommandParse(cmd);
break;
case ZCL_SOFTWARE_DIAGNOSTICS_CLUSTER_ID:
// No commands are enabled for cluster Software Diagnostics
result = status(false, true, cmd->mfgSpecific);
break;
case ZCL_SWITCH_CLUSTER_ID:
// No commands are enabled for cluster Switch
result = status(false, true, cmd->mfgSpecific);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ void emberAfClusterInitCallback(EndpointId endpoint, ClusterId clusterId)
case ZCL_SCENES_CLUSTER_ID:
emberAfScenesClusterInitCallback(endpoint);
break;
case ZCL_SOFTWARE_DIAGNOSTICS_CLUSTER_ID:
emberAfSoftwareDiagnosticsClusterInitCallback(endpoint);
break;
case ZCL_SWITCH_CLUSTER_ID:
emberAfSwitchClusterInitCallback(endpoint);
break;
Expand Down Expand Up @@ -316,6 +319,11 @@ void __attribute__((weak)) emberAfScenesClusterInitCallback(EndpointId endpoint)
// To prevent warning
(void) endpoint;
}
void __attribute__((weak)) emberAfSoftwareDiagnosticsClusterInitCallback(EndpointId endpoint)
{
// To prevent warning
(void) endpoint;
}
void __attribute__((weak)) emberAfSwitchClusterInitCallback(EndpointId endpoint)
{
// To prevent warning
Expand Down
79 changes: 79 additions & 0 deletions examples/all-clusters-app/all-clusters-common/gen/callback.h
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,14 @@ void emberAfPumpConfigurationAndControlClusterInitCallback(chip::EndpointId endp
*/
void emberAfScenesClusterInitCallback(chip::EndpointId endpoint);

/** @brief Software Diagnostics Cluster Init
*
* Cluster Init
*
* @param endpoint Endpoint that is being initialized
*/
void emberAfSoftwareDiagnosticsClusterInitCallback(chip::EndpointId endpoint);

/** @brief Switch Cluster Init
*
* Cluster Init
Expand Down Expand Up @@ -2564,6 +2572,77 @@ EmberAfStatus emberAfScenesClusterServerPreAttributeChangedCallback(chip::Endpoi
*/
void emberAfScenesClusterServerTickCallback(chip::EndpointId endpoint);

//
// Software Diagnostics Cluster server
//

/** @brief Software Diagnostics Cluster Server Init
*
* Server Init
*
* @param endpoint Endpoint that is being initialized
*/
void emberAfSoftwareDiagnosticsClusterServerInitCallback(chip::EndpointId endpoint);

/** @brief Software Diagnostics Cluster Server Attribute Changed
*
* Server Attribute Changed
*
* @param endpoint Endpoint that is being initialized
* @param attributeId Attribute that changed
*/
void emberAfSoftwareDiagnosticsClusterServerAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId);

/** @brief Software Diagnostics Cluster Server Manufacturer Specific Attribute Changed
*
* Server Manufacturer Specific Attribute Changed
*
* @param endpoint Endpoint that is being initialized
* @param attributeId Attribute that changed
* @param manufacturerCode Manufacturer Code of the attribute that changed
*/
void emberAfSoftwareDiagnosticsClusterServerManufacturerSpecificAttributeChangedCallback(chip::EndpointId endpoint,
chip::AttributeId attributeId,
uint16_t manufacturerCode);

/** @brief Software Diagnostics Cluster Server Message Sent
*
* Server Message Sent
*
* @param type The type of message sent
* @param destination The destination to which the message was sent
* @param apsFrame The APS frame for the message
* @param msgLen The length of the message
* @param message The message that was sent
* @param status The status of the sent message
*/
void emberAfSoftwareDiagnosticsClusterServerMessageSentCallback(EmberOutgoingMessageType type,
chip::MessageSendDestination destination, EmberApsFrame * apsFrame,
uint16_t msgLen, uint8_t * message, EmberStatus status);

/** @brief Software Diagnostics Cluster Server Pre Attribute Changed
*
* server Pre Attribute Changed
*
* @param endpoint Endpoint that is being initialized
* @param attributeId Attribute to be changed
* @param attributeType Attribute type
* @param size Attribute size
* @param value Attribute value
*/
EmberAfStatus emberAfSoftwareDiagnosticsClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint,
chip::AttributeId attributeId,
EmberAfAttributeType attributeType, uint16_t size,
uint8_t * value);

/** @brief Software Diagnostics Cluster Server Tick
*
* server Tick
*
* @param endpoint Endpoint that is being served
*/
void emberAfSoftwareDiagnosticsClusterServerTickCallback(chip::EndpointId endpoint);

//
// Switch Cluster server
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2197,6 +2197,15 @@
\
ZCL_GET_LAST_NETWORK_COMMISSIONING_RESULT_COMMAND_ID, "u", timeoutMs);

/** @brief Command description for ResetWatermarks
*
* Command: ResetWatermarks
*/
#define emberAfFillCommandSoftware \
DiagnosticsClusterResetWatermarks() emberAfFillExternalBuffer(mask, \
\
ZCL_RESET_WATERMARKS_COMMAND_ID, "", );

/** @brief Command description for ResetCounts
*
* Command: ResetCounts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@
// Definitions for cluster: General Diagnostics
#define ZCL_GENERAL_DIAGNOSTICS_CLUSTER_ID (0x0033)

// Definitions for cluster: Software Diagnostics
#define ZCL_SOFTWARE_DIAGNOSTICS_CLUSTER_ID (0x0034)

// Definitions for cluster: Thread Network Diagnostics
#define ZCL_THREAD_NETWORK_DIAGNOSTICS_CLUSTER_ID (0x0035)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,9 @@
#define ZCL_DISABLE_NETWORK_RESPONSE_COMMAND_ID (0x0F)
#define ZCL_GET_LAST_NETWORK_COMMISSIONING_RESULT_COMMAND_ID (0x10)

// Commands for cluster: Software Diagnostics
#define ZCL_RESET_WATERMARKS_COMMAND_ID (0x00)

// Commands for cluster: Thread Network Diagnostics
#define ZCL_RESET_COUNTS_COMMAND_ID (0x00)

Expand Down
Loading

0 comments on commit 2218130

Please sign in to comment.