21 #include "comcastIrKeyCodes.h"
25 #include "CecIARMBusMgr.h"
27 #include "safec_lib.h"
33 IARM_Result_t ret = IARM_RESULT_SUCCESS;
35 unsigned char buf[4] = {0x0F, 0x82, 0x00, 0x00};
37 if(bCecLocalLogic && (
keyType == KET_KEYDOWN) && (keyCode == KED_MENU))
41 memset(&data, 0,
sizeof(data));
44 if( IARM_RESULT_SUCCESS == ret)
46 buf[0] |= data.logicalAddress << 4;
48 uint8_t physAddress[4] = {0xF,0xF,0xF,0xF};
55 buf[2] |= ((physAddress[0] << 4)|(physAddress[1]));
56 buf[3] |= ((physAddress[2] << 4)|(physAddress[3]));
58 memset(&dataToSend, 0,
sizeof(dataToSend));
59 dataToSend.length = 4;
60 rc = memcpy_s(dataToSend.data,
sizeof(dataToSend.data), buf, dataToSend.length);
66 if( IARM_RESULT_SUCCESS == ret)
68 LOG(
"%s: send CEC ActiveSource buf:%x:%x:%x:%x\r\n",__FUNCTION__,buf[0],buf[1],buf[2],buf[3]);
74 LOG(
"%s: Failed to send CEC ActiveSource ret:%d \r\n",__FUNCTION__,ret);
78 catch(
const std::exception e)
80 LOG(
"%s: failed to get physAddress\r\n",__FUNCTION__);
85 LOG(
"%s failed to get logicalAddress\r\n",__FUNCTION__);
95 IARM_Result_t ret = IARM_RESULT_SUCCESS;
97 unsigned char buf[2] = {0x00, 0x04};
103 memset(&data, 0,
sizeof(data));
106 if( IARM_RESULT_SUCCESS == ret)
108 buf[0] |= data.logicalAddress << 4;
111 memset(&dataToSend, 0,
sizeof(dataToSend));
112 dataToSend.length = 2;
113 rc = memcpy_s(dataToSend.data,
sizeof(dataToSend.data), buf, dataToSend.length);
119 if( IARM_RESULT_SUCCESS == ret)
121 LOG(
"%s: send CEC ImageViewOn buf:%x:%x\r\n",__FUNCTION__,buf[0],buf[1]);
127 LOG(
"%s failed to get logicalAddress\r\n",__FUNCTION__);