From e9ec6761db0e8f4a49aba88cb6d6679e34d0b31a Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Wed, 22 Sep 2021 12:17:46 +0200 Subject: [PATCH] Map epoch_us to uint64_t and epoch_s to uint32_t (#9848) * Map epoch_us to uint64_t and epoch_s to uint32_t * Update generated code --- .../all-clusters-common/all-clusters-app.zap | 32 +- src/app/tests/suites/TestCluster.yaml | 64 ++ .../util/ember-compatibility-functions.cpp | 2 + src/app/zap-templates/common/override.js | 4 + .../zcl/data-model/chip/test-cluster.xml | 2 + .../data_model/controller-clusters.zap | 33 +- .../java/zap-generated/CHIPClusters-JNI.cpp | 150 ++++ .../chip/devicecontroller/ChipClusters.java | 26 + .../python/chip/clusters/CHIPClusters.cpp | 38 + .../python/chip/clusters/CHIPClusters.py | 32 + .../CHIP/zap-generated/CHIPClustersObjc.h | 6 + .../CHIP/zap-generated/CHIPClustersObjc.mm | 28 + .../Framework/CHIPTests/CHIPClustersTests.m | 214 +++++- .../zap-generated/endpoint_config.h | 54 +- .../app-common/zap-generated/attribute-id.h | 2 + .../zap-generated/attributes/Accessors.cpp | 16 + .../zap-generated/attributes/Accessors.h | 4 + .../app-common/zap-generated/ids/Attributes.h | 2 + .../zap-generated/cluster/Commands.h | 140 ++++ .../chip-tool/zap-generated/test/Commands.h | 712 +++++++++++++++++- .../zap-generated/CHIPClusters.cpp | 58 ++ .../zap-generated/CHIPClusters.h | 6 + 22 files changed, 1568 insertions(+), 57 deletions(-) diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap index 472f1ac14d7a49..7e250ad18ae92c 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap @@ -14017,6 +14017,36 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "epoch_us", + "code": 32, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "epoch_s", + "code": 33, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -17539,4 +17569,4 @@ } ], "log": [] -} +} \ No newline at end of file diff --git a/src/app/tests/suites/TestCluster.yaml b/src/app/tests/suites/TestCluster.yaml index 8641e22a65700c..8a5281ca5d78f4 100644 --- a/src/app/tests/suites/TestCluster.yaml +++ b/src/app/tests/suites/TestCluster.yaml @@ -750,6 +750,70 @@ tests: { fabricIndex: 3, operationalCert: "Test3" }, ] + # Tests for Epoch Microseconds + + - label: "Read attribute EPOCH_US Default Value" + command: "readAttribute" + attribute: "epoch_us" + response: + value: 0 + + - label: "Write attribute EPOCH_US Max Value" + command: "writeAttribute" + attribute: "epoch_us" + arguments: + value: "18446744073709551615" + + - label: "Read attribute EPOCH_US Max Value" + command: "readAttribute" + attribute: "epoch_us" + response: + value: "18446744073709551615" + + - label: "Write attribute EPOCH_US Min Value" + command: "writeAttribute" + attribute: "epoch_us" + arguments: + value: 0 + + - label: "Read attribute EPOCH_US Min Value" + command: "readAttribute" + attribute: "epoch_us" + response: + value: 0 + + # Tests for Epoch Seconds + + - label: "Read attribute EPOCH_S Default Value" + command: "readAttribute" + attribute: "epoch_s" + response: + value: 0 + + - label: "Write attribute EPOCH_S Max Value" + command: "writeAttribute" + attribute: "epoch_s" + arguments: + value: 4294967295 + + - label: "Read attribute EPOCH_S Max Value" + command: "readAttribute" + attribute: "epoch_s" + response: + value: 4294967295 + + - label: "Write attribute EPOCH_S Min Value" + command: "writeAttribute" + attribute: "epoch_s" + arguments: + value: 0 + + - label: "Read attribute EPOCH_S Min Value" + command: "readAttribute" + attribute: "epoch_s" + response: + value: 0 + # Tests for Unsupported attribute - label: "Read attribute UNSUPPORTED" diff --git a/src/app/util/ember-compatibility-functions.cpp b/src/app/util/ember-compatibility-functions.cpp index b111f2266c5af1..abe2a9efb149fa 100644 --- a/src/app/util/ember-compatibility-functions.cpp +++ b/src/app/util/ember-compatibility-functions.cpp @@ -92,6 +92,7 @@ EmberAfAttributeType BaseType(EmberAfAttributeType type) case ZCL_STATUS_ATTRIBUTE_TYPE: // Status Code case ZCL_DATA_VER_ATTRIBUTE_TYPE: // Data Version case ZCL_BITMAP32_ATTRIBUTE_TYPE: // 32-bit bitmap + case ZCL_EPOCH_S_ATTRIBUTE_TYPE: // Epoch Seconds static_assert(std::is_same::value, "chip::Cluster is expected to be uint32_t, change this when necessary"); static_assert(std::is_same::value, @@ -116,6 +117,7 @@ EmberAfAttributeType BaseType(EmberAfAttributeType type) case ZCL_FABRIC_ID_ATTRIBUTE_TYPE: // Fabric Id case ZCL_NODE_ID_ATTRIBUTE_TYPE: // Node Id case ZCL_BITMAP64_ATTRIBUTE_TYPE: // 64-bit bitmap + case ZCL_EPOCH_US_ATTRIBUTE_TYPE: // Epoch Microseconds static_assert(std::is_same::value, "chip::EventNumber is expected to be uint64_t, change this when necessary"); static_assert(std::is_same::value, diff --git a/src/app/zap-templates/common/override.js b/src/app/zap-templates/common/override.js index e1ce6478920ce3..cef5ec1aa9f81e 100644 --- a/src/app/zap-templates/common/override.js +++ b/src/app/zap-templates/common/override.js @@ -59,6 +59,10 @@ function atomicType(arg) return 'chip::Percent'; case 'percent100ths': return 'chip::Percent100ths'; + case 'epoch_us': + return 'uint64_t'; + case 'epoch_s': + return 'uint32_t'; default: throw 'not overriding'; } diff --git a/src/app/zap-templates/zcl/data-model/chip/test-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/test-cluster.xml index d07372f05b98d2..f04a7729bd9e68 100644 --- a/src/app/zap-templates/zcl/data-model/chip/test-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/test-cluster.xml @@ -101,6 +101,8 @@ limitations under the License. long_octet_string char_string long_char_string + epoch_us + epoch_s unsupported diff --git a/src/controller/data_model/controller-clusters.zap b/src/controller/data_model/controller-clusters.zap index 5a3f06c47b1ca1..305ec892d84a7f 100644 --- a/src/controller/data_model/controller-clusters.zap +++ b/src/controller/data_model/controller-clusters.zap @@ -9724,6 +9724,36 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "epoch_us", + "code": 32, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "epoch_s", + "code": 33, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "unsupported", "code": 255, @@ -10137,5 +10167,6 @@ "endpointVersion": null, "deviceIdentifier": null } - ] + ], + "log": [] } \ No newline at end of file diff --git a/src/controller/java/zap-generated/CHIPClusters-JNI.cpp b/src/controller/java/zap-generated/CHIPClusters-JNI.cpp index 04dd42e61341db..f31f9b7de89c66 100644 --- a/src/controller/java/zap-generated/CHIPClusters-JNI.cpp +++ b/src/controller/java/zap-generated/CHIPClusters-JNI.cpp @@ -26260,6 +26260,156 @@ JNI_METHOD(void, TestClusterCluster, writeLongCharStringAttribute) } } +JNI_METHOD(void, TestClusterCluster, readEpochUsAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +{ + StackLockGuard lock(JniReferences::GetInstance().GetStackLock()); + CHIPInt64uAttributeCallback * onSuccess = new CHIPInt64uAttributeCallback(callback); + if (!onSuccess) + { + ReturnIllegalStateException(env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY.AsInteger()); + return; + } + + CHIPDefaultFailureCallback * onFailure = new CHIPDefaultFailureCallback(callback); + if (!onFailure) + { + delete onSuccess; + ReturnIllegalStateException(env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY.AsInteger()); + return; + } + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + if (cppCluster == nullptr) + { + delete onSuccess; + delete onFailure; + ReturnIllegalStateException(env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE.AsInteger()); + return; + } + + err = cppCluster->ReadAttributeEpochUs(onSuccess->Cancel(), onFailure->Cancel()); + if (err != CHIP_NO_ERROR) + { + delete onSuccess; + delete onFailure; + ReturnIllegalStateException(env, callback, "Error reading attribute", err.AsInteger()); + } +} + +JNI_METHOD(void, TestClusterCluster, writeEpochUsAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jlong value) +{ + StackLockGuard lock(JniReferences::GetInstance().GetStackLock()); + CHIPDefaultSuccessCallback * onSuccess = new CHIPDefaultSuccessCallback(callback); + if (!onSuccess) + { + ReturnIllegalStateException(env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY.AsInteger()); + return; + } + + CHIPDefaultFailureCallback * onFailure = new CHIPDefaultFailureCallback(callback); + if (!onFailure) + { + delete onSuccess; + ReturnIllegalStateException(env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY.AsInteger()); + return; + } + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + if (cppCluster == nullptr) + { + delete onSuccess; + delete onFailure; + ReturnIllegalStateException(env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE.AsInteger()); + return; + } + + err = cppCluster->WriteAttributeEpochUs(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + if (err != CHIP_NO_ERROR) + { + delete onSuccess; + delete onFailure; + ReturnIllegalStateException(env, callback, "Error writing attribute", err.AsInteger()); + } +} + +JNI_METHOD(void, TestClusterCluster, readEpochSAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +{ + StackLockGuard lock(JniReferences::GetInstance().GetStackLock()); + CHIPInt32uAttributeCallback * onSuccess = new CHIPInt32uAttributeCallback(callback); + if (!onSuccess) + { + ReturnIllegalStateException(env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY.AsInteger()); + return; + } + + CHIPDefaultFailureCallback * onFailure = new CHIPDefaultFailureCallback(callback); + if (!onFailure) + { + delete onSuccess; + ReturnIllegalStateException(env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY.AsInteger()); + return; + } + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + if (cppCluster == nullptr) + { + delete onSuccess; + delete onFailure; + ReturnIllegalStateException(env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE.AsInteger()); + return; + } + + err = cppCluster->ReadAttributeEpochS(onSuccess->Cancel(), onFailure->Cancel()); + if (err != CHIP_NO_ERROR) + { + delete onSuccess; + delete onFailure; + ReturnIllegalStateException(env, callback, "Error reading attribute", err.AsInteger()); + } +} + +JNI_METHOD(void, TestClusterCluster, writeEpochSAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jlong value) +{ + StackLockGuard lock(JniReferences::GetInstance().GetStackLock()); + CHIPDefaultSuccessCallback * onSuccess = new CHIPDefaultSuccessCallback(callback); + if (!onSuccess) + { + ReturnIllegalStateException(env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY.AsInteger()); + return; + } + + CHIPDefaultFailureCallback * onFailure = new CHIPDefaultFailureCallback(callback); + if (!onFailure) + { + delete onSuccess; + ReturnIllegalStateException(env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY.AsInteger()); + return; + } + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + if (cppCluster == nullptr) + { + delete onSuccess; + delete onFailure; + ReturnIllegalStateException(env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE.AsInteger()); + return; + } + + err = cppCluster->WriteAttributeEpochS(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + if (err != CHIP_NO_ERROR) + { + delete onSuccess; + delete onFailure; + ReturnIllegalStateException(env, callback, "Error writing attribute", err.AsInteger()); + } +} + JNI_METHOD(void, TestClusterCluster, readUnsupportedAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { StackLockGuard lock(JniReferences::GetInstance().GetStackLock()); diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java index 7df03039e0cdfe..c22c6d99b62ca0 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java @@ -4881,6 +4881,22 @@ public void writeLongCharStringAttribute(DefaultClusterCallback callback, String writeLongCharStringAttribute(chipClusterPtr, callback, value); } + public void readEpochUsAttribute(LongAttributeCallback callback) { + readEpochUsAttribute(chipClusterPtr, callback); + } + + public void writeEpochUsAttribute(DefaultClusterCallback callback, long value) { + writeEpochUsAttribute(chipClusterPtr, callback, value); + } + + public void readEpochSAttribute(LongAttributeCallback callback) { + readEpochSAttribute(chipClusterPtr, callback); + } + + public void writeEpochSAttribute(DefaultClusterCallback callback, long value) { + writeEpochSAttribute(chipClusterPtr, callback, value); + } + public void readUnsupportedAttribute(BooleanAttributeCallback callback) { readUnsupportedAttribute(chipClusterPtr, callback); } @@ -5004,6 +5020,16 @@ private native void readLongCharStringAttribute( private native void writeLongCharStringAttribute( long chipClusterPtr, DefaultClusterCallback callback, String value); + private native void readEpochUsAttribute(long chipClusterPtr, LongAttributeCallback callback); + + private native void writeEpochUsAttribute( + long chipClusterPtr, DefaultClusterCallback callback, long value); + + private native void readEpochSAttribute(long chipClusterPtr, LongAttributeCallback callback); + + private native void writeEpochSAttribute( + long chipClusterPtr, DefaultClusterCallback callback, long value); + private native void readUnsupportedAttribute( long chipClusterPtr, BooleanAttributeCallback callback); diff --git a/src/controller/python/chip/clusters/CHIPClusters.cpp b/src/controller/python/chip/clusters/CHIPClusters.cpp index e0c69cd9a9a35c..bea02d0a424c80 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.cpp +++ b/src/controller/python/chip/clusters/CHIPClusters.cpp @@ -5184,6 +5184,44 @@ chip::ChipError::StorageType chip_ime_WriteAttribute_TestCluster_LongCharString( chip::ByteSpan(value, len)) .AsInteger(); } +chip::ChipError::StorageType chip_ime_ReadAttribute_TestCluster_EpochUs(chip::Controller::Device * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeEpochUs(gInt64uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_WriteAttribute_TestCluster_EpochUs(chip::Controller::Device * device, + chip::EndpointId ZCLendpointId, chip::GroupId, + uint64_t value) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.WriteAttributeEpochUs(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel(), value).AsInteger(); +} +chip::ChipError::StorageType chip_ime_ReadAttribute_TestCluster_EpochS(chip::Controller::Device * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeEpochS(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_WriteAttribute_TestCluster_EpochS(chip::Controller::Device * device, + chip::EndpointId ZCLendpointId, chip::GroupId, + uint32_t value) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.WriteAttributeEpochS(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel(), value).AsInteger(); +} chip::ChipError::StorageType chip_ime_ReadAttribute_TestCluster_Unsupported(chip::Controller::Device * device, chip::EndpointId ZCLendpointId, chip::GroupId /* ZCLgroupId */) diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index 676692355ab143..e85b4db4c1dc31 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -2902,6 +2902,18 @@ class ChipClusters: "type": "str", "writable": True, }, + 0x00000020: { + "attributeName": "EpochUs", + "attributeId": 0x00000020, + "type": "int", + "writable": True, + }, + 0x00000021: { + "attributeName": "EpochS", + "attributeId": 0x00000021, + "type": "int", + "writable": True, + }, 0x000000FF: { "attributeName": "Unsupported", "attributeId": 0x000000FF, @@ -5090,6 +5102,14 @@ def ClusterTestCluster_ReadAttributeLongCharString(self, device: ctypes.c_void_p def ClusterTestCluster_WriteAttributeLongCharString(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int, value: bytes): value = value.encode("utf-8") return self._chipLib.chip_ime_WriteAttribute_TestCluster_LongCharString(device, ZCLendpoint, ZCLgroupid, value, len(value)) + def ClusterTestCluster_ReadAttributeEpochUs(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): + return self._chipLib.chip_ime_ReadAttribute_TestCluster_EpochUs(device, ZCLendpoint, ZCLgroupid) + def ClusterTestCluster_WriteAttributeEpochUs(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int, value: int): + return self._chipLib.chip_ime_WriteAttribute_TestCluster_EpochUs(device, ZCLendpoint, ZCLgroupid, value) + def ClusterTestCluster_ReadAttributeEpochS(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): + return self._chipLib.chip_ime_ReadAttribute_TestCluster_EpochS(device, ZCLendpoint, ZCLgroupid) + def ClusterTestCluster_WriteAttributeEpochS(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int, value: int): + return self._chipLib.chip_ime_WriteAttribute_TestCluster_EpochS(device, ZCLendpoint, ZCLgroupid, value) def ClusterTestCluster_ReadAttributeUnsupported(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): return self._chipLib.chip_ime_ReadAttribute_TestCluster_Unsupported(device, ZCLendpoint, ZCLgroupid) def ClusterTestCluster_WriteAttributeUnsupported(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int, value: bool): @@ -6803,6 +6823,18 @@ def InitLib(self, chipLib): # Cluster TestCluster WriteAttribute LongCharString self._chipLib.chip_ime_WriteAttribute_TestCluster_LongCharString.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16, ctypes.c_char_p, ctypes.c_uint32] self._chipLib.chip_ime_WriteAttribute_TestCluster_LongCharString.restype = ctypes.c_uint32 + # Cluster TestCluster ReadAttribute EpochUs + self._chipLib.chip_ime_ReadAttribute_TestCluster_EpochUs.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] + self._chipLib.chip_ime_ReadAttribute_TestCluster_EpochUs.restype = ctypes.c_uint32 + # Cluster TestCluster WriteAttribute EpochUs + self._chipLib.chip_ime_WriteAttribute_TestCluster_EpochUs.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16, ctypes.c_uint64] + self._chipLib.chip_ime_WriteAttribute_TestCluster_EpochUs.restype = ctypes.c_uint32 + # Cluster TestCluster ReadAttribute EpochS + self._chipLib.chip_ime_ReadAttribute_TestCluster_EpochS.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] + self._chipLib.chip_ime_ReadAttribute_TestCluster_EpochS.restype = ctypes.c_uint32 + # Cluster TestCluster WriteAttribute EpochS + self._chipLib.chip_ime_WriteAttribute_TestCluster_EpochS.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16, ctypes.c_uint32] + self._chipLib.chip_ime_WriteAttribute_TestCluster_EpochS.restype = ctypes.c_uint32 # Cluster TestCluster ReadAttribute Unsupported self._chipLib.chip_ime_ReadAttribute_TestCluster_Unsupported.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] self._chipLib.chip_ime_ReadAttribute_TestCluster_Unsupported.restype = ctypes.c_uint32 diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h index 9e70fa9e482d51..e21b9d5310621c 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h @@ -1427,6 +1427,12 @@ NS_ASSUME_NONNULL_BEGIN - (void)readAttributeLongCharStringWithResponseHandler:(ResponseHandler)responseHandler; - (void)writeAttributeLongCharStringWithValue:(NSString *)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeEpochUsWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeEpochUsWithValue:(uint64_t)value responseHandler:(ResponseHandler)responseHandler; + +- (void)readAttributeEpochSWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeEpochSWithValue:(uint32_t)value responseHandler:(ResponseHandler)responseHandler; + - (void)readAttributeUnsupportedWithResponseHandler:(ResponseHandler)responseHandler; - (void)writeAttributeUnsupportedWithValue:(bool)value responseHandler:(ResponseHandler)responseHandler; diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm index fa179a3bc8a316..90ba30c09b6b13 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm @@ -4209,6 +4209,34 @@ new CHIPDefaultSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Canc }); } +- (void)readAttributeEpochUsWithResponseHandler:(ResponseHandler)responseHandler +{ + new CHIPInt64uAttributeCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { + return self.cppCluster.ReadAttributeEpochUs(success, failure); + }); +} + +- (void)writeAttributeEpochUsWithValue:(uint64_t)value responseHandler:(ResponseHandler)responseHandler +{ + new CHIPDefaultSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { + return self.cppCluster.WriteAttributeEpochUs(success, failure, value); + }); +} + +- (void)readAttributeEpochSWithResponseHandler:(ResponseHandler)responseHandler +{ + new CHIPInt32uAttributeCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { + return self.cppCluster.ReadAttributeEpochS(success, failure); + }); +} + +- (void)writeAttributeEpochSWithValue:(uint32_t)value responseHandler:(ResponseHandler)responseHandler +{ + new CHIPDefaultSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { + return self.cppCluster.WriteAttributeEpochS(success, failure, value); + }); +} + - (void)readAttributeUnsupportedWithResponseHandler:(ResponseHandler)responseHandler { new CHIPBooleanAttributeCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { diff --git a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m index f8a809bea45940..26623355ea9166 100644 --- a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m +++ b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m @@ -2479,6 +2479,216 @@ - (void)testSendClusterTestCluster_000108_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterTestCluster_000109_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute EPOCH_US Default Value"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeEpochUsWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute EPOCH_US Default Value Error: %@", err); + + XCTAssertEqual(err.code, 0); + + XCTAssertEqual([values[@"value"] unsignedLongLongValue], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000110_WriteAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute EPOCH_US Max Value"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + uint64_t epochUsArgument = 18446744073709551615ULL; + [cluster writeAttributeEpochUsWithValue:epochUsArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Write attribute EPOCH_US Max Value Error: %@", err); + + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000111_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute EPOCH_US Max Value"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeEpochUsWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute EPOCH_US Max Value Error: %@", err); + + XCTAssertEqual(err.code, 0); + + XCTAssertEqual([values[@"value"] unsignedLongLongValue], 18446744073709551615); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000112_WriteAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute EPOCH_US Min Value"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + uint64_t epochUsArgument = 0ULL; + [cluster writeAttributeEpochUsWithValue:epochUsArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Write attribute EPOCH_US Min Value Error: %@", err); + + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000113_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute EPOCH_US Min Value"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeEpochUsWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute EPOCH_US Min Value Error: %@", err); + + XCTAssertEqual(err.code, 0); + + XCTAssertEqual([values[@"value"] unsignedLongLongValue], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000114_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute EPOCH_S Default Value"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeEpochSWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute EPOCH_S Default Value Error: %@", err); + + XCTAssertEqual(err.code, 0); + + XCTAssertEqual([values[@"value"] unsignedLongValue], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000115_WriteAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute EPOCH_S Max Value"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + uint32_t epochSArgument = 4294967295UL; + [cluster writeAttributeEpochSWithValue:epochSArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Write attribute EPOCH_S Max Value Error: %@", err); + + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000116_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute EPOCH_S Max Value"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeEpochSWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute EPOCH_S Max Value Error: %@", err); + + XCTAssertEqual(err.code, 0); + + XCTAssertEqual([values[@"value"] unsignedLongValue], 4294967295); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000117_WriteAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute EPOCH_S Min Value"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + uint32_t epochSArgument = 0UL; + [cluster writeAttributeEpochSWithValue:epochSArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Write attribute EPOCH_S Min Value Error: %@", err); + + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000118_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute EPOCH_S Min Value"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeEpochSWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Read attribute EPOCH_S Min Value Error: %@", err); + + XCTAssertEqual(err.code, 0); + + XCTAssertEqual([values[@"value"] unsignedLongValue], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000119_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute UNSUPPORTED"]; @@ -2504,7 +2714,7 @@ - (void)testSendClusterTestCluster_000109_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000110_WriteAttribute +- (void)testSendClusterTestCluster_000120_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Writeattribute UNSUPPORTED"]; @@ -2530,7 +2740,7 @@ - (void)testSendClusterTestCluster_000110_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000111_Test +- (void)testSendClusterTestCluster_000121_Test { XCTestExpectation * expectation = [self expectationWithDescription:@"Send Test Command to unsupported endpoint"]; diff --git a/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h b/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h index 8cd4a64e28ed27..dc670ee92f0f2a 100644 --- a/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h +++ b/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h @@ -1034,17 +1034,23 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ + /* 11255 - epoch_us, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + \ + /* 11263 - epoch_s, */ \ + 0x00, 0x00, 0x00, 0x00, \ + \ /* Endpoint: 1, Cluster: Electrical Measurement (server), big-endian */ \ \ - /* 11255 - measurement type, */ \ + /* 11267 - measurement type, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 11259 - total active power, */ \ + /* 11271 - total active power, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 2, Cluster: On/Off (server), big-endian */ \ \ - /* 11263 - FeatureMap, */ \ + /* 11275 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ } @@ -2059,23 +2065,29 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ + /* 11255 - epoch_us, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + \ + /* 11263 - epoch_s, */ \ + 0x00, 0x00, 0x00, 0x00, \ + \ /* Endpoint: 1, Cluster: Electrical Measurement (server), little-endian */ \ \ - /* 11255 - measurement type, */ \ + /* 11267 - measurement type, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 11259 - total active power, */ \ + /* 11271 - total active power, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 2, Cluster: On/Off (server), little-endian */ \ \ - /* 11263 - FeatureMap, */ \ + /* 11275 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ } #endif // BIGENDIAN_CPU -#define GENERATED_DEFAULTS_COUNT (140) +#define GENERATED_DEFAULTS_COUNT (142) #define ZAP_TYPE(type) ZCL_##type##_ATTRIBUTE_TYPE #define ZAP_LONG_DEFAULTS_INDEX(index) \ @@ -2103,7 +2115,7 @@ #define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask // This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 413 +#define GENERATED_ATTRIBUTE_COUNT 415 #define GENERATED_ATTRIBUTES \ { \ \ @@ -2626,12 +2638,14 @@ ZAP_LONG_DEFAULTS_INDEX(9240) }, /* long_octet_string */ \ { 0x001E, ZAP_TYPE(CHAR_STRING), 11, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(10242) }, /* char_string */ \ { 0x001F, ZAP_TYPE(LONG_CHAR_STRING), 1002, ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_LONG_DEFAULTS_INDEX(10253) }, /* long_char_string */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ + ZAP_LONG_DEFAULTS_INDEX(10253) }, /* long_char_string */ \ + { 0x0020, ZAP_TYPE(EPOCH_US), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(11255) }, /* epoch_us */ \ + { 0x0021, ZAP_TYPE(EPOCH_S), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(11263) }, /* epoch_s */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Electrical Measurement (server) */ \ - { 0x0000, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(11255) }, /* measurement type */ \ - { 0x0304, ZAP_TYPE(INT32S), 4, 0, ZAP_LONG_DEFAULTS_INDEX(11259) }, /* total active power */ \ + { 0x0000, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(11267) }, /* measurement type */ \ + { 0x0304, ZAP_TYPE(INT32S), 4, 0, ZAP_LONG_DEFAULTS_INDEX(11271) }, /* total active power */ \ { 0x0505, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0xffff) }, /* rms voltage */ \ { 0x0506, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* rms voltage min */ \ { 0x0507, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* rms voltage max */ \ @@ -2652,7 +2666,7 @@ { 0x4001, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* OnTime */ \ { 0x4002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* OffWaitTime */ \ { 0x4003, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* StartUpOnOff */ \ - { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(11263) }, /* FeatureMap */ \ + { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(11275) }, /* FeatureMap */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(2) }, /* ClusterRevision */ \ \ /* Endpoint: 2, Cluster: Occupancy Sensing (server) */ \ @@ -2917,22 +2931,22 @@ 0x050E, ZAP_ATTRIBUTE_INDEX(365), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Account Login (server) */ \ { \ - 0x050F, ZAP_ATTRIBUTE_INDEX(366), 23, 2595, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050F, ZAP_ATTRIBUTE_INDEX(366), 25, 2607, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Test Cluster (server) */ \ { \ - 0x0B04, ZAP_ATTRIBUTE_INDEX(389), 12, 28, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0B04, ZAP_ATTRIBUTE_INDEX(391), 12, 28, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Electrical Measurement (server) */ \ { \ - 0xF000, ZAP_ATTRIBUTE_INDEX(401), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0xF000, ZAP_ATTRIBUTE_INDEX(403), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Binding (server) */ \ { 0x0006, \ - ZAP_ATTRIBUTE_INDEX(402), \ + ZAP_ATTRIBUTE_INDEX(404), \ 7, \ 13, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayOnOffServer }, /* Endpoint: 2, Cluster: On/Off (server) */ \ { 0x0406, \ - ZAP_ATTRIBUTE_INDEX(409), \ + ZAP_ATTRIBUTE_INDEX(411), \ 4, \ 5, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ @@ -2944,7 +2958,7 @@ // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 17, 4329 }, { ZAP_CLUSTER_INDEX(17), 39, 7368 }, { ZAP_CLUSTER_INDEX(56), 2, 18 }, \ + { ZAP_CLUSTER_INDEX(0), 17, 4329 }, { ZAP_CLUSTER_INDEX(17), 39, 7380 }, { ZAP_CLUSTER_INDEX(56), 2, 18 }, \ } // Largest attribute size is needed for various buffers @@ -2954,7 +2968,7 @@ #define ATTRIBUTE_SINGLETONS_SIZE (1517) // Total size of attribute storage -#define ATTRIBUTE_MAX_SIZE (11715) +#define ATTRIBUTE_MAX_SIZE (11727) // Number of fixed endpoints #define FIXED_ENDPOINT_COUNT (3) diff --git a/zzz_generated/app-common/app-common/zap-generated/attribute-id.h b/zzz_generated/app-common/app-common/zap-generated/attribute-id.h index 14735a96a522ff..0a1ecd7e7a2eab 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attribute-id.h +++ b/zzz_generated/app-common/app-common/zap-generated/attribute-id.h @@ -1326,6 +1326,8 @@ #define ZCL_LONG_OCTET_STRING_ATTRIBUTE_ID (0x001D) #define ZCL_CHAR_STRING_ATTRIBUTE_ID (0x001E) #define ZCL_LONG_CHAR_STRING_ATTRIBUTE_ID (0x001F) +#define ZCL_EPOCH_US_ATTRIBUTE_ID (0x0020) +#define ZCL_EPOCH_S_ATTRIBUTE_ID (0x0021) #define ZCL_UNSUPPORTED_ATTRIBUTE_ID (0x00FF) // Attribute ids for cluster: Messaging diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp index 81fe8c16375505..8bc5f0033dc3da 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp @@ -6789,6 +6789,22 @@ EmberAfStatus SetEnum16(chip::EndpointId endpoint, uint16_t enum16) { return emberAfWriteServerAttribute(endpoint, TestCluster::Id, Ids::Enum16, (uint8_t *) &enum16, ZCL_ENUM16_ATTRIBUTE_TYPE); } +EmberAfStatus GetEpochUs(chip::EndpointId endpoint, uint64_t * epochUs) +{ + return emberAfReadServerAttribute(endpoint, TestCluster::Id, Ids::EpochUs, (uint8_t *) epochUs, sizeof(*epochUs)); +} +EmberAfStatus SetEpochUs(chip::EndpointId endpoint, uint64_t epochUs) +{ + return emberAfWriteServerAttribute(endpoint, TestCluster::Id, Ids::EpochUs, (uint8_t *) &epochUs, ZCL_EPOCH_US_ATTRIBUTE_TYPE); +} +EmberAfStatus GetEpochS(chip::EndpointId endpoint, uint32_t * epochS) +{ + return emberAfReadServerAttribute(endpoint, TestCluster::Id, Ids::EpochS, (uint8_t *) epochS, sizeof(*epochS)); +} +EmberAfStatus SetEpochS(chip::EndpointId endpoint, uint32_t epochS) +{ + return emberAfWriteServerAttribute(endpoint, TestCluster::Id, Ids::EpochS, (uint8_t *) &epochS, ZCL_EPOCH_S_ATTRIBUTE_TYPE); +} EmberAfStatus GetUnsupported(chip::EndpointId endpoint, bool * unsupported) { return emberAfReadServerAttribute(endpoint, TestCluster::Id, Ids::Unsupported, (uint8_t *) unsupported, sizeof(*unsupported)); diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h index 5a7f531e40bed8..bceed74c654893 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h @@ -1867,6 +1867,10 @@ EmberAfStatus GetEnum8(chip::EndpointId endpoint, uint8_t * enum8); // enum8 EmberAfStatus SetEnum8(chip::EndpointId endpoint, uint8_t enum8); EmberAfStatus GetEnum16(chip::EndpointId endpoint, uint16_t * enum16); // enum16 EmberAfStatus SetEnum16(chip::EndpointId endpoint, uint16_t enum16); +EmberAfStatus GetEpochUs(chip::EndpointId endpoint, uint64_t * epochUs); // epoch_us +EmberAfStatus SetEpochUs(chip::EndpointId endpoint, uint64_t epochUs); +EmberAfStatus GetEpochS(chip::EndpointId endpoint, uint32_t * epochS); // epoch_s +EmberAfStatus SetEpochS(chip::EndpointId endpoint, uint32_t epochS); EmberAfStatus GetUnsupported(chip::EndpointId endpoint, bool * unsupported); // boolean EmberAfStatus SetUnsupported(chip::EndpointId endpoint, bool unsupported); } // namespace Attributes diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h b/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h index 8da302c4775737..4b52d043b1bec5 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h @@ -1370,6 +1370,8 @@ static constexpr AttributeId ListStructOctetString = 0x0000001C; static constexpr AttributeId LongOctetString = 0x0000001D; static constexpr AttributeId CharString = 0x0000001E; static constexpr AttributeId LongCharString = 0x0000001F; +static constexpr AttributeId EpochUs = 0x00000020; +static constexpr AttributeId EpochS = 0x00000021; static constexpr AttributeId Unsupported = 0x000000FF; } // namespace Ids } // namespace Attributes diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index 6d543428f9bce0..fd1f896fcc44f3 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -18091,6 +18091,8 @@ class ReadTemperatureMeasurementClusterRevision : public ModelCommand | * LongOctetString | 0x001D | | * CharString | 0x001E | | * LongCharString | 0x001F | +| * EpochUs | 0x0020 | +| * EpochS | 0x0021 | | * Unsupported | 0x00FF | | * ClusterRevision | 0xFFFD | \*----------------------------------------------------------------------------*/ @@ -19658,6 +19660,140 @@ class WriteTestClusterLongCharString : public ModelCommand char * mValue; }; +/* + * Attribute EpochUs + */ +class ReadTestClusterEpochUs : public ModelCommand +{ +public: + ReadTestClusterEpochUs() : ModelCommand("read") + { + AddArgument("attr-name", "epoch-us"); + ModelCommand::AddArguments(); + } + + ~ReadTestClusterEpochUs() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu8, endpointId); + + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadAttributeEpochUs(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnInt64uAttributeResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); +}; + +class WriteTestClusterEpochUs : public ModelCommand +{ +public: + WriteTestClusterEpochUs() : ModelCommand("write") + { + AddArgument("attr-name", "epoch-us"); + AddArgument("attr-value", 0, UINT64_MAX, &mValue); + ModelCommand::AddArguments(); + } + + ~WriteTestClusterEpochUs() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x01) on endpoint %" PRIu8, endpointId); + + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, endpointId); + return cluster.WriteAttributeEpochUs(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnDefaultSuccessResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); + uint64_t mValue; +}; + +/* + * Attribute EpochS + */ +class ReadTestClusterEpochS : public ModelCommand +{ +public: + ReadTestClusterEpochS() : ModelCommand("read") + { + AddArgument("attr-name", "epoch-s"); + ModelCommand::AddArguments(); + } + + ~ReadTestClusterEpochS() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu8, endpointId); + + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadAttributeEpochS(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnInt32uAttributeResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); +}; + +class WriteTestClusterEpochS : public ModelCommand +{ +public: + WriteTestClusterEpochS() : ModelCommand("write") + { + AddArgument("attr-name", "epoch-s"); + AddArgument("attr-value", 0, UINT32_MAX, &mValue); + ModelCommand::AddArguments(); + } + + ~WriteTestClusterEpochS() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x01) on endpoint %" PRIu8, endpointId); + + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, endpointId); + return cluster.WriteAttributeEpochS(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnDefaultSuccessResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); + uint32_t mValue; +}; + /* * Attribute Unsupported */ @@ -26061,6 +26197,10 @@ void registerClusterTestCluster(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // make_unique(), // make_unique(), // make_unique(), // diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index 2f2e48f927974e..0ce96ab5db08c6 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -3292,7 +3292,37 @@ class TestCluster : public TestCommand err = TestSendClusterTestClusterCommandWriteAttribute_110(); break; case 111: - err = TestSendClusterTestClusterCommandTest_111(); + err = TestSendClusterTestClusterCommandReadAttribute_111(); + break; + case 112: + err = TestSendClusterTestClusterCommandWriteAttribute_112(); + break; + case 113: + err = TestSendClusterTestClusterCommandReadAttribute_113(); + break; + case 114: + err = TestSendClusterTestClusterCommandReadAttribute_114(); + break; + case 115: + err = TestSendClusterTestClusterCommandWriteAttribute_115(); + break; + case 116: + err = TestSendClusterTestClusterCommandReadAttribute_116(); + break; + case 117: + err = TestSendClusterTestClusterCommandWriteAttribute_117(); + break; + case 118: + err = TestSendClusterTestClusterCommandReadAttribute_118(); + break; + case 119: + err = TestSendClusterTestClusterCommandReadAttribute_119(); + break; + case 120: + err = TestSendClusterTestClusterCommandWriteAttribute_120(); + break; + case 121: + err = TestSendClusterTestClusterCommandTest_121(); break; } @@ -3305,7 +3335,7 @@ class TestCluster : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 112; + const uint16_t mTestCount = 122; // // Tests methods @@ -10062,8 +10092,8 @@ class TestCluster : public TestCommand runner->NextTest(); } - // Test Read attribute UNSUPPORTED - using SuccessCallback_109 = void (*)(void * context, bool unsupported); + // Test Read attribute EPOCH_US Default Value + using SuccessCallback_109 = void (*)(void * context, uint64_t epochUs); chip::Callback::Callback mOnSuccessCallback_109{ OnTestSendClusterTestClusterCommandReadAttribute_109_SuccessResponse, this }; @@ -10075,19 +10105,635 @@ class TestCluster : public TestCommand CHIP_ERROR TestSendClusterTestClusterCommandReadAttribute_109() { - ChipLogProgress(chipTool, "Test Cluster - Read attribute UNSUPPORTED: Sending command..."); + ChipLogProgress(chipTool, "Test Cluster - Read attribute EPOCH_US Default Value: Sending command..."); chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevice, 1); CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.ReadAttributeUnsupported(mOnSuccessCallback_109.Cancel(), mOnFailureCallback_109.Cancel()); + err = cluster.ReadAttributeEpochUs(mOnSuccessCallback_109.Cancel(), mOnFailureCallback_109.Cancel()); return err; } static void OnTestSendClusterTestClusterCommandReadAttribute_109_FailureResponse(void * context, uint8_t status) + { + ChipLogProgress(chipTool, "Test Cluster - Read attribute EPOCH_US Default Value: Failure Response"); + + TestCluster * runner = reinterpret_cast(context); + + if (runner->mIsFailureExpected_109 == false) + { + ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); + runner->SetCommandExitStatus(CHIP_ERROR_INTERNAL); + return; + } + + runner->NextTest(); + } + + static void OnTestSendClusterTestClusterCommandReadAttribute_109_SuccessResponse(void * context, uint64_t epochUs) + { + ChipLogProgress(chipTool, "Test Cluster - Read attribute EPOCH_US Default Value: Success Response"); + + TestCluster * runner = reinterpret_cast(context); + + if (runner->mIsFailureExpected_109 == true) + { + ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); + runner->SetCommandExitStatus(CHIP_ERROR_INTERNAL); + return; + } + + if (epochUs != 0ULL) + { + ChipLogError(chipTool, "Error: Value mismatch. Expected: '%s'", "0"); + runner->SetCommandExitStatus(CHIP_ERROR_INTERNAL); + return; + } + + runner->NextTest(); + } + + // Test Write attribute EPOCH_US Max Value + using SuccessCallback_110 = void (*)(void * context, uint64_t epochUs); + chip::Callback::Callback mOnSuccessCallback_110{ + OnTestSendClusterTestClusterCommandWriteAttribute_110_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_110{ + OnTestSendClusterTestClusterCommandWriteAttribute_110_FailureResponse, this + }; + + bool mIsFailureExpected_110 = 0; + + CHIP_ERROR TestSendClusterTestClusterCommandWriteAttribute_110() + { + ChipLogProgress(chipTool, "Test Cluster - Write attribute EPOCH_US Max Value: Sending command..."); + + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, 1); + + CHIP_ERROR err = CHIP_NO_ERROR; + + uint64_t epochUsArgument = 18446744073709551615ULL; + err = cluster.WriteAttributeEpochUs(mOnSuccessCallback_110.Cancel(), mOnFailureCallback_110.Cancel(), epochUsArgument); + + return err; + } + + static void OnTestSendClusterTestClusterCommandWriteAttribute_110_FailureResponse(void * context, uint8_t status) + { + ChipLogProgress(chipTool, "Test Cluster - Write attribute EPOCH_US Max Value: Failure Response"); + + TestCluster * runner = reinterpret_cast(context); + + if (runner->mIsFailureExpected_110 == false) + { + ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); + runner->SetCommandExitStatus(CHIP_ERROR_INTERNAL); + return; + } + + runner->NextTest(); + } + + static void OnTestSendClusterTestClusterCommandWriteAttribute_110_SuccessResponse(void * context, uint64_t epochUs) + { + ChipLogProgress(chipTool, "Test Cluster - Write attribute EPOCH_US Max Value: Success Response"); + + TestCluster * runner = reinterpret_cast(context); + + if (runner->mIsFailureExpected_110 == true) + { + ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); + runner->SetCommandExitStatus(CHIP_ERROR_INTERNAL); + return; + } + + runner->NextTest(); + } + + // Test Read attribute EPOCH_US Max Value + using SuccessCallback_111 = void (*)(void * context, uint64_t epochUs); + chip::Callback::Callback mOnSuccessCallback_111{ + OnTestSendClusterTestClusterCommandReadAttribute_111_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_111{ + OnTestSendClusterTestClusterCommandReadAttribute_111_FailureResponse, this + }; + + bool mIsFailureExpected_111 = 0; + + CHIP_ERROR TestSendClusterTestClusterCommandReadAttribute_111() + { + ChipLogProgress(chipTool, "Test Cluster - Read attribute EPOCH_US Max Value: Sending command..."); + + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, 1); + + CHIP_ERROR err = CHIP_NO_ERROR; + + err = cluster.ReadAttributeEpochUs(mOnSuccessCallback_111.Cancel(), mOnFailureCallback_111.Cancel()); + + return err; + } + + static void OnTestSendClusterTestClusterCommandReadAttribute_111_FailureResponse(void * context, uint8_t status) + { + ChipLogProgress(chipTool, "Test Cluster - Read attribute EPOCH_US Max Value: Failure Response"); + + TestCluster * runner = reinterpret_cast(context); + + if (runner->mIsFailureExpected_111 == false) + { + ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); + runner->SetCommandExitStatus(CHIP_ERROR_INTERNAL); + return; + } + + runner->NextTest(); + } + + static void OnTestSendClusterTestClusterCommandReadAttribute_111_SuccessResponse(void * context, uint64_t epochUs) + { + ChipLogProgress(chipTool, "Test Cluster - Read attribute EPOCH_US Max Value: Success Response"); + + TestCluster * runner = reinterpret_cast(context); + + if (runner->mIsFailureExpected_111 == true) + { + ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); + runner->SetCommandExitStatus(CHIP_ERROR_INTERNAL); + return; + } + + if (epochUs != 18446744073709551615ULL) + { + ChipLogError(chipTool, "Error: Value mismatch. Expected: '%s'", "18446744073709551615"); + runner->SetCommandExitStatus(CHIP_ERROR_INTERNAL); + return; + } + + runner->NextTest(); + } + + // Test Write attribute EPOCH_US Min Value + using SuccessCallback_112 = void (*)(void * context, uint64_t epochUs); + chip::Callback::Callback mOnSuccessCallback_112{ + OnTestSendClusterTestClusterCommandWriteAttribute_112_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_112{ + OnTestSendClusterTestClusterCommandWriteAttribute_112_FailureResponse, this + }; + + bool mIsFailureExpected_112 = 0; + + CHIP_ERROR TestSendClusterTestClusterCommandWriteAttribute_112() + { + ChipLogProgress(chipTool, "Test Cluster - Write attribute EPOCH_US Min Value: Sending command..."); + + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, 1); + + CHIP_ERROR err = CHIP_NO_ERROR; + + uint64_t epochUsArgument = 0ULL; + err = cluster.WriteAttributeEpochUs(mOnSuccessCallback_112.Cancel(), mOnFailureCallback_112.Cancel(), epochUsArgument); + + return err; + } + + static void OnTestSendClusterTestClusterCommandWriteAttribute_112_FailureResponse(void * context, uint8_t status) + { + ChipLogProgress(chipTool, "Test Cluster - Write attribute EPOCH_US Min Value: Failure Response"); + + TestCluster * runner = reinterpret_cast(context); + + if (runner->mIsFailureExpected_112 == false) + { + ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); + runner->SetCommandExitStatus(CHIP_ERROR_INTERNAL); + return; + } + + runner->NextTest(); + } + + static void OnTestSendClusterTestClusterCommandWriteAttribute_112_SuccessResponse(void * context, uint64_t epochUs) + { + ChipLogProgress(chipTool, "Test Cluster - Write attribute EPOCH_US Min Value: Success Response"); + + TestCluster * runner = reinterpret_cast(context); + + if (runner->mIsFailureExpected_112 == true) + { + ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); + runner->SetCommandExitStatus(CHIP_ERROR_INTERNAL); + return; + } + + runner->NextTest(); + } + + // Test Read attribute EPOCH_US Min Value + using SuccessCallback_113 = void (*)(void * context, uint64_t epochUs); + chip::Callback::Callback mOnSuccessCallback_113{ + OnTestSendClusterTestClusterCommandReadAttribute_113_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_113{ + OnTestSendClusterTestClusterCommandReadAttribute_113_FailureResponse, this + }; + + bool mIsFailureExpected_113 = 0; + + CHIP_ERROR TestSendClusterTestClusterCommandReadAttribute_113() + { + ChipLogProgress(chipTool, "Test Cluster - Read attribute EPOCH_US Min Value: Sending command..."); + + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, 1); + + CHIP_ERROR err = CHIP_NO_ERROR; + + err = cluster.ReadAttributeEpochUs(mOnSuccessCallback_113.Cancel(), mOnFailureCallback_113.Cancel()); + + return err; + } + + static void OnTestSendClusterTestClusterCommandReadAttribute_113_FailureResponse(void * context, uint8_t status) + { + ChipLogProgress(chipTool, "Test Cluster - Read attribute EPOCH_US Min Value: Failure Response"); + + TestCluster * runner = reinterpret_cast(context); + + if (runner->mIsFailureExpected_113 == false) + { + ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); + runner->SetCommandExitStatus(CHIP_ERROR_INTERNAL); + return; + } + + runner->NextTest(); + } + + static void OnTestSendClusterTestClusterCommandReadAttribute_113_SuccessResponse(void * context, uint64_t epochUs) + { + ChipLogProgress(chipTool, "Test Cluster - Read attribute EPOCH_US Min Value: Success Response"); + + TestCluster * runner = reinterpret_cast(context); + + if (runner->mIsFailureExpected_113 == true) + { + ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); + runner->SetCommandExitStatus(CHIP_ERROR_INTERNAL); + return; + } + + if (epochUs != 0ULL) + { + ChipLogError(chipTool, "Error: Value mismatch. Expected: '%s'", "0"); + runner->SetCommandExitStatus(CHIP_ERROR_INTERNAL); + return; + } + + runner->NextTest(); + } + + // Test Read attribute EPOCH_S Default Value + using SuccessCallback_114 = void (*)(void * context, uint32_t epochS); + chip::Callback::Callback mOnSuccessCallback_114{ + OnTestSendClusterTestClusterCommandReadAttribute_114_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_114{ + OnTestSendClusterTestClusterCommandReadAttribute_114_FailureResponse, this + }; + + bool mIsFailureExpected_114 = 0; + + CHIP_ERROR TestSendClusterTestClusterCommandReadAttribute_114() + { + ChipLogProgress(chipTool, "Test Cluster - Read attribute EPOCH_S Default Value: Sending command..."); + + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, 1); + + CHIP_ERROR err = CHIP_NO_ERROR; + + err = cluster.ReadAttributeEpochS(mOnSuccessCallback_114.Cancel(), mOnFailureCallback_114.Cancel()); + + return err; + } + + static void OnTestSendClusterTestClusterCommandReadAttribute_114_FailureResponse(void * context, uint8_t status) + { + ChipLogProgress(chipTool, "Test Cluster - Read attribute EPOCH_S Default Value: Failure Response"); + + TestCluster * runner = reinterpret_cast(context); + + if (runner->mIsFailureExpected_114 == false) + { + ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); + runner->SetCommandExitStatus(CHIP_ERROR_INTERNAL); + return; + } + + runner->NextTest(); + } + + static void OnTestSendClusterTestClusterCommandReadAttribute_114_SuccessResponse(void * context, uint32_t epochS) + { + ChipLogProgress(chipTool, "Test Cluster - Read attribute EPOCH_S Default Value: Success Response"); + + TestCluster * runner = reinterpret_cast(context); + + if (runner->mIsFailureExpected_114 == true) + { + ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); + runner->SetCommandExitStatus(CHIP_ERROR_INTERNAL); + return; + } + + if (epochS != 0UL) + { + ChipLogError(chipTool, "Error: Value mismatch. Expected: '%s'", "0"); + runner->SetCommandExitStatus(CHIP_ERROR_INTERNAL); + return; + } + + runner->NextTest(); + } + + // Test Write attribute EPOCH_S Max Value + using SuccessCallback_115 = void (*)(void * context, uint32_t epochS); + chip::Callback::Callback mOnSuccessCallback_115{ + OnTestSendClusterTestClusterCommandWriteAttribute_115_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_115{ + OnTestSendClusterTestClusterCommandWriteAttribute_115_FailureResponse, this + }; + + bool mIsFailureExpected_115 = 0; + + CHIP_ERROR TestSendClusterTestClusterCommandWriteAttribute_115() + { + ChipLogProgress(chipTool, "Test Cluster - Write attribute EPOCH_S Max Value: Sending command..."); + + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, 1); + + CHIP_ERROR err = CHIP_NO_ERROR; + + uint32_t epochSArgument = 4294967295UL; + err = cluster.WriteAttributeEpochS(mOnSuccessCallback_115.Cancel(), mOnFailureCallback_115.Cancel(), epochSArgument); + + return err; + } + + static void OnTestSendClusterTestClusterCommandWriteAttribute_115_FailureResponse(void * context, uint8_t status) + { + ChipLogProgress(chipTool, "Test Cluster - Write attribute EPOCH_S Max Value: Failure Response"); + + TestCluster * runner = reinterpret_cast(context); + + if (runner->mIsFailureExpected_115 == false) + { + ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); + runner->SetCommandExitStatus(CHIP_ERROR_INTERNAL); + return; + } + + runner->NextTest(); + } + + static void OnTestSendClusterTestClusterCommandWriteAttribute_115_SuccessResponse(void * context, uint32_t epochS) + { + ChipLogProgress(chipTool, "Test Cluster - Write attribute EPOCH_S Max Value: Success Response"); + + TestCluster * runner = reinterpret_cast(context); + + if (runner->mIsFailureExpected_115 == true) + { + ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); + runner->SetCommandExitStatus(CHIP_ERROR_INTERNAL); + return; + } + + runner->NextTest(); + } + + // Test Read attribute EPOCH_S Max Value + using SuccessCallback_116 = void (*)(void * context, uint32_t epochS); + chip::Callback::Callback mOnSuccessCallback_116{ + OnTestSendClusterTestClusterCommandReadAttribute_116_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_116{ + OnTestSendClusterTestClusterCommandReadAttribute_116_FailureResponse, this + }; + + bool mIsFailureExpected_116 = 0; + + CHIP_ERROR TestSendClusterTestClusterCommandReadAttribute_116() + { + ChipLogProgress(chipTool, "Test Cluster - Read attribute EPOCH_S Max Value: Sending command..."); + + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, 1); + + CHIP_ERROR err = CHIP_NO_ERROR; + + err = cluster.ReadAttributeEpochS(mOnSuccessCallback_116.Cancel(), mOnFailureCallback_116.Cancel()); + + return err; + } + + static void OnTestSendClusterTestClusterCommandReadAttribute_116_FailureResponse(void * context, uint8_t status) + { + ChipLogProgress(chipTool, "Test Cluster - Read attribute EPOCH_S Max Value: Failure Response"); + + TestCluster * runner = reinterpret_cast(context); + + if (runner->mIsFailureExpected_116 == false) + { + ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); + runner->SetCommandExitStatus(CHIP_ERROR_INTERNAL); + return; + } + + runner->NextTest(); + } + + static void OnTestSendClusterTestClusterCommandReadAttribute_116_SuccessResponse(void * context, uint32_t epochS) + { + ChipLogProgress(chipTool, "Test Cluster - Read attribute EPOCH_S Max Value: Success Response"); + + TestCluster * runner = reinterpret_cast(context); + + if (runner->mIsFailureExpected_116 == true) + { + ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); + runner->SetCommandExitStatus(CHIP_ERROR_INTERNAL); + return; + } + + if (epochS != 4294967295UL) + { + ChipLogError(chipTool, "Error: Value mismatch. Expected: '%s'", "4294967295"); + runner->SetCommandExitStatus(CHIP_ERROR_INTERNAL); + return; + } + + runner->NextTest(); + } + + // Test Write attribute EPOCH_S Min Value + using SuccessCallback_117 = void (*)(void * context, uint32_t epochS); + chip::Callback::Callback mOnSuccessCallback_117{ + OnTestSendClusterTestClusterCommandWriteAttribute_117_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_117{ + OnTestSendClusterTestClusterCommandWriteAttribute_117_FailureResponse, this + }; + + bool mIsFailureExpected_117 = 0; + + CHIP_ERROR TestSendClusterTestClusterCommandWriteAttribute_117() + { + ChipLogProgress(chipTool, "Test Cluster - Write attribute EPOCH_S Min Value: Sending command..."); + + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, 1); + + CHIP_ERROR err = CHIP_NO_ERROR; + + uint32_t epochSArgument = 0UL; + err = cluster.WriteAttributeEpochS(mOnSuccessCallback_117.Cancel(), mOnFailureCallback_117.Cancel(), epochSArgument); + + return err; + } + + static void OnTestSendClusterTestClusterCommandWriteAttribute_117_FailureResponse(void * context, uint8_t status) + { + ChipLogProgress(chipTool, "Test Cluster - Write attribute EPOCH_S Min Value: Failure Response"); + + TestCluster * runner = reinterpret_cast(context); + + if (runner->mIsFailureExpected_117 == false) + { + ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); + runner->SetCommandExitStatus(CHIP_ERROR_INTERNAL); + return; + } + + runner->NextTest(); + } + + static void OnTestSendClusterTestClusterCommandWriteAttribute_117_SuccessResponse(void * context, uint32_t epochS) + { + ChipLogProgress(chipTool, "Test Cluster - Write attribute EPOCH_S Min Value: Success Response"); + + TestCluster * runner = reinterpret_cast(context); + + if (runner->mIsFailureExpected_117 == true) + { + ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); + runner->SetCommandExitStatus(CHIP_ERROR_INTERNAL); + return; + } + + runner->NextTest(); + } + + // Test Read attribute EPOCH_S Min Value + using SuccessCallback_118 = void (*)(void * context, uint32_t epochS); + chip::Callback::Callback mOnSuccessCallback_118{ + OnTestSendClusterTestClusterCommandReadAttribute_118_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_118{ + OnTestSendClusterTestClusterCommandReadAttribute_118_FailureResponse, this + }; + + bool mIsFailureExpected_118 = 0; + + CHIP_ERROR TestSendClusterTestClusterCommandReadAttribute_118() + { + ChipLogProgress(chipTool, "Test Cluster - Read attribute EPOCH_S Min Value: Sending command..."); + + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, 1); + + CHIP_ERROR err = CHIP_NO_ERROR; + + err = cluster.ReadAttributeEpochS(mOnSuccessCallback_118.Cancel(), mOnFailureCallback_118.Cancel()); + + return err; + } + + static void OnTestSendClusterTestClusterCommandReadAttribute_118_FailureResponse(void * context, uint8_t status) + { + ChipLogProgress(chipTool, "Test Cluster - Read attribute EPOCH_S Min Value: Failure Response"); + + TestCluster * runner = reinterpret_cast(context); + + if (runner->mIsFailureExpected_118 == false) + { + ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); + runner->SetCommandExitStatus(CHIP_ERROR_INTERNAL); + return; + } + + runner->NextTest(); + } + + static void OnTestSendClusterTestClusterCommandReadAttribute_118_SuccessResponse(void * context, uint32_t epochS) + { + ChipLogProgress(chipTool, "Test Cluster - Read attribute EPOCH_S Min Value: Success Response"); + + TestCluster * runner = reinterpret_cast(context); + + if (runner->mIsFailureExpected_118 == true) + { + ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); + runner->SetCommandExitStatus(CHIP_ERROR_INTERNAL); + return; + } + + if (epochS != 0UL) + { + ChipLogError(chipTool, "Error: Value mismatch. Expected: '%s'", "0"); + runner->SetCommandExitStatus(CHIP_ERROR_INTERNAL); + return; + } + + runner->NextTest(); + } + + // Test Read attribute UNSUPPORTED + using SuccessCallback_119 = void (*)(void * context, bool unsupported); + chip::Callback::Callback mOnSuccessCallback_119{ + OnTestSendClusterTestClusterCommandReadAttribute_119_SuccessResponse, this + }; + chip::Callback::Callback mOnFailureCallback_119{ + OnTestSendClusterTestClusterCommandReadAttribute_119_FailureResponse, this + }; + + bool mIsFailureExpected_119 = 0; + + CHIP_ERROR TestSendClusterTestClusterCommandReadAttribute_119() + { + ChipLogProgress(chipTool, "Test Cluster - Read attribute UNSUPPORTED: Sending command..."); + + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, 1); + + CHIP_ERROR err = CHIP_NO_ERROR; + + err = cluster.ReadAttributeUnsupported(mOnSuccessCallback_119.Cancel(), mOnFailureCallback_119.Cancel()); + + return err; + } + + static void OnTestSendClusterTestClusterCommandReadAttribute_119_FailureResponse(void * context, uint8_t status) { ChipLogProgress(chipTool, "Test Cluster - Read attribute UNSUPPORTED: Failure Response"); @@ -10099,7 +10745,7 @@ class TestCluster : public TestCommand return; } - if (runner->mIsFailureExpected_109 == false) + if (runner->mIsFailureExpected_119 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); runner->SetCommandExitStatus(CHIP_ERROR_INTERNAL); @@ -10109,13 +10755,13 @@ class TestCluster : public TestCommand runner->NextTest(); } - static void OnTestSendClusterTestClusterCommandReadAttribute_109_SuccessResponse(void * context, bool unsupported) + static void OnTestSendClusterTestClusterCommandReadAttribute_119_SuccessResponse(void * context, bool unsupported) { ChipLogProgress(chipTool, "Test Cluster - Read attribute UNSUPPORTED: Success Response"); TestCluster * runner = reinterpret_cast(context); - if (runner->mIsFailureExpected_109 == true) + if (runner->mIsFailureExpected_119 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); runner->SetCommandExitStatus(CHIP_ERROR_INTERNAL); @@ -10133,17 +10779,17 @@ class TestCluster : public TestCommand } // Test Writeattribute UNSUPPORTED - using SuccessCallback_110 = void (*)(void * context, bool unsupported); - chip::Callback::Callback mOnSuccessCallback_110{ - OnTestSendClusterTestClusterCommandWriteAttribute_110_SuccessResponse, this + using SuccessCallback_120 = void (*)(void * context, bool unsupported); + chip::Callback::Callback mOnSuccessCallback_120{ + OnTestSendClusterTestClusterCommandWriteAttribute_120_SuccessResponse, this }; - chip::Callback::Callback mOnFailureCallback_110{ - OnTestSendClusterTestClusterCommandWriteAttribute_110_FailureResponse, this + chip::Callback::Callback mOnFailureCallback_120{ + OnTestSendClusterTestClusterCommandWriteAttribute_120_FailureResponse, this }; - bool mIsFailureExpected_110 = 0; + bool mIsFailureExpected_120 = 0; - CHIP_ERROR TestSendClusterTestClusterCommandWriteAttribute_110() + CHIP_ERROR TestSendClusterTestClusterCommandWriteAttribute_120() { ChipLogProgress(chipTool, "Test Cluster - Writeattribute UNSUPPORTED: Sending command..."); @@ -10153,13 +10799,13 @@ class TestCluster : public TestCommand CHIP_ERROR err = CHIP_NO_ERROR; bool unsupportedArgument = 0; - err = cluster.WriteAttributeUnsupported(mOnSuccessCallback_110.Cancel(), mOnFailureCallback_110.Cancel(), + err = cluster.WriteAttributeUnsupported(mOnSuccessCallback_120.Cancel(), mOnFailureCallback_120.Cancel(), unsupportedArgument); return err; } - static void OnTestSendClusterTestClusterCommandWriteAttribute_110_FailureResponse(void * context, uint8_t status) + static void OnTestSendClusterTestClusterCommandWriteAttribute_120_FailureResponse(void * context, uint8_t status) { ChipLogProgress(chipTool, "Test Cluster - Writeattribute UNSUPPORTED: Failure Response"); @@ -10171,7 +10817,7 @@ class TestCluster : public TestCommand return; } - if (runner->mIsFailureExpected_110 == false) + if (runner->mIsFailureExpected_120 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); runner->SetCommandExitStatus(CHIP_ERROR_INTERNAL); @@ -10181,13 +10827,13 @@ class TestCluster : public TestCommand runner->NextTest(); } - static void OnTestSendClusterTestClusterCommandWriteAttribute_110_SuccessResponse(void * context, bool unsupported) + static void OnTestSendClusterTestClusterCommandWriteAttribute_120_SuccessResponse(void * context, bool unsupported) { ChipLogProgress(chipTool, "Test Cluster - Writeattribute UNSUPPORTED: Success Response"); TestCluster * runner = reinterpret_cast(context); - if (runner->mIsFailureExpected_110 == true) + if (runner->mIsFailureExpected_120 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); runner->SetCommandExitStatus(CHIP_ERROR_INTERNAL); @@ -10198,17 +10844,17 @@ class TestCluster : public TestCommand } // Test Send Test Command to unsupported endpoint - using SuccessCallback_111 = void (*)(void * context); - chip::Callback::Callback mOnSuccessCallback_111{ - OnTestSendClusterTestClusterCommandTest_111_SuccessResponse, this + using SuccessCallback_121 = void (*)(void * context); + chip::Callback::Callback mOnSuccessCallback_121{ + OnTestSendClusterTestClusterCommandTest_121_SuccessResponse, this }; - chip::Callback::Callback mOnFailureCallback_111{ - OnTestSendClusterTestClusterCommandTest_111_FailureResponse, this + chip::Callback::Callback mOnFailureCallback_121{ + OnTestSendClusterTestClusterCommandTest_121_FailureResponse, this }; - bool mIsFailureExpected_111 = 1; + bool mIsFailureExpected_121 = 1; - CHIP_ERROR TestSendClusterTestClusterCommandTest_111() + CHIP_ERROR TestSendClusterTestClusterCommandTest_121() { ChipLogProgress(chipTool, "Test Cluster - Send Test Command to unsupported endpoint: Sending command..."); @@ -10217,18 +10863,18 @@ class TestCluster : public TestCommand CHIP_ERROR err = CHIP_NO_ERROR; - err = cluster.Test(mOnSuccessCallback_111.Cancel(), mOnFailureCallback_111.Cancel()); + err = cluster.Test(mOnSuccessCallback_121.Cancel(), mOnFailureCallback_121.Cancel()); return err; } - static void OnTestSendClusterTestClusterCommandTest_111_FailureResponse(void * context, uint8_t status) + static void OnTestSendClusterTestClusterCommandTest_121_FailureResponse(void * context, uint8_t status) { ChipLogProgress(chipTool, "Test Cluster - Send Test Command to unsupported endpoint: Failure Response"); TestCluster * runner = reinterpret_cast(context); - if (runner->mIsFailureExpected_111 == false) + if (runner->mIsFailureExpected_121 == false) { ChipLogError(chipTool, "Error: The test was expecting a success callback. Got failure callback"); runner->SetCommandExitStatus(CHIP_ERROR_INTERNAL); @@ -10238,13 +10884,13 @@ class TestCluster : public TestCommand runner->NextTest(); } - static void OnTestSendClusterTestClusterCommandTest_111_SuccessResponse(void * context) + static void OnTestSendClusterTestClusterCommandTest_121_SuccessResponse(void * context) { ChipLogProgress(chipTool, "Test Cluster - Send Test Command to unsupported endpoint: Success Response"); TestCluster * runner = reinterpret_cast(context); - if (runner->mIsFailureExpected_111 == true) + if (runner->mIsFailureExpected_121 == true) { ChipLogError(chipTool, "Error: The test was expecting a failure callback. Got success callback"); runner->SetCommandExitStatus(CHIP_ERROR_INTERNAL); diff --git a/zzz_generated/controller-clusters/zap-generated/CHIPClusters.cpp b/zzz_generated/controller-clusters/zap-generated/CHIPClusters.cpp index dd4d2ed4bfe6dd..8a92aadb7ea304 100644 --- a/zzz_generated/controller-clusters/zap-generated/CHIPClusters.cpp +++ b/zzz_generated/controller-clusters/zap-generated/CHIPClusters.cpp @@ -10831,6 +10831,64 @@ CHIP_ERROR TestClusterCluster::WriteAttributeLongCharString(Callback::Cancelable return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); } +CHIP_ERROR TestClusterCluster::ReadAttributeEpochUs(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + app::AttributePathParams attributePath; + attributePath.mEndpointId = mEndpoint; + attributePath.mClusterId = mClusterId; + attributePath.mFieldId = 0x00000020; + attributePath.mFlags.Set(app::AttributePathParams::Flags::kFieldIdValid); + return mDevice->SendReadAttributeRequest(attributePath, onSuccessCallback, onFailureCallback, + BasicAttributeFilter); +} + +CHIP_ERROR TestClusterCluster::WriteAttributeEpochUs(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint64_t value) +{ + app::WriteClientHandle handle; + chip::app::AttributePathParams attributePath; + attributePath.mNodeId = mDevice->GetDeviceId(); + attributePath.mEndpointId = mEndpoint; + attributePath.mClusterId = mClusterId; + attributePath.mFieldId = 0x00000020; + attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); + + ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); + ReturnErrorOnFailure(handle.EncodeScalarAttributeWritePayload(attributePath, value)); + + return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::ReadAttributeEpochS(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + app::AttributePathParams attributePath; + attributePath.mEndpointId = mEndpoint; + attributePath.mClusterId = mClusterId; + attributePath.mFieldId = 0x00000021; + attributePath.mFlags.Set(app::AttributePathParams::Flags::kFieldIdValid); + return mDevice->SendReadAttributeRequest(attributePath, onSuccessCallback, onFailureCallback, + BasicAttributeFilter); +} + +CHIP_ERROR TestClusterCluster::WriteAttributeEpochS(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint32_t value) +{ + app::WriteClientHandle handle; + chip::app::AttributePathParams attributePath; + attributePath.mNodeId = mDevice->GetDeviceId(); + attributePath.mEndpointId = mEndpoint; + attributePath.mClusterId = mClusterId; + attributePath.mFieldId = 0x00000021; + attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); + + ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle)); + ReturnErrorOnFailure(handle.EncodeScalarAttributeWritePayload(attributePath, value)); + + return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); +} + CHIP_ERROR TestClusterCluster::ReadAttributeUnsupported(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) { diff --git a/zzz_generated/controller-clusters/zap-generated/CHIPClusters.h b/zzz_generated/controller-clusters/zap-generated/CHIPClusters.h index 8e6e8b6aa63113..99e18c696da0cc 100644 --- a/zzz_generated/controller-clusters/zap-generated/CHIPClusters.h +++ b/zzz_generated/controller-clusters/zap-generated/CHIPClusters.h @@ -1243,6 +1243,8 @@ class DLL_EXPORT TestClusterCluster : public ClusterBase CHIP_ERROR ReadAttributeLongOctetString(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); CHIP_ERROR ReadAttributeCharString(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); CHIP_ERROR ReadAttributeLongCharString(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeEpochUs(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeEpochS(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); CHIP_ERROR ReadAttributeUnsupported(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); CHIP_ERROR ReadAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); CHIP_ERROR WriteAttributeBoolean(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, @@ -1283,6 +1285,10 @@ class DLL_EXPORT TestClusterCluster : public ClusterBase chip::ByteSpan value); CHIP_ERROR WriteAttributeLongCharString(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, chip::ByteSpan value); + CHIP_ERROR WriteAttributeEpochUs(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint64_t value); + CHIP_ERROR WriteAttributeEpochS(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint32_t value); CHIP_ERROR WriteAttributeUnsupported(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, bool value);