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

Remove the weak MatterGetAccessPrivilegeForXX functions and add stubs #21220

Merged
merged 1 commit into from
Jul 28, 2022
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
20 changes: 0 additions & 20 deletions src/app/RequiredPrivilege.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,3 @@ constexpr Access::Privilege RequiredPrivilege::kPrivilegeMapper[];

} // namespace app
} // namespace chip

int __attribute__((weak)) MatterGetAccessPrivilegeForReadAttribute(chip::ClusterId cluster, chip::AttributeId attribute)
{
return kMatterAccessPrivilegeAdminister;
}

int __attribute__((weak)) MatterGetAccessPrivilegeForWriteAttribute(chip::ClusterId cluster, chip::AttributeId attribute)
{
return kMatterAccessPrivilegeAdminister;
}

int __attribute__((weak)) MatterGetAccessPrivilegeForInvokeCommand(chip::ClusterId cluster, chip::CommandId command)
{
return kMatterAccessPrivilegeAdminister;
}

int __attribute__((weak)) MatterGetAccessPrivilegeForReadEvent(chip::ClusterId cluster, chip::EventId event)
{
return kMatterAccessPrivilegeAdminister;
}
1 change: 1 addition & 0 deletions src/app/tests/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ static_library("helpers") {
sources = [
"AppTestContext.cpp",
"AppTestContext.h",
"integration/RequiredPrivilegeStubs.cpp",
]

cflags = [ "-Wconversion" ]
Expand Down
2 changes: 2 additions & 0 deletions src/app/tests/integration/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ assert(chip_build_tools)

executable("chip-im-initiator") {
sources = [
"RequiredPrivilegeStubs.cpp",
"chip_im_initiator.cpp",
"common.cpp",
]
Expand All @@ -41,6 +42,7 @@ executable("chip-im-initiator") {
executable("chip-im-responder") {
sources = [
"MockEvents.cpp",
"RequiredPrivilegeStubs.cpp",
"chip_im_responder.cpp",
"common.cpp",
]
Expand Down
38 changes: 38 additions & 0 deletions src/app/tests/integration/RequiredPrivilegeStubs.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
*
* Copyright (c) 2022 Project CHIP Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#include <app/util/privilege-storage.h>

int MatterGetAccessPrivilegeForReadAttribute(chip::ClusterId cluster, chip::AttributeId attribute)
{
return kMatterAccessPrivilegeAdminister;
}

int MatterGetAccessPrivilegeForWriteAttribute(chip::ClusterId cluster, chip::AttributeId attribute)
{
return kMatterAccessPrivilegeAdminister;
}

int MatterGetAccessPrivilegeForInvokeCommand(chip::ClusterId cluster, chip::CommandId command)
{
return kMatterAccessPrivilegeAdminister;
}

int MatterGetAccessPrivilegeForReadEvent(chip::ClusterId cluster, chip::EventId event)
{
return kMatterAccessPrivilegeAdminister;
}