diff --git a/.github/workflows/json_validator.yml b/.github/workflows/json_validator.yml deleted file mode 100644 index 5be52c77..00000000 --- a/.github/workflows/json_validator.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: json-validator - -on: - push: - branches: [ main, 'sprint/**', 'release/**' ] - pull_request: - branches: [ main, 'sprint/**', 'release/**' ] - -jobs: - build: - runs-on: ubuntu-latest - name: Validate json files - steps: - - uses: actions/checkout@v3 - - - name: Get modified/added json files - id: json-files - uses: tj-actions/changed-files@v19 - with: - files: | - **/*.json - - - name: Validate the json files - id: validate-json-files - run : | - failed_jsons=() - FAILED=false - for file in ${{ steps.json-files.outputs.all_changed_files }}; do - echo "Validating the json file $file" - if ! python -m json.tool $file - then - FAILED=true - echo "Json schema error in $file" - failed_jsons+=("$file") - continue - fi - done - if [ $FAILED == true ] - then - echo "Error in parsing the JSON" - echo "Failed jsons are ${failed_jsons[@]}" - exit 1 - fi - - - - - diff --git a/.github/workflows/update-changelog-and-api-version.yml b/.github/workflows/update-changelog-and-api-version.yml index a60557c1..61fdb94c 100644 --- a/.github/workflows/update-changelog-and-api-version.yml +++ b/.github/workflows/update-changelog-and-api-version.yml @@ -21,7 +21,7 @@ jobs: - name: Get changed files using defaults id: changed-files - uses: tj-actions/changed-files@v19 + uses: rdkcentral/tj-actions_changed-files@v19 - name: Run step when a CHANGELOG.md didn't change uses: actions/github-script@v3 diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a145496..5cd9c441 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,11 +4,22 @@ All notable changes to this project will be documented in this file. Dates are d Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). +#### [1.0.5](https://github.com/rdkcentral/entservices-inputoutput/compare/1.0.4...1.0.5) + +- RDK-56621: Update all the power manager plugin clients to new register events [`#17`](https://github.com/rdkcentral/entservices-inputoutput/pull/17) +- RDKEMW-2882: Replace the references of tj-actions/changed_files [`#26`](https://github.com/rdkcentral/entservices-inputoutput/pull/26) +- Replace the references of tj-actions/changed_files [`75a649d`](https://github.com/rdkcentral/entservices-inputoutput/commit/75a649d0c19c9f017701ddf408d3bbaf14680529) +- Update update-changelog-and-api-version.yml [`6189d2c`](https://github.com/rdkcentral/entservices-inputoutput/commit/6189d2cf132847a726a2f7ca9e950b112e150ec4) +- Merge tag '1.0.4' into develop [`0b3e426`](https://github.com/rdkcentral/entservices-inputoutput/commit/0b3e426be6b707c54d168843c35f6869673104f7) + #### [1.0.4](https://github.com/rdkcentral/entservices-inputoutput/compare/1.0.3...1.0.4) +> 26 March 2025 + - RDKEMW-1061: RDK-E Add COMRPC [`#29`](https://github.com/rdkcentral/entservices-inputoutput/pull/29) - Merge pull request #27 from rdkcentral/feature/RDKEMW-1061-RDK-E-Add-… [`#28`](https://github.com/rdkcentral/entservices-inputoutput/pull/28) - RDKEMW-1061: RDK-E Add COMRPC [`#27`](https://github.com/rdkcentral/entservices-inputoutput/pull/27) +- 1.0.4 release change log updates [`77d6ace`](https://github.com/rdkcentral/entservices-inputoutput/commit/77d6ace1230f6d08fe2604f4de0673bb16fbebe2) - Merge tag '1.0.3' into develop [`9d73332`](https://github.com/rdkcentral/entservices-inputoutput/commit/9d7333267973f791c7183192c7fce499cbc26efc) #### [1.0.3](https://github.com/rdkcentral/entservices-inputoutput/compare/1.0.2...1.0.3) diff --git a/HdcpProfile/HdcpProfile.cpp b/HdcpProfile/HdcpProfile.cpp index 4179ba00..65bae97b 100644 --- a/HdcpProfile/HdcpProfile.cpp +++ b/HdcpProfile/HdcpProfile.cpp @@ -117,6 +117,8 @@ namespace WPEFramework { _powerManagerPlugin = PowerManagerInterfaceBuilder(_T("org.rdk.PowerManager")) .withIShell(service) + .withRetryIntervalMS(200) + .withRetryCount(25) .createInterface(); } diff --git a/HdmiCecSink/HdmiCecSink.cpp b/HdmiCecSink/HdmiCecSink.cpp index b2cf119f..7c50d696 100644 --- a/HdmiCecSink/HdmiCecSink.cpp +++ b/HdmiCecSink/HdmiCecSink.cpp @@ -23,7 +23,6 @@ #include "ccec/CECFrame.hpp" #include "ccec/MessageEncoder.hpp" #include "host.hpp" -#include "ccec/host/RDK.hpp" #include "UtilsgetRFCConfig.h" #include "dsMgr.h" @@ -901,6 +900,8 @@ namespace WPEFramework { _powerManagerPlugin = PowerManagerInterfaceBuilder(_T("org.rdk.PowerManager")) .withIShell(service) + .withRetryIntervalMS(200) + .withRetryCount(25) .createInterface(); registerEventHandlers(); } @@ -910,7 +911,7 @@ namespace WPEFramework if(!_registeredEventHandlers && _powerManagerPlugin) { _registeredEventHandlers = true; - _powerManagerPlugin->Register(&_pwrMgrNotification); + _powerManagerPlugin->Register(_pwrMgrNotification.baseInterface()); } } diff --git a/HdmiCecSink/HdmiCecSink.h b/HdmiCecSink/HdmiCecSink.h index e3443ad0..d41b16ab 100644 --- a/HdmiCecSink/HdmiCecSink.h +++ b/HdmiCecSink/HdmiCecSink.h @@ -585,33 +585,35 @@ namespace WPEFramework { END_INTERFACE_MAP private: - class PowerManagerNotification : public Exchange::IPowerManager::INotification { + class PowerManagerNotification : public Exchange::IPowerManager::IModeChangedNotification { private: PowerManagerNotification(const PowerManagerNotification&) = delete; PowerManagerNotification& operator=(const PowerManagerNotification&) = delete; - + public: explicit PowerManagerNotification(HdmiCecSink& parent) : _parent(parent) { } ~PowerManagerNotification() override = default; - + public: void OnPowerModeChanged(const PowerState ¤tState, const PowerState &newState) override { _parent.onPowerModeChanged(currentState, newState); } - void OnPowerModePreChange(const PowerState ¤tState, const PowerState &newState) override {} - void OnDeepSleepTimeout(const int &wakeupTimeout) override {} - void OnNetworkStandbyModeChanged(const bool &enabled) override {} - void OnThermalModeChanged(const ThermalTemperature ¤tThermalLevel, const ThermalTemperature &newThermalLevel, const float ¤tTemperature) override {} - void OnRebootBegin(const string &rebootReasonCustom, const string &rebootReasonOther, const string &rebootRequestor) override {} + + template + T* baseInterface() + { + static_assert(std::is_base_of(), "base type mismatch"); + return static_cast(this); + } BEGIN_INTERFACE_MAP(PowerManagerNotification) - INTERFACE_ENTRY(Exchange::IPowerManager::INotification) + INTERFACE_ENTRY(Exchange::IPowerManager::IModeChangedNotification) END_INTERFACE_MAP - + private: HdmiCecSink& _parent; }; diff --git a/HdmiCecSource/HdmiCecSourceImplementation.cpp b/HdmiCecSource/HdmiCecSourceImplementation.cpp index bc944221..b12894dd 100644 --- a/HdmiCecSource/HdmiCecSourceImplementation.cpp +++ b/HdmiCecSource/HdmiCecSourceImplementation.cpp @@ -474,7 +474,7 @@ namespace WPEFramework if(!_registeredEventHandlers && _powerManagerPlugin) { _registeredEventHandlers = true; - _powerManagerPlugin->Register(&_pwrMgrNotification); + _powerManagerPlugin->Register(_pwrMgrNotification.baseInterface()); } @@ -725,6 +725,8 @@ namespace WPEFramework LOGINFO("Connect the COM-RPC socket\n"); _powerManagerPlugin = PowerManagerInterfaceBuilder(_T("org.rdk.PowerManager")) .withIShell(service) + .withRetryIntervalMS(200) + .withRetryCount(25) .createInterface(); registerEventHandlers(); } diff --git a/HdmiCecSource/HdmiCecSourceImplementation.h b/HdmiCecSource/HdmiCecSourceImplementation.h index 7a8bf445..c4832014 100644 --- a/HdmiCecSource/HdmiCecSourceImplementation.h +++ b/HdmiCecSource/HdmiCecSourceImplementation.h @@ -226,7 +226,7 @@ namespace WPEFramework { private: - class PowerManagerNotification : public Exchange::IPowerManager::INotification { + class PowerManagerNotification : public Exchange::IPowerManager::IModeChangedNotification { private: PowerManagerNotification(const PowerManagerNotification&) = delete; PowerManagerNotification& operator=(const PowerManagerNotification&) = delete; @@ -243,14 +243,16 @@ namespace WPEFramework { { _parent.onPowerModeChanged(currentState, newState); } - void OnPowerModePreChange(const PowerState ¤tState, const PowerState &newState) override {} - void OnDeepSleepTimeout(const int &wakeupTimeout) override {} - void OnNetworkStandbyModeChanged(const bool &enabled) override {} - void OnThermalModeChanged(const ThermalTemperature ¤tThermalLevel, const ThermalTemperature &newThermalLevel, const float ¤tTemperature) override {} - void OnRebootBegin(const string &rebootReasonCustom, const string &rebootReasonOther, const string &rebootRequestor) override {} - + + template + T* baseInterface() + { + static_assert(std::is_base_of(), "base type mismatch"); + return static_cast(this); + } + BEGIN_INTERFACE_MAP(PowerManagerNotification) - INTERFACE_ENTRY(Exchange::IPowerManager::INotification) + INTERFACE_ENTRY(Exchange::IPowerManager::IModeChangedNotification) END_INTERFACE_MAP private: diff --git a/cmake/FindCEC.cmake b/cmake/FindCEC.cmake index 71d263a4..442174f9 100644 --- a/cmake/FindCEC.cmake +++ b/cmake/FindCEC.cmake @@ -31,13 +31,12 @@ find_library(OSAL_LIBRARIES NAMES RCECOSHal) find_path(CEC_INCLUDE_DIRS NAMES ccec/Connection.hpp PATH_SUFFIXES ccec/include) find_path(OSAL_INCLUDE_DIRS NAMES osal/Mutex.hpp PATH_SUFFIXES osal/include) -find_path(CEC_HOST_INCLUDE_DIRS NAMES ccec/host/RDK.hpp PATH_SUFFIXES host/include) set(CEC_LIBRARIES "-Wl,--no-as-needed" ${CEC_LIBRARIES} ${CEC_HAL_LIBRARIES} ${OSAL_LIBRARIES} "-Wl,--as-needed") set(CEC_LIBRARIES ${CEC_LIBRARIES} CACHE PATH "Path to CEC library") -set(CEC_INCLUDE_DIRS ${CEC_INCLUDE_DIRS} ${OSAL_INCLUDE_DIRS} ${CEC_HOST_INCLUDE_DIRS}) +set(CEC_INCLUDE_DIRS ${CEC_INCLUDE_DIRS} ${OSAL_INCLUDE_DIRS}) set(CEC_INCLUDE_DIRS ${CEC_INCLUDE_DIRS} CACHE PATH "Path to CEC include") include(FindPackageHandleStandardArgs) diff --git a/helpers/PluginInterfaceBuilder.h b/helpers/PluginInterfaceBuilder.h old mode 100644 new mode 100755 index d10a7f2b..a10ad6a6 --- a/helpers/PluginInterfaceBuilder.h +++ b/helpers/PluginInterfaceBuilder.h @@ -100,18 +100,32 @@ namespace Plugin { { WPEFramework::PluginHost::IShell* controller = builder.controller(); const std::string& callsign = builder.callSign(); + const int retry_count = builder.retryCount(); + const uint32_t retry_interval = builder.retryInterval(); + int count = 0; + if (!controller) { LOGERR("Invalid controller"); return nullptr; } - auto pluginInterface = controller->QueryInterfaceByCallsign(callsign.c_str()); + do { + auto pluginInterface = controller->QueryInterfaceByCallsign(callsign.c_str()); - if (pluginInterface) { - pluginInterface->AddRef(); - } + if (pluginInterface) { + pluginInterface->AddRef(); + LOGINFO("plugin interface succeed and retry count: %d",count); + return pluginInterface; + } + else + { + count++; + LOGERR("plugin interface failed and retry: %d",count); + usleep(retry_interval*1000); + } + }while(count < retry_count); - return pluginInterface; + return nullptr; } template @@ -127,6 +141,8 @@ namespace Plugin { PluginHost::IShell* _service; uint32_t _version; uint32_t _timeout; + int _retry_count; + uint32_t _retry_interval; public: PluginInterfaceBuilder(const char* callsign) @@ -134,6 +150,8 @@ namespace Plugin { , _service(nullptr) , _version(static_cast(~0)) , _timeout(3000) + ,_retry_count(0) + ,_retry_interval(0) { } @@ -158,6 +176,18 @@ namespace Plugin { return *this; } + inline PluginInterfaceBuilder& withRetryIntervalMS(int retryInterval) + { + _retry_interval = retryInterval; + return *this; + } + + inline PluginInterfaceBuilder& withRetryCount(int retryCount) + { + _retry_count = retryCount; + return *this; + } + PluginInterfaceRef createInterface() { auto* interface = ::WPEFramework::Plugin::createInterface(*this); @@ -170,6 +200,16 @@ namespace Plugin { return std::move(PluginInterfaceRef(interface, _service)); } + const uint32_t retryInterval() const + { + return _retry_interval; + } + + const int retryCount() const + { + return _retry_count; + } + const std::string& callSign() const { return _callsign; diff --git a/helpers/frontpanel.cpp b/helpers/frontpanel.cpp index cd8674a2..699bc340 100644 --- a/helpers/frontpanel.cpp +++ b/helpers/frontpanel.cpp @@ -135,6 +135,8 @@ namespace WPEFramework { _powerManagerPlugin = PowerManagerInterfaceBuilder(_T("org.rdk.PowerManager")) .withIShell(service) + .withRetryIntervalMS(200) + .withRetryCount(25) .createInterface(); } if (!s_instance)