RDK Documentation (Open Sourced RDK Components)
CecIARMBusMgr.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 HDMI_DAEMON HDMI-CEC Daemon
23  * @ingroup HDMI_CEC
24  * @addtogroup HDMI_DAEMON
25  * @{
26 **/
27 
28 /**
29 * @defgroup hdmicec
30 * @{
31 * @defgroup daemon
32 * @{
33 **/
34 
35 #include <stdio.h>
36 #include <string.h>
37 #include <unistd.h>
38 #include <fcntl.h>
39 #include <sys/types.h>
40 #include <time.h>
41 #include <pthread.h>
42 #include <errno.h>
43 
44 #include "libIARM.h"
45 #include "iarmUtil.h"
46 #include "libIBus.h"
47 
48 #include "dsMgr.h"
49 #include "dsDisplay.h"
50 
51 #include "CecIARMBusMgr.hpp"
52 #include "osal/Mutex.hpp"
53 #include "ccec/drivers/iarmbus/CecIARMBusMgr.h"
54 
55 #include "ccec/CCEC.hpp"
56 #include "ccec/Assert.hpp"
57 #include "ccec/Connection.hpp"
58 #include "ccec/MessageDecoder.hpp"
59 #include "ccec/MessageProcessor.hpp"
60 
61 #include "ccec/Util.hpp"
62 #include "ccec/driver/hdmi_cec_driver.h"
63 
65 
66 CCEC_BEGIN_NAMESPACE
67 
68 #define HEADER_OFFSET 0
69 #define OPCODE_OFFSET 1
70 
71 static Mutex mutex;
72 static bool enabled;
73 static volatile Connection *m_connection = 0;
74 
75 static IARM_Result_t _Send(void *arg);
76 static IARM_Result_t _GetLogicalAddress(void *arg);
77 static IARM_Result_t _AddLogicalAddress(void *arg);
78 static IARM_Result_t _GetPhysicalAddress(void *arg);
79 static IARM_Result_t _Enable(void *arg);
80 static IARM_Result_t _IsAvailable(void *arg);
81 
82 static void _iarmMgrHdmiEventHandler(const char *owner, IARM_EventId_t eventId, void *data, size_t len);
83 
84 /**
85  * @brief This funtion is used as hdmi event handler to check the status of HDMI
86  * whether it is inserted or ejected during hotplugging.
87  *
88  * @param[in] owner Owner details of the handler.
89  * @param[in] eventId Event type, e.g. Hotplug.
90  * @param[in] data Detail about HDMI event.
91  * @param[in] len Length of data.
92  *
93  * @return None
94  */
95 static void _iarmMgrHdmiEventHandler(const char *owner, IARM_EventId_t eventId, void *data, size_t len)
96 {
97  switch (eventId) {
99 
101  int hdmi_hotplug_event = eventData->data.hdmi_hpd.event;
102  CCEC_LOG( LOG_DEBUG, "I-ARM CEC Mgr:: Received IARM_BUS_DSMGR_EVENT_HDMI_HOTPLUG event data:%d \r\n", hdmi_hotplug_event);
103  if( dsDISPLAY_EVENT_DISCONNECTED == hdmi_hotplug_event)
104  {
105  CCEC_LOG( LOG_INFO, "I-ARM CEC Mgr:: no Closing soc driver due to HDMI disconnect event.\r\n");
106  try{AutoLock lock_(mutex);
107  //CECIARMMgr::getInstance().stop();
108  }
109  catch(Exception &e)
110  {
111  CCEC_LOG( LOG_EXP, "I-ARM CEC Mgr:: Caught Exception while calling LibCCEC::term()\r\n");
112  }
113 
114  }
115  else if(dsDISPLAY_EVENT_CONNECTED == hdmi_hotplug_event)
116  {
117  CCEC_LOG( LOG_INFO, "I-ARM CEC Mgr:: no Opening soc driver on receiving HDMI connect event\r\n");
118  try{AutoLock lock_(mutex);
119  if (enabled) {
120  //CECIARMMgr::getInstance().start();
121  }
122  }
123  catch(Exception &e)
124  {
125  CCEC_LOG( LOG_EXP, "I-ARM CEC Mgr:: Caught Exception while calling LibCCEC::init()\r\n");
126  }
127  }
128  else
129  {
130  //do nothing
131  }
132  }
133  break;
134  default:
135  //do nothing
136  break;
137  }
138 }
139 
140 /**
141  * @brief This function is used to append the received cec event data to
142  * CECFrame structure and sends it out.
143  *
144  * @param[in] owner Owner details of the handler.
145  * @param[in] eventId Event type, e.g. Hotplug.
146  * @param[in] data Detail about HDMI event.
147  * @param[in] len Length of data.
148  *
149  * @return None
150  */
151 static void cecSendEventHandler(const char *owner, IARM_EventId_t eventId, void *data, size_t len)
152 {
153  Mutex m;
155  CECFrame frameIn;
156  frameIn.append(cecEventData->data, cecEventData->length);
157  if (m_connection) {
158  CCEC_LOG( LOG_DEBUG, "cecSendEventHandler sending >>>>>>\r\n");
159  ((Connection *)m_connection)->sendAsync(frameIn);
160  }
161 }
162 
163 /**
164  * @brief This function is used to starts the CECIARMMgr instance by calling
165  * _Enable function after receiving IARM_BUS_CECMGR_EVENT_ENABLE event.
166  *
167  * @param[in] owner Owner details of the handler.
168  * @param[in] eventId Event type, e.g. Hotplug.
169  * @param[in] data Detail about HDMI event.
170  * @param[in] len Length of data.
171  *
172  * @return None
173  */
174 static void cecMgrEventHandler(const char *owner, IARM_EventId_t eventId, void *data, size_t len)
175 {
177  switch (eventId) {
179  if (cecEventData->length == 1) {
180  {AutoLock lock_(mutex);
182  param.enabled = cecEventData->data[0];
183  _Enable(&param);
184  }
185  }
186  }
187  break;
188  default:
189  /*ignore*/
190  break;
191  }
192 }
193 
195 {
196 public:
197  CecIARMMgrFrameListener(MessageProcessor *processor) : processor(processor) {}
198  void notify(const CECFrame &in) const {
199  MessageDecoder(*processor).decode(in);
200  /* Signal to CEC IARMMgr's clients */
202  char strBuffer[50] = {0};
203  const char *opname = "none";
204  Header header(in,HEADER_OFFSET);
205  memset(&dataRcvd, 0, sizeof(dataRcvd));
206  if (in.length() <= IARM_BUS_CECMGR_MAX_DATA_LENGTH) {
207  dataRcvd.length = in.length();
208  memcpy(dataRcvd.data, in.getBuffer(), in.length());
209  for (int i = 0; i< in.length(); i++)
210  {
211  snprintf(strBuffer + strlen(strBuffer) , (sizeof(strBuffer) - strlen(strBuffer)) \
212  ,"%02X ",(uint8_t) *(dataRcvd.data + i));
213  }
214  if (in.length() > OPCODE_OFFSET) {
215  opname = GetOpName(OpCode(in,OPCODE_OFFSET).opCode());
216  CCEC_LOG( LOG_INFO, "%s to %s : opcode: %s :%s \n",header.from.toString().c_str(), \
217  header.to.toString().c_str(), opname, strBuffer);
218  }
219  CCEC_LOG( LOG_DEBUG, "Broadcasting msg on IARMBus\r\n");
220  IARM_Bus_BroadcastEvent(IARM_BUS_CECMGR_NAME, (IARM_EventId_t) IARM_BUS_CECMGR_EVENT_RECV, (void *)&dataRcvd, sizeof(dataRcvd));
221  }
222  else {
223  Assert(0);
224  }
225  }
226  ~CecIARMMgrFrameListener() {processor = 0;}
227 private:
228  MessageProcessor *processor;
229 };
230 
231 /**
232  * @brief This function is used to create instance for CECIARMMgr class.
233  *
234  * @return instance Instance of CECIARMMgr class.
235  */
237 {
238  static CECIARMMgr instance;
239  return instance;
240 }
241 
242 /**
243  * @brief This function is used to initialize the CEC IARM manager by registering
244  * event handlers and function calls through IARM api.
245  *
246  * @return IARM_RESULT_SUCCESS Returns on success condition.
247  */
248 IARM_Result_t CECIARMMgr::init(void)
249 {
250  started = false;
251  IARM_Result_t retVal = IARM_RESULT_SUCCESS;
255  IARM_Bus_RegisterCall(IARM_BUS_CECMGR_API_Send,_Send);
256  IARM_Bus_RegisterCall(IARM_BUS_CECMGR_API_GetLogicalAddress,_GetLogicalAddress);
257  IARM_Bus_RegisterCall(IARM_BUS_CECMGR_API_AddLogicalAddress,_AddLogicalAddress);
258  IARM_Bus_RegisterCall(IARM_BUS_CECMGR_API_GetPhysicalAddress,_GetPhysicalAddress);
259  IARM_Bus_RegisterCall(IARM_BUS_CECMGR_API_Enable, _Enable);
263  IARM_Bus_RegisterCall(IARM_BUS_CECMGR_API_isAvailable, _IsAvailable);
264 
266  memset(&initData, 0, sizeof(initData));
267  retVal = IARM_Bus_BroadcastEvent(IARM_BUS_CECMGR_NAME, (IARM_EventId_t) IARM_BUS_CECMGR_EVENT_DAEMON_INITIALIZED,(void *)&initData, sizeof(initData));
268  if(IARM_RESULT_SUCCESS != retVal)
269  {
270  CCEC_LOG( LOG_ERROR, "IARM Broadcast event failed at %s error code : %d \r\n", __FUNCTION__, retVal);
271  }
272 
273  return IARM_RESULT_SUCCESS;
274 }
275 
276 /**
277  * @brief This function is used to terminate the CEC IARM connection.
278  *
279  * @return IARM_RESULT_SUCCESS Returns on success condition.
280  */
281 IARM_Result_t CECIARMMgr::term(void)
282 {
284  IARM_Bus_Term();
285  return IARM_RESULT_SUCCESS;
286 }
287 
288 /**
289  * @brief This function is used to start the connection for cec manager by
290  * creating and adding the frame listener and establishing the connection.
291  *
292  * @retval IARM_RESULT_SUCCESS Returns on success condition.
293  * @retval IARM_RESULT_INVALID_STATE Returns on failure condition.
294  */
295 IARM_Result_t CECIARMMgr::start(void)
296 {AutoLock lock_(mutex);
297 
298  if (started) return IARM_RESULT_INVALID_STATE;
299 
300  CCEC_LOG( LOG_INFO, "Inside CECIARMMgr::start\r\n");
301  LibCCEC::getInstance().init("CECIARMMgr");
302  processor = new MessageProcessor();
303  frameListener = new CecIARMMgrFrameListener(processor);
304  connection = new Connection(LogicalAddress::UNREGISTERED, false, "CECIARMMgr::Connection::");
305 
306  connection->open();
307  connection->addFrameListener(frameListener);
308 
309  m_connection = connection;
310  /* Listen for incoming Packet */
311  started = true;
312  return IARM_RESULT_SUCCESS;
313 }
314 
315 /**
316  * @brief This function is used to check time the HeartBeat occurs.
317  * A HeartBeat protocol is generally used to negotiate and monitor the
318  * availability of a resource.
319  *
320  * @return IARM_RESULT_SUCCESS Returns on success condition.
321  */
322 IARM_Result_t CECIARMMgr::loop(void)
323 {
324  time_t curr = 0;
325  while(1)
326  {
327  time(&curr);
328  CCEC_LOG( LOG_WARN, "I-ARM CEC Mgr: HeartBeat at %s\r\n", ctime(&curr));
329  sleep(300);
330  }
331  return IARM_RESULT_SUCCESS;
332 }
333 
334 /**
335  * @brief This function is used to stop the cec IARM manager connection.
336  * It closes the connection, deletes framelistener, connection and processor
337  * instances.
338  *
339  * @return IARM_RESULT_SUCCESS Returns on success condition.
340  */
341 IARM_Result_t CECIARMMgr::stop(void)
342 {
343  {AutoLock lock_(mutex);
344 
345  if (!started) return IARM_RESULT_INVALID_STATE;
346 
347  CCEC_LOG( LOG_INFO, "Inside CECIARMMgr::stop\r\n");
348  connection->removeFrameListener(frameListener);
349  connection->close();
350 
351  delete frameListener;
352  frameListener = 0;
353 
354  m_connection = 0;
355 
356  delete connection;
357  connection = 0;
358 
359  delete processor;
360  processor = 0;
361 
363  started = false;
364  }
365 
366  return IARM_RESULT_SUCCESS;
367 }
368 
369 /**
370  * @brief This function is used to send the CECFrame if the connection is ready.
371  *
372  * @param[in] arg Address of IARM_Bus_CECMgr_Send_Param_t structure.
373  *
374  * @retval IARM_RESULT_SUCCESS Returns on success condition.
375  * @retval IARM_RESULT_INVALID_STATE Returns on failed connection.
376  */
377 static IARM_Result_t _Send(void *arg)
378 {
380  CECFrame frameIn;
381  const uint8_t *buf = NULL;
382  char strBuffer[50] = {0};
383  size_t len = 0;
384  const char *opname = "none";
385  frameIn.append(param->data,param->length);
386  frameIn.getBuffer(&buf, &len);
387  Header header(frameIn,HEADER_OFFSET);
388  for (int i = 0; i < len; i++) {
389  snprintf(strBuffer + strlen(strBuffer) , (sizeof(strBuffer) - strlen(strBuffer)) \
390  ,"%02X ",(uint8_t) *(buf + i));
391  }
392  if (frameIn.length() > OPCODE_OFFSET) {
393  opname = GetOpName(OpCode(frameIn,OPCODE_OFFSET).opCode());
394  CCEC_LOG( LOG_INFO, "%s to %s : opcode: %s :%s\n",header.from.toString().c_str(), \
395  header.to.toString().c_str(), opname, strBuffer);
396  }
397  if (m_connection) {
398  try{
399  //CCEC_LOG( LOG_DEBUG, "_Send sending >>>>>>\r\n");
400  ((Connection *)m_connection)->send(frameIn, 0, Throw_e());
401  param->retVal = HDMI_CEC_IO_SENT_AND_ACKD;
402  }
403  catch(CECNoAckException &e )
404  {
405  //CCEC_LOG( LOG_EXP, "_Send caught %s \r\n",e.what());
406  param->retVal = HDMI_CEC_IO_SENT_BUT_NOT_ACKD;
407  }
408  catch(Exception &e)
409  {
410  //CCEC_LOG(LOG_EXP, "_Send caught %s \r\n",e.what());
411  param->retVal = HDMI_CEC_IO_SENT_FAILED;
412  }
413  }
414  else
415  {
416  CCEC_LOG( LOG_DEBUG, "Connection not ready >>>>>>\r\n");
417  return IARM_RESULT_INVALID_STATE;
418  }
419  return IARM_RESULT_SUCCESS;
420 }
421 
422 /**
423  * @brief This function is used to get the logical address of CEC devices.
424  *
425  * @param[in] arg Address of IARM_Bus_CECMgr_Send_Param_t structure, where info
426  * about CEC devices are present.
427  *
428  * @return retCode Returns IARM_RESULT_SUCCESS on success condition and
429  * IARM_RESULT_INVALID_STATE on failure condition.
430  */
431 static IARM_Result_t _GetLogicalAddress(void *arg)
432 {
433  IARM_Result_t retCode = IARM_RESULT_SUCCESS;
435 
436  CCEC_LOG( LOG_DEBUG, "Inside _GetLogicalAddress : for DevType : %d >>>>>>\r\n",param->devType);
437  try{
438  param->logicalAddress = LibCCEC::getInstance().getLogicalAddress(param->devType);
439  }
440  catch(Exception &e)
441  {
442  CCEC_LOG(LOG_EXP, "_GetLogicalAddress caught %s \r\n",e.what());
443  retCode = IARM_RESULT_INVALID_STATE;
444  }
445 
446  CCEC_LOG( LOG_DEBUG, "Inside _GetLogicalAddress : Logical Address : %d >>>>>>\r\n",param->logicalAddress);
447 
448  return retCode;
449 }
450 
451 /**
452  * @brief This function is used to add the logical address of own devices, so driver can ACK while receving direct messages.
453  *
454  * @param[in] arg Address of IARM_Bus_CECMgr_AddLogicalAddress_Param_t structure, the
455  * logical address to be added.
456  *
457  * @return retCode Returns IARM_RESULT_SUCCESS on success condition and
458  * IARM_RESULT_INVALID_STATE on failure condition.
459  */
460 static IARM_Result_t _AddLogicalAddress(void *arg)
461 {
462  IARM_Result_t retCode = IARM_RESULT_SUCCESS;
464  LogicalAddress source(param->logicalAddress);
465 
466  CCEC_LOG( LOG_DEBUG, "Inside _AddLogicalAddress : for logicalAddress : %d >>>>>>\r\n",param->logicalAddress);
467  try{
468  param->logicalAddress = LibCCEC::getInstance().addLogicalAddress(source);
469  }
470  catch(Exception &e)
471  {
472  CCEC_LOG(LOG_EXP, "_AddLogicalAddress caught %s \r\n",e.what());
473  retCode = IARM_RESULT_INVALID_STATE;
474  }
475 
476  CCEC_LOG( LOG_DEBUG, "Inside _AddLogicalAddress : Logical Address : %d >>>>>>\r\n",param->logicalAddress);
477 
478  return retCode;
479 }
480 
481 
482 static IARM_Result_t _GetPhysicalAddress(void *arg)
483 {
484  IARM_Result_t retCode = IARM_RESULT_SUCCESS;
486 
487  CCEC_LOG( LOG_DEBUG, "Inside _GetPhysicalAddress : >>>>>>\r\n");
488  try{
489  LibCCEC::getInstance().getPhysicalAddress(&(param->physicalAddress));
490  }
491  catch(Exception &e)
492  {
493  CCEC_LOG(LOG_EXP, "_GetPhysicalAddress caught %s \r\n",e.what());
494  retCode = IARM_RESULT_INVALID_STATE;
495  }
496 
497  CCEC_LOG( LOG_DEBUG, "Inside _GetPhysicalAddress : Physical Address : %x >>>>>>\r\n",param->physicalAddress);
498 
499  return retCode;
500 }
501 
502 /**
503  * @brief This function is used to start or stop the CEC connections.
504  *
505  * @param[in] arg Address of IARM_Bus_CECMgr_Send_Param_t structure, where info
506  * about CEC devices are present.
507  *
508  * @return Returns IARM_RESULT_SUCCESS on success condition.
509  */
510 static IARM_Result_t _Enable(void *arg)
511 {
512  IARM_Result_t retCode = IARM_RESULT_SUCCESS;
513 
514  {AutoLock lock_(mutex);
516  CCEC_LOG( LOG_INFO, "Inside _Enable : %d, %d >>>>>>\r\n", enabled, param->enabled);
517 
518  enabled = param->enabled;
519 
520  if (param->enabled) {
522  }
523  else {
525  }
526  }
527  return retCode;
528 }
529 
530 IARM_Result_t _IsAvailable(void *arg)
531 {
532  CCEC_LOG( LOG_ERROR, "[%s:%d] IARM_BUS_CECMGR_API_isAvailable is called",__FUNCTION__,__LINE__ );
533  return IARM_RESULT_SUCCESS;
534 }
535 
536 CCEC_END_NAMESPACE
537 
538 
539 
540 
541 /** @} */
542 /** @} */
543 /** @} */
CCEC_OSAL::AutoLock
Definition: Mutex.hpp:121
CCEC_OSAL::Mutex
Definition: Mutex.hpp:53
IARM_Bus_Term
IARM_Result_t IARM_Bus_Term(void)
This API is used to terminate the IARM-Bus library.
_CECMgr_EventData_t
Definition: CecIARMBusMgr.h:66
MessageProcessor
The MessageProcessor class implements a set of overloaded process() methods, with each handling a spe...
Definition: MessageProcessor.hpp:58
dsDISPLAY_EVENT_DISCONNECTED
@ dsDISPLAY_EVENT_DISCONNECTED
Display disconnected event.
Definition: dsDisplay.h:52
LibCCEC::getInstance
static LibCCEC & getInstance(void)
This function is used to create the instance for CEC.
Definition: LibCCEC.cpp:61
_Throw_e
Definition: Exception.hpp:37
CECNoAckException
Definition: Exception.hpp:52
CECIARMMgr::start
IARM_Result_t start(void)
This function is used to start the connection for cec manager by creating and adding the frame listen...
Definition: CecIARMBusMgr.cpp:295
_iarmMgrHdmiEventHandler
static void _iarmMgrHdmiEventHandler(const char *owner, IARM_EventId_t eventId, void *data, size_t len)
This funtion is used as hdmi event handler to check the status of HDMI whether it is inserted or ejec...
Definition: CecIARMBusMgr.cpp:95
FrameListener
Definition: FrameListener.hpp:39
IARM_BUS_CECMGR_EVENT_ENABLE
@ IARM_BUS_CECMGR_EVENT_ENABLE
Definition: CecIARMBusMgr.h:54
IARM_BUS_CECMGR_EVENT_SEND
@ IARM_BUS_CECMGR_EVENT_SEND
Definition: CecIARMBusMgr.h:52
_GetLogicalAddress
static IARM_Result_t _GetLogicalAddress(void *arg)
This function is used to get the logical address of CEC devices.
Definition: CecIARMBusMgr.cpp:431
LibCCEC::init
void init(const char *name=0)
This function is used to initialize CEC by starting the driver and doing host-specific initialization...
Definition: LibCCEC.cpp:84
_IARM_Bus_CECMgr_GetPhysicalAddress_Param_t
Definition: CecIARMBusMgr.h:87
Connection
The connection class provides APIs that allows the application to access CEC Bus. A connection is a t...
Definition: Connection.hpp:57
IARM_BUS_CECMGR_NAME
#define IARM_BUS_CECMGR_NAME
Definition: CecIARMBusMgr.h:41
IARM_BUS_CECMGR_EVENT_DAEMON_INITIALIZED
@ IARM_BUS_CECMGR_EVENT_DAEMON_INITIALIZED
Definition: CecIARMBusMgr.h:55
CECIARMMgr::getInstance
static CECIARMMgr & getInstance(void)
This function is used to create instance for CECIARMMgr class.
Definition: CecIARMBusMgr.cpp:236
IARM_Bus_RegisterEvent
IARM_Result_t IARM_Bus_RegisterEvent(IARM_EventId_t maxEventId)
This API is used to register all the events that are published by the application.
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
Connection::close
void close(void)
Definition: Connection.cpp:73
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.
LogicalAddress
Definition: Operands.hpp:409
Connection::open
void open(void)
Open a connection to receive CEC packets from the bus.
Definition: Connection.cpp:62
CECIARMMgr::init
IARM_Result_t init(void)
This function is used to initialize the CEC IARM manager by registering event handlers and function c...
Definition: CecIARMBusMgr.cpp:248
_Send
static IARM_Result_t _Send(void *arg)
This function is used to send the CECFrame if the connection is ready.
Definition: CecIARMBusMgr.cpp:377
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...
_IARM_Bus_CECMgr_AddLogicalAddress_Param_t
Definition: CecIARMBusMgr.h:82
Connection::addFrameListener
void addFrameListener(FrameListener *listener)
This function is used to listen for CECFrame, which is a byte stream that contains raw bytes received...
Definition: Connection.cpp:88
Connection::removeFrameListener
void removeFrameListener(FrameListener *listener)
This function is used to remove the listener information from the queue.
Definition: Connection.cpp:104
Header
Definition: Header.hpp:41
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...
libIBus.h
RDK IARM-Bus API Declarations.
cecSendEventHandler
static void cecSendEventHandler(const char *owner, IARM_EventId_t eventId, void *data, size_t len)
This function is used to append the received cec event data to CECFrame structure and sends it out.
Definition: CecIARMBusMgr.cpp:151
LibCCEC::addLogicalAddress
int addLogicalAddress(const LogicalAddress &source)
This function is used to add logical address to the driver, so that it can ACK if there a direct mess...
Definition: LibCCEC.cpp:131
cecMgrEventHandler
static void cecMgrEventHandler(const char *owner, IARM_EventId_t eventId, void *data, size_t len)
This function is used to starts the CECIARMMgr instance by calling _Enable function after receiving I...
Definition: CecIARMBusMgr.cpp:174
dsDISPLAY_EVENT_CONNECTED
@ dsDISPLAY_EVENT_CONNECTED
Display connected event.
Definition: dsDisplay.h:51
MessageDecoder
When receiving the message, the raw bytes arrived in a CECFrame are converted to the corresponding Hi...
Definition: MessageDecoder.hpp:45
_AddLogicalAddress
static IARM_Result_t _AddLogicalAddress(void *arg)
This function is used to add the logical address of own devices, so driver can ACK while receving dir...
Definition: CecIARMBusMgr.cpp:460
CECIARMMgr::stop
IARM_Result_t stop(void)
This function is used to stop the cec IARM manager connection. It closes the connection,...
Definition: CecIARMBusMgr.cpp:341
dsDisplay.h
CECIARMMgr
Definition: CecIARMBusMgr.hpp:44
LibCCEC::getLogicalAddress
int getLogicalAddress(int devType)
This function is used to get CEC device logical address starting the connection.
Definition: LibCCEC.cpp:152
_Enable
static IARM_Result_t _Enable(void *arg)
This function is used to start or stop the CEC connections.
Definition: CecIARMBusMgr.cpp:510
LOG_INFO
#define LOG_INFO(AAMP_JS_OBJECT, FORMAT,...)
Definition: jsutils.h:39
_IARM_Bus_CECMgr_Enable_Param_t
Definition: CecIARMBusMgr.h:91
IARM_BUS_DSMGR_EVENT_HDMI_HOTPLUG
@ IARM_BUS_DSMGR_EVENT_HDMI_HOTPLUG
Definition: dsMgr.h:50
OpCode
Definition: OpCode.hpp:123
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_CECMgr_GetLogicalAddress_Param_t
Definition: CecIARMBusMgr.h:77
IARM_BUS_CECMGR_EVENT_MAX
@ IARM_BUS_CECMGR_EVENT_MAX
Definition: CecIARMBusMgr.h:56
CECIARMMgr::loop
IARM_Result_t loop(void)
This function is used to check time the HeartBeat occurs. A HeartBeat protocol is generally used to n...
Definition: CecIARMBusMgr.cpp:322
CECIARMMgr::term
IARM_Result_t term(void)
This function is used to terminate the CEC IARM connection.
Definition: CecIARMBusMgr.cpp:281
Mutex.hpp
This file defines interface of Mutex class.
IARM_BUS_CECMGR_EVENT_RECV
@ IARM_BUS_CECMGR_EVENT_RECV
Definition: CecIARMBusMgr.h:53
Exception
Definition: Exception.hpp:42
CECFrame
Definition: CECFrame.hpp:40
_IARM_Bus_CECMgr_Send_Param_t
Definition: CecIARMBusMgr.h:71
CecIARMMgrFrameListener
Definition: CecIARMBusMgr.cpp:194
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
LibCCEC::term
void term(void)
This function is used to stop CEC by terminating the connection and stoping the driver.
Definition: LibCCEC.cpp:111
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
_DSMgr_EventData_t
Definition: dsMgr.h:81