From 23e5fb2c17a8148d56ec95d874d7007589b8204d Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Tue, 3 Jan 2023 20:00:30 -0500 Subject: [PATCH] Align naming in General Commissioning cluster XML with the spec. (#24241) * Align naming in General Commissioning cluster XML with the spec. * Regenerate generated files. --- src/app/tests/suites/TestArmFailSafe.yaml | 6 +-- .../suites/TestGeneralCommissioning.yaml | 36 ++++++------- .../chip/general-commissioning-cluster.xml | 22 ++++---- .../zap-generated/CHIPInvokeCallbacks.cpp | 50 +++++++++---------- .../devicecontroller/ClusterInfoMapping.java | 30 +++++------ .../CHIP/templates/availability.yaml | 11 ++++ .../CHIP/zap-generated/MTRBaseClusters.h | 5 +- .../app-common/zap-generated/callback.h | 8 +-- .../zap-generated/test/Commands.h | 18 +++---- 9 files changed, 100 insertions(+), 86 deletions(-) diff --git a/src/app/tests/suites/TestArmFailSafe.yaml b/src/app/tests/suites/TestArmFailSafe.yaml index 599164d74ecd0f..4ab62383d6b6d3 100644 --- a/src/app/tests/suites/TestArmFailSafe.yaml +++ b/src/app/tests/suites/TestArmFailSafe.yaml @@ -45,13 +45,13 @@ tests: command: "ArmFailSafe" arguments: values: - - name: "expiryLengthSeconds" + - name: "ExpiryLengthSeconds" value: 0 - - name: "breadcrumb" + - name: "Breadcrumb" value: 0 response: values: - - name: "errorCode" + - name: "ErrorCode" value: 0 - label: "Reads NodeLabel mandatory attribute of target device" diff --git a/src/app/tests/suites/TestGeneralCommissioning.yaml b/src/app/tests/suites/TestGeneralCommissioning.yaml index dbd7072d3e8b39..b42e6cb263e98e 100644 --- a/src/app/tests/suites/TestGeneralCommissioning.yaml +++ b/src/app/tests/suites/TestGeneralCommissioning.yaml @@ -92,7 +92,7 @@ tests: command: "CommissioningComplete" response: values: - - name: errorCode + - name: ErrorCode value: 3 # NoFailSafe - label: "Check Breadcrumb was not touched by invalid CommissioningComplete" @@ -115,13 +115,13 @@ tests: command: "ArmFailSafe" arguments: values: - - name: expiryLengthSeconds + - name: ExpiryLengthSeconds value: 10 - - name: breadcrumb + - name: Breadcrumb value: 5000 response: values: - - name: errorCode + - name: ErrorCode value: 4 # BusyWithOtherAdmin - label: @@ -162,13 +162,13 @@ tests: command: "ArmFailSafe" arguments: values: - - name: expiryLengthSeconds + - name: ExpiryLengthSeconds value: 500 - - name: breadcrumb + - name: Breadcrumb value: 2 response: values: - - name: errorCode + - name: ErrorCode value: 0 # OK - label: "Check Breadcrumb was properly set by ArmFailSafe" @@ -182,13 +182,13 @@ tests: identity: "beta" arguments: values: - - name: expiryLengthSeconds + - name: ExpiryLengthSeconds value: 10 - - name: breadcrumb + - name: Breadcrumb value: 5000 response: values: - - name: errorCode + - name: ErrorCode value: 4 # BusyWithOtherAdmin - label: @@ -204,7 +204,7 @@ tests: identity: "beta" response: values: - - name: errorCode + - name: ErrorCode value: 2 # InvalidAuthentication - label: @@ -219,7 +219,7 @@ tests: command: "CommissioningComplete" response: values: - - name: errorCode + - name: ErrorCode value: 0 # Ok - label: "Check Breadcrumb was reset to 0 by CommissioningComplete" @@ -232,13 +232,13 @@ tests: command: "ArmFailSafe" arguments: values: - - name: expiryLengthSeconds + - name: ExpiryLengthSeconds value: 500 - - name: breadcrumb + - name: Breadcrumb value: 3 response: values: - - name: errorCode + - name: ErrorCode value: 0 # OK - label: "Check Breadcrumb was set by arming fail-safe again" @@ -251,13 +251,13 @@ tests: command: "ArmFailSafe" arguments: values: - - name: expiryLengthSeconds + - name: ExpiryLengthSeconds value: 0 - - name: breadcrumb + - name: Breadcrumb value: 4 response: values: - - name: errorCode + - name: ErrorCode value: 0 # OK - label: "Check Breadcrumb was reset by expiring the fail-safe" diff --git a/src/app/zap-templates/zcl/data-model/chip/general-commissioning-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/general-commissioning-cluster.xml index 4f78d129129b51..cde1addf326305 100644 --- a/src/app/zap-templates/zcl/data-model/chip/general-commissioning-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/general-commissioning-cluster.xml @@ -18,7 +18,7 @@ limitations under the License. - + @@ -53,26 +53,26 @@ limitations under the License. Arm the persistent fail-safe timer with an expiry time of now + ExpiryLengthSeconds using device clock - - + + Success/failure response for ArmFailSafe command - - + + Set the regulatory configuration to be used during commissioning - - + + Success/failure response for SetRegulatoryConfig command - - + + Signals the Server that the Client has successfully completed all steps of Commissioning/Recofiguration needed during fail-safe period. @@ -80,8 +80,8 @@ limitations under the License. Indicates to client whether CommissioningComplete command succeeded - - + + diff --git a/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp b/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp index 9d3344adab4134..a77e04584a2a7b 100644 --- a/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp @@ -1179,15 +1179,15 @@ void CHIPGeneralCommissioningClusterArmFailSafeResponseCallback::CallbackFn( &javaMethod); VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); - jobject errorCode; - std::string errorCodeClassName = "java/lang/Integer"; - std::string errorCodeCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(errorCodeClassName.c_str(), errorCodeCtorSignature.c_str(), - static_cast(dataResponse.errorCode), errorCode); - jobject debugText; - debugText = env->NewStringUTF(std::string(dataResponse.debugText.data(), dataResponse.debugText.size()).c_str()); - - env->CallVoidMethod(javaCallbackRef, javaMethod, errorCode, debugText); + jobject ErrorCode; + std::string ErrorCodeClassName = "java/lang/Integer"; + std::string ErrorCodeCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(ErrorCodeClassName.c_str(), ErrorCodeCtorSignature.c_str(), + static_cast(dataResponse.errorCode), ErrorCode); + jobject DebugText; + DebugText = env->NewStringUTF(std::string(dataResponse.debugText.data(), dataResponse.debugText.size()).c_str()); + + env->CallVoidMethod(javaCallbackRef, javaMethod, ErrorCode, DebugText); } CHIPGeneralCommissioningClusterSetRegulatoryConfigResponseCallback:: CHIPGeneralCommissioningClusterSetRegulatoryConfigResponseCallback(jobject javaCallback) : @@ -1245,15 +1245,15 @@ void CHIPGeneralCommissioningClusterSetRegulatoryConfigResponseCallback::Callbac &javaMethod); VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); - jobject errorCode; - std::string errorCodeClassName = "java/lang/Integer"; - std::string errorCodeCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(errorCodeClassName.c_str(), errorCodeCtorSignature.c_str(), - static_cast(dataResponse.errorCode), errorCode); - jobject debugText; - debugText = env->NewStringUTF(std::string(dataResponse.debugText.data(), dataResponse.debugText.size()).c_str()); + jobject ErrorCode; + std::string ErrorCodeClassName = "java/lang/Integer"; + std::string ErrorCodeCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(ErrorCodeClassName.c_str(), ErrorCodeCtorSignature.c_str(), + static_cast(dataResponse.errorCode), ErrorCode); + jobject DebugText; + DebugText = env->NewStringUTF(std::string(dataResponse.debugText.data(), dataResponse.debugText.size()).c_str()); - env->CallVoidMethod(javaCallbackRef, javaMethod, errorCode, debugText); + env->CallVoidMethod(javaCallbackRef, javaMethod, ErrorCode, DebugText); } CHIPGeneralCommissioningClusterCommissioningCompleteResponseCallback:: CHIPGeneralCommissioningClusterCommissioningCompleteResponseCallback(jobject javaCallback) : @@ -1311,15 +1311,15 @@ void CHIPGeneralCommissioningClusterCommissioningCompleteResponseCallback::Callb &javaMethod); VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); - jobject errorCode; - std::string errorCodeClassName = "java/lang/Integer"; - std::string errorCodeCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(errorCodeClassName.c_str(), errorCodeCtorSignature.c_str(), - static_cast(dataResponse.errorCode), errorCode); - jobject debugText; - debugText = env->NewStringUTF(std::string(dataResponse.debugText.data(), dataResponse.debugText.size()).c_str()); + jobject ErrorCode; + std::string ErrorCodeClassName = "java/lang/Integer"; + std::string ErrorCodeCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(ErrorCodeClassName.c_str(), ErrorCodeCtorSignature.c_str(), + static_cast(dataResponse.errorCode), ErrorCode); + jobject DebugText; + DebugText = env->NewStringUTF(std::string(dataResponse.debugText.data(), dataResponse.debugText.size()).c_str()); - env->CallVoidMethod(javaCallbackRef, javaMethod, errorCode, debugText); + env->CallVoidMethod(javaCallbackRef, javaMethod, ErrorCode, DebugText); } CHIPNetworkCommissioningClusterScanNetworksResponseCallback::CHIPNetworkCommissioningClusterScanNetworksResponseCallback( jobject javaCallback) : diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java b/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java index 6434d4d249f139..c0c8f46f0fd904 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java @@ -2177,12 +2177,12 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(Integer errorCode, String debugText) { + public void onSuccess(Integer ErrorCode, String DebugText) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo errorCodeResponseValue = new CommandResponseInfo("errorCode", "Integer"); - responseValues.put(errorCodeResponseValue, errorCode); - CommandResponseInfo debugTextResponseValue = new CommandResponseInfo("debugText", "String"); - responseValues.put(debugTextResponseValue, debugText); + CommandResponseInfo ErrorCodeResponseValue = new CommandResponseInfo("ErrorCode", "Integer"); + responseValues.put(ErrorCodeResponseValue, ErrorCode); + CommandResponseInfo DebugTextResponseValue = new CommandResponseInfo("DebugText", "String"); + responseValues.put(DebugTextResponseValue, DebugText); callback.onSuccess(responseValues); } @@ -2203,12 +2203,12 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(Integer errorCode, String debugText) { + public void onSuccess(Integer ErrorCode, String DebugText) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo errorCodeResponseValue = new CommandResponseInfo("errorCode", "Integer"); - responseValues.put(errorCodeResponseValue, errorCode); - CommandResponseInfo debugTextResponseValue = new CommandResponseInfo("debugText", "String"); - responseValues.put(debugTextResponseValue, debugText); + CommandResponseInfo ErrorCodeResponseValue = new CommandResponseInfo("ErrorCode", "Integer"); + responseValues.put(ErrorCodeResponseValue, ErrorCode); + CommandResponseInfo DebugTextResponseValue = new CommandResponseInfo("DebugText", "String"); + responseValues.put(DebugTextResponseValue, DebugText); callback.onSuccess(responseValues); } @@ -2229,12 +2229,12 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(Integer errorCode, String debugText) { + public void onSuccess(Integer ErrorCode, String DebugText) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo errorCodeResponseValue = new CommandResponseInfo("errorCode", "Integer"); - responseValues.put(errorCodeResponseValue, errorCode); - CommandResponseInfo debugTextResponseValue = new CommandResponseInfo("debugText", "String"); - responseValues.put(debugTextResponseValue, debugText); + CommandResponseInfo ErrorCodeResponseValue = new CommandResponseInfo("ErrorCode", "Integer"); + responseValues.put(ErrorCodeResponseValue, ErrorCode); + CommandResponseInfo DebugTextResponseValue = new CommandResponseInfo("DebugText", "String"); + responseValues.put(DebugTextResponseValue, DebugText); callback.onSuccess(responseValues); } diff --git a/src/darwin/Framework/CHIP/templates/availability.yaml b/src/darwin/Framework/CHIP/templates/availability.yaml index b37432051eb8fc..67f1d80148899d 100644 --- a/src/darwin/Framework/CHIP/templates/availability.yaml +++ b/src/darwin/Framework/CHIP/templates/availability.yaml @@ -5119,6 +5119,9 @@ - ValueA - ValueB - ValueC + GeneralCommissioning: + CommissioningError: + - OK bitmaps: UnitTesting: - Bitmap8MaskMap @@ -5204,6 +5207,10 @@ Switch: MultiPressComplete: - newPosition + enum values: + GeneralCommissioning: + CommissioningError: + - Ok apis: - Timed Invoke for server to client commands - Deprecated global attribute names @@ -5267,3 +5274,7 @@ Descriptor: DeviceTypeStruct: deviceType: type + enum values: + GeneralCommissioning: + CommissioningError: + OK: Ok diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index 9250cc268cbc54..a4ceee7eba016b 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -17437,7 +17437,10 @@ typedef NS_OPTIONS(uint32_t, MTRPowerSourceFeature) { } API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); typedef NS_ENUM(uint8_t, MTRGeneralCommissioningCommissioningError) { - MTRGeneralCommissioningCommissioningErrorOk API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x00, + MTRGeneralCommissioningCommissioningErrorOK MTR_NEWLY_AVAILABLE = 0x00, + MTRGeneralCommissioningCommissioningErrorOk API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) + MTR_NEWLY_DEPRECATED("Please use MTRGeneralCommissioningCommissioningErrorOK") + = 0x00, MTRGeneralCommissioningCommissioningErrorValueOutsideRange API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x01, MTRGeneralCommissioningCommissioningErrorInvalidAuthentication API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) diff --git a/zzz_generated/app-common/app-common/zap-generated/callback.h b/zzz_generated/app-common/app-common/zap-generated/callback.h index 406cb39979d4f7..aebe2184331823 100644 --- a/zzz_generated/app-common/app-common/zap-generated/callback.h +++ b/zzz_generated/app-common/app-common/zap-generated/callback.h @@ -7949,7 +7949,7 @@ bool emberAfGeneralCommissioningClusterArmFailSafeCallback( * @brief General Commissioning Cluster ArmFailSafeResponse Command callback (from server) */ bool emberAfGeneralCommissioningClusterArmFailSafeResponseCallback(chip::EndpointId endpoint, chip::app::CommandSender * commandObj, - uint8_t errorCode, chip::CharSpan debugText); + uint8_t ErrorCode, chip::CharSpan DebugText); /** * @brief General Commissioning Cluster SetRegulatoryConfig Command callback (from client) */ @@ -7960,8 +7960,8 @@ bool emberAfGeneralCommissioningClusterSetRegulatoryConfigCallback( * @brief General Commissioning Cluster SetRegulatoryConfigResponse Command callback (from server) */ bool emberAfGeneralCommissioningClusterSetRegulatoryConfigResponseCallback(chip::EndpointId endpoint, - chip::app::CommandSender * commandObj, uint8_t errorCode, - chip::CharSpan debugText); + chip::app::CommandSender * commandObj, uint8_t ErrorCode, + chip::CharSpan DebugText); /** * @brief General Commissioning Cluster CommissioningComplete Command callback (from client) */ @@ -7973,7 +7973,7 @@ bool emberAfGeneralCommissioningClusterCommissioningCompleteCallback( */ bool emberAfGeneralCommissioningClusterCommissioningCompleteResponseCallback(chip::EndpointId endpoint, chip::app::CommandSender * commandObj, - uint8_t errorCode, chip::CharSpan debugText); + uint8_t ErrorCode, chip::CharSpan DebugText); /** * @brief Network Commissioning Cluster ScanNetworks Command callback (from client) */ diff --git a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h index 859c8026370121..2e1b2f1006dd6a 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h @@ -96574,7 +96574,7 @@ class TestGeneralCommissioning : public TestCommandBridge { { id actualValue = values.errorCode; - VerifyOrReturn(CheckValue("errorCode", actualValue, 3U)); + VerifyOrReturn(CheckValue("ErrorCode", actualValue, 3U)); } NextTest(); @@ -96652,7 +96652,7 @@ class TestGeneralCommissioning : public TestCommandBridge { { id actualValue = values.errorCode; - VerifyOrReturn(CheckValue("errorCode", actualValue, 4U)); + VerifyOrReturn(CheckValue("ErrorCode", actualValue, 4U)); } NextTest(); @@ -96747,7 +96747,7 @@ class TestGeneralCommissioning : public TestCommandBridge { { id actualValue = values.errorCode; - VerifyOrReturn(CheckValue("errorCode", actualValue, 0U)); + VerifyOrReturn(CheckValue("ErrorCode", actualValue, 0U)); } NextTest(); @@ -96802,7 +96802,7 @@ class TestGeneralCommissioning : public TestCommandBridge { { id actualValue = values.errorCode; - VerifyOrReturn(CheckValue("errorCode", actualValue, 4U)); + VerifyOrReturn(CheckValue("ErrorCode", actualValue, 4U)); } NextTest(); @@ -96853,7 +96853,7 @@ class TestGeneralCommissioning : public TestCommandBridge { { id actualValue = values.errorCode; - VerifyOrReturn(CheckValue("errorCode", actualValue, 2U)); + VerifyOrReturn(CheckValue("ErrorCode", actualValue, 2U)); } NextTest(); @@ -96904,7 +96904,7 @@ class TestGeneralCommissioning : public TestCommandBridge { { id actualValue = values.errorCode; - VerifyOrReturn(CheckValue("errorCode", actualValue, 0U)); + VerifyOrReturn(CheckValue("ErrorCode", actualValue, 0U)); } NextTest(); @@ -96959,7 +96959,7 @@ class TestGeneralCommissioning : public TestCommandBridge { { id actualValue = values.errorCode; - VerifyOrReturn(CheckValue("errorCode", actualValue, 0U)); + VerifyOrReturn(CheckValue("ErrorCode", actualValue, 0U)); } NextTest(); @@ -97014,7 +97014,7 @@ class TestGeneralCommissioning : public TestCommandBridge { { id actualValue = values.errorCode; - VerifyOrReturn(CheckValue("errorCode", actualValue, 0U)); + VerifyOrReturn(CheckValue("ErrorCode", actualValue, 0U)); } NextTest(); @@ -100232,7 +100232,7 @@ class TestArmFailSafe : public TestCommandBridge { { id actualValue = values.errorCode; - VerifyOrReturn(CheckValue("errorCode", actualValue, 0U)); + VerifyOrReturn(CheckValue("ErrorCode", actualValue, 0U)); } NextTest();