Skip to content
Open
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,5 @@ Source/playerinfo/player_info/player_info
*/*/*/*/*tests
*/*/generated
*/*/*/*/lib*.a
.cache
compile_commands.json
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ option(CDMI
"Include OpenCDM interface." OFF)
option(CRYPTOGRAPHY
"Include the cryptography library." OFF)
option(POWERCONTROLLER
"Include the powermanager COMRPC abstraction library." OFF)

option(INSTALL_TESTS "Install the test applications" OFF)

Expand Down
3 changes: 2 additions & 1 deletion NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,5 @@ Licensed under the MIT License
Copyright (C) 2015,2019 Metrological
Licensed under the BSD-2 License


Copyright 2025 RDK Management
Licensed under the Apache License, Version 2.0
4 changes: 4 additions & 0 deletions Source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,7 @@ endif()
if(LOCALTRACER)
add_subdirectory(localtracer)
endif()

if(POWERCONTROLLER)
add_subdirectory(powercontroller)
endif()
79 changes: 79 additions & 0 deletions Source/powercontroller/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# If not stated otherwise in this file or this component's LICENSE file the
# following copyright and licenses apply:
#
# Copyright 2025 RDK Management
#
# 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.

cmake_minimum_required(VERSION 3.3)

find_package(WPEFramework)

project(PowerController)

project_version(4.4.1)

set(TARGET ${NAMESPACE}${PROJECT_NAME})

message("Setup ${TARGET} v${PROJECT_VERSION}")

find_package(${NAMESPACE}Core REQUIRED)
find_package(${NAMESPACE}COM REQUIRED)
find_package(CompileSettingsDebug CONFIG REQUIRED)

set(PUBLIC_HEADERS "power_controller.h")

add_library(${TARGET} SHARED
Module.cpp
power_controller.cpp
)

target_link_libraries(${TARGET}
PRIVATE
${NAMESPACE}Core::${NAMESPACE}Core
${NAMESPACE}COM::${NAMESPACE}COM
CompileSettingsDebug::CompileSettingsDebug
)

set_target_properties(${TARGET} PROPERTIES
CXX_STANDARD 11
CXX_STANDARD_REQUIRED YES
FRAMEWORK FALSE
PUBLIC_HEADER "${PUBLIC_HEADERS}" # specify the public headers
VERSION ${PROJECT_VERSION}
SOVERSION ${PROJECT_VERSION_MAJOR}
)

target_include_directories( ${TARGET}
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}>
$<INSTALL_INTERFACE:include>
)

install(
TARGETS ${TARGET} EXPORT ${TARGET}Targets # for downstream dependencies
ARCHIVE DESTINATION lib COMPONENT libs # static lib
LIBRARY DESTINATION lib COMPONENT libs # shared lib
RUNTIME DESTINATION bin COMPONENT libs # binaries
FRAMEWORK DESTINATION bin COMPONENT libs # for mac
PUBLIC_HEADER DESTINATION include/${NAMESPACE}/powercontroller COMPONENT devel # headers for mac (note the different component -> different package)
INCLUDES DESTINATION include/${NAMESPACE}/powercontroller # headers
)

InstallCMakeConfig(
TARGETS ${TARGET})

InstallPackageConfig(
TARGETS ${TARGET}
DESCRIPTION "communications channel abstraction for powermanager plugin")

22 changes: 22 additions & 0 deletions Source/powercontroller/Module.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* If not stated otherwise in this file or this component's LICENSE file the
* following copyright and licenses apply:
*
* Copyright 2025 RDK Management
*
* 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 "Module.h"

MODULE_NAME_DECLARATION(BUILD_REFERENCE)
33 changes: 33 additions & 0 deletions Source/powercontroller/Module.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* If not stated otherwise in this file or this component's LICENSE file the
* following copyright and licenses apply:
*
* Copyright 2025 RDK Management
*
* 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.
*/

#pragma once

#ifndef MODULE_NAME
#define MODULE_NAME ClientLibrary_PowerManager
#endif

#include <com/com.h>
#include <core/core.h>
#include <messaging/messaging.h>

#if defined(__WINDOWS__) && defined(POWERMANAGER_EXPORTS)
#undef EXTERNAL
#define EXTERNAL EXTERNAL_EXPORT
#endif
Loading