Skip to content

Commit bd0e352

Browse files
committed
RDKEMW-1061: RDK-E Add COMRPC
Reason for change: Create the interface file for HdmiCecSource Test Procedure: Risks: low Priority: P1 Signed-off-by:Hayden Gfeller [email protected]
1 parent a9c071e commit bd0e352

File tree

2 files changed

+21
-33
lines changed

2 files changed

+21
-33
lines changed

HdmiCecSource/HdmiCecSourceImplementation.cpp

Lines changed: 16 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -68,21 +68,6 @@
6868
#define CEC_SETTING_OSD_NAME "cecOSDName"
6969
#define CEC_SETTING_VENDOR_ID "cecVendorId"
7070

71-
72-
enum {
73-
HDMICECSOURCE_EVENT_DEVICE_ADDED=0,
74-
HDMICECSOURCE_EVENT_DEVICE_REMOVED,
75-
HDMICECSOURCE_EVENT_DEVICE_INFO_UPDATED,
76-
HDMICECSOURCE_EVENT_ACTIVE_SOURCE_STATUS_UPDATED,
77-
};
78-
79-
static const char *eventString[] = {
80-
"onDeviceAdded",
81-
"onDeviceRemoved",
82-
"onDeviceInfoUpdated",
83-
"onActiveSourceStatusUpdated"
84-
};
85-
8671
static std::vector<uint8_t> defaultVendorId = {0x00,0x19,0xFB};
8772
static VendorID appVendorId = {defaultVendorId.at(0),defaultVendorId.at(1),defaultVendorId.at(2)};
8873
static VendorID lgVendorId = {0x00,0xE0,0x91};
@@ -145,7 +130,7 @@ namespace WPEFramework
145130
else
146131
isDeviceActiveSource = false;
147132
LOGINFO("ActiveSource isDeviceActiveSource status :%d \n", isDeviceActiveSource);
148-
HdmiCecSourceImplementation::_instance->OnActiveSourceStatusUpdated();
133+
HdmiCecSourceImplementation::_instance->sendActiveSourceEvent();
149134
HdmiCecSourceImplementation::_instance->addDevice(header.from.toInt());
150135
}
151136
void HdmiCecSourceProcessor::process (const InActiveSource &msg, const Header &header)
@@ -285,7 +270,7 @@ namespace WPEFramework
285270
else
286271
isDeviceActiveSource = false;
287272
LOGINFO("physical_addr : %s isDeviceActiveSource :%d \n",physical_addr.toString().c_str(),isDeviceActiveSource);
288-
HdmiCecSourceImplementation::_instance->OnActiveSourceStatusUpdated();
273+
HdmiCecSourceImplementation::_instance->sendActiveSourceEvent();
289274
}
290275
void HdmiCecSourceProcessor::process (const RoutingInformation &msg, const Header &header)
291276
{
@@ -296,7 +281,7 @@ namespace WPEFramework
296281
else
297282
isDeviceActiveSource = false;
298283
LOGINFO("physical_addr : %s isDeviceActiveSource :%d \n",physical_addr.toString().c_str(),isDeviceActiveSource);
299-
HdmiCecSourceImplementation::_instance->OnActiveSourceStatusUpdated();
284+
HdmiCecSourceImplementation::_instance->sendActiveSourceEvent();
300285
}
301286
void HdmiCecSourceProcessor::process (const SetStreamPath &msg, const Header &header)
302287
{
@@ -307,7 +292,7 @@ namespace WPEFramework
307292
else
308293
isDeviceActiveSource = false;
309294
LOGINFO("physical_addr : %s isDeviceActiveSource :%d \n",physical_addr.toString().c_str(),isDeviceActiveSource);
310-
HdmiCecSourceImplementation::_instance->OnActiveSourceStatusUpdated();
295+
HdmiCecSourceImplementation::_instance->sendActiveSourceEvent();
311296

312297
}
313298
void HdmiCecSourceProcessor::process (const GetMenuLanguage &msg, const Header &header)
@@ -685,7 +670,7 @@ namespace WPEFramework
685670

686671
}
687672

688-
uint32_t HdmiCecSourceImplementation::SendStandbyMessage(bool success)
673+
uint32_t HdmiCecSourceImplementation::SendStandbyMessage(bool &success)
689674
{
690675
bool ret = false;
691676

@@ -720,7 +705,7 @@ namespace WPEFramework
720705
}
721706
}
722707

723-
void HdmiCecSourceImplementation::InitializePowerManager()
708+
void HdmiCecSourceImplementation::InitializePowerManager(PluginHost::IShell *service)
724709
{
725710
LOGINFO("Connect the COM-RPC socket\n");
726711
_powerManagerPlugin = PowerManagerInterfaceBuilder(_T("org.rdk.PowerManager"))
@@ -1211,7 +1196,7 @@ namespace WPEFramework
12111196

12121197
uint32_t HdmiCecSourceImplementation::GetOSDName(std::string &name, bool &success)
12131198
{
1214-
osdName = name.toString();
1199+
osdName = name.c_str();
12151200
LOGINFO("GetOSDName :%s ",name.c_str());
12161201
success = true;
12171202
return Core::ERROR_NONE;
@@ -1221,7 +1206,7 @@ namespace WPEFramework
12211206
{
12221207
LOGINFO("SetOSDName :%s ",name.c_str());
12231208
osdName = name.c_str();
1224-
Utils::persistJsonSettings (CEC_SETTING_ENABLED_FILE, CEC_SETTING_OSD_NAME, JsonValue(osd.c_str()));
1209+
Utils::persistJsonSettings (CEC_SETTING_ENABLED_FILE, CEC_SETTING_OSD_NAME, JsonValue(name.c_str()));
12251210
success = true;
12261211
return Core::ERROR_NONE;
12271212
}
@@ -1234,7 +1219,7 @@ namespace WPEFramework
12341219
return Core::ERROR_NONE;
12351220
}
12361221

1237-
uint32_t HdmiCecSourceImplementation::SetVendorId(const std::string vendorid, bool &success)
1222+
uint32_t HdmiCecSourceImplementation::SetVendorId((const string &vendorid), bool &success)
12381223
{
12391224
LOGINFO("SetVendorId :%s ",vendorid.c_str());
12401225
unsigned int vendorIdInt = 0;
@@ -1296,7 +1281,7 @@ namespace WPEFramework
12961281
}
12971282
}
12981283

1299-
uint32_t HdmiCecSourceImplementation::getDeviceList (Exchange::IHdmiCecSourceDeviceListIterator *&devices)
1284+
uint32_t HdmiCecSourceImplementation::getDeviceList (IHdmiCecSource::IHdmiCecSourceDeviceListIterator *&deviceList)
13001285
{ //sample servicemanager response:
13011286
LOGINFOMETHOD();
13021287
std::vector<Exchange::HdmiCecSourceDevices> localDevices;
@@ -1324,7 +1309,7 @@ namespace WPEFramework
13241309
LOGERR("Exception in api");
13251310
success = false;
13261311
}
1327-
devices = (Core::Service<RPC::IteratorType<Exchange::IHdmiCecSource::IHdmiCecSourceDeviceListIterator>>::Create<Exchange::IHdmiCecSource::IHdmiCecSourceDeviceListIterator>(localDevices));
1312+
deviceList = (Core::Service<RPC::IteratorType<Exchange::IHdmiCecSource::IHdmiCecSourceDeviceListIterator>>::Create<Exchange::IHdmiCecSource::IHdmiCecSourceDeviceListIterator>(localDevices));
13281313
returnResponse(success);
13291314
}
13301315

@@ -1585,7 +1570,7 @@ namespace WPEFramework
15851570
}
15861571

15871572

1588-
void HdmiCecSource::sendDeviceUpdateInfo(const int logicalAddress)
1573+
void HdmiCecSourceImplementation::sendDeviceUpdateInfo(const int logicalAddress)
15891574
{
15901575
LOGINFO("Device info updated notification send: for logical address:%d\r\n", logicalAddress);
15911576
std::list<Exchange::IHdmiCecSource::INotification*>::const_iterator index(_hdmiCecSourceNotifications.begin());
@@ -1595,7 +1580,7 @@ namespace WPEFramework
15951580
}
15961581
}
15971582

1598-
void HdmiCecSource::sendActiveSourceEvent()
1583+
void HdmiCecSourceImplementation::sendActiveSourceEvent()
15991584
{
16001585
LOGWARN(" sendActiveSourceEvent isDeviceActiveSource: %d ",isDeviceActiveSource);
16011586
std::list<Exchange::IHdmiCecSource::INotification*>::const_iterator index(_hdmiCecSourceNotifications.begin());
@@ -1605,7 +1590,7 @@ namespace WPEFramework
16051590
}
16061591
}
16071592

1608-
void HdmiCecSource::SendStandbyMsgEvent(const int logicalAddress)
1593+
void HdmiCecSourceImplementation::SendStandbyMsgEvent(const int logicalAddress)
16091594
{
16101595
std::list<Exchange::IHdmiCecSource::INotification*>::const_iterator index(_hdmiCecSourceNotifications.begin());
16111596
while (index != _hdmiCecSourceNotifications.end()) {
@@ -1614,7 +1599,7 @@ namespace WPEFramework
16141599
}
16151600
}
16161601

1617-
void HdmiCecSource::SendKeyReleaseMsgEvent(const int logicalAddress)
1602+
void HdmiCecSourceImplementation::SendKeyReleaseMsgEvent(const int logicalAddress)
16181603
{
16191604
std::list<Exchange::IHdmiCecSource::INotification*>::const_iterator index(_hdmiCecSourceNotifications.begin());
16201605
while (index != _hdmiCecSourceNotifications.end()) {
@@ -1623,7 +1608,7 @@ namespace WPEFramework
16231608
}
16241609
}
16251610

1626-
void HdmiCecSource::SendKeyPressMsgEvent(const int logicalAddress,const int keyCode)
1611+
void HdmiCecSourceImplementation::SendKeyPressMsgEvent(const int logicalAddress,const int keyCode)
16271612
{
16281613
std::list<Exchange::IHdmiCecSource::INotification*>::const_iterator index(_hdmiCecSourceNotifications.begin());
16291614
while (index != _hdmiCecSourceNotifications.end()) {

HdmiCecSource/HdmiCecSourceImplementation.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,10 +221,10 @@ namespace WPEFramework {
221221
int keyCode;
222222
}SendKeyInfo;
223223
BEGIN_INTERFACE_MAP(HdmiCecSourceImplementation)
224-
INTERFACE_ENTRY(PluginHost::IPlugin)
225-
INTERFACE_ENTRY(PluginHost::IDispatcher)
224+
INTERFACE_ENTRY(Exchange::IAuthService)
226225
END_INTERFACE_MAP
227226

227+
228228
private:
229229
class PowerManagerNotification : public Exchange::IPowerManager::INotification {
230230
private:
@@ -329,7 +329,10 @@ namespace WPEFramework {
329329
uint32_t SendStandbyMessage(bool &success);
330330
uint32_t SendKeyPressEvent(const int &logicalAddress, int keyCode, bool &success);
331331
uint32_t GetActiveSourceStatus(bool &isActiveSource, bool &success);
332+
uint32_t GetDeviceList(IHdmiCecSource::HdmiCecSourceDeviceListIterator *&deviceList, bool &success);
332333
uint32_t Configure(PluginHost::IShell*) override;
334+
uint32_t Register(IHdmiCecSource::INotification *notification) override;
335+
uint32_t Unregister(IHdmiCecSource::INotification *notification) override;
333336

334337

335338
};

0 commit comments

Comments
 (0)