RDK Documentation (Open Sourced RDK Components)
RDK.cpp
1 /*
2  * If not stated otherwise in this file or this component's Licenses.txt file the
3  * following copyright and licenses apply:
4  *
5  * Copyright 2016 RDK Management
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18 */
19 
20 
21 /**
22 * @defgroup hdmicec
23 * @{
24 * @defgroup host
25 * @{
26 **/
27 
28 /**
29  * @defgroup hdmi_host HDMI-CEC Host
30  * @ingroup HDMI_CEC
31  * @ingroup hdmi_host
32  * @{
33  */
34 
35 
36 #include <dlfcn.h>
37 #include <stdio.h>
38 #include <string.h>
39 
40 #include "libIARM.h"
41 #include "libIBus.h"
42 #include "libIBusDaemon.h"
43 #include "pwrMgr.h"
44 #include "dsMgr.h"
45 #include "dsDisplay.h"
46 #include "videoOutputPort.hpp"
47 #include "host.hpp"
48 #include "exception.hpp"
49 #include "manager.hpp"
50 #include "ccec/Util.hpp"
51 
52 #include "ccec/Host.hpp"
53 #include "ccec/host/RDK.hpp"
54 
55 #include "safec_lib.h"
56 #define MAX_LENGTH_OF_OSD_NAME 15
57 
58 typedef struct _DeviceStatus_t
59 {
60  int logicalAddress;
61  int powerState;
62  int isConnected;
63  char osdName[14+1];
65 
66 static int powerState;
67 
68 static CECHost_Callback_t hostCb = {0};
69 static pthread_mutex_t devStatMutex = PTHREAD_MUTEX_INITIALIZER;
70 static DeviceStatus_t _deviceStatus[14] = {0};
71 
72 /*
73  * osdName is a properly NULL-terminated cache of the
74  * lastly set OSD name.
75  */
76 static char osdName[14+1] = "SettopBox";
77 
78 
79 static IARM_Result_t _PowerPreChange(void *arg);
80 static IARM_Result_t _SetDevMgrStatus(void *arg);
81 static IARM_Result_t _SetOSDName(void *arg);
82 static IARM_Result_t _GetOSDName(void *arg);
83 static IARM_Result_t _GetDevStatus(void *arg);
84 
85 
86 static void _hdmiEventHandler(const char *owner, IARM_EventId_t eventId, void *data, size_t len);
87 static void _powerEventHandler(const char *owner, IARM_EventId_t eventId, void *data, size_t len);
88 
89 /**
90  * @brief This function is used to initialize CEC host device by registering
91  * event handlers and calls like status, name etc.
92  *
93  * @param[in] name OSD name.
94  *
95  * @retval CECHost_ERR_NONE Returns for successful condition.
96  */
97 CECHost_Err_t CECHost_Init(const char *name)
98 {
99  IARM_Bus_Init(IARM_BUS_CECHOST_NAME);
101 
102  IARM_Bus_RegisterEventHandler(IARM_BUS_DSMGR_NAME,IARM_BUS_DSMGR_EVENT_HDMI_HOTPLUG, _hdmiEventHandler);
104 
105  IARM_Bus_RegisterCall(IARM_BUS_COMMON_API_PowerPreChange, _PowerPreChange);
106  IARM_Bus_RegisterCall(IARM_BUS_CEC_HOST_EnableDevMgr, _SetDevMgrStatus);
107  IARM_Bus_RegisterCall(IARM_BUS_CEC_HOST_SetOSDName, _SetOSDName);
108  IARM_Bus_RegisterCall(IARM_BUS_CEC_HOST_GetOSDName, _GetOSDName);
109  IARM_Bus_RegisterCall(IARM_BUS_CEC_HOST_GetDevStatus, _GetDevStatus);
110  CCEC_LOG( LOG_WARN, "RDKHost::CECHost_Init Initialising DeviceStatus Cache \n");
111  pthread_mutex_lock(&devStatMutex);
112  for( int i=0;i<14;i++)
113  {
114  _deviceStatus[i].logicalAddress = i;
115  _deviceStatus[i].powerState = 1;
116  _deviceStatus[i].isConnected = 0;
117  strncpy(_deviceStatus[i].osdName,"",MAX_LENGTH_OF_OSD_NAME);
118  }
119  pthread_mutex_unlock(&devStatMutex);
120 
122 
123  CECHost_GetPowerState(&powerState);
124 
125  return CECHost_ERR_NONE;
126 }
127 
128 /**
129  * @brief This function is used to de-initialize CEC host device, disconnects
130  * and terminates the CEC connection.
131  *
132  * @retval CECHost_ERR_NONE Returns for successful condition.
133  */
134 CECHost_Err_t CECHost_Term(void)
135 {
137 
140  IARM_Bus_Term();
141  return CECHost_ERR_NONE;
142 }
143 
144 /**
145  * @brief This function is used to set the callback function. It is called by
146  * Device Manager application to set Dev manager status, OSD name, hot plug event
147  * handler, power state event handler etc.
148  *
149  * @param[in] cb CECHost_Callback_t type structure.
150  *
151  * @retval CECHost_ERR_NONE Returns for successful condition.
152  */
154 {
155  hostCb = cb;
156  return CECHost_ERR_NONE;
157 }
158 
159 /**
160  * @brief This function is used to get the physical address of the HDMI output
161  * port byte by byte.
162  *
163  * @param[out] byte0 First byte of physical address.
164  * @param[out] byte1 Second byte of physical address.
165  * @param[out] byte2 Third byte of physical address.
166  * @param[out] byte3 Fourth byte of physical address.
167  *
168  * @retval CECHost_ERR_NONE Returns for successful condition.
169  * @retval CECHost_ERR_STATE Returns on error condition.
170  */
171 CECHost_Err_t CECHost_GetHdmiOuputPhysicalAddress(uint8_t *byte0, uint8_t *byte1, uint8_t *byte2, uint8_t *byte3)
172 {
173  /* Use DS */
174  CCEC_LOG( LOG_DEBUG, "CECHost_GetHdmiOuputPhysicalAddress entering\r\n");
175  try {
177  if (vPort.isDisplayConnected()) {
178  vPort.getDisplay().getPhysicallAddress(*byte0, *byte1, *byte2, *byte3);
179  CCEC_LOG( LOG_WARN, "Geting connected PHY %d %d %d %d\r\n", *byte0, *byte1, *byte2, *byte3);
180  }
181  else {
182  return CECHost_ERR_STATE;
183  }
184  }
185  catch(device::Exception &e) {
186  CCEC_LOG( LOG_EXP, "exception thrown %s\r\n", e.what());
187  return CECHost_ERR_HOST;
188  }
189 
190  return CECHost_ERR_NONE;
191 }
192 
193 /**
194  * @brief This function is used to check whether the HDMI output is connected
195  * or not.
196  *
197  * @param[out] connect State of connection, 1 for connected and 0 for not connected..
198  *
199  * @retval CECHost_ERR_NONE Returns for successful condition.
200  * @retval CECHost_ERR_HOST Returns on fail condition.
201  */
202 CECHost_Err_t CECHost_IsHdmiOutputConnected(int32_t *connect)
203 {
204  /* Use DS */
205  CCEC_LOG( LOG_DEBUG, "CECHost_IsHdmiOutputConnected entering\r\n");
206  try {
208  if (vPort.isDisplayConnected()) {
209  *connect = 1;
210  }
211  else {
212  *connect = 0;
213  }
214  }
215  catch(device::Exception &e) {
216  CCEC_LOG( LOG_EXP, "exceptin thrown %s\r\n", e.what());
217  return CECHost_ERR_HOST;
218  }
219 
220  return CECHost_ERR_NONE;
221 }
222 
223 /**
224  * @brief This function is used to get the state of power whether it is ON or
225  * in STANDBY state.
226  *
227  * @param[out] state State of power, ON or STANDBY.
228  *
229  * @retval CECHost_ERR_NONE Returns for successful condition.
230  * @retval CECHost_ERR_HOST Returns on fail condition.
231  */
232 CECHost_Err_t CECHost_GetPowerState(int32_t *state)
233 {
235  param.curState = IARM_BUS_PWRMGR_POWERSTATE_ON;
236  IARM_Result_t ret = IARM_Bus_Call(IARM_BUS_PWRMGR_NAME, IARM_BUS_PWRMGR_API_GetPowerState, (void *)&param, sizeof(param));
237  int isPowerOn = ((ret == IARM_RESULT_SUCCESS) && (param.curState == IARM_BUS_PWRMGR_POWERSTATE_ON));
238  *state = isPowerOn ? CECHost_POWERSTATE_ON : CECHost_POWERSTATE_STANDBY;
239  powerState = *state;
240  CCEC_LOG( LOG_WARN, "CECHost_GetPowerState has state %d\r\n", *state);
241  return ret == IARM_RESULT_SUCCESS ? CECHost_ERR_NONE : CECHost_ERR_HOST;
242 }
243 
244 /**
245  * @brief This function is used to set and update the device status like power
246  * status, logical address, osd name etc based on status type.
247  *
248  * @param[in] logicalAddress Logical address of cec device.
249  * @param[in] devices CECHost_DeviceStatus_t type pointer containing info about
250  * device.
251  * @retval CECHost_ERR_NONE Returns for successful condition.
252  * @retval CECHost_ERR_HOST Returns on fail condition.
253  */
254 CECHost_Err_t CECHost_SetDeviceStatus(int logicalAddress, CECHost_DeviceStatus_t *devices)
255 {
257  memset(&eventData,0,sizeof(eventData));
258  IARM_Result_t ret = IARM_RESULT_SUCCESS;
259  pthread_mutex_lock(&devStatMutex);
260  if (devices->statusType == CECHost_POWER_STATUS)
261  {
262  if( _deviceStatus[logicalAddress].powerState != devices->data.powerState)
263  {
264  _deviceStatus[logicalAddress].powerState = devices->data.powerState;
265  eventData.logicalAddress = logicalAddress;
266  eventData.changedStatus = IARM_BUS_CECHost_POWER_STATUS;
267  eventData.data.powerState = devices->data.powerState;
268  CCEC_LOG( LOG_WARN, "RDKHost BroadcastingChangedPowerStatus on Iarm Bus \n");
269  ret = IARM_Bus_BroadcastEvent(IARM_BUS_CECHOST_NAME,(IARM_EventId_t)IARM_BUS_CECHost_EVENT_DEVICESTATUSCHANGE,(void *)&eventData,sizeof(eventData));
270  }
271  }
272  else if (devices->statusType == CECHost_OSD_NAME)
273  {
274  if( 0 != strncmp(_deviceStatus[logicalAddress].osdName,(const char *)devices->data.osdName,MAX_LENGTH_OF_OSD_NAME))
275  {
276  memset(_deviceStatus[logicalAddress].osdName,'\0',MAX_LENGTH_OF_OSD_NAME);
277  strncpy(_deviceStatus[logicalAddress].osdName,(const char *)devices->data.osdName,MAX_LENGTH_OF_OSD_NAME-1);
278  eventData.logicalAddress = logicalAddress;
279  eventData.changedStatus = IARM_BUS_CECHost_OSD_NAME;
280  memset(eventData.data.osdName,'\0',MAX_LENGTH_OF_OSD_NAME);
281  strncpy(eventData.data.osdName,(const char *)devices->data.osdName,MAX_LENGTH_OF_OSD_NAME-1);
282  CCEC_LOG( LOG_DEBUG, "RDKHost BroadcastingChangedOsdNameStatus on Iarm Bus \n");
283  ret = IARM_Bus_BroadcastEvent(IARM_BUS_CECHOST_NAME,(IARM_EventId_t)IARM_BUS_CECHost_EVENT_DEVICESTATUSCHANGE,(void *)&eventData,sizeof(eventData));
284  }
285  }
286  else if (devices->statusType == CECHost_CONNECTED_STATUS)
287  {
288  if( _deviceStatus[logicalAddress].isConnected != devices->data.isConnected)
289  {
290  _deviceStatus[logicalAddress].isConnected = devices->data.isConnected;
291  if( !devices->data.isConnected)
292  {
293  _deviceStatus[logicalAddress].powerState = 1;
294  strncpy(_deviceStatus[logicalAddress].osdName,"",MAX_LENGTH_OF_OSD_NAME);
295  }
296  eventData.logicalAddress = logicalAddress;
297  eventData.changedStatus = IARM_BUS_CECHost_CONNECT_STATUS;
298  eventData.data.isConnected = devices->data.isConnected;
299  CCEC_LOG( LOG_DEBUG, "RDKHost BroadcastingChanged ConnectStatus on Iarm Bus for %d \n",logicalAddress);
300  ret = IARM_Bus_BroadcastEvent(IARM_BUS_CECHOST_NAME,(IARM_EventId_t)IARM_BUS_CECHost_EVENT_DEVICESTATUSCHANGE,(void *)&eventData,sizeof(eventData));
301  }
302  }
303  else
304  {
305  /*Do nothing*/
306  }
307  pthread_mutex_unlock(&devStatMutex);
308  return ret == IARM_RESULT_SUCCESS ? CECHost_ERR_NONE : CECHost_ERR_HOST;
309 }
310 
311 /**
312  * @brief This function is used to set the device power state to be ON or STANDBY.
313  *
314  * @param[in] state Power state value to be updated.
315 
316  * @retval CECHost_ERR_NONE Returns for successful condition.
317  * @retval CECHost_ERR_HOST Returns on fail condition.
318  */
319 CECHost_Err_t CECHost_SetPowerState(int32_t state)
320 {
322  param.newState = ((state == CECHost_POWERSTATE_ON) ? IARM_BUS_PWRMGR_POWERSTATE_ON :IARM_BUS_PWRMGR_POWERSTATE_STANDBY);
323  IARM_Result_t ret = IARM_Bus_Call(IARM_BUS_PWRMGR_NAME, IARM_BUS_PWRMGR_API_SetPowerState, (void *)&param, sizeof(param));
324  return ret == IARM_RESULT_SUCCESS ? CECHost_ERR_NONE : CECHost_ERR_HOST;
325 }
326 
327 /**
328  * @brief This function is used to get OSD name of Host module. Here 'buf' need not
329  * to be null terminated. If it is, the 'len' does not include the 'null' termintator.
330  *
331  * @param[in] buf The ASCII bytes of the OSD name
332  * @param[in] len The number of ASCII bytes.
333  *
334  * @retval CECHost_ERR_NONE Returns for success condition.
335  * @retval CECHost_ERR_INVALID Returns for failure condition.
336  */
337 CECHost_Err_t CECHost_GetOSDName(uint8_t *buf, size_t *len)
338 {
339  size_t buf_size= *len;
340  if (!buf || !len || *len == 0) {
341  return CECHost_ERR_INVALID;
342  }
343 
344  size_t nameLen = strlen(osdName);
345  if (*len > nameLen) *len = nameLen;
346  MEMCPY_S((char *)buf,buf_size+1, (char *)osdName, *len);
347  return CECHost_ERR_NONE;
348 }
349 
350 /**
351  * @brief This function is used to check whether host device is active or not.
352  *
353  * @param[out] active Variable that stores the state of box.
354  *
355  * @retval CECHost_ERR_NONE By default it returns success condition.
356  */
357 CECHost_Err_t CECHost_IsActive(int32_t *active)
358 {
359  /* Logic to determine if a box is activeSource
360  * For example, a User-Key PRess on a PowerON
361  * STB indicate that this box is active source.
362  *
363  * Simplest logic:
364  * active = (powerState == CECHost_POWERSTATE_ON)
365  */
366  *active = (powerState == CECHost_POWERSTATE_ON);
367  return CECHost_ERR_NONE;
368 }
369 
370 
371 static IARM_Result_t _PowerPreChange(void *arg)
372 {
373  IARM_Bus_CommonAPI_PowerPreChange_Param_t *param = (IARM_Bus_CommonAPI_PowerPreChange_Param_t *)arg;
374  //IARM_Result_t retCode = IARM_RESULT_SUCCESS;
375 
376  int curState = (param->curState == IARM_BUS_PWRMGR_POWERSTATE_ON) ? CECHost_POWERSTATE_ON : CECHost_POWERSTATE_STANDBY;
377  int newState = (param->newState == IARM_BUS_PWRMGR_POWERSTATE_ON) ? CECHost_POWERSTATE_ON : CECHost_POWERSTATE_STANDBY;
378  CCEC_LOG( LOG_DEBUG, "RDKHost::_PowerPreChange() Old State %d, New State: %d", curState , newState);
379 
380  return IARM_RESULT_SUCCESS;
381 }
382 
383 static IARM_Result_t _SetDevMgrStatus(void *arg)
384 {
385  bool opStatus = false;
386  IARM_Result_t ret = IARM_RESULT_SUCCESS;
389  CCEC_LOG( LOG_DEBUG, "RDKHost::_SetDevMgrStatus() Dev Manager status set by client to : %s \n", (param->status)?"true":"false");
390 
391  if(hostCb.devMgrStatusCb){
392  hostCb.devMgrStatusCb(param->status, &opStatus);
393  }
394 
395  opParam.status = opStatus;
396 
397  ret = IARM_Bus_BroadcastEvent( IARM_BUS_CECHOST_NAME, (IARM_EventId_t)IARM_BUS_CECHost_EVENT_DEVMANAGERSTATUS, (void *)&opParam, sizeof(opParam));
398  CCEC_LOG( LOG_DEBUG, "RDKHost::_SetDevMgrStatus() IARM Broadcast status : %s \n", (ret == IARM_RESULT_SUCCESS) ? "Success" : "Failure");
399 
400  return IARM_RESULT_SUCCESS;
401 }
402 
403 static IARM_Result_t _SetOSDName(void *arg)
404 {
406  CCEC_LOG( LOG_DEBUG, "RDKHost::_SetOSDName() : %s::%s", param->name, osdName);
407 
408  if (strncmp(osdName, (char *)param->name, sizeof(param->name)) != 0) {
409  osdName[14] = '\0';
410 
411  strncpy((char *)osdName, (const char *) param->name, sizeof(osdName) - 1);
412  if (hostCb.osdCb) {
413  hostCb.osdCb((uint8_t *)osdName, strlen(osdName));
414  }
415  }
416  return IARM_RESULT_SUCCESS;
417 }
418 
419 static IARM_Result_t _GetDevStatus(void *arg)
420 {
421  pthread_mutex_lock(&devStatMutex);
422  if(NULL != arg)
423  {
425  if(param->devices)
426  {
427  MEMCPY_S(param->devices,sizeof(param->devices),_deviceStatus,sizeof(_deviceStatus));
428  CCEC_LOG( LOG_DEBUG, "RDKHOST::_GetDevStatus() success \n");
429  pthread_mutex_unlock(&devStatMutex);
430  return IARM_RESULT_SUCCESS;
431  }
432  }
433  pthread_mutex_unlock(&devStatMutex);
434  return IARM_RESULT_INVALID_PARAM;
435 }
436 
437 static IARM_Result_t _GetOSDName(void *arg)
438 {
439  if(NULL != arg)
440  {
442  if(NULL != param->name)
443  {
444  MEMCPY_S(param->name,sizeof(param->name), osdName, sizeof(osdName));
445  CCEC_LOG( LOG_DEBUG, "RDKHost::_GetOSDName() : %s::%s\n",param->name,osdName);
446  return IARM_RESULT_SUCCESS;
447  }
448  }
449  return IARM_RESULT_INVALID_PARAM;
450 }
451 
452 static void _hdmiEventHandler(const char *owner, IARM_EventId_t eventId, void *data, size_t len)
453 {
454  switch (eventId) {
457  int hdmi_hotplug_event = eventData->data.hdmi_hpd.event;
458  CCEC_LOG( LOG_DEBUG, "RDKHost::_hdmiEventHandler: IARM_BUS_DSMGR_EVENT_HDMI_HOTPLUG event data:%d \r\n", hdmi_hotplug_event);
459  if (hostCb.hotplugCb)
460  hostCb.hotplugCb(
461  ((hdmi_hotplug_event == dsDISPLAY_EVENT_CONNECTED) ?
462  CECHost_HDMI_CONNECTED : CECHost_HDMI_DISCONNECTED));
463 
464  if( dsDISPLAY_EVENT_DISCONNECTED == hdmi_hotplug_event)
465  {
466  CCEC_LOG( LOG_DEBUG, "RDKHost::_hdmiEventHandler: Clearing device status on receiving disconnect event\r\n");
467  pthread_mutex_lock(&devStatMutex);
468  for( int i=0;i<14;i++)
469  {
470  _deviceStatus[i].logicalAddress = i;
471  _deviceStatus[i].powerState = 1;
472  _deviceStatus[i].isConnected = 0;
473  strncpy(_deviceStatus[i].osdName,"",MAX_LENGTH_OF_OSD_NAME);
474  }
475  pthread_mutex_unlock(&devStatMutex);
476  }
477 
478  }
479  break;
480  }
481 }
482 
483 static void _powerEventHandler(const char *owner, IARM_EventId_t eventId, void *data, size_t len)
484 {
485  switch (eventId) {
488  //IARM_Result_t retCode = IARM_RESULT_SUCCESS;
489 
490  int curState = (eventData->data.state.curState == IARM_BUS_PWRMGR_POWERSTATE_ON) ? CECHost_POWERSTATE_ON : CECHost_POWERSTATE_STANDBY;
491  int newState = (eventData->data.state.newState == IARM_BUS_PWRMGR_POWERSTATE_ON) ? CECHost_POWERSTATE_ON : CECHost_POWERSTATE_STANDBY;
492 
493  CCEC_LOG( LOG_DEBUG, "RDKHost::_powerEventHandler() Old State %d, New State: %d", curState , newState);
494  if (hostCb.pwrStateCb) hostCb.pwrStateCb(curState, newState);
495  powerState = newState;
496  }
497  break;
498  }
499 }
500 
501 
502 
503 /** @} */
504 /** @} */
505 /** @} */
IARM_BUS_PWRMGR_API_SetPowerState
#define IARM_BUS_PWRMGR_API_SetPowerState
Definition: pwrMgr.h:158
IARM_BUS_PWRMGR_NAME
#define IARM_BUS_PWRMGR_NAME
Definition: pwrMgr.h:54
_IARM_Bus_PWRMgr_SetPowerState_Param_t
Structure which holds the new powerstate to be set to the device.
Definition: pwrMgr.h:163
CECHost_Init
CECHost_Err_t CECHost_Init(const char *name)
This function is used to initialize CEC host device by registering event handlers and calls like stat...
Definition: RDK.cpp:97
CECHost_GetHdmiOuputPhysicalAddress
CECHost_Err_t CECHost_GetHdmiOuputPhysicalAddress(uint8_t *byte0, uint8_t *byte1, uint8_t *byte2, uint8_t *byte3)
This function is used to get the physical address of the HDMI output port byte by byte.
Definition: RDK.cpp:171
CECHost_SetDeviceStatus
CECHost_Err_t CECHost_SetDeviceStatus(int logicalAddress, CECHost_DeviceStatus_t *devices)
This function is used to set and update the device status like power status, logical address,...
Definition: RDK.cpp:254
_DeviceStatus_t
Definition: RDK.cpp:58
device::VideoOutputPort::Display::getPhysicallAddress
void getPhysicallAddress(uint8_t &physicalAddressA, uint8_t &physicalAddressB, uint8_t &physicalAddressC, uint8_t &physicalAddressD) const
This function gets the physical address of the HDMI node of the video display device.
Definition: videoOutputPort.hpp:196
IARM_Bus_Term
IARM_Result_t IARM_Bus_Term(void)
This API is used to terminate the IARM-Bus library.
dsDISPLAY_EVENT_DISCONNECTED
@ dsDISPLAY_EVENT_DISCONNECTED
Display disconnected event.
Definition: dsDisplay.h:52
_IARM_Bus_CECHost_DeviceStatusChanged_EventData_t
Definition: RDK.hpp:84
CECHost_GetOSDName
CECHost_Err_t CECHost_GetOSDName(uint8_t *buf, size_t *len)
This function is used to get OSD name of Host module. Here 'buf' need not to be null terminated....
Definition: RDK.cpp:337
_IARM_Bus_CECHost_DevMgrStatus_Param_t
Definition: RDK.hpp:55
CECHost_SetCallback
CECHost_Err_t CECHost_SetCallback(CECHost_Callback_t cb)
This function is used to set the callback function. It is called by Device Manager application to set...
Definition: RDK.cpp:153
_IARM_Bus_PWRMgr_GetPowerState_Param_t
Structure which holds the current power state of the CPE.
Definition: pwrMgr.h:173
device::VideoOutputPort::isDisplayConnected
bool isDisplayConnected() const
This API is used to Check if the port is currently connected to any display device.
Definition: videoOutputPort.cpp:381
IARM_Bus_Call
IARM_Result_t IARM_Bus_Call(const char *ownerName, const char *methodName, void *arg, size_t argLen)
This API is used to Invoke RPC method by its application name and method name.
Definition: iarm_bus.c:57
device::VideoOutputPort
Class extending enumerable to implement the videoooutputport interface.
Definition: videoOutputPort.hpp:59
manager.hpp
It contains class referenced by manager.cpp file.
_PWRMgr_EventData_t
Structure which holds the event data.
Definition: pwrMgr.h:117
IARM_BUS_PWRMGR_API_GetPowerState
#define IARM_BUS_PWRMGR_API_GetPowerState
Definition: pwrMgr.h:168
CECHost_SetPowerState
CECHost_Err_t CECHost_SetPowerState(int32_t state)
This function is used to set the device power state to be ON or STANDBY.
Definition: RDK.cpp:319
CECHost_IsActive
CECHost_Err_t CECHost_IsActive(int32_t *active)
This function is used to check whether host device is active or not.
Definition: RDK.cpp:357
IARM_Bus_RegisterEventHandler
IARM_Result_t IARM_Bus_RegisterEventHandler(const char *ownerName, IARM_EventId_t eventId, IARM_EventHandler_t handler)
This API register to listen to event and provide the callback function for event notification....
Definition: iarmMgrMocks.cpp:43
_PowerPreChange
static IARM_Result_t _PowerPreChange(void *arg)
Definition: vrexMgr.cpp:1027
_IARM_Bus_PWRMgr_GetPowerState_Param_t::curState
IARM_Bus_PWRMgr_PowerState_t curState
Definition: pwrMgr.h:174
IARM_Bus_RegisterCall
IARM_Result_t IARM_Bus_RegisterCall(const char *methodName, IARM_BusCall_t handler)
This API is used to register an RPC method that can be invoked by other applications.
CECHost_IsHdmiOutputConnected
CECHost_Err_t CECHost_IsHdmiOutputConnected(int32_t *connect)
This function is used to check whether the HDMI output is connected or not.
Definition: RDK.cpp:202
_IARM_Bus_CECHost_GetOSDName_Param_t::name
uint8_t name[14+1]
Definition: RDK.hpp:48
IARM_Bus_Disconnect
IARM_Result_t IARM_Bus_Disconnect(void)
This API disconnect Application from IARM Bus so the application will not receive any IARM event or R...
device::VideoOutputPort::getDisplay
const VideoOutputPort::Display & getDisplay()
This API is used to get the display device information currently connected to the output port....
Definition: videoOutputPort.cpp:328
_IARM_Bus_CECHost_EnableDevMgr_Param_t
Definition: RDK.hpp:51
device::Exception::what
virtual const char * what() const
This function is overwritten to get the null terminated character sequence of the exception message.
Definition: exception.hpp:116
device::Manager::Initialize
static void Initialize()
This API is used to initialize the Device Setting module. Each API should be called by any client of ...
Definition: manager.cpp:97
IARM_Bus_BroadcastEvent
IARM_Result_t IARM_Bus_BroadcastEvent(const char *ownerName, IARM_EventId_t eventId, void *data, size_t len)
This API is used to publish an Asynchronous event to all IARM client registered for this perticular e...
CECHost_Term
CECHost_Err_t CECHost_Term(void)
This function is used to de-initialize CEC host device, disconnects and terminates the CEC connection...
Definition: RDK.cpp:134
libIBus.h
RDK IARM-Bus API Declarations.
_IARM_Bus_CECHost_SetOSDName_Param_t
Definition: RDK.hpp:43
dsDISPLAY_EVENT_CONNECTED
@ dsDISPLAY_EVENT_CONNECTED
Display connected event.
Definition: dsDisplay.h:51
IARM_BUS_PWRMGR_EVENT_MODECHANGED
@ IARM_BUS_PWRMGR_EVENT_MODECHANGED
Definition: pwrMgr.h:60
dsDisplay.h
CECHost_GetPowerState
CECHost_Err_t CECHost_GetPowerState(int32_t *state)
This function is used to get the state of power whether it is ON or in STANDBY state.
Definition: RDK.cpp:232
videoOutputPort.hpp
It contains class and structure refrenced by the videooutputport.cpp file.
device::Exception
This class handles exceptions occurring in DS module.
Definition: exception.hpp:52
pwrMgr.h
IARM-Bus Power Manager Public API.
device::Manager::DeInitialize
static void DeInitialize()
This API is used to deinitialize the device settings module. DeInitialize() must be called to release...
Definition: manager.cpp:138
device::Host::getVideoOutputPort
VideoOutputPort & getVideoOutputPort(const std::string &name)
This API is used to get the reference to the video output port by its name. The name of the port must...
Definition: host.cpp:350
device::Host::getInstance
static Host & getInstance(void)
This API is used to get a reference to the single instance of the Host object.
Definition: host.cpp:88
IARM_BUS_DSMGR_EVENT_HDMI_HOTPLUG
@ IARM_BUS_DSMGR_EVENT_HDMI_HOTPLUG
Definition: dsMgr.h:50
_IARM_Bus_CECHost_SetOSDName_Param_t::name
uint8_t name[14+1]
Definition: RDK.hpp:44
IARM_Bus_Connect
IARM_Result_t IARM_Bus_Connect(void)
This API is used to connect application to the IARM bus daemon. After connected, the application can ...
Definition: iarmMgrMocks.cpp:33
_IARM_Bus_PWRMgr_SetPowerState_Param_t::newState
IARM_Bus_PWRMgr_PowerState_t newState
Definition: pwrMgr.h:164
IARM_Bus_UnRegisterEventHandler
IARM_Result_t IARM_Bus_UnRegisterEventHandler(const char *ownerName, IARM_EventId_t eventId)
This API is used to Remove ALL handlers registered for the given event. This API remove the all the e...
CCEC_LOG
void CCEC_LOG(int level, const char *format ...)
This function is used to gets the logs depending on the level of log and print these to standard outp...
Definition: Util.cpp:120
_CECHost_Callback_t
Definition: Host.hpp:102
IARM_Bus_Init
IARM_Result_t IARM_Bus_Init(const char *name)
This API is used to initialize the IARM-Bus library.
Definition: iarmMgrMocks.cpp:38
_IARM_Bus_CECHost_GetOSDName_Param_t
Definition: RDK.hpp:47
_CECHost_DeviceStatus_t
Definition: Host.hpp:69
_DSMgr_EventData_t
Definition: dsMgr.h:81
_IARM_Bus_CECHost_GetDeviceStatus_Param_t
Definition: RDK.hpp:67