Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux tv-casting-app enable AccountLogin cluster #33766

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading