Skip to content

Commit 39b0f94

Browse files
Added CastingApp::ShutdownAllSubscriptions API
1 parent 7626717 commit 39b0f94

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

examples/tv-casting-app/tv-casting-common/core/CastingApp.cpp

+10
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
#include "support/ChipDeviceEventHandler.h"
2222

23+
#include <app/InteractionModelEngine.h>
2324
#include <app/clusters/bindings/BindingManager.h>
2425
#include <app/server/Server.h>
2526
#include <credentials/DeviceAttestationCredsProvider.h>
@@ -133,6 +134,15 @@ CHIP_ERROR CastingApp::Stop()
133134
return CHIP_ERROR_NOT_IMPLEMENTED;
134135
}
135136

137+
CHIP_ERROR CastingApp::ShutdownAllSubscriptions()
138+
{
139+
VerifyOrReturnError(mState == CASTING_APP_RUNNING, CHIP_ERROR_INCORRECT_STATE);
140+
141+
chip::app::InteractionModelEngine::GetInstance()->ShutdownAllSubscriptions();
142+
143+
return CHIP_NO_ERROR;
144+
}
145+
136146
}; // namespace core
137147
}; // namespace casting
138148
}; // namespace matter

examples/tv-casting-app/tv-casting-common/core/CastingApp.h

+5
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,11 @@ class CastingApp
7272
*/
7373
bool isRunning() { return mState == CASTING_APP_RUNNING; }
7474

75+
/**
76+
* @brief Tears down all active subscriptions.
77+
*/
78+
CHIP_ERROR ShutdownAllSubscriptions();
79+
7580
private:
7681
CastingApp();
7782
static CastingApp * _castingApp;

0 commit comments

Comments
 (0)