New unit testing cluster commands to support testing batch commands corner cases (#31138)
* New unit testing cluster commands for batch testing
* Restyled by whitespace
* Restyled by clang-format
* Address PR comments
* Restyled by clang-format
* Fixes for CI
* Restyled by prettier-yaml
* Fix Darwin codegen for adding new commands to UnitTesting.
1) Add missing isSupported check that was causing us to generate an
implementation that did not have a corresponding declaration (which had the
check).
2) Add missing isForCommandPayload to existing isSupported check, so
implementation and declaration are doing the same check.
3) Mark newly-added things as provisional.
* Rerun zap regen
---------
Co-authored-by: Restyled.io <commits@restyled.io>
Co-authored-by: Boris Zbarsky <bzbarsky@apple.com>
diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter
index c09d305..b17ab91 100644
--- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter
+++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter
@@ -6198,6 +6198,10 @@
NestedStructList arg1[] = 0;
}
+ response struct TestBatchHelperResponse = 12 {
+ octet_string<800> buffer = 0;
+ }
+
request struct TestListInt8UReverseRequestRequest {
int8u arg1[] = 0;
}
@@ -6244,6 +6248,18 @@
int8u arg1 = 0;
}
+ request struct TestBatchHelperRequestRequest {
+ int16u sleepBeforeResponseTimeMs = 0;
+ int16u sizeOfResponseBuffer = 1;
+ int8u fillCharacter = 2;
+ }
+
+ request struct TestSecondBatchHelperRequestRequest {
+ int16u sleepBeforeResponseTimeMs = 0;
+ int16u sizeOfResponseBuffer = 1;
+ int8u fillCharacter = 2;
+ }
+
/** Simple command without any parameters and without a specific response */
command Test(): DefaultSuccess = 0;
/** Simple command without any parameters and without a specific response not handled by the server */
@@ -6309,6 +6325,10 @@
command TestEmitTestEventRequest(TestEmitTestEventRequestRequest): TestEmitTestEventResponse = 20;
/** Command that takes identical arguments to the fields of the TestFabricScopedEvent and logs the TestFabricScopedEvent to the buffer. Command returns an event ID as the response. */
command TestEmitTestFabricScopedEventRequest(TestEmitTestFabricScopedEventRequestRequest): TestEmitTestFabricScopedEventResponse = 21;
+ /** Command that responds after sleepBeforeResponseTimeMs with an octet_string the size requested with fillCharacter. */
+ command TestBatchHelperRequest(TestBatchHelperRequestRequest): TestBatchHelperResponse = 22;
+ /** Second command that responds after sleepBeforeResponseTimeMs with an octet_string the size requested with fillCharacter. */
+ command TestSecondBatchHelperRequest(TestSecondBatchHelperRequestRequest): TestBatchHelperResponse = 23;
}
/** The Fault Injection Cluster provide a means for a test harness to configure faults(for example triggering a fault in the system). */
@@ -8012,6 +8032,8 @@
handle command TestSimpleOptionalArgumentRequest;
handle command TestEmitTestEventRequest;
handle command TestEmitTestFabricScopedEventRequest;
+ handle command TestBatchHelperRequest;
+ handle command TestSecondBatchHelperRequest;
}
}
endpoint 2 {
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 8f1d733..a5d0627 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
@@ -19,17 +19,17 @@
"package": [
{
"pathRelativity": "relativeToZap",
+ "path": "../../../src/app/zap-templates/app-templates.json",
+ "type": "gen-templates-json",
+ "version": "chip-v1"
+ },
+ {
+ "pathRelativity": "relativeToZap",
"path": "../../../src/app/zap-templates/zcl/zcl-with-test-extensions.json",
"type": "zcl-properties",
"category": "matter",
"version": 1,
"description": "Matter SDK ZCL data with some extensions"
- },
- {
- "pathRelativity": "relativeToZap",
- "path": "../../../src/app/zap-templates/app-templates.json",
- "type": "gen-templates-json",
- "version": "chip-v1"
}
],
"endpointTypes": [
@@ -19318,6 +19318,22 @@
"source": "client",
"isIncoming": 1,
"isEnabled": 1
+ },
+ {
+ "name": "TestBatchHelperRequest",
+ "code": 22,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ },
+ {
+ "name": "TestSecondBatchHelperRequest",
+ "code": 23,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
}
],
"attributes": [
diff --git a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter
index 42daa8d..601b3e8 100644
--- a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter
+++ b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter
@@ -5601,6 +5601,10 @@
NestedStructList arg1[] = 0;
}
+ response struct TestBatchHelperResponse = 12 {
+ octet_string<800> buffer = 0;
+ }
+
request struct TestListInt8UReverseRequestRequest {
int8u arg1[] = 0;
}
@@ -5647,6 +5651,18 @@
int8u arg1 = 0;
}
+ request struct TestBatchHelperRequestRequest {
+ int16u sleepBeforeResponseTimeMs = 0;
+ int16u sizeOfResponseBuffer = 1;
+ int8u fillCharacter = 2;
+ }
+
+ request struct TestSecondBatchHelperRequestRequest {
+ int16u sleepBeforeResponseTimeMs = 0;
+ int16u sizeOfResponseBuffer = 1;
+ int8u fillCharacter = 2;
+ }
+
/** Simple command without any parameters and without a specific response */
command Test(): DefaultSuccess = 0;
/** Simple command without any parameters and without a specific response not handled by the server */
@@ -5712,6 +5728,10 @@
command TestEmitTestEventRequest(TestEmitTestEventRequestRequest): TestEmitTestEventResponse = 20;
/** Command that takes identical arguments to the fields of the TestFabricScopedEvent and logs the TestFabricScopedEvent to the buffer. Command returns an event ID as the response. */
command TestEmitTestFabricScopedEventRequest(TestEmitTestFabricScopedEventRequestRequest): TestEmitTestFabricScopedEventResponse = 21;
+ /** Command that responds after sleepBeforeResponseTimeMs with an octet_string the size requested with fillCharacter. */
+ command TestBatchHelperRequest(TestBatchHelperRequestRequest): TestBatchHelperResponse = 22;
+ /** Second command that responds after sleepBeforeResponseTimeMs with an octet_string the size requested with fillCharacter. */
+ command TestSecondBatchHelperRequest(TestSecondBatchHelperRequestRequest): TestBatchHelperResponse = 23;
}
endpoint 0 {
diff --git a/src/app/clusters/test-cluster-server/test-cluster-server.cpp b/src/app/clusters/test-cluster-server/test-cluster-server.cpp
index 30d1fb4..de41c28 100644
--- a/src/app/clusters/test-cluster-server/test-cluster-server.cpp
+++ b/src/app/clusters/test-cluster-server/test-cluster-server.cpp
@@ -55,6 +55,9 @@
// The maximum length of the fabric sensitive integer list within the TestFabricScoped struct.
constexpr uint8_t kFabricSensitiveIntListLength = 8;
+// The maximum buffer size allowed in TestBatchHelperResponse
+constexpr uint16_t kTestBatchHelperResponseBufferMax = 800;
+
namespace {
class OctetStringData
@@ -103,6 +106,14 @@
CHIP_ERROR WriteListFabricScopedAttribute(const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder);
};
+struct AsyncBatchCommandsWorkData
+{
+ CommandHandler::Handle asyncCommandHandle;
+ ConcreteCommandPath commandPath = ConcreteCommandPath(0, 0, 0);
+ uint16_t sizeOfResponseBuffer;
+ uint8_t fillCharacter;
+};
+
TestAttrAccess gAttrAccess;
uint8_t gListUint8Data[kAttributeListLength];
size_t gListUint8DataLen = kAttributeListLength;
@@ -137,6 +148,36 @@
size_t gSimpleEnumCount = 0;
Structs::NullablesAndOptionalsStruct::Type gNullablesAndOptionalsStruct;
+void AsyncBatchCommandWork(AsyncBatchCommandsWorkData * asyncWorkData)
+{
+ auto commandHandleRef = std::move(asyncWorkData->asyncCommandHandle);
+ auto commandHandle = commandHandleRef.Get();
+ if (commandHandle == nullptr)
+ {
+ // Very weird that we are even in here, what set this to nullptr?
+ Platform::Delete(asyncWorkData);
+ return;
+ }
+
+ uint8_t buffer[kTestBatchHelperResponseBufferMax];
+ memset(buffer, asyncWorkData->fillCharacter, asyncWorkData->sizeOfResponseBuffer);
+ Commands::TestBatchHelperResponse::Type response;
+ response.buffer = ByteSpan(buffer, asyncWorkData->sizeOfResponseBuffer);
+ commandHandle->AddResponse(asyncWorkData->commandPath, response);
+ Platform::Delete(asyncWorkData);
+}
+
+static void timerCallback(System::Layer *, void * callbackContext)
+{
+ AsyncBatchCommandWork(reinterpret_cast<AsyncBatchCommandsWorkData *>(callbackContext));
+}
+
+static void scheduleTimerCallbackMs(AsyncBatchCommandsWorkData * asyncWorkData, uint32_t delayMs)
+{
+ DeviceLayer::SystemLayer().StartTimer(chip::System::Clock::Milliseconds32(delayMs), timerCallback,
+ reinterpret_cast<void *>(asyncWorkData));
+}
+
CHIP_ERROR TestAttrAccess::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder)
{
switch (aPath.mAttributeId)
@@ -994,6 +1035,52 @@
return true;
}
+// TestBatchHelperRequest and TestSecondBatchHelperRequest do the same thing.
+// The reason there are two identical commands is because batch command requires
+// command paths in the same batch to be unique. These command allow for
+// client to control order of the response and control size of CommandDataIB
+// being sent back to help test some corner cases.
+bool TestBatchHelperCommon(CommandHandler * commandObj, const ConcreteCommandPath & commandPath, const uint16_t sleepTimeMs,
+ const uint16_t sizeOfResponseBuffer, const uint8_t fillCharacter)
+{
+ if (sizeOfResponseBuffer > kTestBatchHelperResponseBufferMax)
+ {
+ commandObj->AddStatus(commandPath, Protocols::InteractionModel::Status::ConstraintError);
+ return true;
+ }
+
+ AsyncBatchCommandsWorkData * asyncWorkData = Platform::New<AsyncBatchCommandsWorkData>();
+ if (asyncWorkData == nullptr)
+ {
+ commandObj->AddStatus(commandPath, Protocols::InteractionModel::Status::Busy);
+ return true;
+ }
+
+ asyncWorkData->asyncCommandHandle = commandObj;
+ asyncWorkData->commandPath = commandPath;
+ asyncWorkData->sizeOfResponseBuffer = sizeOfResponseBuffer;
+ asyncWorkData->fillCharacter = fillCharacter;
+
+ scheduleTimerCallbackMs(asyncWorkData, sleepTimeMs);
+
+ return true;
+}
+
+bool emberAfUnitTestingClusterTestBatchHelperRequestCallback(CommandHandler * commandObj, const ConcreteCommandPath & commandPath,
+ const Commands::TestBatchHelperRequest::DecodableType & commandData)
+{
+ return TestBatchHelperCommon(commandObj, commandPath, commandData.sleepBeforeResponseTimeMs, commandData.sizeOfResponseBuffer,
+ commandData.fillCharacter);
+}
+
+bool emberAfUnitTestingClusterTestSecondBatchHelperRequestCallback(
+ CommandHandler * commandObj, const ConcreteCommandPath & commandPath,
+ const Commands::TestSecondBatchHelperRequest::DecodableType & commandData)
+{
+ return TestBatchHelperCommon(commandObj, commandPath, commandData.sleepBeforeResponseTimeMs, commandData.sizeOfResponseBuffer,
+ commandData.fillCharacter);
+}
+
// -----------------------------------------------------------------------------
// Plugin initialization
diff --git a/src/app/tests/suites/TestCluster.yaml b/src/app/tests/suites/TestCluster.yaml
index e89a892..c6e8dc0 100644
--- a/src/app/tests/suites/TestCluster.yaml
+++ b/src/app/tests/suites/TestCluster.yaml
@@ -3855,13 +3855,34 @@
attribute: "AcceptedCommandList"
response:
value:
- [0, 1, 2, 4, 7, 8, 9, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21]
+ [
+ 0,
+ 1,
+ 2,
+ 4,
+ 7,
+ 8,
+ 9,
+ 10,
+ 11,
+ 12,
+ 13,
+ 14,
+ 15,
+ 17,
+ 18,
+ 19,
+ 20,
+ 21,
+ 22,
+ 23,
+ ]
- label: "read GeneratedCommandList attribute"
command: "readAttribute"
attribute: "GeneratedCommandList"
response:
- value: [0, 1, 4, 5, 6, 8, 9, 10, 11]
+ value: [0, 1, 4, 5, 6, 8, 9, 10, 11, 12]
# Struct-typed attribute
- label: "Write struct-typed attribute"
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 6e81b67..f043c49 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
@@ -440,6 +440,26 @@
<arg name="arg1" type="int8u"/>
</command>
+ <command source="client" code="0x16" name="TestBatchHelperRequest"
+ optional="true" response="TestBatchHelperResponse" apiMaturity="provisional">
+ <description>
+ Command that responds after sleepBeforeResponseTimeMs with an octet_string the size requested with fillCharacter.
+ </description>
+ <arg name="sleepBeforeResponseTimeMs" type="int16u"/>
+ <arg name="sizeOfResponseBuffer" min="0" max="800" type="int16u"/>
+ <arg name="fillCharacter" type="int8u"/>
+ </command>
+
+ <command source="client" code="0x17" name="TestSecondBatchHelperRequest"
+ optional="true" response="TestBatchHelperResponse" apiMaturity="provisional">
+ <description>
+ Second command that responds after sleepBeforeResponseTimeMs with an octet_string the size requested with fillCharacter.
+ </description>
+ <arg name="sleepBeforeResponseTimeMs" type="int16u"/>
+ <arg name="sizeOfResponseBuffer" min="0" max="800" type="int16u"/>
+ <arg name="fillCharacter" type="int8u"/>
+ </command>
+
<command source="server" code="0x00" name="TestSpecificResponse" optional="true" disableDefaultResponse="true">
<description>
Simple response for TestWithResponse with a simple return value
@@ -566,6 +586,13 @@
<arg name="value" type="int64u"/>
</command>
+ <command source="server" code="0x0C" name="TestBatchHelperResponse" optional="true" disableDefaultResponse="true" apiMaturity="provisional">
+ <description>
+ Response to TestBatchHelperRequest or TestSecondBatchHelperRequest. Buffer in response is filled as directed in the Request.
+ </description>
+ <arg name="buffer" type="octet_string" length="800"/>
+ </command>
+
<event code="0x0001" name="TestEvent" priority="info" side="server">
<description>Example test event</description>
<field id="1" name="arg1" type="int8u"/>
diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter
index 380270d..70cef4b 100644
--- a/src/controller/data_model/controller-clusters.matter
+++ b/src/controller/data_model/controller-clusters.matter
@@ -8693,6 +8693,10 @@
NestedStructList arg1[] = 0;
}
+ response struct TestBatchHelperResponse = 12 {
+ octet_string<800> buffer = 0;
+ }
+
request struct TestListInt8UReverseRequestRequest {
int8u arg1[] = 0;
}
@@ -8739,6 +8743,18 @@
int8u arg1 = 0;
}
+ request struct TestBatchHelperRequestRequest {
+ int16u sleepBeforeResponseTimeMs = 0;
+ int16u sizeOfResponseBuffer = 1;
+ int8u fillCharacter = 2;
+ }
+
+ request struct TestSecondBatchHelperRequestRequest {
+ int16u sleepBeforeResponseTimeMs = 0;
+ int16u sizeOfResponseBuffer = 1;
+ int8u fillCharacter = 2;
+ }
+
/** Simple command without any parameters and without a specific response */
command Test(): DefaultSuccess = 0;
/** Simple command without any parameters and without a specific response not handled by the server */
@@ -8804,6 +8820,10 @@
command TestEmitTestEventRequest(TestEmitTestEventRequestRequest): TestEmitTestEventResponse = 20;
/** Command that takes identical arguments to the fields of the TestFabricScopedEvent and logs the TestFabricScopedEvent to the buffer. Command returns an event ID as the response. */
command TestEmitTestFabricScopedEventRequest(TestEmitTestFabricScopedEventRequestRequest): TestEmitTestFabricScopedEventResponse = 21;
+ /** Command that responds after sleepBeforeResponseTimeMs with an octet_string the size requested with fillCharacter. */
+ command TestBatchHelperRequest(TestBatchHelperRequestRequest): TestBatchHelperResponse = 22;
+ /** Second command that responds after sleepBeforeResponseTimeMs with an octet_string the size requested with fillCharacter. */
+ command TestSecondBatchHelperRequest(TestSecondBatchHelperRequestRequest): TestBatchHelperResponse = 23;
}
/** The Fault Injection Cluster provide a means for a test harness to configure faults(for example triggering a fault in the system). */
diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java
index d9b1143..eb221bf 100644
--- a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java
+++ b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java
@@ -58464,6 +58464,82 @@
}}, commandId, value, timedInvokeTimeoutMs);
}
+ public void testBatchHelperRequest(TestBatchHelperResponseCallback callback, Integer sleepBeforeResponseTimeMs, Integer sizeOfResponseBuffer, Integer fillCharacter) {
+ testBatchHelperRequest(callback, sleepBeforeResponseTimeMs, sizeOfResponseBuffer, fillCharacter, 0);
+ }
+
+ public void testBatchHelperRequest(TestBatchHelperResponseCallback callback, Integer sleepBeforeResponseTimeMs, Integer sizeOfResponseBuffer, Integer fillCharacter, int timedInvokeTimeoutMs) {
+ final long commandId = 22L;
+
+ ArrayList<StructElement> elements = new ArrayList<>();
+ final long sleepBeforeResponseTimeMsFieldID = 0L;
+ BaseTLVType sleepBeforeResponseTimeMstlvValue = new UIntType(sleepBeforeResponseTimeMs);
+ elements.add(new StructElement(sleepBeforeResponseTimeMsFieldID, sleepBeforeResponseTimeMstlvValue));
+
+ final long sizeOfResponseBufferFieldID = 1L;
+ BaseTLVType sizeOfResponseBuffertlvValue = new UIntType(sizeOfResponseBuffer);
+ elements.add(new StructElement(sizeOfResponseBufferFieldID, sizeOfResponseBuffertlvValue));
+
+ final long fillCharacterFieldID = 2L;
+ BaseTLVType fillCharactertlvValue = new UIntType(fillCharacter);
+ elements.add(new StructElement(fillCharacterFieldID, fillCharactertlvValue));
+
+ StructType value = new StructType(elements);
+ invoke(new InvokeCallbackImpl(callback) {
+ @Override
+ public void onResponse(StructType invokeStructValue) {
+ final long bufferFieldID = 0L;
+ byte[] buffer = null;
+ for (StructElement element: invokeStructValue.value()) {
+ if (element.contextTagNum() == bufferFieldID) {
+ if (element.value(BaseTLVType.class).type() == TLVType.ByteArray) {
+ ByteArrayType castingValue = element.value(ByteArrayType.class);
+ buffer = castingValue.value(byte[].class);
+ }
+ }
+ }
+ callback.onSuccess(buffer);
+ }}, commandId, value, timedInvokeTimeoutMs);
+ }
+
+ public void testSecondBatchHelperRequest(TestBatchHelperResponseCallback callback, Integer sleepBeforeResponseTimeMs, Integer sizeOfResponseBuffer, Integer fillCharacter) {
+ testSecondBatchHelperRequest(callback, sleepBeforeResponseTimeMs, sizeOfResponseBuffer, fillCharacter, 0);
+ }
+
+ public void testSecondBatchHelperRequest(TestBatchHelperResponseCallback callback, Integer sleepBeforeResponseTimeMs, Integer sizeOfResponseBuffer, Integer fillCharacter, int timedInvokeTimeoutMs) {
+ final long commandId = 23L;
+
+ ArrayList<StructElement> elements = new ArrayList<>();
+ final long sleepBeforeResponseTimeMsFieldID = 0L;
+ BaseTLVType sleepBeforeResponseTimeMstlvValue = new UIntType(sleepBeforeResponseTimeMs);
+ elements.add(new StructElement(sleepBeforeResponseTimeMsFieldID, sleepBeforeResponseTimeMstlvValue));
+
+ final long sizeOfResponseBufferFieldID = 1L;
+ BaseTLVType sizeOfResponseBuffertlvValue = new UIntType(sizeOfResponseBuffer);
+ elements.add(new StructElement(sizeOfResponseBufferFieldID, sizeOfResponseBuffertlvValue));
+
+ final long fillCharacterFieldID = 2L;
+ BaseTLVType fillCharactertlvValue = new UIntType(fillCharacter);
+ elements.add(new StructElement(fillCharacterFieldID, fillCharactertlvValue));
+
+ StructType value = new StructType(elements);
+ invoke(new InvokeCallbackImpl(callback) {
+ @Override
+ public void onResponse(StructType invokeStructValue) {
+ final long bufferFieldID = 0L;
+ byte[] buffer = null;
+ for (StructElement element: invokeStructValue.value()) {
+ if (element.contextTagNum() == bufferFieldID) {
+ if (element.value(BaseTLVType.class).type() == TLVType.ByteArray) {
+ ByteArrayType castingValue = element.value(ByteArrayType.class);
+ buffer = castingValue.value(byte[].class);
+ }
+ }
+ }
+ callback.onSuccess(buffer);
+ }}, commandId, value, timedInvokeTimeoutMs);
+ }
+
public interface TestSpecificResponseCallback extends BaseClusterCallback {
void onSuccess(Integer returnValue);
}
@@ -58512,6 +58588,10 @@
void onSuccess(Long value);
}
+ public interface TestBatchHelperResponseCallback extends BaseClusterCallback {
+ void onSuccess(byte[] buffer);
+ }
+
public interface ListInt8uAttributeCallback extends BaseAttributeCallback {
void onSuccess(List<Integer> value);
}
diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java
index e432ede..77021a2 100644
--- a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java
+++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java
@@ -16053,7 +16053,9 @@
TimedInvokeRequest(18L),
TestSimpleOptionalArgumentRequest(19L),
TestEmitTestEventRequest(20L),
- TestEmitTestFabricScopedEventRequest(21L),;
+ TestEmitTestFabricScopedEventRequest(21L),
+ TestBatchHelperRequest(22L),
+ TestSecondBatchHelperRequest(23L),;
private final long id;
Command(long id) {
this.id = id;
@@ -16360,6 +16362,40 @@
}
throw new NoSuchFieldError();
}
+ }public enum TestBatchHelperRequestCommandField {SleepBeforeResponseTimeMs(0),SizeOfResponseBuffer(1),FillCharacter(2),;
+ private final int id;
+ TestBatchHelperRequestCommandField(int id) {
+ this.id = id;
+ }
+
+ public int getID() {
+ return id;
+ }
+ public static TestBatchHelperRequestCommandField value(int id) throws NoSuchFieldError {
+ for (TestBatchHelperRequestCommandField field : TestBatchHelperRequestCommandField.values()) {
+ if (field.getID() == id) {
+ return field;
+ }
+ }
+ throw new NoSuchFieldError();
+ }
+ }public enum TestSecondBatchHelperRequestCommandField {SleepBeforeResponseTimeMs(0),SizeOfResponseBuffer(1),FillCharacter(2),;
+ private final int id;
+ TestSecondBatchHelperRequestCommandField(int id) {
+ this.id = id;
+ }
+
+ public int getID() {
+ return id;
+ }
+ public static TestSecondBatchHelperRequestCommandField value(int id) throws NoSuchFieldError {
+ for (TestSecondBatchHelperRequestCommandField field : TestSecondBatchHelperRequestCommandField.values()) {
+ if (field.getID() == id) {
+ return field;
+ }
+ }
+ throw new NoSuchFieldError();
+ }
}@Override
public String getAttributeName(long id) throws NoSuchFieldError {
return Attribute.value(id).toString();
diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java
index 187400c..a0a0585 100644
--- a/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java
+++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java
@@ -18312,6 +18312,28 @@
callback.onFailure(error);
}
}
+
+ public static class DelegatedUnitTestingClusterTestBatchHelperResponseCallback implements ChipClusters.UnitTestingCluster.TestBatchHelperResponseCallback, DelegatedClusterCallback {
+ private ClusterCommandCallback callback;
+ @Override
+ public void setCallbackDelegate(ClusterCommandCallback callback) {
+ this.callback = callback;
+ }
+
+ @Override
+ public void onSuccess(byte[] buffer) {
+ Map<CommandResponseInfo, Object> responseValues = new LinkedHashMap<>();
+
+ CommandResponseInfo bufferResponseValue = new CommandResponseInfo("buffer", "byte[]");
+ responseValues.put(bufferResponseValue, buffer);
+ callback.onSuccess(responseValues);
+ }
+
+ @Override
+ public void onError(Exception error) {
+ callback.onFailure(error);
+ }
+ }
public static class DelegatedUnitTestingClusterListInt8uAttributeCallback implements ChipClusters.UnitTestingCluster.ListInt8uAttributeCallback, DelegatedClusterCallback {
private ClusterCommandCallback callback;
@Override
@@ -26190,6 +26212,66 @@
);
unitTestingClusterInteractionInfoMap.put("testEmitTestFabricScopedEventRequest", unitTestingtestEmitTestFabricScopedEventRequestInteractionInfo);
+ Map<String, CommandParameterInfo> unitTestingtestBatchHelperRequestCommandParams = new LinkedHashMap<String, CommandParameterInfo>();
+
+ CommandParameterInfo unitTestingtestBatchHelperRequestsleepBeforeResponseTimeMsCommandParameterInfo = new CommandParameterInfo("sleepBeforeResponseTimeMs", Integer.class, Integer.class);
+ unitTestingtestBatchHelperRequestCommandParams.put("sleepBeforeResponseTimeMs",unitTestingtestBatchHelperRequestsleepBeforeResponseTimeMsCommandParameterInfo);
+
+ CommandParameterInfo unitTestingtestBatchHelperRequestsizeOfResponseBufferCommandParameterInfo = new CommandParameterInfo("sizeOfResponseBuffer", Integer.class, Integer.class);
+ unitTestingtestBatchHelperRequestCommandParams.put("sizeOfResponseBuffer",unitTestingtestBatchHelperRequestsizeOfResponseBufferCommandParameterInfo);
+
+ CommandParameterInfo unitTestingtestBatchHelperRequestfillCharacterCommandParameterInfo = new CommandParameterInfo("fillCharacter", Integer.class, Integer.class);
+ unitTestingtestBatchHelperRequestCommandParams.put("fillCharacter",unitTestingtestBatchHelperRequestfillCharacterCommandParameterInfo);
+ InteractionInfo unitTestingtestBatchHelperRequestInteractionInfo = new InteractionInfo(
+ (cluster, callback, commandArguments) -> {
+ ((ChipClusters.UnitTestingCluster) cluster)
+ .testBatchHelperRequest((ChipClusters.UnitTestingCluster.TestBatchHelperResponseCallback) callback
+ , (Integer)
+ commandArguments.get("sleepBeforeResponseTimeMs")
+
+ , (Integer)
+ commandArguments.get("sizeOfResponseBuffer")
+
+ , (Integer)
+ commandArguments.get("fillCharacter")
+
+ );
+ },
+ () -> new DelegatedUnitTestingClusterTestBatchHelperResponseCallback(),
+ unitTestingtestBatchHelperRequestCommandParams
+ );
+ unitTestingClusterInteractionInfoMap.put("testBatchHelperRequest", unitTestingtestBatchHelperRequestInteractionInfo);
+
+ Map<String, CommandParameterInfo> unitTestingtestSecondBatchHelperRequestCommandParams = new LinkedHashMap<String, CommandParameterInfo>();
+
+ CommandParameterInfo unitTestingtestSecondBatchHelperRequestsleepBeforeResponseTimeMsCommandParameterInfo = new CommandParameterInfo("sleepBeforeResponseTimeMs", Integer.class, Integer.class);
+ unitTestingtestSecondBatchHelperRequestCommandParams.put("sleepBeforeResponseTimeMs",unitTestingtestSecondBatchHelperRequestsleepBeforeResponseTimeMsCommandParameterInfo);
+
+ CommandParameterInfo unitTestingtestSecondBatchHelperRequestsizeOfResponseBufferCommandParameterInfo = new CommandParameterInfo("sizeOfResponseBuffer", Integer.class, Integer.class);
+ unitTestingtestSecondBatchHelperRequestCommandParams.put("sizeOfResponseBuffer",unitTestingtestSecondBatchHelperRequestsizeOfResponseBufferCommandParameterInfo);
+
+ CommandParameterInfo unitTestingtestSecondBatchHelperRequestfillCharacterCommandParameterInfo = new CommandParameterInfo("fillCharacter", Integer.class, Integer.class);
+ unitTestingtestSecondBatchHelperRequestCommandParams.put("fillCharacter",unitTestingtestSecondBatchHelperRequestfillCharacterCommandParameterInfo);
+ InteractionInfo unitTestingtestSecondBatchHelperRequestInteractionInfo = new InteractionInfo(
+ (cluster, callback, commandArguments) -> {
+ ((ChipClusters.UnitTestingCluster) cluster)
+ .testSecondBatchHelperRequest((ChipClusters.UnitTestingCluster.TestBatchHelperResponseCallback) callback
+ , (Integer)
+ commandArguments.get("sleepBeforeResponseTimeMs")
+
+ , (Integer)
+ commandArguments.get("sizeOfResponseBuffer")
+
+ , (Integer)
+ commandArguments.get("fillCharacter")
+
+ );
+ },
+ () -> new DelegatedUnitTestingClusterTestBatchHelperResponseCallback(),
+ unitTestingtestSecondBatchHelperRequestCommandParams
+ );
+ unitTestingClusterInteractionInfoMap.put("testSecondBatchHelperRequest", unitTestingtestSecondBatchHelperRequestInteractionInfo);
+
commandMap.put("unitTesting", unitTestingClusterInteractionInfoMap);
Map<String, InteractionInfo> faultInjectionClusterInteractionInfoMap = new LinkedHashMap<>();
diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/UnitTestingCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/UnitTestingCluster.kt
index 94fe391..468d4e4 100644
--- a/src/controller/java/generated/java/matter/controller/cluster/clusters/UnitTestingCluster.kt
+++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/UnitTestingCluster.kt
@@ -119,6 +119,8 @@
class TestEmitTestFabricScopedEventResponse(val value: ULong)
+ class TestBatchHelperResponse(val buffer: ByteArray)
+
class ListInt8uAttribute(val value: List<UByte>)
sealed class ListInt8uAttributeSubscriptionState {
@@ -2217,6 +2219,122 @@
return TestEmitTestFabricScopedEventResponse(value_decoded)
}
+ suspend fun testBatchHelperRequest(
+ sleepBeforeResponseTimeMs: UShort,
+ sizeOfResponseBuffer: UShort,
+ fillCharacter: UByte,
+ timedInvokeTimeout: Duration? = null
+ ): TestBatchHelperResponse {
+ val commandId: UInt = 22u
+
+ val tlvWriter = TlvWriter()
+ tlvWriter.startStructure(AnonymousTag)
+
+ val TAG_SLEEP_BEFORE_RESPONSE_TIME_MS_REQ: Int = 0
+ tlvWriter.put(
+ ContextSpecificTag(TAG_SLEEP_BEFORE_RESPONSE_TIME_MS_REQ),
+ sleepBeforeResponseTimeMs
+ )
+
+ val TAG_SIZE_OF_RESPONSE_BUFFER_REQ: Int = 1
+ tlvWriter.put(ContextSpecificTag(TAG_SIZE_OF_RESPONSE_BUFFER_REQ), sizeOfResponseBuffer)
+
+ val TAG_FILL_CHARACTER_REQ: Int = 2
+ tlvWriter.put(ContextSpecificTag(TAG_FILL_CHARACTER_REQ), fillCharacter)
+ tlvWriter.endStructure()
+
+ val request: InvokeRequest =
+ InvokeRequest(
+ CommandPath(endpointId, clusterId = CLUSTER_ID, commandId),
+ tlvPayload = tlvWriter.getEncoded(),
+ timedRequest = timedInvokeTimeout
+ )
+
+ val response: InvokeResponse = controller.invoke(request)
+ logger.log(Level.FINE, "Invoke command succeeded: ${response}")
+
+ val tlvReader = TlvReader(response.payload)
+ tlvReader.enterStructure(AnonymousTag)
+ val TAG_BUFFER: Int = 0
+ var buffer_decoded: ByteArray? = null
+
+ while (!tlvReader.isEndOfContainer()) {
+ val tag = tlvReader.peekElement().tag
+
+ if (tag == ContextSpecificTag(TAG_BUFFER)) {
+ buffer_decoded = tlvReader.getByteArray(tag)
+ } else {
+ tlvReader.skipElement()
+ }
+ }
+
+ if (buffer_decoded == null) {
+ throw IllegalStateException("buffer not found in TLV")
+ }
+
+ tlvReader.exitContainer()
+
+ return TestBatchHelperResponse(buffer_decoded)
+ }
+
+ suspend fun testSecondBatchHelperRequest(
+ sleepBeforeResponseTimeMs: UShort,
+ sizeOfResponseBuffer: UShort,
+ fillCharacter: UByte,
+ timedInvokeTimeout: Duration? = null
+ ): TestBatchHelperResponse {
+ val commandId: UInt = 23u
+
+ val tlvWriter = TlvWriter()
+ tlvWriter.startStructure(AnonymousTag)
+
+ val TAG_SLEEP_BEFORE_RESPONSE_TIME_MS_REQ: Int = 0
+ tlvWriter.put(
+ ContextSpecificTag(TAG_SLEEP_BEFORE_RESPONSE_TIME_MS_REQ),
+ sleepBeforeResponseTimeMs
+ )
+
+ val TAG_SIZE_OF_RESPONSE_BUFFER_REQ: Int = 1
+ tlvWriter.put(ContextSpecificTag(TAG_SIZE_OF_RESPONSE_BUFFER_REQ), sizeOfResponseBuffer)
+
+ val TAG_FILL_CHARACTER_REQ: Int = 2
+ tlvWriter.put(ContextSpecificTag(TAG_FILL_CHARACTER_REQ), fillCharacter)
+ tlvWriter.endStructure()
+
+ val request: InvokeRequest =
+ InvokeRequest(
+ CommandPath(endpointId, clusterId = CLUSTER_ID, commandId),
+ tlvPayload = tlvWriter.getEncoded(),
+ timedRequest = timedInvokeTimeout
+ )
+
+ val response: InvokeResponse = controller.invoke(request)
+ logger.log(Level.FINE, "Invoke command succeeded: ${response}")
+
+ val tlvReader = TlvReader(response.payload)
+ tlvReader.enterStructure(AnonymousTag)
+ val TAG_BUFFER: Int = 0
+ var buffer_decoded: ByteArray? = null
+
+ while (!tlvReader.isEndOfContainer()) {
+ val tag = tlvReader.peekElement().tag
+
+ if (tag == ContextSpecificTag(TAG_BUFFER)) {
+ buffer_decoded = tlvReader.getByteArray(tag)
+ } else {
+ tlvReader.skipElement()
+ }
+ }
+
+ if (buffer_decoded == null) {
+ throw IllegalStateException("buffer not found in TLV")
+ }
+
+ tlvReader.exitContainer()
+
+ return TestBatchHelperResponse(buffer_decoded)
+ }
+
suspend fun readBooleanAttribute(): Boolean {
val ATTRIBUTE_ID: UInt = 0u
diff --git a/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp b/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp
index c8b5c50..8c3deac 100644
--- a/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp
+++ b/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp
@@ -8330,6 +8330,66 @@
env->CallVoidMethod(javaCallbackRef, javaMethod, value);
}
+CHIPUnitTestingClusterTestBatchHelperResponseCallback::CHIPUnitTestingClusterTestBatchHelperResponseCallback(jobject javaCallback) :
+ Callback::Callback<CHIPUnitTestingClusterTestBatchHelperResponseCallbackType>(CallbackFn, this)
+{
+ JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread();
+ if (env == nullptr)
+ {
+ ChipLogError(Zcl, "Could not create global reference for Java callback");
+ return;
+ }
+
+ javaCallbackRef = env->NewGlobalRef(javaCallback);
+ if (javaCallbackRef == nullptr)
+ {
+ ChipLogError(Zcl, "Could not create global reference for Java callback");
+ }
+}
+
+CHIPUnitTestingClusterTestBatchHelperResponseCallback::~CHIPUnitTestingClusterTestBatchHelperResponseCallback()
+{
+ JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread();
+ if (env == nullptr)
+ {
+ ChipLogError(Zcl, "Could not delete global reference for Java callback");
+ return;
+ }
+ env->DeleteGlobalRef(javaCallbackRef);
+};
+
+void CHIPUnitTestingClusterTestBatchHelperResponseCallback::CallbackFn(
+ void * context, const chip::app::Clusters::UnitTesting::Commands::TestBatchHelperResponse::DecodableType & dataResponse)
+{
+ chip::DeviceLayer::StackUnlock unlock;
+ CHIP_ERROR err = CHIP_NO_ERROR;
+ JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread();
+ jobject javaCallbackRef;
+ jmethodID javaMethod;
+
+ VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv"));
+
+ std::unique_ptr<CHIPUnitTestingClusterTestBatchHelperResponseCallback,
+ void (*)(CHIPUnitTestingClusterTestBatchHelperResponseCallback *)>
+ cppCallback(reinterpret_cast<CHIPUnitTestingClusterTestBatchHelperResponseCallback *>(context),
+ chip::Platform::Delete<CHIPUnitTestingClusterTestBatchHelperResponseCallback>);
+ VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback"));
+
+ javaCallbackRef = cppCallback->javaCallbackRef;
+ // Java callback is allowed to be null, exit early if this is the case.
+ VerifyOrReturn(javaCallbackRef != nullptr);
+
+ err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "([B)V", &javaMethod);
+ VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err)));
+
+ jobject buffer;
+ jbyteArray bufferByteArray = env->NewByteArray(static_cast<jsize>(dataResponse.buffer.size()));
+ env->SetByteArrayRegion(bufferByteArray, 0, static_cast<jsize>(dataResponse.buffer.size()),
+ reinterpret_cast<const jbyte *>(dataResponse.buffer.data()));
+ buffer = bufferByteArray;
+
+ env->CallVoidMethod(javaCallbackRef, javaMethod, buffer);
+}
CHIPSampleMeiClusterAddArgumentsResponseCallback::CHIPSampleMeiClusterAddArgumentsResponseCallback(jobject javaCallback) :
Callback::Callback<CHIPSampleMeiClusterAddArgumentsResponseCallbackType>(CallbackFn, this)
{
diff --git a/src/controller/java/zap-generated/CHIPInvokeCallbacks.h b/src/controller/java/zap-generated/CHIPInvokeCallbacks.h
index 23b691e..1a0c0dd 100644
--- a/src/controller/java/zap-generated/CHIPInvokeCallbacks.h
+++ b/src/controller/java/zap-generated/CHIPInvokeCallbacks.h
@@ -1126,6 +1126,21 @@
jobject javaCallbackRef;
};
+class CHIPUnitTestingClusterTestBatchHelperResponseCallback
+ : public Callback::Callback<CHIPUnitTestingClusterTestBatchHelperResponseCallbackType>
+{
+public:
+ CHIPUnitTestingClusterTestBatchHelperResponseCallback(jobject javaCallback);
+
+ ~CHIPUnitTestingClusterTestBatchHelperResponseCallback();
+
+ static void CallbackFn(void * context,
+ const chip::app::Clusters::UnitTesting::Commands::TestBatchHelperResponse::DecodableType & data);
+
+private:
+ jobject javaCallbackRef;
+};
+
class CHIPSampleMeiClusterAddArgumentsResponseCallback
: public Callback::Callback<CHIPSampleMeiClusterAddArgumentsResponseCallbackType>
{
diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py
index 57d6c97..59c67cb 100644
--- a/src/controller/python/chip/clusters/CHIPClusters.py
+++ b/src/controller/python/chip/clusters/CHIPClusters.py
@@ -13126,6 +13126,24 @@
"arg1": "int",
},
},
+ 0x00000016: {
+ "commandId": 0x00000016,
+ "commandName": "TestBatchHelperRequest",
+ "args": {
+ "sleepBeforeResponseTimeMs": "int",
+ "sizeOfResponseBuffer": "int",
+ "fillCharacter": "int",
+ },
+ },
+ 0x00000017: {
+ "commandId": 0x00000017,
+ "commandName": "TestSecondBatchHelperRequest",
+ "args": {
+ "sleepBeforeResponseTimeMs": "int",
+ "sizeOfResponseBuffer": "int",
+ "fillCharacter": "int",
+ },
+ },
},
"attributes": {
0x00000000: {
diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py
index c5874b2..ac7aeca 100644
--- a/src/controller/python/chip/clusters/Objects.py
+++ b/src/controller/python/chip/clusters/Objects.py
@@ -45542,6 +45542,22 @@
arg1: 'typing.List[UnitTesting.Structs.NestedStructList]' = field(default_factory=lambda: [])
@dataclass
+ class TestBatchHelperResponse(ClusterCommand):
+ cluster_id: typing.ClassVar[int] = 0xFFF1FC05
+ command_id: typing.ClassVar[int] = 0x0000000C
+ is_client: typing.ClassVar[bool] = False
+ response_type: typing.ClassVar[str] = None
+
+ @ChipUtility.classproperty
+ def descriptor(cls) -> ClusterObjectDescriptor:
+ return ClusterObjectDescriptor(
+ Fields=[
+ ClusterObjectFieldDescriptor(Label="buffer", Tag=0, Type=bytes),
+ ])
+
+ buffer: 'bytes' = b""
+
+ @dataclass
class TestListInt8UReverseRequest(ClusterCommand):
cluster_id: typing.ClassVar[int] = 0xFFF1FC05
command_id: typing.ClassVar[int] = 0x0000000D
@@ -45714,6 +45730,46 @@
arg1: 'uint' = 0
+ @dataclass
+ class TestBatchHelperRequest(ClusterCommand):
+ cluster_id: typing.ClassVar[int] = 0xFFF1FC05
+ command_id: typing.ClassVar[int] = 0x00000016
+ is_client: typing.ClassVar[bool] = True
+ response_type: typing.ClassVar[str] = 'TestBatchHelperResponse'
+
+ @ChipUtility.classproperty
+ def descriptor(cls) -> ClusterObjectDescriptor:
+ return ClusterObjectDescriptor(
+ Fields=[
+ ClusterObjectFieldDescriptor(Label="sleepBeforeResponseTimeMs", Tag=0, Type=uint),
+ ClusterObjectFieldDescriptor(Label="sizeOfResponseBuffer", Tag=1, Type=uint),
+ ClusterObjectFieldDescriptor(Label="fillCharacter", Tag=2, Type=uint),
+ ])
+
+ sleepBeforeResponseTimeMs: 'uint' = 0
+ sizeOfResponseBuffer: 'uint' = 0
+ fillCharacter: 'uint' = 0
+
+ @dataclass
+ class TestSecondBatchHelperRequest(ClusterCommand):
+ cluster_id: typing.ClassVar[int] = 0xFFF1FC05
+ command_id: typing.ClassVar[int] = 0x00000017
+ is_client: typing.ClassVar[bool] = True
+ response_type: typing.ClassVar[str] = 'TestBatchHelperResponse'
+
+ @ChipUtility.classproperty
+ def descriptor(cls) -> ClusterObjectDescriptor:
+ return ClusterObjectDescriptor(
+ Fields=[
+ ClusterObjectFieldDescriptor(Label="sleepBeforeResponseTimeMs", Tag=0, Type=uint),
+ ClusterObjectFieldDescriptor(Label="sizeOfResponseBuffer", Tag=1, Type=uint),
+ ClusterObjectFieldDescriptor(Label="fillCharacter", Tag=2, Type=uint),
+ ])
+
+ sleepBeforeResponseTimeMs: 'uint' = 0
+ sizeOfResponseBuffer: 'uint' = 0
+ fillCharacter: 'uint' = 0
+
class Attributes:
@dataclass
class Boolean(ClusterAttributeDescriptor):
diff --git a/src/darwin/Framework/CHIP/templates/MTRCommandPayloadsObjc-src.zapt b/src/darwin/Framework/CHIP/templates/MTRCommandPayloadsObjc-src.zapt
index aa7fe84..c58c75f 100644
--- a/src/darwin/Framework/CHIP/templates/MTRCommandPayloadsObjc-src.zapt
+++ b/src/darwin/Framework/CHIP/templates/MTRCommandPayloadsObjc-src.zapt
@@ -198,6 +198,7 @@
{{/if}}
{{/inline}}
{{#*inline "oldNameImpl"}}
+{{#if (isSupported cluster command=command isForCommandPayload=true)}}
@implementation MTR{{cluster}}Cluster{{command}}Params
{{#zcl_command_arguments}}
@@ -213,8 +214,9 @@
@dynamic timedInvokeTimeoutMs;
{{/if}}
@end
+{{/if}}
{{/inline}}
-{{#if (isSupported (asUpperCamelCase parent.name preserveAcronyms=true) command=(asUpperCamelCase name preserveAcronyms=true))}}
+{{#if (isSupported (asUpperCamelCase parent.name preserveAcronyms=true) command=(asUpperCamelCase name preserveAcronyms=true) isForCommandPayload=true)}}
{{> completeImpl cluster=(asUpperCamelCase parent.name preserveAcronyms=true)
command=(asUpperCamelCase name preserveAcronyms=true)
includeRenamedProperties=false}}
diff --git a/src/darwin/Framework/CHIP/templates/availability.yaml b/src/darwin/Framework/CHIP/templates/availability.yaml
index 0911dd0..ae0d022 100644
--- a/src/darwin/Framework/CHIP/templates/availability.yaml
+++ b/src/darwin/Framework/CHIP/templates/availability.yaml
@@ -8313,6 +8313,12 @@
- ActivateAudioTrack
- ActivateTextTrack
- DeactivateTextTrack
+ UnitTesting:
+ # Ideally none of UnitTesting would be exposed as public API, but
+ # for now just start doing that for new additions to it.
+ - TestBatchHelperResponse
+ - TestBatchHelperRequest
+ - TestSecondBatchHelperRequest
command fields:
NetworkCommissioning:
# Targeting Spring 2024 Matter release
diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h
index ffa6767..1ae4424 100644
--- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h
+++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h
@@ -14764,6 +14764,18 @@
* Command that takes identical arguments to the fields of the TestFabricScopedEvent and logs the TestFabricScopedEvent to the buffer. Command returns an event ID as the response.
*/
- (void)testEmitTestFabricScopedEventRequestWithParams:(MTRUnitTestingClusterTestEmitTestFabricScopedEventRequestParams *)params completion:(void (^)(MTRUnitTestingClusterTestEmitTestFabricScopedEventResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4));
+/**
+ * Command TestBatchHelperRequest
+ *
+ * Command that responds after sleepBeforeResponseTimeMs with an octet_string the size requested with fillCharacter.
+ */
+- (void)testBatchHelperRequestWithParams:(MTRUnitTestingClusterTestBatchHelperRequestParams *)params completion:(void (^)(MTRUnitTestingClusterTestBatchHelperResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE;
+/**
+ * Command TestSecondBatchHelperRequest
+ *
+ * Second command that responds after sleepBeforeResponseTimeMs with an octet_string the size requested with fillCharacter.
+ */
+- (void)testSecondBatchHelperRequestWithParams:(MTRUnitTestingClusterTestSecondBatchHelperRequestParams *)params completion:(void (^)(MTRUnitTestingClusterTestBatchHelperResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE;
- (void)readAttributeBooleanWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4));
- (void)writeAttributeBooleanWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4));
diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm
index 19b00a2..1050bcb 100644
--- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm
+++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm
@@ -109665,6 +109665,54 @@
queue:self.callbackQueue
completion:responseHandler];
}
+- (void)testBatchHelperRequestWithParams:(MTRUnitTestingClusterTestBatchHelperRequestParams *)params completion:(void (^)(MTRUnitTestingClusterTestBatchHelperResponseParams * _Nullable data, NSError * _Nullable error))completion
+{
+ if (params == nil) {
+ params = [[MTRUnitTestingClusterTestBatchHelperRequestParams
+ alloc] init];
+ }
+
+ auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) {
+ completion(response, error);
+ };
+
+ auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs;
+
+ using RequestType = UnitTesting::Commands::TestBatchHelperRequest::Type;
+ [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint)
+ clusterID:@(RequestType::GetClusterId())
+ commandID:@(RequestType::GetCommandId())
+ commandPayload:params
+ timedInvokeTimeout:timedInvokeTimeoutMs
+ serverSideProcessingTimeout:params.serverSideProcessingTimeout
+ responseClass:MTRUnitTestingClusterTestBatchHelperResponseParams.class
+ queue:self.callbackQueue
+ completion:responseHandler];
+}
+- (void)testSecondBatchHelperRequestWithParams:(MTRUnitTestingClusterTestSecondBatchHelperRequestParams *)params completion:(void (^)(MTRUnitTestingClusterTestBatchHelperResponseParams * _Nullable data, NSError * _Nullable error))completion
+{
+ if (params == nil) {
+ params = [[MTRUnitTestingClusterTestSecondBatchHelperRequestParams
+ alloc] init];
+ }
+
+ auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) {
+ completion(response, error);
+ };
+
+ auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs;
+
+ using RequestType = UnitTesting::Commands::TestSecondBatchHelperRequest::Type;
+ [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint)
+ clusterID:@(RequestType::GetClusterId())
+ commandID:@(RequestType::GetCommandId())
+ commandPayload:params
+ timedInvokeTimeout:timedInvokeTimeoutMs
+ serverSideProcessingTimeout:params.serverSideProcessingTimeout
+ responseClass:MTRUnitTestingClusterTestBatchHelperResponseParams.class
+ queue:self.callbackQueue
+ completion:responseHandler];
+}
- (void)readAttributeBooleanWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion
{
diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h
index 8e61874..4cf0aa3 100644
--- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h
+++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h
@@ -6918,6 +6918,7 @@
MTRCommandIDTypeClusterUnitTestingCommandTestNestedStructListArgumentRequestID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x0000000B,
MTRCommandIDTypeClusterUnitTestingCommandTestEmitTestFabricScopedEventResponseID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x0000000B,
MTRCommandIDTypeClusterUnitTestingCommandTestListNestedStructListArgumentRequestID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x0000000C,
+ MTRCommandIDTypeClusterUnitTestingCommandTestBatchHelperResponseID MTR_PROVISIONALLY_AVAILABLE = 0x0000000C,
MTRCommandIDTypeClusterUnitTestingCommandTestListInt8UReverseRequestID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x0000000D,
MTRCommandIDTypeClusterUnitTestingCommandTestEnumsRequestID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x0000000E,
MTRCommandIDTypeClusterUnitTestingCommandTestNullableOptionalRequestID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x0000000F,
@@ -6927,6 +6928,8 @@
MTRCommandIDTypeClusterUnitTestingCommandTestSimpleOptionalArgumentRequestID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000013,
MTRCommandIDTypeClusterUnitTestingCommandTestEmitTestEventRequestID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000014,
MTRCommandIDTypeClusterUnitTestingCommandTestEmitTestFabricScopedEventRequestID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000015,
+ MTRCommandIDTypeClusterUnitTestingCommandTestBatchHelperRequestID MTR_PROVISIONALLY_AVAILABLE = 0x00000016,
+ MTRCommandIDTypeClusterUnitTestingCommandTestSecondBatchHelperRequestID MTR_PROVISIONALLY_AVAILABLE = 0x00000017,
// Cluster SampleMEI commands
MTRCommandIDTypeClusterSampleMEICommandPingID MTR_PROVISIONALLY_AVAILABLE = 0x00000000,
diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h
index 7e3c9eb..b377db1 100644
--- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h
+++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h
@@ -6730,6 +6730,8 @@
MTR_AVAILABLE(ios(17.4), macos(14.4), watchos(10.4), tvos(17.4));
- (void)testEmitTestEventRequestWithParams:(MTRUnitTestingClusterTestEmitTestEventRequestParams *)params expectedValues:(NSArray<NSDictionary<NSString *, id> *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRUnitTestingClusterTestEmitTestEventResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4));
- (void)testEmitTestFabricScopedEventRequestWithParams:(MTRUnitTestingClusterTestEmitTestFabricScopedEventRequestParams *)params expectedValues:(NSArray<NSDictionary<NSString *, id> *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRUnitTestingClusterTestEmitTestFabricScopedEventResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4));
+- (void)testBatchHelperRequestWithParams:(MTRUnitTestingClusterTestBatchHelperRequestParams *)params expectedValues:(NSArray<NSDictionary<NSString *, id> *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRUnitTestingClusterTestBatchHelperResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE;
+- (void)testSecondBatchHelperRequestWithParams:(MTRUnitTestingClusterTestSecondBatchHelperRequestParams *)params expectedValues:(NSArray<NSDictionary<NSString *, id> *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRUnitTestingClusterTestBatchHelperResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE;
- (NSDictionary<NSString *, id> * _Nullable)readAttributeBooleanWithParams:(MTRReadParams * _Nullable)params MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4));
- (void)writeAttributeBooleanWithValue:(NSDictionary<NSString *, id> *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4));
diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm
index 0ab55d5..f8bb88a 100644
--- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm
+++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm
@@ -19977,6 +19977,60 @@
completion:responseHandler];
}
+- (void)testBatchHelperRequestWithParams:(MTRUnitTestingClusterTestBatchHelperRequestParams *)params expectedValues:(NSArray<NSDictionary<NSString *, id> *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRUnitTestingClusterTestBatchHelperResponseParams * _Nullable data, NSError * _Nullable error))completion
+{
+ if (params == nil) {
+ params = [[MTRUnitTestingClusterTestBatchHelperRequestParams
+ alloc] init];
+ }
+
+ auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) {
+ completion(response, error);
+ };
+
+ auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs;
+
+ using RequestType = UnitTesting::Commands::TestBatchHelperRequest::Type;
+ [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint)
+ clusterID:@(RequestType::GetClusterId())
+ commandID:@(RequestType::GetCommandId())
+ commandPayload:params
+ expectedValues:expectedValues
+ expectedValueInterval:expectedValueIntervalMs
+ timedInvokeTimeout:timedInvokeTimeoutMs
+ serverSideProcessingTimeout:params.serverSideProcessingTimeout
+ responseClass:MTRUnitTestingClusterTestBatchHelperResponseParams.class
+ queue:self.callbackQueue
+ completion:responseHandler];
+}
+
+- (void)testSecondBatchHelperRequestWithParams:(MTRUnitTestingClusterTestSecondBatchHelperRequestParams *)params expectedValues:(NSArray<NSDictionary<NSString *, id> *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRUnitTestingClusterTestBatchHelperResponseParams * _Nullable data, NSError * _Nullable error))completion
+{
+ if (params == nil) {
+ params = [[MTRUnitTestingClusterTestSecondBatchHelperRequestParams
+ alloc] init];
+ }
+
+ auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) {
+ completion(response, error);
+ };
+
+ auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs;
+
+ using RequestType = UnitTesting::Commands::TestSecondBatchHelperRequest::Type;
+ [self.device _invokeKnownCommandWithEndpointID:@(self.endpoint)
+ clusterID:@(RequestType::GetClusterId())
+ commandID:@(RequestType::GetCommandId())
+ commandPayload:params
+ expectedValues:expectedValues
+ expectedValueInterval:expectedValueIntervalMs
+ timedInvokeTimeout:timedInvokeTimeoutMs
+ serverSideProcessingTimeout:params.serverSideProcessingTimeout
+ responseClass:MTRUnitTestingClusterTestBatchHelperResponseParams.class
+ queue:self.callbackQueue
+ completion:responseHandler];
+}
+
- (NSDictionary<NSString *, id> * _Nullable)readAttributeBooleanWithParams:(MTRReadParams * _Nullable)params
{
return [self.device readAttributeWithEndpointID:@(self.endpoint) clusterID:@(MTRClusterIDTypeUnitTestingID) attributeID:@(MTRAttributeIDTypeClusterUnitTestingAttributeBooleanID) params:params];
diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h
index f540aa1..a317763 100644
--- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h
+++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h
@@ -11959,6 +11959,25 @@
@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout;
@end
+MTR_PROVISIONALLY_AVAILABLE
+@interface MTRUnitTestingClusterTestBatchHelperResponseParams : NSObject <NSCopying>
+
+@property (nonatomic, copy) NSData * _Nonnull buffer MTR_PROVISIONALLY_AVAILABLE;
+
+/**
+ * Initialize an MTRUnitTestingClusterTestBatchHelperResponseParams with a response-value dictionary
+ * of the sort that MTRDeviceResponseHandler would receive.
+ *
+ * Will return nil and hand out an error if the response-value dictionary is not
+ * a command data response or is not the right command response.
+ *
+ * Will return nil and hand out an error if the data response does not match the known
+ * schema for this command.
+ */
+- (nullable instancetype)initWithResponseValue:(NSDictionary<NSString *, id> *)responseValue
+ error:(NSError * __autoreleasing *)error MTR_PROVISIONALLY_AVAILABLE;
+@end
+
MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4))
@interface MTRUnitTestingClusterTestListInt8UReverseRequestParams : NSObject <NSCopying>
@@ -12552,6 +12571,74 @@
@end
MTR_PROVISIONALLY_AVAILABLE
+@interface MTRUnitTestingClusterTestBatchHelperRequestParams : NSObject <NSCopying>
+
+@property (nonatomic, copy) NSNumber * _Nonnull sleepBeforeResponseTimeMs MTR_PROVISIONALLY_AVAILABLE;
+
+@property (nonatomic, copy) NSNumber * _Nonnull sizeOfResponseBuffer MTR_PROVISIONALLY_AVAILABLE;
+
+@property (nonatomic, copy) NSNumber * _Nonnull fillCharacter MTR_PROVISIONALLY_AVAILABLE;
+/**
+ * Controls whether the command is a timed command (using Timed Invoke).
+ *
+ * If nil (the default value), a regular invoke is done for commands that do
+ * not require a timed invoke and a timed invoke with some default timed request
+ * timeout is done for commands that require a timed invoke.
+ *
+ * If not nil, a timed invoke is done, with the provided value used as the timed
+ * request timeout. The value should be chosen small enough to provide the
+ * desired security properties but large enough that it will allow a round-trip
+ * from the sever to the client (for the status response and actual invoke
+ * request) within the timeout window.
+ *
+ */
+@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs;
+
+/**
+ * Controls how much time, in seconds, we will allow for the server to process the command.
+ *
+ * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes.
+ *
+ * If nil, the framework will try to select an appropriate timeout value itself.
+ */
+@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout;
+@end
+
+MTR_PROVISIONALLY_AVAILABLE
+@interface MTRUnitTestingClusterTestSecondBatchHelperRequestParams : NSObject <NSCopying>
+
+@property (nonatomic, copy) NSNumber * _Nonnull sleepBeforeResponseTimeMs MTR_PROVISIONALLY_AVAILABLE;
+
+@property (nonatomic, copy) NSNumber * _Nonnull sizeOfResponseBuffer MTR_PROVISIONALLY_AVAILABLE;
+
+@property (nonatomic, copy) NSNumber * _Nonnull fillCharacter MTR_PROVISIONALLY_AVAILABLE;
+/**
+ * Controls whether the command is a timed command (using Timed Invoke).
+ *
+ * If nil (the default value), a regular invoke is done for commands that do
+ * not require a timed invoke and a timed invoke with some default timed request
+ * timeout is done for commands that require a timed invoke.
+ *
+ * If not nil, a timed invoke is done, with the provided value used as the timed
+ * request timeout. The value should be chosen small enough to provide the
+ * desired security properties but large enough that it will allow a round-trip
+ * from the sever to the client (for the status response and actual invoke
+ * request) within the timeout window.
+ *
+ */
+@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs;
+
+/**
+ * Controls how much time, in seconds, we will allow for the server to process the command.
+ *
+ * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes.
+ *
+ * If nil, the framework will try to select an appropriate timeout value itself.
+ */
+@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout;
+@end
+
+MTR_PROVISIONALLY_AVAILABLE
@interface MTRSampleMEIClusterPingParams : NSObject <NSCopying>
/**
* Controls whether the command is a timed command (using Timed Invoke).
diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm
index 35c71e8..368ac07 100644
--- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm
+++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm
@@ -32513,6 +32513,85 @@
@dynamic timedInvokeTimeoutMs;
@dynamic serverSideProcessingTimeout;
@end
+@implementation MTRUnitTestingClusterTestBatchHelperResponseParams
+- (instancetype)init
+{
+ if (self = [super init]) {
+
+ _buffer = [NSData data];
+ }
+ return self;
+}
+
+- (id)copyWithZone:(NSZone * _Nullable)zone;
+{
+ auto other = [[MTRUnitTestingClusterTestBatchHelperResponseParams alloc] init];
+
+ other.buffer = self.buffer;
+
+ return other;
+}
+
+- (NSString *)description
+{
+ NSString * descriptionString = [NSString stringWithFormat:@"<%@: buffer:%@; >", NSStringFromClass([self class]), [_buffer base64EncodedStringWithOptions:0]];
+ return descriptionString;
+}
+
+- (nullable instancetype)initWithResponseValue:(NSDictionary<NSString *, id> *)responseValue
+ error:(NSError * __autoreleasing *)error
+{
+ if (!(self = [super init])) {
+ return nil;
+ }
+
+ using DecodableType = chip::app::Clusters::UnitTesting::Commands::TestBatchHelperResponse::DecodableType;
+ chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue
+ clusterID:DecodableType::GetClusterId()
+ commandID:DecodableType::GetCommandId()
+ error:error];
+ if (buffer.IsNull()) {
+ return nil;
+ }
+
+ chip::TLV::TLVReader reader;
+ reader.Init(buffer->Start(), buffer->DataLength());
+
+ CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag());
+ if (err == CHIP_NO_ERROR) {
+ DecodableType decodedStruct;
+ err = chip::app::DataModel::Decode(reader, decodedStruct);
+ if (err == CHIP_NO_ERROR) {
+ err = [self _setFieldsFromDecodableStruct:decodedStruct];
+ if (err == CHIP_NO_ERROR) {
+ return self;
+ }
+ }
+ }
+
+ NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()];
+ MTR_LOG_ERROR("%s", errorStr.UTF8String);
+ if (error != nil) {
+ NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) };
+ *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo];
+ }
+ return nil;
+}
+
+@end
+
+@implementation MTRUnitTestingClusterTestBatchHelperResponseParams (InternalMethods)
+
+- (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::UnitTesting::Commands::TestBatchHelperResponse::DecodableType &)decodableStruct
+{
+ {
+ self.buffer = AsData(decodableStruct.buffer);
+ }
+ return CHIP_NO_ERROR;
+}
+
+@end
+
@implementation MTRUnitTestingClusterTestListInt8UReverseRequestParams
- (instancetype)init
{
@@ -33556,6 +33635,188 @@
@dynamic timedInvokeTimeoutMs;
@dynamic serverSideProcessingTimeout;
@end
+@implementation MTRUnitTestingClusterTestBatchHelperRequestParams
+- (instancetype)init
+{
+ if (self = [super init]) {
+
+ _sleepBeforeResponseTimeMs = @(0);
+
+ _sizeOfResponseBuffer = @(0);
+
+ _fillCharacter = @(0);
+ _timedInvokeTimeoutMs = nil;
+ _serverSideProcessingTimeout = nil;
+ }
+ return self;
+}
+
+- (id)copyWithZone:(NSZone * _Nullable)zone;
+{
+ auto other = [[MTRUnitTestingClusterTestBatchHelperRequestParams alloc] init];
+
+ other.sleepBeforeResponseTimeMs = self.sleepBeforeResponseTimeMs;
+ other.sizeOfResponseBuffer = self.sizeOfResponseBuffer;
+ other.fillCharacter = self.fillCharacter;
+ other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs;
+ other.serverSideProcessingTimeout = self.serverSideProcessingTimeout;
+
+ return other;
+}
+
+- (NSString *)description
+{
+ NSString * descriptionString = [NSString stringWithFormat:@"<%@: sleepBeforeResponseTimeMs:%@; sizeOfResponseBuffer:%@; fillCharacter:%@; >", NSStringFromClass([self class]), _sleepBeforeResponseTimeMs, _sizeOfResponseBuffer, _fillCharacter];
+ return descriptionString;
+}
+
+@end
+
+@implementation MTRUnitTestingClusterTestBatchHelperRequestParams (InternalMethods)
+
+- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader
+{
+ chip::app::Clusters::UnitTesting::Commands::TestBatchHelperRequest::Type encodableStruct;
+ ListFreer listFreer;
+ {
+ encodableStruct.sleepBeforeResponseTimeMs = self.sleepBeforeResponseTimeMs.unsignedShortValue;
+ }
+ {
+ encodableStruct.sizeOfResponseBuffer = self.sizeOfResponseBuffer.unsignedShortValue;
+ }
+ {
+ encodableStruct.fillCharacter = self.fillCharacter.unsignedCharValue;
+ }
+
+ auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0);
+ if (buffer.IsNull()) {
+ return CHIP_ERROR_NO_MEMORY;
+ }
+
+ chip::System::PacketBufferTLVWriter writer;
+ // Commands never need chained buffers, since they cannot be chunked.
+ writer.Init(std::move(buffer), /* useChainedBuffers = */ false);
+
+ ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct));
+
+ ReturnErrorOnFailure(writer.Finalize(&buffer));
+
+ reader.Init(std::move(buffer));
+ return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag());
+}
+
+- (NSDictionary<NSString *, id> * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error
+{
+ chip::System::PacketBufferTLVReader reader;
+ CHIP_ERROR err = [self _encodeToTLVReader:reader];
+ if (err != CHIP_NO_ERROR) {
+ if (error) {
+ *error = [MTRError errorForCHIPErrorCode:err];
+ }
+ return nil;
+ }
+
+ auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader);
+ if (decodedObj == nil) {
+ if (error) {
+ *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE];
+ }
+ }
+ return decodedObj;
+}
+@end
+
+@implementation MTRUnitTestingClusterTestSecondBatchHelperRequestParams
+- (instancetype)init
+{
+ if (self = [super init]) {
+
+ _sleepBeforeResponseTimeMs = @(0);
+
+ _sizeOfResponseBuffer = @(0);
+
+ _fillCharacter = @(0);
+ _timedInvokeTimeoutMs = nil;
+ _serverSideProcessingTimeout = nil;
+ }
+ return self;
+}
+
+- (id)copyWithZone:(NSZone * _Nullable)zone;
+{
+ auto other = [[MTRUnitTestingClusterTestSecondBatchHelperRequestParams alloc] init];
+
+ other.sleepBeforeResponseTimeMs = self.sleepBeforeResponseTimeMs;
+ other.sizeOfResponseBuffer = self.sizeOfResponseBuffer;
+ other.fillCharacter = self.fillCharacter;
+ other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs;
+ other.serverSideProcessingTimeout = self.serverSideProcessingTimeout;
+
+ return other;
+}
+
+- (NSString *)description
+{
+ NSString * descriptionString = [NSString stringWithFormat:@"<%@: sleepBeforeResponseTimeMs:%@; sizeOfResponseBuffer:%@; fillCharacter:%@; >", NSStringFromClass([self class]), _sleepBeforeResponseTimeMs, _sizeOfResponseBuffer, _fillCharacter];
+ return descriptionString;
+}
+
+@end
+
+@implementation MTRUnitTestingClusterTestSecondBatchHelperRequestParams (InternalMethods)
+
+- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader
+{
+ chip::app::Clusters::UnitTesting::Commands::TestSecondBatchHelperRequest::Type encodableStruct;
+ ListFreer listFreer;
+ {
+ encodableStruct.sleepBeforeResponseTimeMs = self.sleepBeforeResponseTimeMs.unsignedShortValue;
+ }
+ {
+ encodableStruct.sizeOfResponseBuffer = self.sizeOfResponseBuffer.unsignedShortValue;
+ }
+ {
+ encodableStruct.fillCharacter = self.fillCharacter.unsignedCharValue;
+ }
+
+ auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0);
+ if (buffer.IsNull()) {
+ return CHIP_ERROR_NO_MEMORY;
+ }
+
+ chip::System::PacketBufferTLVWriter writer;
+ // Commands never need chained buffers, since they cannot be chunked.
+ writer.Init(std::move(buffer), /* useChainedBuffers = */ false);
+
+ ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct));
+
+ ReturnErrorOnFailure(writer.Finalize(&buffer));
+
+ reader.Init(std::move(buffer));
+ return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag());
+}
+
+- (NSDictionary<NSString *, id> * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error
+{
+ chip::System::PacketBufferTLVReader reader;
+ CHIP_ERROR err = [self _encodeToTLVReader:reader];
+ if (err != CHIP_NO_ERROR) {
+ if (error) {
+ *error = [MTRError errorForCHIPErrorCode:err];
+ }
+ return nil;
+ }
+
+ auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader);
+ if (decodedObj == nil) {
+ if (error) {
+ *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE];
+ }
+ }
+ return decodedObj;
+}
+@end
+
@implementation MTRSampleMEIClusterPingParams
- (instancetype)init
{
diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h
index 24ef38c..eaf1bf2 100644
--- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h
+++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h
@@ -2014,6 +2014,12 @@
@end
+@interface MTRUnitTestingClusterTestBatchHelperResponseParams (InternalMethods)
+
+- (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::UnitTesting::Commands::TestBatchHelperResponse::DecodableType &)decodableStruct;
+
+@end
+
@interface MTRUnitTestingClusterTestListInt8UReverseRequestParams (InternalMethods)
- (NSDictionary<NSString *, id> * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error;
@@ -2068,6 +2074,18 @@
@end
+@interface MTRUnitTestingClusterTestBatchHelperRequestParams (InternalMethods)
+
+- (NSDictionary<NSString *, id> * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error;
+
+@end
+
+@interface MTRUnitTestingClusterTestSecondBatchHelperRequestParams (InternalMethods)
+
+- (NSDictionary<NSString *, id> * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error;
+
+@end
+
@interface MTRSampleMEIClusterPingParams (InternalMethods)
- (NSDictionary<NSString *, id> * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error;
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 439ed6b..61c9095 100644
--- a/zzz_generated/app-common/app-common/zap-generated/callback.h
+++ b/zzz_generated/app-common/app-common/zap-generated/callback.h
@@ -10981,6 +10981,18 @@
chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath,
const chip::app::Clusters::UnitTesting::Commands::TestEmitTestFabricScopedEventRequest::DecodableType & commandData);
/**
+ * @brief Unit Testing Cluster TestBatchHelperRequest Command callback (from client)
+ */
+bool emberAfUnitTestingClusterTestBatchHelperRequestCallback(
+ chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath,
+ const chip::app::Clusters::UnitTesting::Commands::TestBatchHelperRequest::DecodableType & commandData);
+/**
+ * @brief Unit Testing Cluster TestSecondBatchHelperRequest Command callback (from client)
+ */
+bool emberAfUnitTestingClusterTestSecondBatchHelperRequestCallback(
+ chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath,
+ const chip::app::Clusters::UnitTesting::Commands::TestSecondBatchHelperRequest::DecodableType & commandData);
+/**
* @brief Fault Injection Cluster FailAtFault Command callback (from client)
*/
bool emberAfFaultInjectionClusterFailAtFaultCallback(
diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp
index 7d25bcc..e3798e4 100644
--- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp
+++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp
@@ -27154,6 +27154,40 @@
}
}
} // namespace TestListNestedStructListArgumentRequest.
+namespace TestBatchHelperResponse {
+CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
+{
+ DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
+ encoder.Encode(to_underlying(Fields::kBuffer), buffer);
+ return encoder.Finalize();
+}
+
+CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
+{
+ detail::StructDecodeIterator __iterator(reader);
+ while (true)
+ {
+ auto __element = __iterator.Next();
+ if (std::holds_alternative<CHIP_ERROR>(__element))
+ {
+ return std::get<CHIP_ERROR>(__element);
+ }
+
+ CHIP_ERROR err = CHIP_NO_ERROR;
+ const uint8_t __context_tag = std::get<uint8_t>(__element);
+
+ if (__context_tag == to_underlying(Fields::kBuffer))
+ {
+ err = DataModel::Decode(reader, buffer);
+ }
+ else
+ {
+ }
+
+ ReturnErrorOnFailure(err);
+ }
+}
+} // namespace TestBatchHelperResponse.
namespace TestListInt8UReverseRequest {
CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
{
@@ -27516,6 +27550,94 @@
}
}
} // namespace TestEmitTestFabricScopedEventRequest.
+namespace TestBatchHelperRequest {
+CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
+{
+ DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
+ encoder.Encode(to_underlying(Fields::kSleepBeforeResponseTimeMs), sleepBeforeResponseTimeMs);
+ encoder.Encode(to_underlying(Fields::kSizeOfResponseBuffer), sizeOfResponseBuffer);
+ encoder.Encode(to_underlying(Fields::kFillCharacter), fillCharacter);
+ return encoder.Finalize();
+}
+
+CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
+{
+ detail::StructDecodeIterator __iterator(reader);
+ while (true)
+ {
+ auto __element = __iterator.Next();
+ if (std::holds_alternative<CHIP_ERROR>(__element))
+ {
+ return std::get<CHIP_ERROR>(__element);
+ }
+
+ CHIP_ERROR err = CHIP_NO_ERROR;
+ const uint8_t __context_tag = std::get<uint8_t>(__element);
+
+ if (__context_tag == to_underlying(Fields::kSleepBeforeResponseTimeMs))
+ {
+ err = DataModel::Decode(reader, sleepBeforeResponseTimeMs);
+ }
+ else if (__context_tag == to_underlying(Fields::kSizeOfResponseBuffer))
+ {
+ err = DataModel::Decode(reader, sizeOfResponseBuffer);
+ }
+ else if (__context_tag == to_underlying(Fields::kFillCharacter))
+ {
+ err = DataModel::Decode(reader, fillCharacter);
+ }
+ else
+ {
+ }
+
+ ReturnErrorOnFailure(err);
+ }
+}
+} // namespace TestBatchHelperRequest.
+namespace TestSecondBatchHelperRequest {
+CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const
+{
+ DataModel::WrappedStructEncoder encoder{ aWriter, aTag };
+ encoder.Encode(to_underlying(Fields::kSleepBeforeResponseTimeMs), sleepBeforeResponseTimeMs);
+ encoder.Encode(to_underlying(Fields::kSizeOfResponseBuffer), sizeOfResponseBuffer);
+ encoder.Encode(to_underlying(Fields::kFillCharacter), fillCharacter);
+ return encoder.Finalize();
+}
+
+CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
+{
+ detail::StructDecodeIterator __iterator(reader);
+ while (true)
+ {
+ auto __element = __iterator.Next();
+ if (std::holds_alternative<CHIP_ERROR>(__element))
+ {
+ return std::get<CHIP_ERROR>(__element);
+ }
+
+ CHIP_ERROR err = CHIP_NO_ERROR;
+ const uint8_t __context_tag = std::get<uint8_t>(__element);
+
+ if (__context_tag == to_underlying(Fields::kSleepBeforeResponseTimeMs))
+ {
+ err = DataModel::Decode(reader, sleepBeforeResponseTimeMs);
+ }
+ else if (__context_tag == to_underlying(Fields::kSizeOfResponseBuffer))
+ {
+ err = DataModel::Decode(reader, sizeOfResponseBuffer);
+ }
+ else if (__context_tag == to_underlying(Fields::kFillCharacter))
+ {
+ err = DataModel::Decode(reader, fillCharacter);
+ }
+ else
+ {
+ }
+
+ ReturnErrorOnFailure(err);
+ }
+}
+} // namespace TestSecondBatchHelperRequest.
} // namespace Commands
namespace Attributes {
diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h
index c292a11..cb176c3 100644
--- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h
+++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h
@@ -39687,6 +39687,11 @@
struct DecodableType;
} // namespace TestListNestedStructListArgumentRequest
+namespace TestBatchHelperResponse {
+struct Type;
+struct DecodableType;
+} // namespace TestBatchHelperResponse
+
namespace TestListInt8UReverseRequest {
struct Type;
struct DecodableType;
@@ -39732,6 +39737,16 @@
struct DecodableType;
} // namespace TestEmitTestFabricScopedEventRequest
+namespace TestBatchHelperRequest {
+struct Type;
+struct DecodableType;
+} // namespace TestBatchHelperRequest
+
+namespace TestSecondBatchHelperRequest {
+struct Type;
+struct DecodableType;
+} // namespace TestSecondBatchHelperRequest
+
} // namespace Commands
namespace Commands {
@@ -40645,6 +40660,38 @@
CHIP_ERROR Decode(TLV::TLVReader & reader);
};
}; // namespace TestListNestedStructListArgumentRequest
+namespace TestBatchHelperResponse {
+enum class Fields : uint8_t
+{
+ kBuffer = 0,
+};
+
+struct Type
+{
+public:
+ // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand
+ static constexpr CommandId GetCommandId() { return Commands::TestBatchHelperResponse::Id; }
+ static constexpr ClusterId GetClusterId() { return Clusters::UnitTesting::Id; }
+
+ chip::ByteSpan buffer;
+
+ CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const;
+
+ using ResponseType = DataModel::NullObjectType;
+
+ static constexpr bool MustUseTimedInvoke() { return false; }
+};
+
+struct DecodableType
+{
+public:
+ static constexpr CommandId GetCommandId() { return Commands::TestBatchHelperResponse::Id; }
+ static constexpr ClusterId GetClusterId() { return Clusters::UnitTesting::Id; }
+
+ chip::ByteSpan buffer;
+ CHIP_ERROR Decode(TLV::TLVReader & reader);
+};
+}; // namespace TestBatchHelperResponse
namespace TestListInt8UReverseRequest {
enum class Fields : uint8_t
{
@@ -40971,6 +41018,82 @@
CHIP_ERROR Decode(TLV::TLVReader & reader);
};
}; // namespace TestEmitTestFabricScopedEventRequest
+namespace TestBatchHelperRequest {
+enum class Fields : uint8_t
+{
+ kSleepBeforeResponseTimeMs = 0,
+ kSizeOfResponseBuffer = 1,
+ kFillCharacter = 2,
+};
+
+struct Type
+{
+public:
+ // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand
+ static constexpr CommandId GetCommandId() { return Commands::TestBatchHelperRequest::Id; }
+ static constexpr ClusterId GetClusterId() { return Clusters::UnitTesting::Id; }
+
+ uint16_t sleepBeforeResponseTimeMs = static_cast<uint16_t>(0);
+ uint16_t sizeOfResponseBuffer = static_cast<uint16_t>(0);
+ uint8_t fillCharacter = static_cast<uint8_t>(0);
+
+ CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const;
+
+ using ResponseType = Clusters::UnitTesting::Commands::TestBatchHelperResponse::DecodableType;
+
+ static constexpr bool MustUseTimedInvoke() { return false; }
+};
+
+struct DecodableType
+{
+public:
+ static constexpr CommandId GetCommandId() { return Commands::TestBatchHelperRequest::Id; }
+ static constexpr ClusterId GetClusterId() { return Clusters::UnitTesting::Id; }
+
+ uint16_t sleepBeforeResponseTimeMs = static_cast<uint16_t>(0);
+ uint16_t sizeOfResponseBuffer = static_cast<uint16_t>(0);
+ uint8_t fillCharacter = static_cast<uint8_t>(0);
+ CHIP_ERROR Decode(TLV::TLVReader & reader);
+};
+}; // namespace TestBatchHelperRequest
+namespace TestSecondBatchHelperRequest {
+enum class Fields : uint8_t
+{
+ kSleepBeforeResponseTimeMs = 0,
+ kSizeOfResponseBuffer = 1,
+ kFillCharacter = 2,
+};
+
+struct Type
+{
+public:
+ // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand
+ static constexpr CommandId GetCommandId() { return Commands::TestSecondBatchHelperRequest::Id; }
+ static constexpr ClusterId GetClusterId() { return Clusters::UnitTesting::Id; }
+
+ uint16_t sleepBeforeResponseTimeMs = static_cast<uint16_t>(0);
+ uint16_t sizeOfResponseBuffer = static_cast<uint16_t>(0);
+ uint8_t fillCharacter = static_cast<uint8_t>(0);
+
+ CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const;
+
+ using ResponseType = Clusters::UnitTesting::Commands::TestBatchHelperResponse::DecodableType;
+
+ static constexpr bool MustUseTimedInvoke() { return false; }
+};
+
+struct DecodableType
+{
+public:
+ static constexpr CommandId GetCommandId() { return Commands::TestSecondBatchHelperRequest::Id; }
+ static constexpr ClusterId GetClusterId() { return Clusters::UnitTesting::Id; }
+
+ uint16_t sleepBeforeResponseTimeMs = static_cast<uint16_t>(0);
+ uint16_t sizeOfResponseBuffer = static_cast<uint16_t>(0);
+ uint8_t fillCharacter = static_cast<uint8_t>(0);
+ CHIP_ERROR Decode(TLV::TLVReader & reader);
+};
+}; // namespace TestSecondBatchHelperRequest
} // namespace Commands
namespace Attributes {
diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h b/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h
index d903540..e5d62e2 100644
--- a/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h
+++ b/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h
@@ -1740,6 +1740,10 @@
static constexpr CommandId Id = 0x0000000C;
} // namespace TestListNestedStructListArgumentRequest
+namespace TestBatchHelperResponse {
+static constexpr CommandId Id = 0x0000000C;
+} // namespace TestBatchHelperResponse
+
namespace TestListInt8UReverseRequest {
static constexpr CommandId Id = 0x0000000D;
} // namespace TestListInt8UReverseRequest
@@ -1776,6 +1780,14 @@
static constexpr CommandId Id = 0x00000015;
} // namespace TestEmitTestFabricScopedEventRequest
+namespace TestBatchHelperRequest {
+static constexpr CommandId Id = 0x00000016;
+} // namespace TestBatchHelperRequest
+
+namespace TestSecondBatchHelperRequest {
+static constexpr CommandId Id = 0x00000017;
+} // namespace TestSecondBatchHelperRequest
+
} // namespace Commands
} // namespace UnitTesting
diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h
index 1c9302b..24be99e 100644
--- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h
+++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h
@@ -12795,6 +12795,8 @@
| * TestSimpleOptionalArgumentRequest | 0x13 |
| * TestEmitTestEventRequest | 0x14 |
| * TestEmitTestFabricScopedEventRequest | 0x15 |
+| * TestBatchHelperRequest | 0x16 |
+| * TestSecondBatchHelperRequest | 0x17 |
|------------------------------------------------------------------------------|
| Attributes: | |
| * Boolean | 0x0000 |
@@ -13775,6 +13777,86 @@
chip::app::Clusters::UnitTesting::Commands::TestEmitTestFabricScopedEventRequest::Type mRequest;
};
+/*
+ * Command TestBatchHelperRequest
+ */
+class UnitTestingTestBatchHelperRequest : public ClusterCommand
+{
+public:
+ UnitTestingTestBatchHelperRequest(CredentialIssuerCommands * credsIssuerConfig) :
+ ClusterCommand("test-batch-helper-request", credsIssuerConfig)
+ {
+ AddArgument("SleepBeforeResponseTimeMs", 0, UINT16_MAX, &mRequest.sleepBeforeResponseTimeMs);
+ AddArgument("SizeOfResponseBuffer", 0, UINT16_MAX, &mRequest.sizeOfResponseBuffer);
+ AddArgument("FillCharacter", 0, UINT8_MAX, &mRequest.fillCharacter);
+ ClusterCommand::AddArguments();
+ }
+
+ CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector<chip::EndpointId> endpointIds) override
+ {
+ constexpr chip::ClusterId clusterId = chip::app::Clusters::UnitTesting::Id;
+ constexpr chip::CommandId commandId = chip::app::Clusters::UnitTesting::Commands::TestBatchHelperRequest::Id;
+
+ ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId,
+ commandId, endpointIds.at(0));
+ return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest);
+ }
+
+ CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override
+ {
+ constexpr chip::ClusterId clusterId = chip::app::Clusters::UnitTesting::Id;
+ constexpr chip::CommandId commandId = chip::app::Clusters::UnitTesting::Commands::TestBatchHelperRequest::Id;
+
+ ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId,
+ groupId);
+
+ return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest);
+ }
+
+private:
+ chip::app::Clusters::UnitTesting::Commands::TestBatchHelperRequest::Type mRequest;
+};
+
+/*
+ * Command TestSecondBatchHelperRequest
+ */
+class UnitTestingTestSecondBatchHelperRequest : public ClusterCommand
+{
+public:
+ UnitTestingTestSecondBatchHelperRequest(CredentialIssuerCommands * credsIssuerConfig) :
+ ClusterCommand("test-second-batch-helper-request", credsIssuerConfig)
+ {
+ AddArgument("SleepBeforeResponseTimeMs", 0, UINT16_MAX, &mRequest.sleepBeforeResponseTimeMs);
+ AddArgument("SizeOfResponseBuffer", 0, UINT16_MAX, &mRequest.sizeOfResponseBuffer);
+ AddArgument("FillCharacter", 0, UINT8_MAX, &mRequest.fillCharacter);
+ ClusterCommand::AddArguments();
+ }
+
+ CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector<chip::EndpointId> endpointIds) override
+ {
+ constexpr chip::ClusterId clusterId = chip::app::Clusters::UnitTesting::Id;
+ constexpr chip::CommandId commandId = chip::app::Clusters::UnitTesting::Commands::TestSecondBatchHelperRequest::Id;
+
+ ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId,
+ commandId, endpointIds.at(0));
+ return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest);
+ }
+
+ CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override
+ {
+ constexpr chip::ClusterId clusterId = chip::app::Clusters::UnitTesting::Id;
+ constexpr chip::CommandId commandId = chip::app::Clusters::UnitTesting::Commands::TestSecondBatchHelperRequest::Id;
+
+ ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId,
+ groupId);
+
+ return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest);
+ }
+
+private:
+ chip::app::Clusters::UnitTesting::Commands::TestSecondBatchHelperRequest::Type mRequest;
+};
+
/*----------------------------------------------------------------------------*\
| Cluster FaultInjection | 0xFFF1FC06 |
|------------------------------------------------------------------------------|
@@ -24899,6 +24981,8 @@
make_unique<UnitTestingTestSimpleOptionalArgumentRequest>(credsIssuerConfig), //
make_unique<UnitTestingTestEmitTestEventRequest>(credsIssuerConfig), //
make_unique<UnitTestingTestEmitTestFabricScopedEventRequest>(credsIssuerConfig), //
+ make_unique<UnitTestingTestBatchHelperRequest>(credsIssuerConfig), //
+ make_unique<UnitTestingTestSecondBatchHelperRequest>(credsIssuerConfig), //
//
// Attributes
//
diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp
index 6089c40..8f0584c 100644
--- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp
+++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp
@@ -7303,6 +7303,14 @@
return CHIP_NO_ERROR;
}
CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent,
+ const UnitTesting::Commands::TestBatchHelperResponse::DecodableType & value)
+{
+ DataModelLogger::LogString(label, indent, "{");
+ ReturnErrorOnFailure(DataModelLogger::LogValue("buffer", indent + 1, value.buffer));
+ DataModelLogger::LogString(indent, "}");
+ return CHIP_NO_ERROR;
+}
+CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent,
const SampleMei::Commands::AddArgumentsResponse::DecodableType & value)
{
DataModelLogger::LogString(label, indent, "{");
@@ -17455,6 +17463,11 @@
ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value));
return DataModelLogger::LogValue("TestEmitTestFabricScopedEventResponse", 1, value);
}
+ case UnitTesting::Commands::TestBatchHelperResponse::Id: {
+ UnitTesting::Commands::TestBatchHelperResponse::DecodableType value;
+ ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value));
+ return DataModelLogger::LogValue("TestBatchHelperResponse", 1, value);
+ }
}
break;
}
diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h
index 8828a11..007d791 100644
--- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h
+++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h
@@ -738,4 +738,6 @@
LogValue(const char * label, size_t indent,
const chip::app::Clusters::UnitTesting::Commands::TestEmitTestFabricScopedEventResponse::DecodableType & value);
static CHIP_ERROR LogValue(const char * label, size_t indent,
+ const chip::app::Clusters::UnitTesting::Commands::TestBatchHelperResponse::DecodableType & value);
+static CHIP_ERROR LogValue(const char * label, size_t indent,
const chip::app::Clusters::SampleMei::Commands::AddArgumentsResponse::DecodableType & value);
diff --git a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h
index 61c9dc6..bdfa874 100644
--- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h
+++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h
@@ -160860,6 +160860,8 @@
| * TestSimpleOptionalArgumentRequest | 0x13 |
| * TestEmitTestEventRequest | 0x14 |
| * TestEmitTestFabricScopedEventRequest | 0x15 |
+| * TestBatchHelperRequest | 0x16 |
+| * TestSecondBatchHelperRequest | 0x17 |
|------------------------------------------------------------------------------|
| Attributes: | |
| * Boolean | 0x0000 |
@@ -162549,6 +162551,149 @@
chip::app::Clusters::UnitTesting::Commands::TestEmitTestFabricScopedEventRequest::Type mRequest;
};
+#if MTR_ENABLE_PROVISIONAL
+/*
+ * Command TestBatchHelperRequest
+ */
+class UnitTestingTestBatchHelperRequest : public ClusterCommand {
+public:
+ UnitTestingTestBatchHelperRequest()
+ : ClusterCommand("test-batch-helper-request")
+ {
+#if MTR_ENABLE_PROVISIONAL
+ AddArgument("SleepBeforeResponseTimeMs", 0, UINT16_MAX, &mRequest.sleepBeforeResponseTimeMs);
+#endif // MTR_ENABLE_PROVISIONAL
+#if MTR_ENABLE_PROVISIONAL
+ AddArgument("SizeOfResponseBuffer", 0, UINT16_MAX, &mRequest.sizeOfResponseBuffer);
+#endif // MTR_ENABLE_PROVISIONAL
+#if MTR_ENABLE_PROVISIONAL
+ AddArgument("FillCharacter", 0, UINT8_MAX, &mRequest.fillCharacter);
+#endif // MTR_ENABLE_PROVISIONAL
+ ClusterCommand::AddArguments();
+ }
+
+ CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override
+ {
+ constexpr chip::ClusterId clusterId = chip::app::Clusters::UnitTesting::Id;
+ constexpr chip::CommandId commandId = chip::app::Clusters::UnitTesting::Commands::TestBatchHelperRequest::Id;
+
+ ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId);
+
+ dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL);
+ __auto_type * cluster = [[MTRBaseClusterUnitTesting alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue];
+ __auto_type * params = [[MTRUnitTestingClusterTestBatchHelperRequestParams alloc] init];
+ params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil;
+#if MTR_ENABLE_PROVISIONAL
+ params.sleepBeforeResponseTimeMs = [NSNumber numberWithUnsignedShort:mRequest.sleepBeforeResponseTimeMs];
+#endif // MTR_ENABLE_PROVISIONAL
+#if MTR_ENABLE_PROVISIONAL
+ params.sizeOfResponseBuffer = [NSNumber numberWithUnsignedShort:mRequest.sizeOfResponseBuffer];
+#endif // MTR_ENABLE_PROVISIONAL
+#if MTR_ENABLE_PROVISIONAL
+ params.fillCharacter = [NSNumber numberWithUnsignedChar:mRequest.fillCharacter];
+#endif // MTR_ENABLE_PROVISIONAL
+ uint16_t repeatCount = mRepeatCount.ValueOr(1);
+ uint16_t __block responsesNeeded = repeatCount;
+ while (repeatCount--) {
+ [cluster testBatchHelperRequestWithParams:params completion:
+ ^(MTRUnitTestingClusterTestBatchHelperResponseParams * _Nullable values, NSError * _Nullable error) {
+ NSLog(@"Values: %@", values);
+ if (error == nil) {
+ constexpr chip::CommandId responseId = chip::app::Clusters::UnitTesting::Commands::TestBatchHelperResponse::Id;
+ RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values);
+ }
+ responsesNeeded--;
+ if (error != nil) {
+ mError = error;
+ LogNSError("Error", error);
+ constexpr chip::CommandId responseId = chip::app::Clusters::UnitTesting::Commands::TestBatchHelperResponse::Id;
+ RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error);
+ }
+ if (responsesNeeded == 0) {
+ SetCommandExitStatus(mError);
+ }
+ }];
+ }
+ return CHIP_NO_ERROR;
+ }
+
+private:
+ chip::app::Clusters::UnitTesting::Commands::TestBatchHelperRequest::Type mRequest;
+};
+
+#endif // MTR_ENABLE_PROVISIONAL
+#if MTR_ENABLE_PROVISIONAL
+/*
+ * Command TestSecondBatchHelperRequest
+ */
+class UnitTestingTestSecondBatchHelperRequest : public ClusterCommand {
+public:
+ UnitTestingTestSecondBatchHelperRequest()
+ : ClusterCommand("test-second-batch-helper-request")
+ {
+#if MTR_ENABLE_PROVISIONAL
+ AddArgument("SleepBeforeResponseTimeMs", 0, UINT16_MAX, &mRequest.sleepBeforeResponseTimeMs);
+#endif // MTR_ENABLE_PROVISIONAL
+#if MTR_ENABLE_PROVISIONAL
+ AddArgument("SizeOfResponseBuffer", 0, UINT16_MAX, &mRequest.sizeOfResponseBuffer);
+#endif // MTR_ENABLE_PROVISIONAL
+#if MTR_ENABLE_PROVISIONAL
+ AddArgument("FillCharacter", 0, UINT8_MAX, &mRequest.fillCharacter);
+#endif // MTR_ENABLE_PROVISIONAL
+ ClusterCommand::AddArguments();
+ }
+
+ CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override
+ {
+ constexpr chip::ClusterId clusterId = chip::app::Clusters::UnitTesting::Id;
+ constexpr chip::CommandId commandId = chip::app::Clusters::UnitTesting::Commands::TestSecondBatchHelperRequest::Id;
+
+ ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId);
+
+ dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL);
+ __auto_type * cluster = [[MTRBaseClusterUnitTesting alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue];
+ __auto_type * params = [[MTRUnitTestingClusterTestSecondBatchHelperRequestParams alloc] init];
+ params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil;
+#if MTR_ENABLE_PROVISIONAL
+ params.sleepBeforeResponseTimeMs = [NSNumber numberWithUnsignedShort:mRequest.sleepBeforeResponseTimeMs];
+#endif // MTR_ENABLE_PROVISIONAL
+#if MTR_ENABLE_PROVISIONAL
+ params.sizeOfResponseBuffer = [NSNumber numberWithUnsignedShort:mRequest.sizeOfResponseBuffer];
+#endif // MTR_ENABLE_PROVISIONAL
+#if MTR_ENABLE_PROVISIONAL
+ params.fillCharacter = [NSNumber numberWithUnsignedChar:mRequest.fillCharacter];
+#endif // MTR_ENABLE_PROVISIONAL
+ uint16_t repeatCount = mRepeatCount.ValueOr(1);
+ uint16_t __block responsesNeeded = repeatCount;
+ while (repeatCount--) {
+ [cluster testSecondBatchHelperRequestWithParams:params completion:
+ ^(MTRUnitTestingClusterTestBatchHelperResponseParams * _Nullable values, NSError * _Nullable error) {
+ NSLog(@"Values: %@", values);
+ if (error == nil) {
+ constexpr chip::CommandId responseId = chip::app::Clusters::UnitTesting::Commands::TestBatchHelperResponse::Id;
+ RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values);
+ }
+ responsesNeeded--;
+ if (error != nil) {
+ mError = error;
+ LogNSError("Error", error);
+ constexpr chip::CommandId responseId = chip::app::Clusters::UnitTesting::Commands::TestBatchHelperResponse::Id;
+ RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error);
+ }
+ if (responsesNeeded == 0) {
+ SetCommandExitStatus(mError);
+ }
+ }];
+ }
+ return CHIP_NO_ERROR;
+ }
+
+private:
+ chip::app::Clusters::UnitTesting::Commands::TestSecondBatchHelperRequest::Type mRequest;
+};
+
+#endif // MTR_ENABLE_PROVISIONAL
+
/*
* Attribute Boolean
*/
@@ -181084,6 +181229,12 @@
make_unique<UnitTestingTestSimpleOptionalArgumentRequest>(), //
make_unique<UnitTestingTestEmitTestEventRequest>(), //
make_unique<UnitTestingTestEmitTestFabricScopedEventRequest>(), //
+#if MTR_ENABLE_PROVISIONAL
+ make_unique<UnitTestingTestBatchHelperRequest>(), //
+#endif // MTR_ENABLE_PROVISIONAL
+#if MTR_ENABLE_PROVISIONAL
+ make_unique<UnitTestingTestSecondBatchHelperRequest>(), //
+#endif // MTR_ENABLE_PROVISIONAL
make_unique<ReadAttribute>(Id), //
make_unique<WriteAttribute>(Id), //
make_unique<SubscribeAttribute>(Id), //
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 d67b622..5a739fd 100644
--- a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h
+++ b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h
@@ -143224,7 +143224,7 @@
{
id actualValue = value;
- VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast<uint32_t>(18)));
+ VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast<uint32_t>(20)));
VerifyOrReturn(CheckValue("", actualValue[0], 0UL));
VerifyOrReturn(CheckValue("", actualValue[1], 1UL));
VerifyOrReturn(CheckValue("", actualValue[2], 2UL));
@@ -143243,6 +143243,8 @@
VerifyOrReturn(CheckValue("", actualValue[15], 19UL));
VerifyOrReturn(CheckValue("", actualValue[16], 20UL));
VerifyOrReturn(CheckValue("", actualValue[17], 21UL));
+ VerifyOrReturn(CheckValue("", actualValue[18], 22UL));
+ VerifyOrReturn(CheckValue("", actualValue[19], 23UL));
}
NextTest();
@@ -143269,7 +143271,7 @@
{
id actualValue = value;
- VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast<uint32_t>(9)));
+ VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast<uint32_t>(10)));
VerifyOrReturn(CheckValue("", actualValue[0], 0UL));
VerifyOrReturn(CheckValue("", actualValue[1], 1UL));
VerifyOrReturn(CheckValue("", actualValue[2], 4UL));
@@ -143279,6 +143281,7 @@
VerifyOrReturn(CheckValue("", actualValue[6], 9UL));
VerifyOrReturn(CheckValue("", actualValue[7], 10UL));
VerifyOrReturn(CheckValue("", actualValue[8], 11UL));
+ VerifyOrReturn(CheckValue("", actualValue[9], 12UL));
}
NextTest();