@@ -108,6 +108,7 @@ void InteractionModelEngine::Shutdown()
108
108
109
109
mReadHandlers .ReleaseAll ();
110
110
111
+ #if CHIP_CONFIG_ENABLE_READ_CLIENT
111
112
// Shut down any subscription clients that are still around. They won't be
112
113
// able to work after this point anyway, since we're about to drop our refs
113
114
// to them.
@@ -134,6 +135,7 @@ void InteractionModelEngine::Shutdown()
134
135
// After that, we just null out our tracker.
135
136
//
136
137
mpActiveReadClientList = nullptr ;
138
+ #endif // CHIP_CONFIG_ENABLE_READ_CLIENT
137
139
138
140
for (auto & writeHandler : mWriteHandlers )
139
141
{
@@ -254,6 +256,7 @@ uint32_t InteractionModelEngine::GetNumActiveWriteHandlers() const
254
256
return numActive;
255
257
}
256
258
259
+ #if CHIP_CONFIG_ENABLE_READ_CLIENT
257
260
CHIP_ERROR InteractionModelEngine::ShutdownSubscription (const ScopedNodeId & aPeerNodeId, SubscriptionId aSubscriptionId)
258
261
{
259
262
assertChipStackLockedByCurrentThread ();
@@ -311,6 +314,7 @@ void InteractionModelEngine::ShutdownMatchingSubscriptions(const Optional<Fabric
311
314
readClient = nextClient;
312
315
}
313
316
}
317
+ #endif // CHIP_CONFIG_ENABLE_READ_CLIENT
314
318
315
319
void InteractionModelEngine::OnDone (CommandHandler & apCommandObj)
316
320
{
@@ -794,6 +798,7 @@ CHIP_ERROR InteractionModelEngine::OnTimedRequest(Messaging::ExchangeContext * a
794
798
return handler->OnMessageReceived (apExchangeContext, aPayloadHeader, std::move (aPayload));
795
799
}
796
800
801
+ #if CHIP_CONFIG_ENABLE_READ_CLIENT
797
802
Status InteractionModelEngine::OnUnsolicitedReportData (Messaging::ExchangeContext * apExchangeContext,
798
803
const PayloadHeader & aPayloadHeader, System::PacketBufferHandle && aPayload)
799
804
{
@@ -849,6 +854,7 @@ Status InteractionModelEngine::OnUnsolicitedReportData(Messaging::ExchangeContex
849
854
850
855
return Status::InvalidSubscription;
851
856
}
857
+ #endif // CHIP_CONFIG_ENABLE_READ_CLIENT
852
858
853
859
CHIP_ERROR InteractionModelEngine::OnUnsolicitedMessageReceived (const PayloadHeader & payloadHeader,
854
860
ExchangeDelegate *& newDelegate)
@@ -892,10 +898,12 @@ CHIP_ERROR InteractionModelEngine::OnMessageReceived(Messaging::ExchangeContext
892
898
status =
893
899
OnReadInitialRequest (apExchangeContext, aPayloadHeader, std::move (aPayload), ReadHandler::InteractionType::Subscribe);
894
900
}
901
+ #if CHIP_CONFIG_ENABLE_READ_CLIENT
895
902
else if (aPayloadHeader.HasMessageType (Protocols::InteractionModel::MsgType::ReportData))
896
903
{
897
904
status = OnUnsolicitedReportData (apExchangeContext, aPayloadHeader, std::move (aPayload));
898
905
}
906
+ #endif // CHIP_CONFIG_ENABLE_READ_CLIENT
899
907
else if (aPayloadHeader.HasMessageType (MsgType::TimedRequest))
900
908
{
901
909
OnTimedRequest (apExchangeContext, aPayloadHeader, std::move (aPayload), status);
@@ -920,11 +928,13 @@ void InteractionModelEngine::OnResponseTimeout(Messaging::ExchangeContext * ec)
920
928
ChipLogValueExchange (ec));
921
929
}
922
930
931
+ #if CHIP_CONFIG_ENABLE_READ_CLIENT
923
932
void InteractionModelEngine::AddReadClient (ReadClient * apReadClient)
924
933
{
925
934
apReadClient->SetNextClient (mpActiveReadClientList);
926
935
mpActiveReadClientList = apReadClient;
927
936
}
937
+ #endif // CHIP_CONFIG_ENABLE_READ_CLIENT
928
938
929
939
bool InteractionModelEngine::TrimFabricForSubscriptions (FabricIndex aFabricIndex, bool aForceEvict)
930
940
{
@@ -1322,6 +1332,7 @@ Protocols::InteractionModel::Status InteractionModelEngine::EnsureResourceForRea
1322
1332
return Status::Success;
1323
1333
}
1324
1334
1335
+ #if CHIP_CONFIG_ENABLE_READ_CLIENT
1325
1336
void InteractionModelEngine::RemoveReadClient (ReadClient * apReadClient)
1326
1337
{
1327
1338
ReadClient * pPrevListItem = nullptr ;
@@ -1380,6 +1391,7 @@ bool InteractionModelEngine::InActiveReadClientList(ReadClient * apReadClient)
1380
1391
1381
1392
return false ;
1382
1393
}
1394
+ #endif // CHIP_CONFIG_ENABLE_READ_CLIENT
1383
1395
1384
1396
bool InteractionModelEngine::HasConflictWriteRequests (const WriteHandler * apWriteHandler, const ConcreteAttributePath & aPath)
1385
1397
{
@@ -1738,6 +1750,7 @@ void InteractionModelEngine::OnFabricRemoved(const FabricTable & fabricTable, Fa
1738
1750
return Loop::Continue;
1739
1751
});
1740
1752
1753
+ #if CHIP_CONFIG_ENABLE_READ_CLIENT
1741
1754
for (auto * readClient = mpActiveReadClientList; readClient != nullptr ; readClient = readClient->GetNextClient ())
1742
1755
{
1743
1756
if (readClient->GetFabricIndex () == fabricIndex)
@@ -1746,6 +1759,7 @@ void InteractionModelEngine::OnFabricRemoved(const FabricTable & fabricTable, Fa
1746
1759
readClient->Close (CHIP_ERROR_IM_FABRIC_DELETED, false );
1747
1760
}
1748
1761
}
1762
+ #endif // CHIP_CONFIG_ENABLE_READ_CLIENT
1749
1763
1750
1764
for (auto & handler : mWriteHandlers )
1751
1765
{
0 commit comments