Skip to content

Commit

Permalink
Add Ethernet Network Diagnostics Cluster definition (#6894)
Browse files Browse the repository at this point in the history
  • Loading branch information
yufengwangca authored and pull[bot] committed Jul 16, 2021
1 parent 2403790 commit 2082868
Show file tree
Hide file tree
Showing 139 changed files with 4,508 additions and 443 deletions.
138 changes: 137 additions & 1 deletion examples/all-clusters-app/all-clusters-common/all-clusters-app.zap
Original file line number Diff line number Diff line change
Expand Up @@ -1592,7 +1592,7 @@
}
]
},
{
{
"name": "Thread Network Diagnostics",
"code": 53,
"mfgCode": null,
Expand Down Expand Up @@ -2645,6 +2645,142 @@
}
]
},
{
"name": "Ethernet Network Diagnostics",
"code": 55,
"mfgCode": null,
"define": "ETHERNET_NETWORK_DIAGNOSTICS_CLUSTER",
"side": "client",
"enabled": 0,
"commands": [
{
"name": "ResetCounts",
"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": "Ethernet Network Diagnostics",
"code": 55,
"mfgCode": null,
"define": "ETHERNET_NETWORK_DIAGNOSTICS_CLUSTER",
"side": "server",
"enabled": 1,
"commands": [],
"attributes": [
{
"name": "PacketRxCount",
"code": 2,
"mfgCode": null,
"side": "server",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "0x0000000000000000",
"reportable": 0,
"minInterval": 0,
"maxInterval": 65344,
"reportableChange": 0
},
{
"name": "PacketTxCount",
"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": "TxErrCount",
"code": 4,
"mfgCode": null,
"side": "server",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "0x0000000000000000",
"reportable": 0,
"minInterval": 0,
"maxInterval": 65344,
"reportableChange": 0
},
{
"name": "CollisionCount",
"code": 5,
"mfgCode": null,
"side": "server",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "0x0000000000000000",
"reportable": 0,
"minInterval": 0,
"maxInterval": 65344,
"reportableChange": 0
},
{
"name": "OverrunCount",
"code": 6,
"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": "Switch",
"code": 59,
Expand Down
15 changes: 15 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 @@ -523,6 +523,21 @@
#define ZCL_CURRENT_MAX_RATE_ATTRIBUTE_ID (0x000B)
#define ZCL_OVERRUN_COUNT_ATTRIBUTE_ID (0x000C)

// Attribute ids for cluster: Ethernet Network Diagnostics

// Client attributes

// Server attributes
#define ZCL_PHY_RATE_ATTRIBUTE_ID (0x0000)
#define ZCL_FULL_DUPLEX_ATTRIBUTE_ID (0x0001)
#define ZCL_PACKET_RX_COUNT_ATTRIBUTE_ID (0x0002)
#define ZCL_PACKET_TX_COUNT_ATTRIBUTE_ID (0x0003)
#define ZCL_TX_ERR_COUNT_ATTRIBUTE_ID (0x0004)
#define ZCL_COLLISION_COUNT_ATTRIBUTE_ID (0x0005)
#define ZCL_ETHERNET_OVERRUN_COUNT_ATTRIBUTE_ID (0x0006)
#define ZCL_CARRIER_DETECT_ATTRIBUTE_ID (0x0007)
#define ZCL_TIME_SINCE_RESET_ATTRIBUTE_ID (0x0008)

// Attribute ids for cluster: Switch

// Client attributes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ EmberAfStatus emberAfBindingClusterServerCommandParse(EmberAfClusterCommand * cm
EmberAfStatus emberAfColorControlClusterServerCommandParse(EmberAfClusterCommand * cmd);
EmberAfStatus emberAfDescriptorClusterServerCommandParse(EmberAfClusterCommand * cmd);
EmberAfStatus emberAfDoorLockClusterServerCommandParse(EmberAfClusterCommand * cmd);
EmberAfStatus emberAfEthernetNetworkDiagnosticsClusterServerCommandParse(EmberAfClusterCommand * cmd);
EmberAfStatus emberAfGeneralCommissioningClusterServerCommandParse(EmberAfClusterCommand * cmd);
EmberAfStatus emberAfGeneralDiagnosticsClusterServerCommandParse(EmberAfClusterCommand * cmd);
EmberAfStatus emberAfGroupKeyManagementClusterServerCommandParse(EmberAfClusterCommand * cmd);
Expand Down Expand Up @@ -120,6 +121,10 @@ EmberAfStatus emberAfClusterSpecificCommandParse(EmberAfClusterCommand * cmd)
case ZCL_DOOR_LOCK_CLUSTER_ID:
result = emberAfDoorLockClusterServerCommandParse(cmd);
break;
case ZCL_ETHERNET_NETWORK_DIAGNOSTICS_CLUSTER_ID:
// No commands are enabled for cluster Ethernet Network Diagnostics
result = status(false, true, cmd->mfgSpecific);
break;
case ZCL_GENERAL_COMMISSIONING_CLUSTER_ID:
result = emberAfGeneralCommissioningClusterServerCommandParse(cmd);
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ void emberAfClusterInitCallback(EndpointId endpoint, ClusterId clusterId)
case ZCL_DOOR_LOCK_CLUSTER_ID:
emberAfDoorLockClusterInitCallback(endpoint);
break;
case ZCL_ETHERNET_NETWORK_DIAGNOSTICS_CLUSTER_ID:
emberAfEthernetNetworkDiagnosticsClusterInitCallback(endpoint);
break;
case ZCL_GENERAL_COMMISSIONING_CLUSTER_ID:
emberAfGeneralCommissioningClusterInitCallback(endpoint);
break;
Expand Down Expand Up @@ -157,6 +160,11 @@ void __attribute__((weak)) emberAfDoorLockClusterInitCallback(EndpointId endpoin
// To prevent warning
(void) endpoint;
}
void __attribute__((weak)) emberAfEthernetNetworkDiagnosticsClusterInitCallback(EndpointId endpoint)
{
// To prevent warning
(void) endpoint;
}
void __attribute__((weak)) emberAfGeneralCommissioningClusterInitCallback(EndpointId endpoint)
{
// To prevent warning
Expand Down
81 changes: 81 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 @@ -96,6 +96,14 @@ void emberAfDescriptorClusterInitCallback(chip::EndpointId endpoint);
*/
void emberAfDoorLockClusterInitCallback(chip::EndpointId endpoint);

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

/** @brief General Commissioning Cluster Init
*
* Cluster Init
Expand Down Expand Up @@ -764,6 +772,79 @@ EmberAfStatus emberAfDoorLockClusterServerPreAttributeChangedCallback(chip::Endp
*/
void emberAfDoorLockClusterServerTickCallback(chip::EndpointId endpoint);

//
// Ethernet Network Diagnostics Cluster server
//

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

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

/** @brief Ethernet Network 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 emberAfEthernetNetworkDiagnosticsClusterServerManufacturerSpecificAttributeChangedCallback(chip::EndpointId endpoint,
chip::AttributeId attributeId,
uint16_t manufacturerCode);

/** @brief Ethernet Network 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 emberAfEthernetNetworkDiagnosticsClusterServerMessageSentCallback(EmberOutgoingMessageType type,
chip::MessageSendDestination destination,
EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message,
EmberStatus status);

/** @brief Ethernet Network 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 emberAfEthernetNetworkDiagnosticsClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint,
chip::AttributeId attributeId,
EmberAfAttributeType attributeType,
uint16_t size, uint8_t * value);

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

//
// General Commissioning Cluster server
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2215,6 +2215,15 @@
\
ZCL_RESET_COUNTS_COMMAND_ID, "", );

/** @brief Command description for ResetCounts
*
* Command: ResetCounts
*/
#define emberAfFillCommandEthernet \
Network DiagnosticsClusterResetCounts() emberAfFillExternalBuffer(mask, \
\
ZCL_RESET_COUNTS_COMMAND_ID, "", );

/** @brief Command description for SetFabric
*
* Command: SetFabric
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@
// Definitions for cluster: WiFi Network Diagnostics
#define ZCL_WIFI_NETWORK_DIAGNOSTICS_CLUSTER_ID (0x0036)

// Definitions for cluster: Ethernet Network Diagnostics
#define ZCL_ETHERNET_NETWORK_DIAGNOSTICS_CLUSTER_ID (0x0037)

// Definitions for cluster: Switch
#define ZCL_SWITCH_CLUSTER_ID (0x003B)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,9 @@
// Commands for cluster: WiFi Network Diagnostics
#define ZCL_RESET_COUNTS_COMMAND_ID (0x00)

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

// Commands for cluster: Operational Credentials
#define ZCL_SET_FABRIC_COMMAND_ID (0x00)
#define ZCL_SET_FABRIC_RESPONSE_COMMAND_ID (0x01)
Expand Down
Loading

0 comments on commit 2082868

Please sign in to comment.