|
44 | 44 | #include <lib/support/CodeUtils.h>
|
45 | 45 | #include <lib/support/ZclString.h>
|
46 | 46 | #include <platform/CHIPDeviceLayer.h>
|
| 47 | +#include <platform/DeviceInstanceInfoProvider.h> |
47 | 48 |
|
48 | 49 | using namespace chip;
|
49 | 50 | using namespace chip::AppPlatform;
|
| 51 | +using namespace chip::DeviceLayer; |
50 | 52 |
|
51 | 53 | #if CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED
|
52 | 54 | ContentAppFactoryImpl gFactory;
|
@@ -407,6 +409,20 @@ std::list<ClusterId> ContentAppFactoryImpl::GetAllowedClusterListForStaticEndpoi
|
407 | 409 | {
|
408 | 410 | if (endpointId == kLocalVideoPlayerEndpointId)
|
409 | 411 | {
|
| 412 | + if (GetVendorPrivilege(vendorId) == Access::Privilege::kAdminister) |
| 413 | + { |
| 414 | + ChipLogProgress(DeviceLayer, |
| 415 | + "ContentAppFactoryImpl GetAllowedClusterListForStaticEndpoint priviledged vendor accessible clusters " |
| 416 | + "being returned."); |
| 417 | + return { chip::app::Clusters::Descriptor::Id, chip::app::Clusters::OnOff::Id, |
| 418 | + chip::app::Clusters::WakeOnLan::Id, chip::app::Clusters::MediaPlayback::Id, |
| 419 | + chip::app::Clusters::LowPower::Id, chip::app::Clusters::KeypadInput::Id, |
| 420 | + chip::app::Clusters::ContentLauncher::Id, chip::app::Clusters::AudioOutput::Id, |
| 421 | + chip::app::Clusters::ApplicationLauncher::Id }; |
| 422 | + } |
| 423 | + ChipLogProgress( |
| 424 | + DeviceLayer, |
| 425 | + "ContentAppFactoryImpl GetAllowedClusterListForStaticEndpoint operator vendor accessible clusters being returned."); |
410 | 426 | return { chip::app::Clusters::Descriptor::Id, chip::app::Clusters::OnOff::Id,
|
411 | 427 | chip::app::Clusters::WakeOnLan::Id, chip::app::Clusters::MediaPlayback::Id,
|
412 | 428 | chip::app::Clusters::LowPower::Id, chip::app::Clusters::KeypadInput::Id,
|
@@ -478,3 +494,16 @@ void ReportAttributeChange(EndpointId epId, chip::ClusterId clusterId, chip::Att
|
478 | 494 | {
|
479 | 495 | MatterReportingAttributeChangeCallback(epId, clusterId, attributeId);
|
480 | 496 | }
|
| 497 | + |
| 498 | +void AddSelfVendorAsAdmin() |
| 499 | +{ |
| 500 | + uint16_t value; |
| 501 | + if (DeviceLayer::GetDeviceInstanceInfoProvider()->GetVendorId(value) != CHIP_NO_ERROR) |
| 502 | + { |
| 503 | + ChipLogDetail(Discovery, "AppImpl addSelfVendorAsAdmin Vendor ID not known"); |
| 504 | + } |
| 505 | + else |
| 506 | + { |
| 507 | + gFactory.AddAdminVendorId(value); |
| 508 | + } |
| 509 | +} |
0 commit comments