@@ -114,10 +114,18 @@ class TestCommandInteraction
114
114
private:
115
115
};
116
116
117
+ // We want to send a TestSimpleArgumentRequest::Type, but get a
118
+ // TestStructArrayArgumentResponse in return, so need to shadow the actual
119
+ // ResponseType that TestSimpleArgumentRequest has.
120
+ struct FakeRequest : public TestCluster ::Commands::TestSimpleArgumentRequest::Type
121
+ {
122
+ using ResponseType = TestCluster::Commands::TestStructArrayArgumentResponse::DecodableType;
123
+ };
124
+
117
125
void TestCommandInteraction::TestNoHandler (nlTestSuite * apSuite, void * apContext)
118
126
{
119
127
TestContext & ctx = *static_cast <TestContext *>(apContext);
120
- TestCluster::Commands::TestSimpleArgumentRequest::Type request;
128
+ FakeRequest request;
121
129
auto sessionHandle = ctx.GetSessionBobToAlice ();
122
130
123
131
request.arg1 = true ;
@@ -142,8 +150,8 @@ void TestCommandInteraction::TestNoHandler(nlTestSuite * apSuite, void * apConte
142
150
143
151
ctx.EnableAsyncDispatch ();
144
152
145
- chip::Controller::InvokeCommandRequest<TestCluster::Commands::TestStructArrayArgumentResponse::DecodableType>(
146
- &ctx. GetExchangeManager (), sessionHandle, kTestEndpointId , request, onSuccessCb, onFailureCb);
153
+ chip::Controller::InvokeCommandRequest (&ctx. GetExchangeManager (), sessionHandle, kTestEndpointId , request, onSuccessCb,
154
+ onFailureCb);
147
155
148
156
ctx.DrainAndServiceIO ();
149
157
@@ -176,7 +184,7 @@ DECLARE_DYNAMIC_ENDPOINT(testEndpoint, testEndpointClusters);
176
184
void TestCommandInteraction::TestDataResponse (nlTestSuite * apSuite, void * apContext)
177
185
{
178
186
TestContext & ctx = *static_cast <TestContext *>(apContext);
179
- TestCluster::Commands::TestSimpleArgumentRequest::Type request;
187
+ FakeRequest request;
180
188
auto sessionHandle = ctx.GetSessionBobToAlice ();
181
189
TestClusterCommandHandler commandHandler;
182
190
@@ -220,8 +228,8 @@ void TestCommandInteraction::TestDataResponse(nlTestSuite * apSuite, void * apCo
220
228
221
229
responseDirective = kSendDataResponse ;
222
230
223
- chip::Controller::InvokeCommandRequest<TestCluster::Commands::TestStructArrayArgumentResponse::DecodableType>(
224
- &ctx. GetExchangeManager (), sessionHandle, kTestEndpointId , request, onSuccessCb, onFailureCb);
231
+ chip::Controller::InvokeCommandRequest (&ctx. GetExchangeManager (), sessionHandle, kTestEndpointId , request, onSuccessCb,
232
+ onFailureCb);
225
233
226
234
ctx.DrainAndServiceIO ();
227
235
0 commit comments