36 #ifdef USE_XRDK_SDCARD_PROFILE
39 #ifdef USE_XRDK_EMMC_PROFILE
43 #include "Capabilities.h"
49 #include "hostIf_utils.h"
55 #ifdef USE_XRDK_RF4CE_PROFILE
56 #include "Components_XrdkRf4ce.h"
58 #define CAPABILTIES_OBJ "Device.Services.STBService.1.Capabilities."
62 updateCallback DSClientReqHandler::mUpdateCallback = NULL;
83 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%s] Entering..\n", __FUNCTION__, __FILE__);
84 RDK_LOG(RDK_LOG_DEBUG,LOG_TR69HOSTIF,
"[%s()] Device manager Initializing\n", __FUNCTION__);
89 catch(
const std::exception e)
91 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"Exception thrown while initializing device manager %s\n", e.what());
93 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__);
110 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%s] Entering..\n", __FUNCTION__, __FILE__);
111 RDK_LOG(RDK_LOG_DEBUG,LOG_TR69HOSTIF,
"[%s()] Device manager DeInitializing\n", __FUNCTION__);
112 hostIf_STBServiceHDMI::closeAllInstances();
113 hostIf_STBServiceVideoOutput::closeAllInstances();
114 hostIf_STBServiceVideoDecoder::closeAllInstances();
115 hostIf_STBServiceAudioInterface::closeAllInstances();
116 hostIf_STBServiceSPDIF::closeAllInstances();
118 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__);
136 int ret = NOT_HANDLED;
138 const char *pSetting;
140 hostIf_STBServiceHDMI::getLock();
141 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%s:%d] Found string as %s\n", __FUNCTION__, __FILE__, __LINE__, stMsgData->
paramName);
142 if(matchComponent(stMsgData->
paramName,
"Device.Services.STBService.1.Components.HDMI",&pSetting,instanceNumber))
147 hostIf_STBServiceHDMI::releaseLock();
154 else if(matchComponent(stMsgData->
paramName,
155 "Device.Services.STBService.1.Components.VideoDecoder",&pSetting,instanceNumber))
160 hostIf_STBServiceHDMI::releaseLock();
166 else if(matchComponent(stMsgData->
paramName,
167 "Device.Services.STBService.1.Components.AudioOutput",&pSetting,instanceNumber))
172 hostIf_STBServiceHDMI::releaseLock();
179 else if(matchComponent(stMsgData->
paramName,
180 "Device.Services.STBService.1.Components.SPDIF",&pSetting,instanceNumber))
185 hostIf_STBServiceHDMI::releaseLock();
194 stMsgData->
faultCode = fcAttemptToSetaNonWritableParameter;
195 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"[%s] Failed, since Attempt To Set a NonWritable Parameter \"%s\"\n", __FUNCTION__, stMsgData->
paramName);
197 hostIf_STBServiceHDMI::releaseLock();
216 int ret = NOT_HANDLED;
217 const char *paramName;
219 hostIf_STBServiceHDMI::getLock();
222 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%s:%d] Found string as %s\n", __FUNCTION__, __FILE__, __LINE__, stMsgData->
paramName);
224 CAPABILTIES_OBJ, strlen(CAPABILTIES_OBJ)) == 0)
229 hostIf_STBServiceHDMI::releaseLock();
233 ret = pIface->handleGetMsg(stMsgData);
238 hostIf_STBServiceCapabilities::closeInstance(pIface);
241 "Device.Services.STBService.1.Enable") == 0)
244 stMsgData->
paramtype = hostIf_UnsignedIntType;
248 "Device.Services.STBService.1.Components.VideoDecoderNumberOfEntries") == 0)
251 stMsgData->
paramtype = hostIf_UnsignedIntType;
255 "Device.Services.STBServiceNumberOfEntries") == 0)
258 stMsgData->
paramtype = hostIf_UnsignedIntType;
262 "Device.Services.STBService.1.Components.AudioOutputNumberOfEntries") == 0)
264 ret = hostIf_STBServiceAudioInterface::getNumberOfInstances(stMsgData);
267 "Device.Services.STBService.1.Components.VideoOutputNumberOfEntries") == 0)
270 stMsgData->
paramtype = hostIf_UnsignedIntType;
274 "Device.Services.STBService.1.Components.HDMINumberOfEntries") == 0)
277 stMsgData->
paramtype = hostIf_UnsignedIntType;
281 "Device.Services.STBService.1.Components.SPDIFNumberOfEntries") == 0)
283 ret = hostIf_STBServiceSPDIF::getNumberOfInstances(stMsgData);
285 else if(matchComponent(stMsgData->
paramName,
286 "Device.Services.STBService.1.Components.HDMI",¶mName,index))
288 RDK_LOG(RDK_LOG_DEBUG,LOG_TR69HOSTIF,
"[%s:%s:%d] pSetting :[%s] instanceNumber: [%d]\n", __FILE__, __FUNCTION__, __LINE__, paramName,index);
292 hostIf_STBServiceHDMI::releaseLock();
299 else if(matchComponent(stMsgData->
paramName,
300 "Device.Services.STBService.1.Components.VideoDecoder",
303 RDK_LOG(RDK_LOG_DEBUG,LOG_TR69HOSTIF,
"[%s%s:%d] pSetting :[%s] instanceNumber: [%d]\n", __FILE__, __FUNCTION__, __LINE__, paramName,index);
307 hostIf_STBServiceHDMI::releaseLock();
313 else if (matchComponent(stMsgData->
paramName,
314 "Device.Services.STBService.1.Components.AudioOutput",
317 RDK_LOG(RDK_LOG_DEBUG,LOG_TR69HOSTIF,
"[%s%s:%d] pSetting :[%s] instanceNumber: [%d]\n", __FILE__, __FUNCTION__, __LINE__, paramName,index);
321 hostIf_STBServiceHDMI::releaseLock();
328 else if (matchComponent(stMsgData->
paramName,
"Device.Services.STBService.1.Components.SPDIF",
334 hostIf_STBServiceHDMI::releaseLock();
340 else if (matchComponent(stMsgData->
paramName,
341 "Device.Services.STBService.1.Components.VideoOutput",
347 hostIf_STBServiceHDMI::releaseLock();
350 RDK_LOG(RDK_LOG_DEBUG,LOG_TR69HOSTIF,
"[%s%s:%d] pSetting :[%s] instanceNumber: [%d]\n", __FILE__, __FUNCTION__, __LINE__, paramName,index);
355 #ifdef USE_XRDK_SDCARD_PROFILE
356 else if(strncasecmp(stMsgData->
paramName, X_SDCARD_OBJ, strlen(X_SDCARD_OBJ)) == 0)
358 RDK_LOG(RDK_LOG_DEBUG,LOG_TR69HOSTIF,
"[%s:%s:%d] Parameter Name : [\'%s\'] \n", __FILE__, __FUNCTION__, __LINE__, stMsgData->
paramName);
362 hostIf_STBServiceHDMI::releaseLock();
366 ret = pIfaceSdcardif->handleGetMsg(stMsgData);
369 #ifdef USE_XRDK_EMMC_PROFILE
370 else if(strncasecmp(stMsgData->
paramName, X_EMMC_OBJ, strlen(X_EMMC_OBJ)) == 0)
372 RDK_LOG(RDK_LOG_DEBUG,LOG_TR69HOSTIF,
"[%s:%s:%d] Parameter Name : [\'%s\'] \n", __FILE__, __FUNCTION__, __LINE__, stMsgData->
paramName);
377 hostIf_STBServiceHDMI::releaseLock();
381 ret = pIfaceEMMCif->handleGetMsg(stMsgData);
385 #ifdef USE_XRDK_RF4CE_PROFILE
386 else if(strncasecmp(stMsgData->
paramName, X_RF4CE_REMOTE_OBJ, strlen(X_RF4CE_REMOTE_OBJ)) == 0)
388 RDK_LOG(RDK_LOG_DEBUG,LOG_TR69HOSTIF,
"[%s:%s:%d] Parameter Name : [\'%s\'] \n", __FILE__, __FUNCTION__, __LINE__, stMsgData->
paramName);
389 hostIf_STBServiceXrdkRf4ce *pIface = hostIf_STBServiceXrdkRf4ce::getInstance();
392 hostIf_STBServiceHDMI::releaseLock();
396 ret = pIface->handleGetMsg(stMsgData);
401 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"[%s%s] Failed to match STBSevice Object. Not supported \'%s\' object. \n", __FILE__, __FUNCTION__, stMsgData->
paramName);
402 stMsgData->
faultCode = fcInvalidParameterName;
407 hostIf_STBServiceHDMI::releaseLock();
412 void DSClientReqHandler::registerUpdateCallback(updateCallback cb)
414 mUpdateCallback = cb;
419 int ret = NOT_HANDLED;
420 hostIf_STBServiceHDMI::getLock();
422 hostIf_STBServiceHDMI::releaseLock();
428 int ret = NOT_HANDLED;
429 hostIf_STBServiceHDMI::getLock();
431 hostIf_STBServiceHDMI::releaseLock();
437 void DSClientReqHandler::checkForUpdates()
443 char tmp_buff[TR69HOSTIFMGR_MAX_PARAM_LEN];
444 hostIf_STBServiceHDMI::getLock();
446 memset(&msgData,0,
sizeof(msgData));
447 memset(tmp_buff,0,TR69HOSTIFMGR_MAX_PARAM_LEN);
449 GList *devList = hostIf_STBServiceHDMI::getAllInstances();
450 for(elem = devList; elem; elem = elem->next,index++)
459 g_list_free(devList);
461 devList = hostIf_STBServiceVideoOutput::getAllInstances();
462 for(elem = devList; elem; elem = elem->next,index++)
471 g_list_free(devList);
473 devList = hostIf_STBServiceVideoDecoder::getAllInstances();
474 for(elem = devList; elem; elem = elem->next,index++)
483 g_list_free(devList);
485 devList = hostIf_STBServiceAudioInterface::getAllInstances();
487 for(elem = devList; elem; elem = elem->next,index++)
496 g_list_free(devList);
498 devList = hostIf_STBServiceSPDIF::getAllInstances();
500 for (elem = devList; elem; elem = elem->next, index++)
509 g_list_free(devList);
511 hostIf_STBServiceHDMI::releaseLock();