From 6318491d79fc676373e22d7bb50c4b016c4cbcb3 Mon Sep 17 00:00:00 2001 From: kartnema Date: Thu, 19 Feb 2026 10:38:09 +0530 Subject: [PATCH 1/2] Incorporate new urm headers --- CMakeLists.txt | 2 +- Extensions/Example.cpp | 23 +++++++++++++++++++++++ Extensions/Include/Helpers.h | 6 ++++++ 3 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 Extensions/Example.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 99a79bd..9533ee6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,7 +11,7 @@ include(GNUInstallDirs) file(GLOB SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/Extensions/*.cpp") add_library(UrmPlugin ${SOURCES}) set_target_properties(UrmPlugin PROPERTIES VERSION 1.0.0 SOVERSION 1) -target_link_libraries(UrmPlugin UrmExtAPIs UrmAuxUtils) +target_link_libraries(UrmPlugin UrmExtAPIs RestuneCore UrmAuxUtils) target_include_directories(UrmPlugin PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/Extensions/Include) # install to standard /usr/lib or /lib install(TARGETS UrmPlugin DESTINATION ${CMAKE_INSTALL_LIBDIR}/urm/) diff --git a/Extensions/Example.cpp b/Extensions/Example.cpp new file mode 100644 index 0000000..5976c50 --- /dev/null +++ b/Extensions/Example.cpp @@ -0,0 +1,23 @@ +// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. +// SPDX-License-Identifier: BSD-3-Clause-Clear + +#include "Helpers.h" + +static void setCpuMaxFreq(void* context) { + if(context == nullptr) return; + Resource* resource = static_cast(context); + + ResConfInfo* resConf = + ResourceRegistry::getInstance()->getResConf(resource->getResCode()); + if(resConf == nullptr) { + return; + } + + int32_t clusterId = resource->getClusterValue(); + int32_t valueToWrite = resource->getValueAt(0); + + // Get Node path: + std::string nodePath = resConf->mResourcePath; + + // Custom write to node logic follows: +} \ No newline at end of file diff --git a/Extensions/Include/Helpers.h b/Extensions/Include/Helpers.h index 3617074..8837966 100644 --- a/Extensions/Include/Helpers.h +++ b/Extensions/Include/Helpers.h @@ -6,6 +6,12 @@ #include +#include +#include +#include +#include +#include + void writeLineToFile(const std::string& fileName, const std::string& value); void readLineFromFile(const std::string& fileName, std::string& line); void fetchMachineName(std::string& machineName); From b525d9269d1a611ce0e30cf675bc03f023df746b Mon Sep 17 00:00:00 2001 From: kartnema Date: Thu, 19 Feb 2026 10:39:26 +0530 Subject: [PATCH 2/2] cleanup --- Extensions/Example.cpp | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 Extensions/Example.cpp diff --git a/Extensions/Example.cpp b/Extensions/Example.cpp deleted file mode 100644 index 5976c50..0000000 --- a/Extensions/Example.cpp +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. -// SPDX-License-Identifier: BSD-3-Clause-Clear - -#include "Helpers.h" - -static void setCpuMaxFreq(void* context) { - if(context == nullptr) return; - Resource* resource = static_cast(context); - - ResConfInfo* resConf = - ResourceRegistry::getInstance()->getResConf(resource->getResCode()); - if(resConf == nullptr) { - return; - } - - int32_t clusterId = resource->getClusterValue(); - int32_t valueToWrite = resource->getValueAt(0); - - // Get Node path: - std::string nodePath = resConf->mResourcePath; - - // Custom write to node logic follows: -} \ No newline at end of file