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

Better align naming in General Diagnostics cluster XML with the spec. #24292

Merged
Merged
Show file tree
Hide file tree
Changes from all 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 @@ -1113,7 +1113,7 @@ server cluster DiagnosticLogs = 50 {
}

server cluster GeneralDiagnostics = 51 {
enum BootReasonType : ENUM8 {
enum BootReasonEnum : ENUM8 {
kUnspecified = 0;
kPowerOnReboot = 1;
kBrownOutReset = 2;
Expand All @@ -1123,7 +1123,7 @@ server cluster GeneralDiagnostics = 51 {
kSoftwareReset = 6;
}

enum HardwareFaultType : ENUM8 {
enum HardwareFault : ENUM8 {
kUnspecified = 0;
kRadio = 1;
kSensor = 2;
Expand Down Expand Up @@ -1152,7 +1152,7 @@ server cluster GeneralDiagnostics = 51 {
kConnectionFailed = 3;
}

enum RadioFaultType : ENUM8 {
enum RadioFault : ENUM8 {
kUnspecified = 0;
kWiFiFault = 1;
kCellularFault = 2;
Expand All @@ -1162,7 +1162,7 @@ server cluster GeneralDiagnostics = 51 {
kEthernetFault = 6;
}

struct NetworkInterfaceType {
struct NetworkInterface {
char_string<32> name = 0;
boolean isOperational = 1;
nullable boolean offPremiseServicesReachableIPv4 = 2;
Expand All @@ -1174,13 +1174,13 @@ server cluster GeneralDiagnostics = 51 {
}

critical event HardwareFaultChange = 0 {
HardwareFaultType current[] = 0;
HardwareFaultType previous[] = 1;
HardwareFault current[] = 0;
HardwareFault previous[] = 1;
}

critical event RadioFaultChange = 1 {
RadioFaultType current[] = 0;
RadioFaultType previous[] = 1;
RadioFault current[] = 0;
RadioFault previous[] = 1;
}

critical event NetworkFaultChange = 2 {
Expand All @@ -1189,17 +1189,17 @@ server cluster GeneralDiagnostics = 51 {
}

critical event BootReason = 3 {
BootReasonType bootReason = 0;
BootReasonEnum bootReason = 0;
}

readonly attribute NetworkInterfaceType networkInterfaces[] = 0;
readonly attribute NetworkInterface networkInterfaces[] = 0;
readonly attribute int16u rebootCount = 1;
readonly attribute int64u upTime = 2;
readonly attribute int32u totalOperationalHours = 3;
readonly attribute enum8 bootReasons = 4;
readonly attribute ENUM8 activeHardwareFaults[] = 5;
readonly attribute ENUM8 activeRadioFaults[] = 6;
readonly attribute ENUM8 activeNetworkFaults[] = 7;
readonly attribute BootReasonEnum bootReason = 4;
readonly attribute HardwareFault activeHardwareFaults[] = 5;
readonly attribute RadioFault activeRadioFaults[] = 6;
readonly attribute NetworkFaultType activeNetworkFaults[] = 7;
readonly attribute boolean testEventTriggersEnabled = 8;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
Expand Down Expand Up @@ -4044,7 +4044,7 @@ endpoint 0 {
callback attribute rebootCount;
callback attribute upTime;
callback attribute totalOperationalHours;
callback attribute bootReasons;
callback attribute bootReason;
callback attribute activeHardwareFaults;
callback attribute activeRadioFaults;
callback attribute activeNetworkFaults;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3415,11 +3415,11 @@
"reportableChange": 0
},
{
"name": "BootReasons",
"name": "BootReason",
"code": 4,
"mfgCode": null,
"side": "server",
"type": "enum8",
"type": "BootReasonEnum",
"included": 1,
"storageOption": "External",
"singleton": 0,
Expand Down
24 changes: 12 additions & 12 deletions examples/all-clusters-app/linux/AllClustersCommandDelegate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,13 +183,13 @@ void AllClustersAppCommandHandler::OnGeneralFaultEventHandler(uint32_t eventId)

#if CHIP_CONFIG_TEST
// On Linux Simulation, set following hardware faults statically.
ReturnOnFailure(previous.add(EMBER_ZCL_HARDWARE_FAULT_TYPE_RADIO));
ReturnOnFailure(previous.add(EMBER_ZCL_HARDWARE_FAULT_TYPE_POWER_SOURCE));
ReturnOnFailure(previous.add(EMBER_ZCL_HARDWARE_FAULT_RADIO));
ReturnOnFailure(previous.add(EMBER_ZCL_HARDWARE_FAULT_POWER_SOURCE));

ReturnOnFailure(current.add(EMBER_ZCL_HARDWARE_FAULT_TYPE_RADIO));
ReturnOnFailure(current.add(EMBER_ZCL_HARDWARE_FAULT_TYPE_SENSOR));
ReturnOnFailure(current.add(EMBER_ZCL_HARDWARE_FAULT_TYPE_POWER_SOURCE));
ReturnOnFailure(current.add(EMBER_ZCL_HARDWARE_FAULT_TYPE_USER_INTERFACE_FAULT));
ReturnOnFailure(current.add(EMBER_ZCL_HARDWARE_FAULT_RADIO));
ReturnOnFailure(current.add(EMBER_ZCL_HARDWARE_FAULT_SENSOR));
ReturnOnFailure(current.add(EMBER_ZCL_HARDWARE_FAULT_POWER_SOURCE));
ReturnOnFailure(current.add(EMBER_ZCL_HARDWARE_FAULT_USER_INTERFACE_FAULT));
#endif
Clusters::GeneralDiagnosticsServer::Instance().OnHardwareFaultsDetect(previous, current);
}
Expand All @@ -200,13 +200,13 @@ void AllClustersAppCommandHandler::OnGeneralFaultEventHandler(uint32_t eventId)

#if CHIP_CONFIG_TEST
// On Linux Simulation, set following radio faults statically.
ReturnOnFailure(previous.add(EMBER_ZCL_RADIO_FAULT_TYPE_WI_FI_FAULT));
ReturnOnFailure(previous.add(EMBER_ZCL_RADIO_FAULT_TYPE_THREAD_FAULT));
ReturnOnFailure(previous.add(EMBER_ZCL_RADIO_FAULT_WI_FI_FAULT));
ReturnOnFailure(previous.add(EMBER_ZCL_RADIO_FAULT_THREAD_FAULT));

ReturnOnFailure(current.add(EMBER_ZCL_RADIO_FAULT_TYPE_WI_FI_FAULT));
ReturnOnFailure(current.add(EMBER_ZCL_RADIO_FAULT_TYPE_CELLULAR_FAULT));
ReturnOnFailure(current.add(EMBER_ZCL_RADIO_FAULT_TYPE_THREAD_FAULT));
ReturnOnFailure(current.add(EMBER_ZCL_RADIO_FAULT_TYPE_NFC_FAULT));
ReturnOnFailure(current.add(EMBER_ZCL_RADIO_FAULT_WI_FI_FAULT));
ReturnOnFailure(current.add(EMBER_ZCL_RADIO_FAULT_CELLULAR_FAULT));
ReturnOnFailure(current.add(EMBER_ZCL_RADIO_FAULT_THREAD_FAULT));
ReturnOnFailure(current.add(EMBER_ZCL_RADIO_FAULT_NFC_FAULT));
#endif
Clusters::GeneralDiagnosticsServer::Instance().OnRadioFaultsDetect(previous, current);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1042,7 +1042,7 @@ server cluster DiagnosticLogs = 50 {
}

server cluster GeneralDiagnostics = 51 {
enum BootReasonType : ENUM8 {
enum BootReasonEnum : ENUM8 {
kUnspecified = 0;
kPowerOnReboot = 1;
kBrownOutReset = 2;
Expand All @@ -1052,7 +1052,7 @@ server cluster GeneralDiagnostics = 51 {
kSoftwareReset = 6;
}

enum HardwareFaultType : ENUM8 {
enum HardwareFault : ENUM8 {
kUnspecified = 0;
kRadio = 1;
kSensor = 2;
Expand Down Expand Up @@ -1081,7 +1081,7 @@ server cluster GeneralDiagnostics = 51 {
kConnectionFailed = 3;
}

enum RadioFaultType : ENUM8 {
enum RadioFault : ENUM8 {
kUnspecified = 0;
kWiFiFault = 1;
kCellularFault = 2;
Expand All @@ -1091,7 +1091,7 @@ server cluster GeneralDiagnostics = 51 {
kEthernetFault = 6;
}

struct NetworkInterfaceType {
struct NetworkInterface {
char_string<32> name = 0;
boolean isOperational = 1;
nullable boolean offPremiseServicesReachableIPv4 = 2;
Expand All @@ -1103,13 +1103,13 @@ server cluster GeneralDiagnostics = 51 {
}

critical event HardwareFaultChange = 0 {
HardwareFaultType current[] = 0;
HardwareFaultType previous[] = 1;
HardwareFault current[] = 0;
HardwareFault previous[] = 1;
}

critical event RadioFaultChange = 1 {
RadioFaultType current[] = 0;
RadioFaultType previous[] = 1;
RadioFault current[] = 0;
RadioFault previous[] = 1;
}

critical event NetworkFaultChange = 2 {
Expand All @@ -1118,10 +1118,10 @@ server cluster GeneralDiagnostics = 51 {
}

critical event BootReason = 3 {
BootReasonType bootReason = 0;
BootReasonEnum bootReason = 0;
}

readonly attribute NetworkInterfaceType networkInterfaces[] = 0;
readonly attribute NetworkInterface networkInterfaces[] = 0;
readonly attribute int16u rebootCount = 1;
readonly attribute boolean testEventTriggersEnabled = 8;
readonly attribute command_id generatedCommandList[] = 65528;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3415,11 +3415,11 @@
"reportableChange": 0
},
{
"name": "BootReasons",
"name": "BootReason",
"code": 4,
"mfgCode": null,
"side": "server",
"type": "enum8",
"type": "BootReasonEnum",
"included": 0,
"storageOption": "External",
"singleton": 0,
Expand Down
30 changes: 15 additions & 15 deletions examples/bridge-app/bridge-common/bridge-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,7 @@ server cluster DiagnosticLogs = 50 {
}

server cluster GeneralDiagnostics = 51 {
enum BootReasonType : ENUM8 {
enum BootReasonEnum : ENUM8 {
kUnspecified = 0;
kPowerOnReboot = 1;
kBrownOutReset = 2;
Expand All @@ -801,7 +801,7 @@ server cluster GeneralDiagnostics = 51 {
kSoftwareReset = 6;
}

enum HardwareFaultType : ENUM8 {
enum HardwareFault : ENUM8 {
kUnspecified = 0;
kRadio = 1;
kSensor = 2;
Expand Down Expand Up @@ -830,7 +830,7 @@ server cluster GeneralDiagnostics = 51 {
kConnectionFailed = 3;
}

enum RadioFaultType : ENUM8 {
enum RadioFault : ENUM8 {
kUnspecified = 0;
kWiFiFault = 1;
kCellularFault = 2;
Expand All @@ -840,7 +840,7 @@ server cluster GeneralDiagnostics = 51 {
kEthernetFault = 6;
}

struct NetworkInterfaceType {
struct NetworkInterface {
char_string<32> name = 0;
boolean isOperational = 1;
nullable boolean offPremiseServicesReachableIPv4 = 2;
Expand All @@ -852,13 +852,13 @@ server cluster GeneralDiagnostics = 51 {
}

critical event HardwareFaultChange = 0 {
HardwareFaultType current[] = 0;
HardwareFaultType previous[] = 1;
HardwareFault current[] = 0;
HardwareFault previous[] = 1;
}

critical event RadioFaultChange = 1 {
RadioFaultType current[] = 0;
RadioFaultType previous[] = 1;
RadioFault current[] = 0;
RadioFault previous[] = 1;
}

critical event NetworkFaultChange = 2 {
Expand All @@ -867,17 +867,17 @@ server cluster GeneralDiagnostics = 51 {
}

critical event BootReason = 3 {
BootReasonType bootReason = 0;
BootReasonEnum bootReason = 0;
}

readonly attribute NetworkInterfaceType networkInterfaces[] = 0;
readonly attribute NetworkInterface networkInterfaces[] = 0;
readonly attribute int16u rebootCount = 1;
readonly attribute int64u upTime = 2;
readonly attribute int32u totalOperationalHours = 3;
readonly attribute enum8 bootReasons = 4;
readonly attribute ENUM8 activeHardwareFaults[] = 5;
readonly attribute ENUM8 activeRadioFaults[] = 6;
readonly attribute ENUM8 activeNetworkFaults[] = 7;
readonly attribute BootReasonEnum bootReason = 4;
readonly attribute HardwareFault activeHardwareFaults[] = 5;
readonly attribute RadioFault activeRadioFaults[] = 6;
readonly attribute NetworkFaultType activeNetworkFaults[] = 7;
readonly attribute boolean testEventTriggersEnabled = 8;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
Expand Down Expand Up @@ -1578,7 +1578,7 @@ endpoint 0 {
callback attribute rebootCount;
callback attribute upTime;
callback attribute totalOperationalHours;
callback attribute bootReasons;
callback attribute bootReason;
callback attribute activeHardwareFaults;
callback attribute activeRadioFaults;
callback attribute activeNetworkFaults;
Expand Down
4 changes: 2 additions & 2 deletions examples/bridge-app/bridge-common/bridge-app.zap
Original file line number Diff line number Diff line change
Expand Up @@ -2177,11 +2177,11 @@
"reportableChange": 0
},
{
"name": "BootReasons",
"name": "BootReason",
"code": 4,
"mfgCode": null,
"side": "server",
"type": "enum8",
"type": "BootReasonEnum",
"included": 1,
"storageOption": "External",
"singleton": 0,
Expand Down
Loading