Skip to content

Commit 617100b

Browse files
committed
Merge branch 'develop' into feature/RDKEMW-1015_COMRPC
2 parents 97414bc + 8684118 commit 617100b

File tree

9 files changed

+154
-69
lines changed

9 files changed

+154
-69
lines changed

.github/workflows/L1-tests.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,6 @@ jobs:
247247
network/wifiSrvMgrIarmIf.h
248248
network/netsrvmgrIarm.h
249249
libudev.h
250-
libusb.h
251250
rfcapi.h
252251
rbus.h
253252
motionDetector.h
@@ -297,7 +296,6 @@ jobs:
297296
-I $GITHUB_WORKSPACE/Thunder/Source/core
298297
-include $GITHUB_WORKSPACE/entservices-testframework/Tests/mocks/devicesettings.h
299298
-include $GITHUB_WORKSPACE/entservices-testframework/Tests/mocks/Iarm.h
300-
-include $GITHUB_WORKSPACE/entservices-testframework/Tests/mocks/libusb.h
301299
-include $GITHUB_WORKSPACE/entservices-testframework/Tests/mocks/Rfc.h
302300
-include $GITHUB_WORKSPACE/entservices-testframework/Tests/mocks/RBus.h
303301
-include $GITHUB_WORKSPACE/entservices-testframework/Tests/mocks/Telemetry.h
@@ -367,7 +365,6 @@ jobs:
367365
-I $GITHUB_WORKSPACE/Thunder/Source/core
368366
-include $GITHUB_WORKSPACE/entservices-testframework/Tests/mocks/devicesettings.h
369367
-include $GITHUB_WORKSPACE/entservices-testframework/Tests/mocks/Iarm.h
370-
-include $GITHUB_WORKSPACE/entservices-testframework/Tests/mocks/libusb.h
371368
-include $GITHUB_WORKSPACE/entservices-testframework/Tests/mocks/Rfc.h
372369
-include $GITHUB_WORKSPACE/entservices-testframework/Tests/mocks/RBus.h
373370
-include $GITHUB_WORKSPACE/entservices-testframework/Tests/mocks/Telemetry.h

.github/workflows/L2-tests.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,6 @@ jobs:
203203
rfcapi.h
204204
rbus.h
205205
libudev.h
206-
libusb.h
207206
systemservices/proc/readproc.h
208207
systemservices/secure_wrapper.h
209208
systemaudioplatform.h
@@ -283,7 +282,6 @@ jobs:
283282
-include $GITHUB_WORKSPACE/entservices-testframework/Tests/mocks/RBus.h
284283
-include $GITHUB_WORKSPACE/entservices-testframework/Tests/mocks/Udev.h
285284
-include $GITHUB_WORKSPACE/entservices-testframework/Tests/mocks/Wraps.h
286-
-include $GITHUB_WORKSPACE/entservices-testframework/Tests/mocks/libusb.h
287285
-include $GITHUB_WORKSPACE/entservices-testframework/Tests/mocks/maintenanceMGR.h
288286
-include $GITHUB_WORKSPACE/entservices-testframework/Tests/mocks/pkg.h
289287
-include $GITHUB_WORKSPACE/entservices-testframework/Tests/mocks/secure_wrappermock.h

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,19 @@ 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.10](https://github.com/rdkcentral/entservices-inputoutput/compare/1.0.9...1.0.10)
8+
9+
- RDK-55554 Update return type [`#60`](https://github.com/rdkcentral/entservices-inputoutput/pull/60)
10+
- RDKEMW-3207 [OSCR SCAN] RDKE - entservices-testframework [`#61`](https://github.com/rdkcentral/entservices-inputoutput/pull/61)
11+
- Modifying L1-tests.yml L2-tests.yml [`fd0a678`](https://github.com/rdkcentral/entservices-inputoutput/commit/fd0a6783526fa0dd6d6541b31aeef4c2d8272fb5)
12+
- Merge tag '1.0.9' into develop [`668cc7c`](https://github.com/rdkcentral/entservices-inputoutput/commit/668cc7ce09864ac16e6c609cabbfcf94ae16faba)
13+
714
#### [1.0.9](https://github.com/rdkcentral/entservices-inputoutput/compare/1.0.8...1.0.9)
815

16+
> 15 April 2025
17+
918
- RDK-57093: Resolved the compilation error [`#55`](https://github.com/rdkcentral/entservices-inputoutput/pull/55)
19+
- 1.0.9 release change log updates [`fb8eb3c`](https://github.com/rdkcentral/entservices-inputoutput/commit/fb8eb3c4fe58d2165dbab6d57d8eab46673ed1f3)
1020
- Merge tag '1.0.8' into develop [`fe37f21`](https://github.com/rdkcentral/entservices-inputoutput/commit/fe37f210ddbf3e698fccc454fd7593e7fb6e4a9d)
1121

1222
#### [1.0.8](https://github.com/rdkcentral/entservices-inputoutput/compare/1.0.7...1.0.8)

HdcpProfile/HdcpProfile.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ namespace WPEFramework
306306

307307
void HdcpProfile::dsHdmiEventHandler(const char *owner, IARM_EventId_t eventId, void *data, size_t len)
308308
{
309-
uint32_t res = Core::ERROR_GENERAL;
309+
Core::hresult res = Core::ERROR_GENERAL;
310310
PowerState pwrStateCur = WPEFramework::Exchange::IPowerManager::POWER_STATE_UNKNOWN;
311311
PowerState pwrStatePrev = WPEFramework::Exchange::IPowerManager::POWER_STATE_UNKNOWN;
312312

HdmiCecSink/HdmiCecSink.cpp

Lines changed: 109 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -62,40 +62,122 @@ namespace WPEFramework
6262
return (std::string("Not supported"));
6363
}
6464

65-
string msg = "";
65+
HdmiCecSink::_instance = this;
66+
smConnection=NULL;
67+
cecEnableStatus = false;
68+
HdmiCecSink::_instance->m_numberOfDevices = 0;
69+
m_logicalAddressAllocated = LogicalAddress::UNREGISTERED;
70+
m_currentActiveSource = -1;
71+
m_isHdmiInConnected = false;
72+
hdmiCecAudioDeviceConnected = false;
73+
m_isAudioStatusInfoUpdated = false;
74+
m_audioStatusReceived = false;
75+
m_audioStatusTimerStarted = false;
76+
m_audioDevicePowerStatusRequested = false;
77+
m_pollNextState = POLL_THREAD_STATE_NONE;
78+
m_pollThreadState = POLL_THREAD_STATE_NONE;
79+
m_video_latency = DEFAULT_VIDEO_LATENCY;
80+
m_latency_flags = DEFAULT_LATENCY_FLAGS ;
81+
m_audio_output_delay = DEFAULT_AUDIO_OUTPUT_DELAY;
82+
83+
Register(HDMICECSINK_METHOD_SET_ENABLED, &HdmiCecSink::setEnabledWrapper, this);
84+
Register(HDMICECSINK_METHOD_GET_ENABLED, &HdmiCecSink::getEnabledWrapper, this);
85+
Register(HDMICECSINK_METHOD_SET_OSD_NAME, &HdmiCecSink::setOSDNameWrapper, this);
86+
Register(HDMICECSINK_METHOD_GET_OSD_NAME, &HdmiCecSink::getOSDNameWrapper, this);
87+
Register(HDMICECSINK_METHOD_SET_VENDOR_ID, &HdmiCecSink::setVendorIdWrapper, this);
88+
Register(HDMICECSINK_METHOD_GET_VENDOR_ID, &HdmiCecSink::getVendorIdWrapper, this);
89+
Register(HDMICECSINK_METHOD_PRINT_DEVICE_LIST, &HdmiCecSink::printDeviceListWrapper, this);
90+
Register(HDMICECSINK_METHOD_SET_ACTIVE_PATH, &HdmiCecSink::setActivePathWrapper, this);
91+
Register(HDMICECSINK_METHOD_SET_ROUTING_CHANGE, &HdmiCecSink::setRoutingChangeWrapper, this);
92+
Register(HDMICECSINK_METHOD_GET_DEVICE_LIST, &HdmiCecSink::getDeviceListWrapper, this);
93+
Register(HDMICECSINK_METHOD_GET_ACTIVE_SOURCE, &HdmiCecSink::getActiveSourceWrapper, this);
94+
Register(HDMICECSINK_METHOD_SET_ACTIVE_SOURCE, &HdmiCecSink::setActiveSourceWrapper, this);
95+
Register(HDMICECSINK_METHOD_GET_ACTIVE_ROUTE, &HdmiCecSink::getActiveRouteWrapper, this);
96+
Register(HDMICECSINK_METHOD_REQUEST_ACTIVE_SOURCE, &HdmiCecSink::requestActiveSourceWrapper, this);
97+
Register(HDMICECSINK_METHOD_SETUP_ARC, &HdmiCecSink::setArcEnableDisableWrapper, this);
98+
Register(HDMICECSINK_METHOD_SET_MENU_LANGUAGE, &HdmiCecSink::setMenuLanguageWrapper, this);
99+
Register(HDMICECSINK_METHOD_REQUEST_SHORT_AUDIO_DESCRIPTOR, &HdmiCecSink::requestShortAudioDescriptorWrapper, this);
100+
Register(HDMICECSINK_METHOD_SEND_STANDBY_MESSAGE, &HdmiCecSink::sendStandbyMessageWrapper, this);
101+
Register(HDMICECSINK_METHOD_SEND_AUDIO_DEVICE_POWER_ON, &HdmiCecSink::sendAudioDevicePowerOnMsgWrapper, this);
102+
Register(HDMICECSINK_METHOD_SEND_KEY_PRESS,&HdmiCecSink::sendRemoteKeyPressWrapper,this);
103+
Register(HDMICECSINK_METHOD_SEND_USER_CONTROL_PRESSED,&HdmiCecSink::sendUserControlPressedWrapper,this);
104+
Register(HDMICECSINK_METHOD_SEND_USER_CONTROL_RELEASED,&HdmiCecSink::sendUserControlReleasedWrapper,this);
105+
Register(HDMICECSINK_METHOD_SEND_GIVE_AUDIO_STATUS,&HdmiCecSink::sendGiveAudioStatusWrapper,this);
106+
Register(HDMICECSINK_METHOD_GET_AUDIO_DEVICE_CONNECTED_STATUS,&HdmiCecSink::getAudioDeviceConnectedStatusWrapper,this);
107+
Register(HDMICECSINK_METHOD_REQUEST_AUDIO_DEVICE_POWER_STATUS,&HdmiCecSink::requestAudioDevicePowerStatusWrapper,this);
108+
Register(HDMICECSINK_METHOD_SET_LATENCY_INFO, &HdmiCecSink::setLatencyInfoWrapper, this);
109+
logicalAddressDeviceType = "None";
110+
logicalAddress = 0xFF;
111+
// load persistence setting
112+
loadSettings();
113+
114+
int err;
115+
dsHdmiInGetNumberOfInputsParam_t hdmiInput;
116+
InitializeIARM();
117+
m_sendKeyEventThreadExit = false;
118+
m_sendKeyEventThread = std::thread(threadSendKeyEvent);
119+
120+
m_currentArcRoutingState = ARC_STATE_ARC_TERMINATED;
121+
m_semSignaltoArcRoutingThread.acquire();
122+
m_arcRoutingThread = std::thread(threadArcRouting);
123+
124+
m_audioStatusDetectionTimer.connect( std::bind( &HdmiCecSink::audioStatusTimerFunction, this ) );
125+
m_audioStatusDetectionTimer.setSingleShot(true);
126+
m_arcStartStopTimer.connect( std::bind( &HdmiCecSink::arcStartStopTimerFunction, this ) );
127+
m_arcStartStopTimer.setSingleShot(true);
128+
// get power state:
129+
uint32_t res = Core::ERROR_GENERAL;
130+
PowerState pwrStateCur = WPEFramework::Exchange::IPowerManager::POWER_STATE_UNKNOWN;
131+
PowerState pwrStatePrev = WPEFramework::Exchange::IPowerManager::POWER_STATE_UNKNOWN;
132+
133+
ASSERT (_powerManagerPlugin);
134+
if (_powerManagerPlugin) {
135+
res = _powerManagerPlugin->GetPowerState(pwrStateCur, pwrStatePrev);
136+
if (Core::ERROR_NONE == res) {
137+
powerState = (pwrStateCur == WPEFramework::Exchange::IPowerManager::POWER_STATE_ON) ? DEVICE_POWER_STATE_ON : DEVICE_POWER_STATE_OFF;
138+
LOGINFO("Current state is PowerManagerPlugin: (%d) powerState :%d \n", pwrStateCur, powerState);
139+
}
140+
}
66141

67-
ASSERT(nullptr != service);
68-
ASSERT(nullptr == _service);
69-
ASSERT(nullptr == _hdmiCecSink);
70-
ASSERT(0 == _connectionId);
142+
err = IARM_Bus_Call(IARM_BUS_DSMGR_NAME,
143+
IARM_BUS_DSMGR_API_dsHdmiInGetNumberOfInputs,
144+
(void *)&hdmiInput,
145+
sizeof(hdmiInput));
71146

147+
if (err == IARM_RESULT_SUCCESS && hdmiInput.result == dsERR_NONE)
148+
{
149+
LOGINFO("Number of Inputs [%d] \n", hdmiInput.numHdmiInputs );
150+
m_numofHdmiInput = hdmiInput.numHdmiInputs;
151+
}else{
152+
LOGINFO("Not able to get Numebr of inputs so defaulting to 3 \n");
153+
m_numofHdmiInput = 3;
154+
}
72155

73-
_service = service;
74-
_service->AddRef();
75-
_service->Register(&_notification);
76-
_hdmiCecSink = _service->Root<Exchange::IHdmiCecSink>(_connectionId, 5000, _T("HdmiCecSinkImplementation"));
156+
LOGINFO("initalize inputs \n");
77157

78-
if(nullptr != _hdmiCecSink)
79-
{
80-
_hdmiCecSink->Configure(service);
81-
_hdmiCecSink->Register(&_notification);
82-
Exchange::JHdmiCecSink::Register(*this, _hdmiCecSink);
83-
LOGINFO("HdmiCecSink plugin is available. Successfully activated HdmiCecSink Plugin");
84-
}
85-
else
86-
{
87-
msg = "HdmiCecSink plugin is not available";
88-
LOGINFO("HdmiCecSink plugin is not available. Failed to activate HdmiCecSink Plugin");
89-
}
158+
for (int i = 0; i < m_numofHdmiInput; i++){
159+
HdmiPortMap hdmiPort((uint8_t)i);
160+
LOGINFO(" Add to vector [%d] \n", i);
161+
hdmiInputs.push_back(hdmiPort);
162+
}
163+
164+
LOGINFO("Check the HDMI State \n");
90165

91-
if (0 != msg.length())
166+
CheckHdmiInState();
167+
if (cecSettingEnabled)
92168
{
93-
Deinitialize(service);
169+
try
170+
{
171+
CECEnable();
172+
}
173+
catch(...)
174+
{
175+
LOGWARN("Exception while enabling CEC settings .\r\n");
176+
}
94177
}
95-
96-
// On success return empty, to indicate there is no error text.
97-
return msg;
98-
178+
getCecVersion();
179+
LOGINFO(" HdmiCecSink plugin Initialize completed \n");
180+
return (std::string());
99181

100182
}
101183

HdmiCecSource/HdmiCecSourceImplementation.cpp

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -392,13 +392,13 @@ namespace WPEFramework
392392
DeinitializeIARM();
393393
}
394394

395-
uint32_t HdmiCecSourceImplementation::Configure(PluginHost::IShell* service)
395+
Core::hresult HdmiCecSourceImplementation::Configure(PluginHost::IShell* service)
396396
{
397397
LOGINFO("Configure");
398398
ASSERT(service != nullptr);
399399
PowerState pwrStateCur = WPEFramework::Exchange::IPowerManager::POWER_STATE_UNKNOWN;
400400
PowerState pwrStatePrev = WPEFramework::Exchange::IPowerManager::POWER_STATE_UNKNOWN;
401-
uint32_t res = Core::ERROR_GENERAL;
401+
Core::hresult res = Core::ERROR_GENERAL;
402402
string msg;
403403
if (Utils::IARM::init()) {
404404
//Initialize cecEnableStatus to false in ctor
@@ -479,7 +479,7 @@ namespace WPEFramework
479479

480480
}
481481

482-
uint32_t HdmiCecSourceImplementation::Register(Exchange::IHdmiCecSource::INotification* notification)
482+
Core::hresult HdmiCecSourceImplementation::Register(Exchange::IHdmiCecSource::INotification* notification)
483483
{
484484

485485
LOGINFO("Register");
@@ -501,7 +501,7 @@ namespace WPEFramework
501501
}
502502

503503

504-
uint32_t HdmiCecSourceImplementation::Unregister(Exchange::IHdmiCecSource::INotification* notification)
504+
Core::hresult HdmiCecSourceImplementation::Unregister(Exchange::IHdmiCecSource::INotification* notification)
505505
{
506506
LOGINFO("Unregister");
507507
if(notification != nullptr){
@@ -572,7 +572,7 @@ namespace WPEFramework
572572
}
573573

574574

575-
uint32_t HdmiCecSourceImplementation::GetActiveSourceStatus(bool &isActiveSource, bool &success)
575+
Core::hresult HdmiCecSourceImplementation::GetActiveSourceStatus(bool &isActiveSource, bool &success)
576576
{
577577
isActiveSource = isDeviceActiveSource;
578578
success = true;
@@ -653,7 +653,7 @@ namespace WPEFramework
653653
return Core::ERROR_NONE;
654654
}
655655

656-
uint32_t HdmiCecSourceImplementation::SendKeyPressEvent(const uint32_t &logicalAddress,const uint32_t &keyCode, HdmiCecSourceSuccess &success)
656+
Core::hresult HdmiCecSourceImplementation::SendKeyPressEvent(const uint32_t &logicalAddress,const uint32_t &keyCode, HdmiCecSourceSuccess &success)
657657
{
658658
SendKeyInfo keyInfo;
659659
try {
@@ -684,7 +684,7 @@ namespace WPEFramework
684684

685685
}
686686

687-
uint32_t HdmiCecSourceImplementation::SendStandbyMessage(HdmiCecSourceSuccess &success)
687+
Core::hresult HdmiCecSourceImplementation::SendStandbyMessage(HdmiCecSourceSuccess &success)
688688
{
689689
bool ret = false;
690690

@@ -946,7 +946,7 @@ namespace WPEFramework
946946
return cecSettingEnabled;
947947
}
948948

949-
uint32_t HdmiCecSourceImplementation::SetEnabled(const bool &enabled, HdmiCecSourceSuccess &success)
949+
Core::hresult HdmiCecSourceImplementation::SetEnabled(const bool &enabled, HdmiCecSourceSuccess &success)
950950
{
951951
LOGINFO("Entered SetEnabled ");
952952

@@ -967,7 +967,7 @@ namespace WPEFramework
967967
return Core::ERROR_NONE;
968968
}
969969

970-
uint32_t HdmiCecSourceImplementation::SetOTPEnabled(const bool &enabled, HdmiCecSourceSuccess &success)
970+
Core::hresult HdmiCecSourceImplementation::SetOTPEnabled(const bool &enabled, HdmiCecSourceSuccess &success)
971971
{
972972
if (cecOTPSettingEnabled != enabled)
973973
{
@@ -1197,31 +1197,31 @@ namespace WPEFramework
11971197
return;
11981198
}
11991199

1200-
uint32_t HdmiCecSourceImplementation::GetEnabled(bool &enabled, bool &success)
1200+
Core::hresult HdmiCecSourceImplementation::GetEnabled(bool &enabled, bool &success)
12011201
{
12021202
LOGINFO("GetEnabled :%d ",cecEnableStatus);
12031203
enabled = cecEnableStatus;
12041204
success = true;
12051205
return Core::ERROR_NONE;
12061206
}
12071207

1208-
uint32_t HdmiCecSourceImplementation::GetOTPEnabled(bool &enabled, bool &success)
1208+
Core::hresult HdmiCecSourceImplementation::GetOTPEnabled(bool &enabled, bool &success)
12091209
{
12101210
enabled = cecOTPSettingEnabled;
12111211
LOGINFO("GetOTPEnabled :%d ",cecOTPSettingEnabled);
12121212
success = true;
12131213
return Core::ERROR_NONE;
12141214
}
12151215

1216-
uint32_t HdmiCecSourceImplementation::GetOSDName(std::string &name, bool &success)
1216+
Core::hresult HdmiCecSourceImplementation::GetOSDName(std::string &name, bool &success)
12171217
{
12181218
name = osdName.toString();
12191219
LOGINFO("GetOSDName :%s ",name.c_str());
12201220
success = true;
12211221
return Core::ERROR_NONE;
12221222
}
12231223

1224-
uint32_t HdmiCecSourceImplementation::SetOSDName(const std::string &name, HdmiCecSourceSuccess &success)
1224+
Core::hresult HdmiCecSourceImplementation::SetOSDName(const std::string &name, HdmiCecSourceSuccess &success)
12251225
{
12261226
LOGINFO("SetOSDName :%s ",name.c_str());
12271227
osdName = name.c_str();
@@ -1230,15 +1230,15 @@ namespace WPEFramework
12301230
return Core::ERROR_NONE;
12311231
}
12321232

1233-
uint32_t HdmiCecSourceImplementation::GetVendorId(std::string &vendorid, bool &success)
1233+
Core::hresult HdmiCecSourceImplementation::GetVendorId(std::string &vendorid, bool &success)
12341234
{
12351235
vendorid = appVendorId.toString();
12361236
LOGINFO("GetVendorId :%s ",vendorid.c_str());
12371237
success = true;
12381238
return Core::ERROR_NONE;
12391239
}
12401240

1241-
uint32_t HdmiCecSourceImplementation::SetVendorId(const string &vendorid, HdmiCecSourceSuccess &success)
1241+
Core::hresult HdmiCecSourceImplementation::SetVendorId(const string &vendorid, HdmiCecSourceSuccess &success)
12421242
{
12431243
LOGINFO("SetVendorId :%s ",vendorid.c_str());
12441244
unsigned int vendorIdInt = 0;
@@ -1258,7 +1258,7 @@ namespace WPEFramework
12581258
return Core::ERROR_NONE;
12591259
}
12601260

1261-
uint32_t HdmiCecSourceImplementation::PerformOTPAction(HdmiCecSourceSuccess &success)
1261+
Core::hresult HdmiCecSourceImplementation::PerformOTPAction(HdmiCecSourceSuccess &success)
12621262
{
12631263
LOGINFO("PerformOTPAction ");
12641264
bool ret = false;
@@ -1300,7 +1300,7 @@ namespace WPEFramework
13001300
}
13011301
}
13021302

1303-
uint32_t HdmiCecSourceImplementation::GetDeviceList(uint32_t &numberofdevices, IHdmiCecSourceDeviceListIterator*& deviceList, bool &success)
1303+
Core::hresult HdmiCecSourceImplementation::GetDeviceList(uint32_t &numberofdevices, IHdmiCecSourceDeviceListIterator*& deviceList, bool &success)
13041304
{ //sample servicemanager response:
13051305
std::vector<Exchange::IHdmiCecSource::HdmiCecSourceDevices> localDevices;
13061306
Exchange::IHdmiCecSource::HdmiCecSourceDevices actual_hdmicecdevices = {0};

0 commit comments

Comments
 (0)