From 2546738d8c214430d3cadebc43e680dce3acf8ee Mon Sep 17 00:00:00 2001 From: yunhanw-google Date: Fri, 18 Feb 2022 03:24:22 -0800 Subject: [PATCH] Fix exchange delegate for post-subscription (#15339) --- src/app/ReadClient.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/app/ReadClient.cpp b/src/app/ReadClient.cpp index 01ac081f4c4873..8356407b90bf22 100644 --- a/src/app/ReadClient.cpp +++ b/src/app/ReadClient.cpp @@ -396,6 +396,12 @@ CHIP_ERROR ReadClient::OnUnsolicitedReportData(Messaging::ExchangeContext * apEx { mpExchangeCtx = apExchangeContext; + // + // Let's take over further message processing on this exchange from the IM. + // This is only relevant for reports during post-subscription. + // + mpExchangeCtx->SetDelegate(this); + CHIP_ERROR err = ProcessReportData(std::move(aPayload)); if (err != CHIP_NO_ERROR) {