Skip to content

Commit c9bcd22

Browse files
Linux tv-casting-app enable AccountLogin cluster (#33766)
1 parent 9b7e300 commit c9bcd22

File tree

4 files changed

+39
-0
lines changed

4 files changed

+39
-0
lines changed

examples/tv-casting-app/android/App/app/src/main/java/com/matter/casting/ApplicationBasicReadVendorIDExampleFragment.java

+6
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,12 @@ public View onCreateView(
7777
v -> {
7878
Endpoint endpoint;
7979
if (useCommissionerGeneratedPasscode) {
80+
// For the example Commissioner-Generated passcode commissioning flow, run demo
81+
// interactions with the Endpoint with ID DEFAULT_ENDPOINT_ID_FOR_CGP_FLOW = 1. For this
82+
// flow, we commissioned with the Target Content Application with Vendor ID 1111. Since
83+
// this target content application does not report its Endpoint's Vendor IDs, we find
84+
// the desired endpoint based on the Endpoint ID. See
85+
// connectedhomeip/examples/tv-app/tv-common/include/AppTv.h.
8086
endpoint =
8187
EndpointSelectorExample.selectEndpointById(
8288
selectedCastingPlayer, DEFAULT_ENDPOINT_ID_FOR_CGP_FLOW);

examples/tv-casting-app/android/App/app/src/main/java/com/matter/casting/ContentLauncherLaunchURLExampleFragment.java

+6
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,12 @@ public View onCreateView(
7777
v -> {
7878
Endpoint endpoint;
7979
if (useCommissionerGeneratedPasscode) {
80+
// For the example Commissioner-Generated passcode commissioning flow, run demo
81+
// interactions with the Endpoint with ID DEFAULT_ENDPOINT_ID_FOR_CGP_FLOW = 1. For this
82+
// flow, we commissioned with the Target Content Application with Vendor ID 1111. Since
83+
// this target content application does not report its Endpoint's Vendor IDs, we find
84+
// the desired endpoint based on the Endpoint ID. See
85+
// connectedhomeip/examples/tv-app/tv-common/include/AppTv.h.
8086
endpoint =
8187
EndpointSelectorExample.selectEndpointById(
8288
selectedCastingPlayer, DEFAULT_ENDPOINT_ID_FOR_CGP_FLOW);

examples/tv-casting-app/android/App/app/src/main/java/com/matter/casting/MediaPlaybackSubscribeToCurrentStateExampleFragment.java

+5
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@ public View onCreateView(
7979
LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
8080
Endpoint endpoint;
8181
if (useCommissionerGeneratedPasscode) {
82+
// For the example Commissioner-Generated passcode commissioning flow, run demo interactions
83+
// with the Endpoint with ID DEFAULT_ENDPOINT_ID_FOR_CGP_FLOW = 1. For this flow, we
84+
// commissioned with the Target Content Application with Vendor ID 1111. Since this target
85+
// content application does not report its Endpoint's Vendor IDs, we find the desired endpoint
86+
// based on the Endpoint ID. See connectedhomeip/examples/tv-app/tv-common/include/AppTv.h.
8287
endpoint =
8388
EndpointSelectorExample.selectEndpointById(
8489
selectedCastingPlayer, DEFAULT_ENDPOINT_ID_FOR_CGP_FLOW);

examples/tv-casting-app/tv-casting-common/clusters/Clusters.h

+22
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,28 @@ class ApplicationBasicCluster : public core::BaseCluster
6767
};
6868
}; // namespace application_basic
6969

70+
namespace account_login {
71+
class AccountLoginCluster : public core::BaseCluster
72+
{
73+
public:
74+
AccountLoginCluster(memory::Weak<core::Endpoint> endpoint) : core::BaseCluster(endpoint) {}
75+
76+
void SetUp()
77+
{
78+
ChipLogProgress(AppServer, "Setting up AccountLoginCluster on EndpointId: %d", GetEndpoint().lock()->GetId());
79+
80+
RegisterCommand(chip::app::Clusters::AccountLogin::Commands::GetSetupPIN::Id,
81+
new core::Command<chip::app::Clusters::AccountLogin::Commands::GetSetupPIN::Type>(GetEndpoint()));
82+
RegisterCommand(chip::app::Clusters::AccountLogin::Commands::GetSetupPINResponse::Id,
83+
new core::Command<chip::app::Clusters::AccountLogin::Commands::GetSetupPINResponse::Type>(GetEndpoint()));
84+
RegisterCommand(chip::app::Clusters::AccountLogin::Commands::Login::Id,
85+
new core::Command<chip::app::Clusters::AccountLogin::Commands::Login::Type>(GetEndpoint()));
86+
RegisterCommand(chip::app::Clusters::AccountLogin::Commands::Logout::Id,
87+
new core::Command<chip::app::Clusters::AccountLogin::Commands::Logout::Type>(GetEndpoint()));
88+
}
89+
};
90+
}; // namespace account_login
91+
7092
namespace application_launcher {
7193
class ApplicationLauncherCluster : public core::BaseCluster
7294
{

0 commit comments

Comments
 (0)