Skip to content

Commit 7eff05a

Browse files
committed
Update code as it failed tests
1 parent 0e435c6 commit 7eff05a

File tree

3 files changed

+32
-14
lines changed

3 files changed

+32
-14
lines changed

examples/tv-app/linux/main.cpp

+23
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,29 @@ void ApplicationInit()
4545
ChipLogDetail(DeviceLayer, "TV Linux App: Warning - Fixed Content App Endpoint Not Disabled");
4646
// Can't disable this without breaking CI unit tests that act upon account login cluster (only available on ep3)
4747
// emberAfEndpointEnableDisable(3, false);
48+
49+
// Install Content Apps
50+
ContentAppFactoryImpl * factory = GetContentAppFactoryImpl();
51+
52+
// Content App 1
53+
constexpr uint16_t kApp1VendorId = 65521;
54+
constexpr uint16_t kApp1ProductId = 32769;
55+
factory->InstallContentApp(kApp1VendorId, kApp1ProductId);
56+
57+
// Content App 2
58+
constexpr uint16_t kApp2VendorId = 1;
59+
constexpr uint16_t kApp2ProductId = 11;
60+
factory->InstallContentApp(kApp2VendorId, kApp2ProductId);
61+
62+
// Content App 3
63+
constexpr uint16_t kApp3VendorId = 9050;
64+
constexpr uint16_t kApp3ProductId = 22;
65+
factory->InstallContentApp(kApp3VendorId, kApp3ProductId);
66+
67+
// Content App 4
68+
constexpr uint16_t kApp4VendorId = 1111;
69+
constexpr uint16_t kApp4ProductId = 22;
70+
factory->InstallContentApp(kApp4VendorId, kApp4ProductId);
4871
}
4972

5073
void ApplicationShutdown() {}

examples/tv-app/tv-common/shell/AppTvShellCommands.cpp

+9
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,8 @@ static CHIP_ERROR PrintAllCommands()
209209
#if CHIP_DEVICE_CONFIG_ENABLE_BOTH_COMMISSIONER_AND_COMMISSIONEE
210210
streamer_printf(sout, " print-app-access Print all ACLs for app platform fabric. Usage: app print-app-access\r\n");
211211
streamer_printf(sout, " remove-app-access Remove all ACLs for app platform fabric. Usage: app remove-app-access\r\n");
212+
streamer_printf(sout, " print-installed-apps Print all installed content apps with their endpoints. Usage: app print-installed-apps\r\n");
213+
212214
streamer_printf(sout,
213215
" commission <udc-entry> Commission given udc-entry using given pincode from corresponding app. Usage: "
214216
"app commission 0\r\n");
@@ -436,6 +438,13 @@ static CHIP_ERROR AppPlatformHandler(int argc, char ** argv)
436438
Access::GetAccessControl().DeleteAllEntriesForFabric(GetDeviceCommissioner()->GetFabricIndex());
437439
return CHIP_NO_ERROR;
438440
}
441+
else if (strcmp(argv[0], "print-installed-apps") == 0)
442+
{
443+
ContentAppFactoryImpl * factory = GetContentAppFactoryImpl();
444+
factory->LogInstalledApps();
445+
446+
return CHIP_NO_ERROR;
447+
}
439448
else if (strcmp(argv[0], "commission") == 0)
440449
{
441450
if (argc < 2)

examples/tv-app/tv-common/src/AppTv.cpp

-14
Original file line numberDiff line numberDiff line change
@@ -801,22 +801,8 @@ std::list<ClusterId> ContentAppFactoryImpl::GetAllowedClusterListForStaticEndpoi
801801
CHIP_ERROR AppTvInit()
802802
{
803803
#if CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED
804-
// test data for apps
805-
constexpr uint16_t kApp1VendorId = 1;
806-
constexpr uint16_t kApp1ProductId = 11;
807-
constexpr uint16_t kApp2VendorId = 65521;
808-
constexpr uint16_t kApp2ProductId = 32769;
809-
constexpr uint16_t kApp3VendorId = 9050;
810-
constexpr uint16_t kApp3ProductId = 22;
811-
constexpr uint16_t kApp4VendorId = 1111;
812-
constexpr uint16_t kApp4ProductId = 22;
813-
814804
ContentAppPlatform::GetInstance().SetupAppPlatform();
815805
ContentAppPlatform::GetInstance().SetContentAppFactory(&gFactory);
816-
gFactory.InstallContentApp(kApp1VendorId, kApp1ProductId);
817-
gFactory.InstallContentApp(kApp2VendorId, kApp2ProductId);
818-
gFactory.InstallContentApp(kApp3VendorId, kApp3ProductId);
819-
gFactory.InstallContentApp(kApp4VendorId, kApp4ProductId);
820806
uint16_t value;
821807
if (DeviceLayer::GetDeviceInstanceInfoProvider()->GetVendorId(value) != CHIP_NO_ERROR)
822808
{

0 commit comments

Comments
 (0)