Skip to content

Commit

Permalink
Linux tv-casting-app enable AccountLogin cluster (#33766)
Browse files Browse the repository at this point in the history
  • Loading branch information
pgregorr-amazon authored and pull[bot] committed Jul 25, 2024
1 parent 0262463 commit 1236624
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,12 @@ public View onCreateView(
v -> {
Endpoint endpoint;
if (useCommissionerGeneratedPasscode) {
// For the example Commissioner-Generated passcode commissioning flow, run demo
// interactions with the Endpoint with ID DEFAULT_ENDPOINT_ID_FOR_CGP_FLOW = 1. For this
// flow, we commissioned with the Target Content Application with Vendor ID 1111. Since
// this target content application does not report its Endpoint's Vendor IDs, we find
// the desired endpoint based on the Endpoint ID. See
// connectedhomeip/examples/tv-app/tv-common/include/AppTv.h.
endpoint =
EndpointSelectorExample.selectEndpointById(
selectedCastingPlayer, DEFAULT_ENDPOINT_ID_FOR_CGP_FLOW);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,12 @@ public View onCreateView(
v -> {
Endpoint endpoint;
if (useCommissionerGeneratedPasscode) {
// For the example Commissioner-Generated passcode commissioning flow, run demo
// interactions with the Endpoint with ID DEFAULT_ENDPOINT_ID_FOR_CGP_FLOW = 1. For this
// flow, we commissioned with the Target Content Application with Vendor ID 1111. Since
// this target content application does not report its Endpoint's Vendor IDs, we find
// the desired endpoint based on the Endpoint ID. See
// connectedhomeip/examples/tv-app/tv-common/include/AppTv.h.
endpoint =
EndpointSelectorExample.selectEndpointById(
selectedCastingPlayer, DEFAULT_ENDPOINT_ID_FOR_CGP_FLOW);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ public View onCreateView(
LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
Endpoint endpoint;
if (useCommissionerGeneratedPasscode) {
// For the example Commissioner-Generated passcode commissioning flow, run demo interactions
// with the Endpoint with ID DEFAULT_ENDPOINT_ID_FOR_CGP_FLOW = 1. For this flow, we
// commissioned with the Target Content Application with Vendor ID 1111. Since this target
// content application does not report its Endpoint's Vendor IDs, we find the desired endpoint
// based on the Endpoint ID. See connectedhomeip/examples/tv-app/tv-common/include/AppTv.h.
endpoint =
EndpointSelectorExample.selectEndpointById(
selectedCastingPlayer, DEFAULT_ENDPOINT_ID_FOR_CGP_FLOW);
Expand Down
22 changes: 22 additions & 0 deletions examples/tv-casting-app/tv-casting-common/clusters/Clusters.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,28 @@ class ApplicationBasicCluster : public core::BaseCluster
};
}; // namespace application_basic

namespace account_login {
class AccountLoginCluster : public core::BaseCluster
{
public:
AccountLoginCluster(memory::Weak<core::Endpoint> endpoint) : core::BaseCluster(endpoint) {}

void SetUp()
{
ChipLogProgress(AppServer, "Setting up AccountLoginCluster on EndpointId: %d", GetEndpoint().lock()->GetId());

RegisterCommand(chip::app::Clusters::AccountLogin::Commands::GetSetupPIN::Id,
new core::Command<chip::app::Clusters::AccountLogin::Commands::GetSetupPIN::Type>(GetEndpoint()));
RegisterCommand(chip::app::Clusters::AccountLogin::Commands::GetSetupPINResponse::Id,
new core::Command<chip::app::Clusters::AccountLogin::Commands::GetSetupPINResponse::Type>(GetEndpoint()));
RegisterCommand(chip::app::Clusters::AccountLogin::Commands::Login::Id,
new core::Command<chip::app::Clusters::AccountLogin::Commands::Login::Type>(GetEndpoint()));
RegisterCommand(chip::app::Clusters::AccountLogin::Commands::Logout::Id,
new core::Command<chip::app::Clusters::AccountLogin::Commands::Logout::Type>(GetEndpoint()));
}
};
}; // namespace account_login

namespace application_launcher {
class ApplicationLauncherCluster : public core::BaseCluster
{
Expand Down

0 comments on commit 1236624

Please sign in to comment.