@@ -121,12 +121,11 @@ CHIP_ERROR CommandSender::OnMessageReceived(Messaging::ExchangeContext * apExcha
121
121
}
122
122
123
123
CHIP_ERROR err = CHIP_NO_ERROR;
124
- StatusIB status (Protocols::InteractionModel::Status::Failure);
125
124
VerifyOrExit (apExchangeContext == mpExchangeCtx, err = CHIP_ERROR_INCORRECT_STATE);
126
125
127
126
if (mState == State::AwaitingTimedStatus)
128
127
{
129
- err = HandleTimedStatus (aPayloadHeader, std::move (aPayload), status );
128
+ err = HandleTimedStatus (aPayloadHeader, std::move (aPayload));
130
129
// Skip all other processing here (which is for the response to the
131
130
// invoke request), no matter whether err is success or not.
132
131
goto exit ;
@@ -136,11 +135,10 @@ CHIP_ERROR CommandSender::OnMessageReceived(Messaging::ExchangeContext * apExcha
136
135
{
137
136
err = ProcessInvokeResponse (std::move (aPayload));
138
137
SuccessOrExit (err);
139
- status.mStatus = Protocols::InteractionModel::Status::Success;
140
138
}
141
139
else if (aPayloadHeader.HasMessageType (Protocols::InteractionModel::MsgType::StatusResponse))
142
140
{
143
- err = StatusResponse::ProcessStatusResponse (std::move (aPayload), status );
141
+ err = StatusResponse::ProcessStatusResponse (std::move (aPayload));
144
142
SuccessOrExit (err);
145
143
}
146
144
else
@@ -153,7 +151,7 @@ CHIP_ERROR CommandSender::OnMessageReceived(Messaging::ExchangeContext * apExcha
153
151
{
154
152
if (err != CHIP_NO_ERROR)
155
153
{
156
- mpCallback->OnError (this , status, err);
154
+ mpCallback->OnError (this , err);
157
155
}
158
156
}
159
157
@@ -210,9 +208,7 @@ void CommandSender::OnResponseTimeout(Messaging::ExchangeContext * apExchangeCon
210
208
211
209
if (mpCallback != nullptr )
212
210
{
213
- StatusIB status;
214
- status.mStatus = Protocols::InteractionModel::Status::Failure;
215
- mpCallback->OnError (this , status, CHIP_ERROR_TIMEOUT);
211
+ mpCallback->OnError (this , CHIP_ERROR_TIMEOUT);
216
212
}
217
213
218
214
Close ();
@@ -309,14 +305,14 @@ CHIP_ERROR CommandSender::ProcessInvokeResponseIB(InvokeResponseIB::Parser & aIn
309
305
310
306
if (mpCallback != nullptr )
311
307
{
312
- if (statusIB.mStatus == Protocols::InteractionModel::Status::Success )
308
+ if (statusIB.IsSuccess () )
313
309
{
314
310
mpCallback->OnResponse (this , ConcreteCommandPath (endpointId, clusterId, commandId), statusIB,
315
311
hasDataResponse ? &commandDataReader : nullptr );
316
312
}
317
313
else
318
314
{
319
- mpCallback->OnError (this , statusIB, CHIP_ERROR_IM_STATUS_CODE_RECEIVED );
315
+ mpCallback->OnError (this , statusIB. ToChipError () );
320
316
}
321
317
}
322
318
}
@@ -382,10 +378,9 @@ TLV::TLVWriter * CommandSender::GetCommandDataIBTLVWriter()
382
378
}
383
379
}
384
380
385
- CHIP_ERROR CommandSender::HandleTimedStatus (const PayloadHeader & aPayloadHeader, System::PacketBufferHandle && aPayload,
386
- StatusIB & aStatusIB)
381
+ CHIP_ERROR CommandSender::HandleTimedStatus (const PayloadHeader & aPayloadHeader, System::PacketBufferHandle && aPayload)
387
382
{
388
- ReturnErrorOnFailure (TimedRequest::HandleResponse (aPayloadHeader, std::move (aPayload), aStatusIB ));
383
+ ReturnErrorOnFailure (TimedRequest::HandleResponse (aPayloadHeader, std::move (aPayload)));
389
384
390
385
return SendInvokeRequest ();
391
386
}
0 commit comments