Skip to content

Commit

Permalink
Update code as it failed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lazarkov committed Jul 10, 2024
1 parent 0e435c6 commit 7eff05a
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 14 deletions.
23 changes: 23 additions & 0 deletions examples/tv-app/linux/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,29 @@ void ApplicationInit()
ChipLogDetail(DeviceLayer, "TV Linux App: Warning - Fixed Content App Endpoint Not Disabled");
// Can't disable this without breaking CI unit tests that act upon account login cluster (only available on ep3)
// emberAfEndpointEnableDisable(3, false);

// Install Content Apps
ContentAppFactoryImpl * factory = GetContentAppFactoryImpl();

// Content App 1
constexpr uint16_t kApp1VendorId = 65521;
constexpr uint16_t kApp1ProductId = 32769;
factory->InstallContentApp(kApp1VendorId, kApp1ProductId);

// Content App 2
constexpr uint16_t kApp2VendorId = 1;
constexpr uint16_t kApp2ProductId = 11;
factory->InstallContentApp(kApp2VendorId, kApp2ProductId);

// Content App 3
constexpr uint16_t kApp3VendorId = 9050;
constexpr uint16_t kApp3ProductId = 22;
factory->InstallContentApp(kApp3VendorId, kApp3ProductId);

// Content App 4
constexpr uint16_t kApp4VendorId = 1111;
constexpr uint16_t kApp4ProductId = 22;
factory->InstallContentApp(kApp4VendorId, kApp4ProductId);
}

void ApplicationShutdown() {}
Expand Down
9 changes: 9 additions & 0 deletions examples/tv-app/tv-common/shell/AppTvShellCommands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,8 @@ static CHIP_ERROR PrintAllCommands()
#if CHIP_DEVICE_CONFIG_ENABLE_BOTH_COMMISSIONER_AND_COMMISSIONEE
streamer_printf(sout, " print-app-access Print all ACLs for app platform fabric. Usage: app print-app-access\r\n");
streamer_printf(sout, " remove-app-access Remove all ACLs for app platform fabric. Usage: app remove-app-access\r\n");
streamer_printf(sout, " print-installed-apps Print all installed content apps with their endpoints. Usage: app print-installed-apps\r\n");

streamer_printf(sout,
" commission <udc-entry> Commission given udc-entry using given pincode from corresponding app. Usage: "
"app commission 0\r\n");
Expand Down Expand Up @@ -436,6 +438,13 @@ static CHIP_ERROR AppPlatformHandler(int argc, char ** argv)
Access::GetAccessControl().DeleteAllEntriesForFabric(GetDeviceCommissioner()->GetFabricIndex());
return CHIP_NO_ERROR;
}
else if (strcmp(argv[0], "print-installed-apps") == 0)
{
ContentAppFactoryImpl * factory = GetContentAppFactoryImpl();
factory->LogInstalledApps();

return CHIP_NO_ERROR;
}
else if (strcmp(argv[0], "commission") == 0)
{
if (argc < 2)
Expand Down
14 changes: 0 additions & 14 deletions examples/tv-app/tv-common/src/AppTv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -801,22 +801,8 @@ std::list<ClusterId> ContentAppFactoryImpl::GetAllowedClusterListForStaticEndpoi
CHIP_ERROR AppTvInit()
{
#if CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED
// test data for apps
constexpr uint16_t kApp1VendorId = 1;
constexpr uint16_t kApp1ProductId = 11;
constexpr uint16_t kApp2VendorId = 65521;
constexpr uint16_t kApp2ProductId = 32769;
constexpr uint16_t kApp3VendorId = 9050;
constexpr uint16_t kApp3ProductId = 22;
constexpr uint16_t kApp4VendorId = 1111;
constexpr uint16_t kApp4ProductId = 22;

ContentAppPlatform::GetInstance().SetupAppPlatform();
ContentAppPlatform::GetInstance().SetContentAppFactory(&gFactory);
gFactory.InstallContentApp(kApp1VendorId, kApp1ProductId);
gFactory.InstallContentApp(kApp2VendorId, kApp2ProductId);
gFactory.InstallContentApp(kApp3VendorId, kApp3ProductId);
gFactory.InstallContentApp(kApp4VendorId, kApp4ProductId);
uint16_t value;
if (DeviceLayer::GetDeviceInstanceInfoProvider()->GetVendorId(value) != CHIP_NO_ERROR)
{
Expand Down

0 comments on commit 7eff05a

Please sign in to comment.