Skip to content

Commit 2647ed8

Browse files
Assign retry interval from client plugins
1 parent a1d4d87 commit 2647ed8

File tree

5 files changed

+25
-7
lines changed

5 files changed

+25
-7
lines changed

HdcpProfile/HdcpProfile.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ namespace WPEFramework
117117
{
118118
_powerManagerPlugin = PowerManagerInterfaceBuilder(_T("org.rdk.PowerManager"))
119119
.withIShell(service)
120-
.withRetry(25)
120+
.withRetryIntervalMS(200)
121+
.withRetryCount(25)
121122
.createInterface();
122123
}
123124

HdmiCecSink/HdmiCecSink.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -901,7 +901,8 @@ namespace WPEFramework
901901
{
902902
_powerManagerPlugin = PowerManagerInterfaceBuilder(_T("org.rdk.PowerManager"))
903903
.withIShell(service)
904-
.withRetry(25)
904+
.withRetryIntervalMS(200)
905+
.withRetryCount(25)
905906
.createInterface();
906907
registerEventHandlers();
907908
}

HdmiCecSource/HdmiCecSource.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,8 @@ namespace WPEFramework
721721
LOGINFO("Connect the COM-RPC socket\n");
722722
_powerManagerPlugin = PowerManagerInterfaceBuilder(_T("org.rdk.PowerManager"))
723723
.withIShell(service)
724-
.withRetry(25)
724+
.withRetryIntervalMS(200)
725+
.withRetryCount(25)
725726
.createInterface();
726727
registerEventHandlers();
727728
}

helpers/PluginInterfaceBuilder.h

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ namespace Plugin {
101101
WPEFramework::PluginHost::IShell* controller = builder.controller();
102102
const std::string& callsign = builder.callSign();
103103
const int retry_count = builder.retryCount();
104+
const uint32_t retry_interval = builder.retryInterval();
104105
int count = 0;
105106

106107
if (!controller) {
@@ -118,7 +119,7 @@ namespace Plugin {
118119
else
119120
{
120121
count++;
121-
usleep(200*1000);
122+
usleep(retry_interval*1000);
122123
}
123124
}while(count < retry_count);
124125

@@ -139,6 +140,7 @@ namespace Plugin {
139140
uint32_t _version;
140141
uint32_t _timeout;
141142
int _retry_count;
143+
uint32_t _retry_interval;
142144

143145
public:
144146
PluginInterfaceBuilder(const char* callsign)
@@ -147,6 +149,7 @@ namespace Plugin {
147149
, _version(static_cast<uint32_t>(~0))
148150
, _timeout(3000)
149151
,_retry_count(0)
152+
,_retry_interval(0)
150153
{
151154
}
152155

@@ -171,7 +174,13 @@ namespace Plugin {
171174
return *this;
172175
}
173176

174-
inline PluginInterfaceBuilder& withRetry(int retryCount)
177+
inline PluginInterfaceBuilder& withRetryIntervalMS(int retryInterval)
178+
{
179+
_retry_interval = retryInterval;
180+
return *this;
181+
}
182+
183+
inline PluginInterfaceBuilder& withRetryCount(int retryCount)
175184
{
176185
_retry_count = retryCount;
177186
return *this;
@@ -189,9 +198,14 @@ namespace Plugin {
189198
return std::move(PluginInterfaceRef<INTERFACE>(interface, _service));
190199
}
191200

201+
const uint32_t retryInterval() const
202+
{
203+
return _retry_interval;
204+
}
205+
192206
const int retryCount() const
193207
{
194-
return _callsign;
208+
return _retry_count;
195209
}
196210

197211
const std::string& callSign() const

helpers/frontpanel.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,8 @@ namespace WPEFramework
135135
{
136136
_powerManagerPlugin = PowerManagerInterfaceBuilder(_T("org.rdk.PowerManager"))
137137
.withIShell(service)
138-
.withRetry(25)
138+
.withRetryIntervalMS(200)
139+
.withRetryCount(25)
139140
.createInterface();
140141
}
141142
if (!s_instance)

0 commit comments

Comments
 (0)