Skip to content

Commit 4501b77

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 5ec3368 commit 4501b77

File tree

2 files changed

+59
-49
lines changed

2 files changed

+59
-49
lines changed

HdmiCecSource/HdmiCecSource.cpp

Lines changed: 7 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -164,53 +164,18 @@ namespace WPEFramework
164164
return ;
165165
}
166166

167-
if(true == HdmiCecSource::_hdmiCecSource->getEnabled())
167+
if(true == HdmiCecSource::_hdmiCecSource->GetEnabled())
168168
{
169-
HdmiCecSource::_hdmiCecSource->SetEnabled(false,false);
169+
bool enabled = false;
170+
HdmiCecSource::_hdmiCecSource->SetEnabled(false,enabled);
170171
}
171172
isDeviceActiveSource = false;
172-
HdmiCecSource::_instance->OnActiveSourceStatusUpdated();
173-
HdmiCecSource::_instance = nullptr;
173+
HdmiCecSource::_notification->OnActiveSourceStatusUpdated();
174174

175-
DeinitializeIARM();
176-
}
175+
HdmiCecSource::_instance->DeinitializeIARM();
177176

178-
void HdmiCecSource::sendDeviceUpdateInfo(const int logicalAddress)
179-
{
180-
JsonObject params;
181-
params["logicalAddress"] = JsonValue(logicalAddress);
182-
LOGINFO("Device info updated notification send: for logical address:%d\r\n", logicalAddress);
183-
sendNotify(eventString[HDMICECSOURCE_EVENT_DEVICE_INFO_UPDATED], params);
184-
}
185-
186-
void HdmiCecSource::OnActiveSourceStatusUpdated()
187-
{
188-
JsonObject params;
189-
params["status"] = isDeviceActiveSource;
190-
LOGWARN(" OnActiveSourceStatusUpdated isDeviceActiveSource: %d ",isDeviceActiveSource);
191-
sendNotify(eventString[HDMICECSOURCE_EVENT_ACTIVE_SOURCE_STATUS_UPDATED], params);
192-
}
193-
194-
void HdmiCecSource::SendKeyPressMsgEvent(const int logicalAddress,const int keyCode)
195-
{
196-
JsonObject params;
197-
params["logicalAddress"] = JsonValue(logicalAddress);
198-
params["keyCode"] = JsonValue(keyCode);
199-
sendNotify(HDMICEC_EVENT_ON_KEYPRESS_MSG_RECEIVED, params);
200-
}
201-
void HdmiCecSource::SendKeyReleaseMsgEvent(const int logicalAddress)
202-
{
203-
JsonObject params;
204-
params["logicalAddress"] = JsonValue(logicalAddress);
205-
sendNotify(HDMICEC_EVENT_ON_KEYRELEASE_MSG_RECEIVED, params);
206-
}
207-
208-
void HdmiCecSource::SendStandbyMsgEvent(const int logicalAddress)
209-
{
210-
JsonObject params;
211-
params["logicalAddress"] = JsonValue(logicalAddress);
212-
sendNotify(HDMICEC_EVENT_ON_STANDBY_MSG_RECEIVED, params);
213-
}
177+
HdmiCecSource::_instance = nullptr;
178+
}
214179

215180
} // namespace Plugin
216181
} // namespace WPEFramework

HdmiCecSource/HdmiCecSource.h

Lines changed: 52 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,58 @@ namespace WPEFramework {
9292
void Activated(RPC::IRemoteConnection*) override;
9393
void Deactivated(RPC::IRemoteConnection *connection) override;
9494

95-
void OnDeviceAdded() override;
96-
void OnDeviceRemoved(const uint8_t logicalAddress) override;
97-
void OnDeviceInfoUpdated(const int logicalAddress) override;
98-
void OnActiveSourceStatusUpdated(const bool isActiveSource) override;
99-
void StandbyMessageReceived(const int8_t logicalAddress) override;
100-
void SendKeyReleasedMsgEvent(const int8_t logicalAddress) override;
101-
void SendKeyPressMsgEvent(const int8_t logicalAddress, const int32_t keyCode) override;
95+
void OnDeviceAdded() override
96+
{
97+
LOGINFO("OnDeviceAdded");
98+
JsonObject params;
99+
_parent.Notify(_T("onDeviceAdded"), params);
100+
}
101+
void OnDeviceRemoved(const uint8_t logicalAddress) override
102+
{
103+
LOGINFO("OnDeviceRemoved");
104+
JsonObject params;
105+
params["logicalAddress"] = logicalAddress;
106+
_parent.Notify(_T("onDeviceRemoved"), params);
107+
}
108+
void OnDeviceInfoUpdated(const int logicalAddress) override
109+
{
110+
LOGINFO("OnDeviceInfoUpdated");
111+
JsonObject params;
112+
params["logicalAddress"] = logicalAddress;
113+
_parent.Notify(_T("onDeviceInfoUpdated"), params);
114+
}
115+
void OnActiveSourceStatusUpdated(const bool isActiveSource) override
116+
{
117+
LOGINFO("OnActiveSourceStatusUpdated");
118+
JsonObject params;
119+
params["isActiveSource"] = isActiveSource;
120+
_parent.Notify(_T("onActiveSourceStatusUpdated"), params);
121+
}
122+
void StandbyMessageReceived(const int8_t logicalAddress) override
123+
{
124+
LOGINFO("StandbyMessageReceived");
125+
JsonObject params;
126+
params["logicalAddress"] = logicalAddress;
127+
_parent.Notify(_T("standbyMessageReceived"), params);
128+
}
129+
void SendKeyReleasedMsgEvent(const int8_t logicalAddress) override
130+
{
131+
LOGINFO("SendKeyReleasedMsgEvent");
132+
JsonObject params;
133+
params["logicalAddress"] = logicalAddress;
134+
_parent.Notify(_T("sendKeyReleasedMsgEvent"), params);
135+
}
136+
void SendKeyPressMsgEvent(const int8_t logicalAddress, const int32_t keyCode) override
137+
{
138+
LOGINFO("SendKeyPressMsgEvent");
139+
JsonObject params;
140+
params["logicalAddress"] = logicalAddress;
141+
params["keyCode"] = keyCode;
142+
_parent.Notify(_T("sendKeyPressMsgEvent"), params);
143+
}
144+
145+
private:
146+
HdmiCecSource &_parent;
102147

103148
};
104149

0 commit comments

Comments
 (0)