Skip to content

Commit 278df82

Browse files
committed
Merge branch 'release/1.0.5' into main
2 parents f98fa04 + 8a276be commit 278df82

File tree

11 files changed

+90
-77
lines changed

11 files changed

+90
-77
lines changed

.github/workflows/json_validator.yml

Lines changed: 0 additions & 48 deletions
This file was deleted.

.github/workflows/update-changelog-and-api-version.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121

2222
- name: Get changed files using defaults
2323
id: changed-files
24-
uses: tj-actions/changed-files@v19
24+
uses: rdkcentral/tj-actions_changed-files@v19
2525

2626
- name: Run step when a CHANGELOG.md didn't change
2727
uses: actions/github-script@v3

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,22 @@ All notable changes to this project will be documented in this file. Dates are d
44

55
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
66

7+
#### [1.0.5](https://github.com/rdkcentral/entservices-inputoutput/compare/1.0.4...1.0.5)
8+
9+
- RDK-56621: Update all the power manager plugin clients to new register events [`#17`](https://github.com/rdkcentral/entservices-inputoutput/pull/17)
10+
- RDKEMW-2882: Replace the references of tj-actions/changed_files [`#26`](https://github.com/rdkcentral/entservices-inputoutput/pull/26)
11+
- Replace the references of tj-actions/changed_files [`75a649d`](https://github.com/rdkcentral/entservices-inputoutput/commit/75a649d0c19c9f017701ddf408d3bbaf14680529)
12+
- Update update-changelog-and-api-version.yml [`6189d2c`](https://github.com/rdkcentral/entservices-inputoutput/commit/6189d2cf132847a726a2f7ca9e950b112e150ec4)
13+
- Merge tag '1.0.4' into develop [`0b3e426`](https://github.com/rdkcentral/entservices-inputoutput/commit/0b3e426be6b707c54d168843c35f6869673104f7)
14+
715
#### [1.0.4](https://github.com/rdkcentral/entservices-inputoutput/compare/1.0.3...1.0.4)
816

17+
> 26 March 2025
18+
919
- RDKEMW-1061: RDK-E Add COMRPC [`#29`](https://github.com/rdkcentral/entservices-inputoutput/pull/29)
1020
- Merge pull request #27 from rdkcentral/feature/RDKEMW-1061-RDK-E-Add-… [`#28`](https://github.com/rdkcentral/entservices-inputoutput/pull/28)
1121
- RDKEMW-1061: RDK-E Add COMRPC [`#27`](https://github.com/rdkcentral/entservices-inputoutput/pull/27)
22+
- 1.0.4 release change log updates [`77d6ace`](https://github.com/rdkcentral/entservices-inputoutput/commit/77d6ace1230f6d08fe2604f4de0673bb16fbebe2)
1223
- Merge tag '1.0.3' into develop [`9d73332`](https://github.com/rdkcentral/entservices-inputoutput/commit/9d7333267973f791c7183192c7fce499cbc26efc)
1324

1425
#### [1.0.3](https://github.com/rdkcentral/entservices-inputoutput/compare/1.0.2...1.0.3)

HdcpProfile/HdcpProfile.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,8 @@ namespace WPEFramework
117117
{
118118
_powerManagerPlugin = PowerManagerInterfaceBuilder(_T("org.rdk.PowerManager"))
119119
.withIShell(service)
120+
.withRetryIntervalMS(200)
121+
.withRetryCount(25)
120122
.createInterface();
121123
}
122124

HdmiCecSink/HdmiCecSink.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
#include "ccec/CECFrame.hpp"
2424
#include "ccec/MessageEncoder.hpp"
2525
#include "host.hpp"
26-
#include "ccec/host/RDK.hpp"
2726
#include "UtilsgetRFCConfig.h"
2827

2928
#include "dsMgr.h"
@@ -901,6 +900,8 @@ namespace WPEFramework
901900
{
902901
_powerManagerPlugin = PowerManagerInterfaceBuilder(_T("org.rdk.PowerManager"))
903902
.withIShell(service)
903+
.withRetryIntervalMS(200)
904+
.withRetryCount(25)
904905
.createInterface();
905906
registerEventHandlers();
906907
}
@@ -910,7 +911,7 @@ namespace WPEFramework
910911

911912
if(!_registeredEventHandlers && _powerManagerPlugin) {
912913
_registeredEventHandlers = true;
913-
_powerManagerPlugin->Register(&_pwrMgrNotification);
914+
_powerManagerPlugin->Register(_pwrMgrNotification.baseInterface<Exchange::IPowerManager::IModeChangedNotification>());
914915
}
915916
}
916917

HdmiCecSink/HdmiCecSink.h

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -585,33 +585,35 @@ namespace WPEFramework {
585585
END_INTERFACE_MAP
586586

587587
private:
588-
class PowerManagerNotification : public Exchange::IPowerManager::INotification {
588+
class PowerManagerNotification : public Exchange::IPowerManager::IModeChangedNotification {
589589
private:
590590
PowerManagerNotification(const PowerManagerNotification&) = delete;
591591
PowerManagerNotification& operator=(const PowerManagerNotification&) = delete;
592-
592+
593593
public:
594594
explicit PowerManagerNotification(HdmiCecSink& parent)
595595
: _parent(parent)
596596
{
597597
}
598598
~PowerManagerNotification() override = default;
599-
599+
600600
public:
601601
void OnPowerModeChanged(const PowerState &currentState, const PowerState &newState) override
602602
{
603603
_parent.onPowerModeChanged(currentState, newState);
604604
}
605-
void OnPowerModePreChange(const PowerState &currentState, const PowerState &newState) override {}
606-
void OnDeepSleepTimeout(const int &wakeupTimeout) override {}
607-
void OnNetworkStandbyModeChanged(const bool &enabled) override {}
608-
void OnThermalModeChanged(const ThermalTemperature &currentThermalLevel, const ThermalTemperature &newThermalLevel, const float &currentTemperature) override {}
609-
void OnRebootBegin(const string &rebootReasonCustom, const string &rebootReasonOther, const string &rebootRequestor) override {}
605+
606+
template <typename T>
607+
T* baseInterface()
608+
{
609+
static_assert(std::is_base_of<T, PowerManagerNotification>(), "base type mismatch");
610+
return static_cast<T*>(this);
611+
}
610612

611613
BEGIN_INTERFACE_MAP(PowerManagerNotification)
612-
INTERFACE_ENTRY(Exchange::IPowerManager::INotification)
614+
INTERFACE_ENTRY(Exchange::IPowerManager::IModeChangedNotification)
613615
END_INTERFACE_MAP
614-
616+
615617
private:
616618
HdmiCecSink& _parent;
617619
};

HdmiCecSource/HdmiCecSourceImplementation.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ namespace WPEFramework
474474

475475
if(!_registeredEventHandlers && _powerManagerPlugin) {
476476
_registeredEventHandlers = true;
477-
_powerManagerPlugin->Register(&_pwrMgrNotification);
477+
_powerManagerPlugin->Register(_pwrMgrNotification.baseInterface<Exchange::IPowerManager::IModeChangedNotification>());
478478
}
479479

480480

@@ -725,6 +725,8 @@ namespace WPEFramework
725725
LOGINFO("Connect the COM-RPC socket\n");
726726
_powerManagerPlugin = PowerManagerInterfaceBuilder(_T("org.rdk.PowerManager"))
727727
.withIShell(service)
728+
.withRetryIntervalMS(200)
729+
.withRetryCount(25)
728730
.createInterface();
729731
registerEventHandlers();
730732
}

HdmiCecSource/HdmiCecSourceImplementation.h

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ namespace WPEFramework {
226226

227227

228228
private:
229-
class PowerManagerNotification : public Exchange::IPowerManager::INotification {
229+
class PowerManagerNotification : public Exchange::IPowerManager::IModeChangedNotification {
230230
private:
231231
PowerManagerNotification(const PowerManagerNotification&) = delete;
232232
PowerManagerNotification& operator=(const PowerManagerNotification&) = delete;
@@ -243,14 +243,16 @@ namespace WPEFramework {
243243
{
244244
_parent.onPowerModeChanged(currentState, newState);
245245
}
246-
void OnPowerModePreChange(const PowerState &currentState, const PowerState &newState) override {}
247-
void OnDeepSleepTimeout(const int &wakeupTimeout) override {}
248-
void OnNetworkStandbyModeChanged(const bool &enabled) override {}
249-
void OnThermalModeChanged(const ThermalTemperature &currentThermalLevel, const ThermalTemperature &newThermalLevel, const float &currentTemperature) override {}
250-
void OnRebootBegin(const string &rebootReasonCustom, const string &rebootReasonOther, const string &rebootRequestor) override {}
251-
246+
247+
template <typename T>
248+
T* baseInterface()
249+
{
250+
static_assert(std::is_base_of<T, PowerManagerNotification>(), "base type mismatch");
251+
return static_cast<T*>(this);
252+
}
253+
252254
BEGIN_INTERFACE_MAP(PowerManagerNotification)
253-
INTERFACE_ENTRY(Exchange::IPowerManager::INotification)
255+
INTERFACE_ENTRY(Exchange::IPowerManager::IModeChangedNotification)
254256
END_INTERFACE_MAP
255257

256258
private:

cmake/FindCEC.cmake

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,12 @@ find_library(OSAL_LIBRARIES NAMES RCECOSHal)
3131

3232
find_path(CEC_INCLUDE_DIRS NAMES ccec/Connection.hpp PATH_SUFFIXES ccec/include)
3333
find_path(OSAL_INCLUDE_DIRS NAMES osal/Mutex.hpp PATH_SUFFIXES osal/include)
34-
find_path(CEC_HOST_INCLUDE_DIRS NAMES ccec/host/RDK.hpp PATH_SUFFIXES host/include)
3534

3635
set(CEC_LIBRARIES "-Wl,--no-as-needed" ${CEC_LIBRARIES} ${CEC_HAL_LIBRARIES} ${OSAL_LIBRARIES} "-Wl,--as-needed")
3736

3837
set(CEC_LIBRARIES ${CEC_LIBRARIES} CACHE PATH "Path to CEC library")
3938

40-
set(CEC_INCLUDE_DIRS ${CEC_INCLUDE_DIRS} ${OSAL_INCLUDE_DIRS} ${CEC_HOST_INCLUDE_DIRS})
39+
set(CEC_INCLUDE_DIRS ${CEC_INCLUDE_DIRS} ${OSAL_INCLUDE_DIRS})
4140
set(CEC_INCLUDE_DIRS ${CEC_INCLUDE_DIRS} CACHE PATH "Path to CEC include")
4241

4342
include(FindPackageHandleStandardArgs)

helpers/PluginInterfaceBuilder.h

100644100755
Lines changed: 45 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,18 +100,32 @@ namespace Plugin {
100100
{
101101
WPEFramework::PluginHost::IShell* controller = builder.controller();
102102
const std::string& callsign = builder.callSign();
103+
const int retry_count = builder.retryCount();
104+
const uint32_t retry_interval = builder.retryInterval();
105+
int count = 0;
106+
103107
if (!controller) {
104108
LOGERR("Invalid controller");
105109
return nullptr;
106110
}
107111

108-
auto pluginInterface = controller->QueryInterfaceByCallsign<INTERFACE>(callsign.c_str());
112+
do {
113+
auto pluginInterface = controller->QueryInterfaceByCallsign<INTERFACE>(callsign.c_str());
109114

110-
if (pluginInterface) {
111-
pluginInterface->AddRef();
112-
}
115+
if (pluginInterface) {
116+
pluginInterface->AddRef();
117+
LOGINFO("plugin interface succeed and retry count: %d",count);
118+
return pluginInterface;
119+
}
120+
else
121+
{
122+
count++;
123+
LOGERR("plugin interface failed and retry: %d",count);
124+
usleep(retry_interval*1000);
125+
}
126+
}while(count < retry_count);
113127

114-
return pluginInterface;
128+
return nullptr;
115129
}
116130

117131
template <typename T, typename... Args>
@@ -127,13 +141,17 @@ namespace Plugin {
127141
PluginHost::IShell* _service;
128142
uint32_t _version;
129143
uint32_t _timeout;
144+
int _retry_count;
145+
uint32_t _retry_interval;
130146

131147
public:
132148
PluginInterfaceBuilder(const char* callsign)
133149
: _callsign(callsign)
134150
, _service(nullptr)
135151
, _version(static_cast<uint32_t>(~0))
136152
, _timeout(3000)
153+
,_retry_count(0)
154+
,_retry_interval(0)
137155
{
138156
}
139157

@@ -158,6 +176,18 @@ namespace Plugin {
158176
return *this;
159177
}
160178

179+
inline PluginInterfaceBuilder& withRetryIntervalMS(int retryInterval)
180+
{
181+
_retry_interval = retryInterval;
182+
return *this;
183+
}
184+
185+
inline PluginInterfaceBuilder& withRetryCount(int retryCount)
186+
{
187+
_retry_count = retryCount;
188+
return *this;
189+
}
190+
161191
PluginInterfaceRef<INTERFACE> createInterface()
162192
{
163193
auto* interface = ::WPEFramework::Plugin::createInterface<INTERFACE>(*this);
@@ -170,6 +200,16 @@ namespace Plugin {
170200
return std::move(PluginInterfaceRef<INTERFACE>(interface, _service));
171201
}
172202

203+
const uint32_t retryInterval() const
204+
{
205+
return _retry_interval;
206+
}
207+
208+
const int retryCount() const
209+
{
210+
return _retry_count;
211+
}
212+
173213
const std::string& callSign() const
174214
{
175215
return _callsign;

0 commit comments

Comments
 (0)