50 #ifdef USE_XRDK_BT_PROFILE
57 #ifdef BLE_TILE_PROFILE
58 #include "lemgr_iarm_interface.h"
59 #include "hostIf_NotificationHandler.h"
68 static BTRMgrDeviceHandle handle_devInfo = 0;
70 std::mutex hostIf_DeviceInfoRdk_xBT::m;
71 hostIf_DeviceInfoRdk_xBT* hostIf_DeviceInfoRdk_xBT::m_instance = NULL;
73 #define BTRMGR_QUERY_INTERVAL 5
75 int hostIf_DeviceInfoRdk_xBT::noOfDiscoveredDevice=0;
76 int hostIf_DeviceInfoRdk_xBT::noOfPairedDevice=0;
77 int hostIf_DeviceInfoRdk_xBT::noOfConnectedDevices=0;
79 updateCallback hostIf_DeviceInfoRdk_xBT::mUpdateCallback = NULL;
81 hostIf_DeviceInfoRdk_xBT* hostIf_DeviceInfoRdk_xBT::getInstance()
86 m_instance =
new hostIf_DeviceInfoRdk_xBT();
87 }
catch(
const std::exception& e)
89 RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,
"[%s:%d] xBlueTooth: Caught exception \" %s\"\n", __FUNCTION__, __LINE__, e.what());
96 void hostIf_DeviceInfoRdk_xBT::closeInstance()
105 void hostIf_DeviceInfoRdk_xBT::reset()
107 std::lock_guard<std::mutex> lg(m);
109 noOfDiscoveredDevice = 0;
110 noOfPairedDevice = 0;
111 noOfConnectedDevices = 0;
118 hostIf_DeviceInfoRdk_xBT::hostIf_DeviceInfoRdk_xBT()
122 this->triggerFlag =
false;
136 int ret = NOT_HANDLED;
137 const char *path = NULL, *paramName = NULL, *tblAttName = NULL;
139 std::lock_guard<std::mutex> lg(m);
142 int str_len = strlen(X_BT_ROOT_OBJ);
145 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Entering... \n", __FUNCTION__, __LINE__);
148 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Failed : Parameter is NULL, %s \n", __FUNCTION__, __LINE__, path);
149 stMsgData->
faultCode = fcInvalidParameterName;
153 if((strncasecmp(path, X_BT_ROOT_OBJ, str_len) != 0)) {
154 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Failed due to Mismatch parameter path : %s \n", __FUNCTION__, __LINE__, path);
155 stMsgData->
faultCode = fcInvalidParameterName;
158 const char *tmp_ptr = strchr(path+str_len-1,
'.');
159 if(tmp_ptr == NULL) {
160 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Parameter is NULL \n", __FUNCTION__, __LINE__);
161 stMsgData->
faultCode = fcInvalidParameterName;
167 if (strncasecmp(paramName, BT_DEV_GETDEVICEINFO_STRING, strlen(BT_DEV_GETDEVICEINFO_STRING)) == 0)
169 ret = setDeviceInfo(stMsgData);
171 #ifdef BLE_TILE_PROFILE
172 else if (strncasecmp(paramName, BT_LIMIT_BEACON_DETECTION_STRING, strlen(BT_LIMIT_BEACON_DETECTION_STRING)) == 0)
174 ret = setLimitBeaconDetection(stMsgData);
176 else if (strncasecmp(paramName, BT_TILE_ID_STRING, strlen(BT_TILE_ID_STRING)) == 0)
179 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"[%s:%d]]xBlueTooth: :Set for parameters %s and value %s. \n", __FUNCTION__, __LINE__, stMsgData->
paramName, stMsgData->
paramValue);
182 else if (strncasecmp(paramName, BT_TILE_SESSION_ID_STRING, strlen(BT_TILE_SESSION_ID_STRING)) == 0)
185 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"[%s:%d]]xBlueTooth: :Set for parameters %s and value %s. \n", __FUNCTION__, __LINE__, stMsgData->
paramName, stMsgData->
paramValue);
188 else if (strncasecmp(paramName, BT_TILE_TRIGGER_STRING, strlen(BT_TILE_TRIGGER_STRING)) == 0)
190 bool triggerFlag = get_boolean(stMsgData->
paramValue);
191 RDK_LOG(RDK_LOG_ERROR, LOG_TR69HOSTIF,
"[%s:%d]]xBlueTooth: :Set for parameters %s and value %d. \n", __FUNCTION__, __LINE__, stMsgData->
paramName, triggerFlag);
193 if(triggerFlag ==
true && (!tile_Id.empty()))
195 this->triggerFlag = triggerFlag;
196 RDK_LOG(RDK_LOG_INFO,LOG_TR69HOSTIF,
"[%s:%d]]xBlueTooth: :Trigger Ring a tile. \n", __FUNCTION__, __LINE__);
197 this->do_Ring_A_Tile(triggerFlag);
201 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"[%s:%d]]xBlueTooth::Empty tile Id or session id. Please set these parameters first. \n", __FUNCTION__, __LINE__);
204 else if (strncasecmp(paramName, BT_TILE_CMD_REQUEST_STRING, strlen(BT_TILE_CMD_REQUEST_STRING))== 0)
206 ret = process_TileCmdRequest(stMsgData);
208 else if (strncasecmp(paramName, BT_TILE_CMD_NOTIFY_STRING, strlen(BT_TILE_CMD_NOTIFY_STRING))== 0)
213 NotificationHandler::getInstance()->pushKeyValueNotification(
"event:BLE_TILE_RING_NOTIFICATION",
"cmd_notify", stMsgData->
paramValue);
218 stMsgData->
faultCode = fcInvalidParameterName;
222 catch (
const std::exception& e )
224 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Exception caught %s \n", __FUNCTION__, __LINE__, e.what());
228 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Exiting..\n", __FUNCTION__, __LINE__);
247 int ret = NOT_HANDLED;
248 const char *path = NULL, *paramName = NULL, *tblAttName = NULL;
250 std::lock_guard<std::mutex> lg(m);
253 int str_len = strlen(X_BT_ROOT_OBJ);
256 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Entering... \n", __FUNCTION__, __LINE__);
259 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Failed : Parameter is NULL, %s \n", __FUNCTION__, __LINE__, path);
263 if((strncasecmp(path, X_BT_ROOT_OBJ, str_len) != 0)) {
264 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Failed due to Mismatch parameter path : %s \n", __FUNCTION__, __LINE__, path);
267 const char *tmp_ptr = strchr(path+str_len-1,
'.');
268 if(tmp_ptr == NULL) {
269 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Parameter is NULL \n", __FUNCTION__, __LINE__);
275 if (strncasecmp(paramName, BT_ENABLE_STRING, strlen(BT_ENABLE_STRING)) == 0)
277 ret = isEnabled(stMsgData);
279 else if (strncasecmp(paramName, BT_DISCOVERY_ENABLED_STRING, strlen(BT_DISCOVERY_ENABLED_STRING)) == 0)
281 ret = isDiscoveryEnabled(stMsgData);
283 else if (strncasecmp(paramName, BT_DISCOVERY_DEVICE_CNT_STRING, strlen(BT_DISCOVERY_DEVICE_CNT_STRING)) == 0)
285 ret = getDiscoveredDeviceCnt(stMsgData);
287 else if (strncasecmp(paramName, BT_PAIRED_DEVICE_CNT_STRING, strlen(BT_PAIRED_DEVICE_CNT_STRING)) == 0)
289 ret = getPairedDeviceCnt(stMsgData);
291 else if (strncasecmp(paramName, BT_CONNECTED_DEVICE_CNT_STRING, strlen(BT_CONNECTED_DEVICE_CNT_STRING)) == 0)
293 ret = getConnectedDeviceCnt(stMsgData);
296 else if (strncasecmp(paramName, BT_DEV_GETDEVICEINFO_STRING, strlen(BT_DEV_GETDEVICEINFO_STRING)) == 0)
298 ret = getDeviceInfo(stMsgData);
300 else if (strncasecmp(paramName, BT_DEV_INFO_DEVICE_ID_STRING, strlen(BT_DEV_INFO_DEVICE_ID_STRING)) == 0)
302 ret = getDeviceInfo_DeviceID(stMsgData);
304 else if (strncasecmp(paramName, BT_DEV_INFO_MANUFACTURER_STRING, strlen(BT_DEV_INFO_MANUFACTURER_STRING)) == 0)
306 ret = getDeviceInfo_Manufacturer(stMsgData);
308 else if (strncasecmp(paramName, BT_DEV_INFO_PROFILE_STRING, strlen(BT_DEV_INFO_PROFILE_STRING)) == 0)
310 ret = getDeviceInfo_Profile(stMsgData);
312 else if (strncasecmp(paramName, BT_DEV_INFO_MAC_STRING, strlen(BT_DEV_INFO_MAC_STRING)) == 0)
314 ret = getDeviceInfo_MAC(stMsgData);
316 else if (strncasecmp(paramName, BT_DEV_INFO_SIGNALLEVEL_STRING, strlen(BT_DEV_INFO_SIGNALLEVEL_STRING)) == 0)
318 ret = getDeviceInfo_SignalLevel(stMsgData);
320 else if (strncasecmp(paramName, BT_DEV_INFO_RSSI_STRING, strlen(BT_DEV_INFO_RSSI_STRING)) == 0)
322 ret = getDeviceInfo_RSSI(stMsgData);
324 #ifdef BLE_TILE_PROFILE
325 else if (strncasecmp(paramName, BT_LIMIT_BEACON_DETECTION_STRING, strlen(BT_LIMIT_BEACON_DETECTION_STRING)) == 0)
327 ret = getLimitBeaconDetection(stMsgData);
329 else if (strncasecmp(paramName, BT_TILE_ID_STRING, strlen(BT_TILE_ID_STRING)) == 0)
331 snprintf(stMsgData->
paramValue, (TR69HOSTIFMGR_MAX_PARAM_LEN -1),
"%s", this->tile_Id.c_str());
332 RDK_LOG(RDK_LOG_DEBUG,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: :Parameter name : \"%s \"and value \"%d\". \n", __FUNCTION__, __LINE__, stMsgData->
paramName, this->triggerFlag);
336 else if (strncasecmp(paramName, BT_TILE_SESSION_ID_STRING, strlen(BT_TILE_SESSION_ID_STRING)) == 0)
338 snprintf(stMsgData->
paramValue, (TR69HOSTIFMGR_MAX_PARAM_LEN -1),
"%s", this->sessionId.c_str());
339 RDK_LOG(RDK_LOG_DEBUG,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: :Parameter name : \"%s \"and value \"%d\". \n", __FUNCTION__, __LINE__, stMsgData->
paramName, this->triggerFlag);
343 else if (strncasecmp(paramName, BT_TILE_TRIGGER_STRING, strlen(BT_TILE_TRIGGER_STRING)) == 0)
346 RDK_LOG(RDK_LOG_DEBUG,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: :Parameter name : \"%s \"and value \"%d\". \n", __FUNCTION__, __LINE__, stMsgData->
paramName, this->triggerFlag);
352 else if(matchComponent(stMsgData->
paramName, X_BT_DISCOVERED_DEV_OBJ, &tblAttName, index))
355 if (strcasecmp(tblAttName, BT_DEV_NAME_STRING) == 0)
357 ret = getDiscoveredDevice_Name(stMsgData);
359 else if (strcasecmp(tblAttName, BT_DEV_DEVICE_ID_STRING) == 0)
361 ret = getDiscoveredDevice_DeviceID(stMsgData);
363 else if (strcasecmp(tblAttName, BT_DEV_DEVICE_TYPE_STRING) == 0)
365 ret = getDiscoveredDevice_DeviceType(stMsgData);
367 else if (strcasecmp(tblAttName, BT_DEV_PAIRED_STRING) == 0)
369 ret = getDiscoveredDevice_Paired(stMsgData);
371 else if (strcasecmp(tblAttName, BT_DEV_CONNECTED_STRING) == 0)
373 ret = getDiscoveredDevice_Connected (stMsgData);
377 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Parameter \'%s\' is Not Supported \n", __FUNCTION__, __LINE__, stMsgData->
paramName);
378 stMsgData->
faultCode = fcInvalidParameterName;
383 else if(matchComponent(stMsgData->
paramName, X_BT_PAIRED_DEV_OBJ, &tblAttName, index))
386 if (strcasecmp(tblAttName, BT_DEV_NAME_STRING) == 0)
388 ret = getPairedDevice_Name(stMsgData);
390 else if (strcasecmp(tblAttName, BT_DEV_DEVICE_ID_STRING) == 0)
392 ret = getPairedDevice_DeviceID(stMsgData);
394 else if (strcasecmp(tblAttName, BT_DEV_CONNECTED_STRING) == 0)
396 ret = getPairedDevice_Connected (stMsgData);
398 else if (strcasecmp(tblAttName, BT_DEV_DEVICE_TYPE_STRING) == 0)
400 ret = getPairedDevice_DeviceType(stMsgData);
404 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Parameter \'%s\' is Not Supported \n", __FUNCTION__, __LINE__, stMsgData->
paramName);
405 stMsgData->
faultCode = fcInvalidParameterName;
410 else if(matchComponent(stMsgData->
paramName, X_BT_CONNECTED_DEV_OBJ, &tblAttName, index))
414 if (strcasecmp(tblAttName, BT_DEV_NAME_STRING) == 0)
416 ret = getConnectedDevice_Name(stMsgData);
418 else if (strcasecmp(tblAttName, BT_DEV_DEVICE_ID_STRING) == 0)
420 ret = getConnectedDevice_DeviceID(stMsgData);
422 else if (strcasecmp(tblAttName, BT_DEV_DEVICE_TYPE_STRING) == 0)
424 ret = getConnectedDevice_DeviceType(stMsgData);
426 else if (strcasecmp(tblAttName, BT_DEV_ACTIVE_STRING) == 0)
428 ret = getConnectedDevice_Active(stMsgData);
432 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Parameter \'%s\' is Not Supported \n", __FUNCTION__, __LINE__, stMsgData->
paramName);
433 stMsgData->
faultCode = fcInvalidParameterName;
439 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Parameter \'%s\' is Not Supported \n", __FUNCTION__, __LINE__, paramName);
440 stMsgData->
faultCode = fcInvalidParameterName;
444 catch (
const std::exception& e )
446 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Exception caught %s \n", __FUNCTION__, __LINE__, e.what());
450 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Exiting..\n", __FUNCTION__, __LINE__);
469 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Entering..\n", __FUNCTION__, __LINE__);
473 unsigned char power_status = 0;
475 strncpy(stMsgData->
paramValue,
"BLUETOOTH_ENABLED", TR69HOSTIFMGR_MAX_PARAM_LEN);
476 RDK_LOG(RDK_LOG_DEBUG,LOG_TR69HOSTIF,
"[%s]xBlueTooth: Successfully get BTRMGR_GetAdapterPowerStatus (%u), so BLUETOOTH_ENABLED. \n",
477 __FUNCTION__, power_status);
480 strncpy(stMsgData->
paramValue,
"BLUETOOTH_DISABLED", TR69HOSTIFMGR_MAX_PARAM_LEN);
481 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Failed in get BTRMGR_GetAdapterPowerStatus, so BLUETOOTH_DISABLED. \n", __FUNCTION__, __LINE__);
483 }
catch (
const std::exception& e) {
484 RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Exception : %s\r\n",__FUNCTION__, __LINE__, e.what());
488 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Exiting..\n", __FUNCTION__, __LINE__);
504 int hostIf_DeviceInfoRdk_xBT::isDiscoveryEnabled(
HOSTIF_MsgData_t *stMsgData)
506 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Entering..\n", __FUNCTION__, __LINE__);
507 bool isDisEnable =
false;
510 unsigned char isDiscoverable = 0;
512 RDK_LOG(RDK_LOG_DEBUG, LOG_TR69HOSTIF,
"[%s]xBlueTooth: isDiscoveryEnabled : %d \n",
513 __FUNCTION__, isDisEnable);
514 }
catch (
const std::exception& e) {
515 RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Exception : %s\r\n",__FUNCTION__, __LINE__, e.what());
520 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Exiting..\n", __FUNCTION__, __LINE__);
537 int hostIf_DeviceInfoRdk_xBT::getDiscoveredDeviceCnt(
HOSTIF_MsgData_t *stMsgData)
539 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Entering..\n", __FUNCTION__, __LINE__);
543 stMsgData->
paramtype=hostIf_UnsignedIntType;
544 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Exiting..\n", __FUNCTION__, __LINE__);
561 int hostIf_DeviceInfoRdk_xBT::getPairedDeviceCnt(
HOSTIF_MsgData_t *stMsgData)
563 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Entering..\n", __FUNCTION__, __LINE__);
566 stMsgData->
paramtype=hostIf_UnsignedIntType;
567 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Exiting..\n", __FUNCTION__, __LINE__);
584 int hostIf_DeviceInfoRdk_xBT::getConnectedDeviceCnt(
HOSTIF_MsgData_t *stMsgData)
586 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Entering..\n", __FUNCTION__, __LINE__);
589 stMsgData->
paramtype=hostIf_UnsignedIntType;
590 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Exiting..\n", __FUNCTION__, __LINE__);
606 int hostIf_DeviceInfoRdk_xBT::getDiscoveredDevice_Name(
HOSTIF_MsgData_t *stMsgData)
608 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Entering..\n", __FUNCTION__, __LINE__);
614 if((devIndex && disDevList.m_numOfDevices) && (devIndex <= disDevList.m_numOfDevices)) {
615 RDK_LOG(RDK_LOG_DEBUG, LOG_TR69HOSTIF,
"[%s]xBlueTooth: The Discovered Devices (index : %d) Name is \'%s\'.\n", __FUNCTION__, devIndex-1, disDevList.m_deviceProperty[devIndex-1].m_name);
616 strncpy(stMsgData->
paramValue, disDevList.m_deviceProperty[devIndex-1].m_name, TR69HOSTIFMGR_MAX_PARAM_LEN);
620 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"[%s]xBlueTooth: Failed due to wrong device index %d\r\n",__FUNCTION__, devIndex);
623 }
catch (
const std::exception& e) {
624 RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,
"[%s]xBlueTooth: Exception : %s\r\n",__FUNCTION__, e.what());
628 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Exiting..\n", __FUNCTION__, __LINE__);
643 int hostIf_DeviceInfoRdk_xBT::getDiscoveredDevice_MAC(
HOSTIF_MsgData_t *stMsgData) {
644 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Entering..\n", __FUNCTION__, __LINE__);
648 if((devIndex && disDevList.m_numOfDevices) && (devIndex <= disDevList.m_numOfDevices)) {
650 RDK_LOG(RDK_LOG_DEBUG, LOG_TR69HOSTIF,
"[%s]xBlueTooth: The Discovered Devices (index : %d) MAC is \'%s\'.\n", __FUNCTION__, devIndex-1, disDevList.m_deviceProperty[devIndex-1].m_deviceAddress);
651 strncpy(stMsgData->
paramValue, disDevList.m_deviceProperty[devIndex-1].m_deviceAddress, TR69HOSTIFMGR_MAX_PARAM_LEN);
655 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"[%s]xBlueTooth: Failed due to wrong device index %d\r\n",__FUNCTION__, devIndex);
658 }
catch (
const std::exception& e) {
659 RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,
"[%s]xBlueTooth: Exception : %s\r\n",__FUNCTION__, e.what());
663 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Exiting..\n", __FUNCTION__, __LINE__);
678 int hostIf_DeviceInfoRdk_xBT::getDiscoveredDevice_DeviceType(
HOSTIF_MsgData_t *stMsgData) {
679 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Entering..\n", __FUNCTION__, __LINE__);
683 if((devIndex && disDevList.m_numOfDevices) && (devIndex <= disDevList.m_numOfDevices)) {
687 RDK_LOG(RDK_LOG_DEBUG, LOG_TR69HOSTIF,
"[%s]xBlueTooth: The Discovered Devices (index : %d) device type is \'%s\'.\n", __FUNCTION__, devIndex-1, pType);
693 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"[%s]xBlueTooth:Failed; Null Name\r\n",__FUNCTION__);
699 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"[%s]xBlueTooth: Failed due to wrong device index %d\r\n",__FUNCTION__, devIndex);
702 }
catch (
const std::exception& e) {
703 RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,
"[%s]xBlueTooth: Exception : %s\r\n",__FUNCTION__, e.what());
707 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Exiting..\n", __FUNCTION__, __LINE__);
722 int hostIf_DeviceInfoRdk_xBT::getDiscoveredDevice_Paired(
HOSTIF_MsgData_t *stMsgData) {
723 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Entering..\n", __FUNCTION__, __LINE__);
727 if((devIndex && disDevList.m_numOfDevices) && (devIndex <= disDevList.m_numOfDevices)) {
728 RDK_LOG(RDK_LOG_DEBUG, LOG_TR69HOSTIF,
"[%s]xBlueTooth: The Discovered Devices (index : %d) Pairing status is \'%d\'.\n", __FUNCTION__, devIndex-1, disDevList.m_deviceProperty[devIndex-1].m_isPairedDevice);
733 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"[%s]xBlueTooth: Failed due to wrong device index %d\r\n",__FUNCTION__, devIndex);
736 }
catch (
const std::exception& e) {
737 RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,
"[%s]xBlueTooth: Exception : %s\r\n",__FUNCTION__, e.what());
741 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Exiting..\n", __FUNCTION__, __LINE__);
756 int hostIf_DeviceInfoRdk_xBT::getDiscoveredDevice_DeviceID(
HOSTIF_MsgData_t *stMsgData) {
757 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Entering..\n", __FUNCTION__, __LINE__);
761 stMsgData->
paramtype = hostIf_StringType;
763 if((devIndex) && (devIndex <= disDevList.m_numOfDevices)) {
764 RDK_LOG(RDK_LOG_DEBUG, LOG_TR69HOSTIF,
"[%s]xBlueTooth: The Discovered Devices (index : %d) DeviceID is \'%llu\'.\n", __FUNCTION__, devIndex-1, disDevList.m_deviceProperty[devIndex-1].m_deviceHandle);
765 memset(stMsgData->
paramValue,
'\0', TR69HOSTIFMGR_MAX_PARAM_LEN);
766 sprintf(stMsgData->
paramValue,
"%llu", disDevList.m_deviceProperty[devIndex-1].m_deviceHandle);
767 RDK_LOG(RDK_LOG_DEBUG, LOG_TR69HOSTIF,
"[%s]xBlueTooth: The Discovered Devices (index : %d) Convert DeviceID is \'%s\'.\n", __FUNCTION__, devIndex-1, stMsgData->
paramValue);
772 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"[%s]xBlueTooth: Failed due to wrong device index %d\r\n",__FUNCTION__, devIndex);
775 }
catch (
const std::exception& e) {
776 RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,
"[%s]xBlueTooth: Exception : %s\r\n",__FUNCTION__, e.what());
780 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Exiting..\n", __FUNCTION__, __LINE__);
796 int hostIf_DeviceInfoRdk_xBT::getDiscoveredDevice_Manufacturer(
HOSTIF_MsgData_t *stMsgData) {
797 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Entering..\n", __FUNCTION__, __LINE__);
801 if((devIndex && disDevList.m_numOfDevices) && (devIndex <= disDevList.m_numOfDevices)) {
802 RDK_LOG(RDK_LOG_DEBUG, LOG_TR69HOSTIF,
"[%s]xBlueTooth: The Discovered Devices (index : %d) Manufacturer is \'%d\'.\n", __FUNCTION__, devIndex-1, disDevList.m_deviceProperty[devIndex-1].m_vendorID);
803 put_int(stMsgData->
paramValue, disDevList.m_deviceProperty[devIndex-1].m_vendorID);
807 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"[%s]xBlueTooth: Failed due to wrong device index %d\r\n",__FUNCTION__, devIndex);
810 }
catch (
const std::exception& e) {
811 RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,
"[%s]xBlueTooth: Exception : %s\r\n",__FUNCTION__, e.what());
814 stMsgData->
paramtype=hostIf_UnsignedIntType;
815 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Exiting..\n", __FUNCTION__, __LINE__);
830 int hostIf_DeviceInfoRdk_xBT::getDiscoveredDevice_Connected(
HOSTIF_MsgData_t *stMsgData)
832 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Entering..\n", __FUNCTION__, __LINE__);
834 memset (&deviceProperty, 0,
sizeof (deviceProperty));
839 if((devIndex && disDevList.m_numOfDevices) && (devIndex <= disDevList.m_numOfDevices)) {
843 if (BTRMGR_RESULT_SUCCESS != rc)
845 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Failed at BTRMGR \r\n",__FUNCTION__, __LINE__);
847 RDK_LOG(RDK_LOG_DEBUG, LOG_TR69HOSTIF,
"[%s]xBlueTooth: The Discovered Devices (index : %d) Connection Status is \'%d\'.\n", __FUNCTION__, devIndex-1, deviceProperty.m_isConnected);
853 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"[%s]xBlueTooth: Failed due to wrong device index %d\r\n",__FUNCTION__, devIndex);
856 }
catch (
const std::exception& e) {
857 RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,
"[%s]xBlueTooth: Exception : %s\r\n",__FUNCTION__, e.what());
861 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Exiting..\n", __FUNCTION__, __LINE__);
878 int hostIf_DeviceInfoRdk_xBT::getPairedDevice_Name(
HOSTIF_MsgData_t *stMsgData)
880 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Entering..\n", __FUNCTION__, __LINE__);
884 if((devIndex && pairedDevList.m_numOfDevices) && (devIndex <= pairedDevList.m_numOfDevices)) {
885 RDK_LOG(RDK_LOG_DEBUG, LOG_TR69HOSTIF,
"[%s]xBlueTooth: The Paired Devices (index : %d) Name is \'%s\'.\n", __FUNCTION__, devIndex-1, pairedDevList.m_deviceProperty[devIndex-1].m_name);
886 memset(stMsgData->
paramValue,
'\0', TR69HOSTIFMGR_MAX_PARAM_LEN);
887 strncpy(stMsgData->
paramValue, pairedDevList.m_deviceProperty[devIndex-1].m_name, TR69HOSTIFMGR_MAX_PARAM_LEN);
891 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"[%s]xBlueTooth: Failed due to wrong device index %d\r\n",__FUNCTION__, devIndex);
894 }
catch (
const std::exception& e) {
895 RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,
"[%s]xBlueTooth: Exception : %s\r\n",__FUNCTION__, e.what());
899 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Exiting..\n", __FUNCTION__, __LINE__);
914 int hostIf_DeviceInfoRdk_xBT::getPairedDevice_Profile(
HOSTIF_MsgData_t *stMsgData) {
915 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Entering..\n", __FUNCTION__, __LINE__);
919 char serviceInfo[TR69HOSTIFMGR_MAX_PARAM_LEN];
920 memset (&serviceInfo,
'\0',
sizeof(serviceInfo));
921 if((devIndex && pairedDevList.m_numOfDevices) && (devIndex <= pairedDevList.m_numOfDevices)) {
922 for (
int i = 0; i < pairedDevList.m_deviceProperty[devIndex-1].m_serviceInfo.m_numOfService; i++)
924 strcat(serviceInfo, pairedDevList.m_deviceProperty[devIndex-1].m_serviceInfo.m_profileInfo[i].m_profile);
925 if ( (i + 1) < pairedDevList.m_deviceProperty[devIndex-1].m_serviceInfo.m_numOfService)
926 strcat(serviceInfo,
",");
929 RDK_LOG(RDK_LOG_DEBUG, LOG_TR69HOSTIF,
"[%s]xBlueTooth: The Paired Devices (index : %d) profile is \'%s\'.\n", __FUNCTION__, devIndex-1, serviceInfo);
930 memset(stMsgData->
paramValue,
'\0', TR69HOSTIFMGR_MAX_PARAM_LEN);
936 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"[%s]xBlueTooth: Failed due to wrong device index %d\r\n",__FUNCTION__, devIndex);
939 }
catch (
const std::exception& e) {
940 RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,
"[%s]xBlueTooth: Exception : %s\r\n",__FUNCTION__, e.what());
944 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Exiting..\n", __FUNCTION__, __LINE__);
959 int hostIf_DeviceInfoRdk_xBT::getPairedDevice_MAC(
HOSTIF_MsgData_t *stMsgData)
961 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Entering..\n", __FUNCTION__, __LINE__);
965 if((devIndex && pairedDevList.m_numOfDevices) && (devIndex <= pairedDevList.m_numOfDevices)) {
966 RDK_LOG(RDK_LOG_DEBUG, LOG_TR69HOSTIF,
"[%s]xBlueTooth: The Paired Devices (index : %d) MAC is \'%s\'.\n", __FUNCTION__, devIndex-1, pairedDevList.m_deviceProperty[devIndex-1].m_deviceAddress);
967 memset(stMsgData->
paramValue,
'\0', TR69HOSTIFMGR_MAX_PARAM_LEN);
968 strncpy(stMsgData->
paramValue, pairedDevList.m_deviceProperty[devIndex-1].m_deviceAddress, TR69HOSTIFMGR_MAX_PARAM_LEN);
972 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"[%s]xBlueTooth: Failed due to wrong device index %d\r\n",__FUNCTION__, devIndex);
975 }
catch (
const std::exception& e) {
976 RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,
"[%s]xBlueTooth: Exception : %s\r\n",__FUNCTION__, e.what());
980 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Exiting..\n", __FUNCTION__, __LINE__);
995 int hostIf_DeviceInfoRdk_xBT::getPairedDevice_Manufacturer(
HOSTIF_MsgData_t *stMsgData)
997 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Entering..\n", __FUNCTION__, __LINE__);
1001 if((devIndex && pairedDevList.m_numOfDevices) && (devIndex <= pairedDevList.m_numOfDevices)) {
1002 RDK_LOG(RDK_LOG_DEBUG, LOG_TR69HOSTIF,
"[%s]xBlueTooth: The Paired Devices (index : %d) Manufacturer is \'%d\'.\n", __FUNCTION__, devIndex-1, pairedDevList.m_deviceProperty[devIndex-1].m_vendorID);
1003 put_int(stMsgData->
paramValue, pairedDevList.m_deviceProperty[devIndex-1].m_vendorID);
1007 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"[%s]xBlueTooth: Failed due to wrong device index %d\r\n",__FUNCTION__, devIndex);
1010 }
catch (
const std::exception& e) {
1011 RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,
"[%s]xBlueTooth: Exception : %s\r\n",__FUNCTION__, e.what());
1014 stMsgData->
paramtype=hostIf_UnsignedIntType;
1015 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Exiting..\n", __FUNCTION__, __LINE__);
1031 int hostIf_DeviceInfoRdk_xBT::getPairedDevice_DeviceID(
HOSTIF_MsgData_t *stMsgData)
1033 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Entering..\n", __FUNCTION__, __LINE__);
1037 stMsgData->
paramtype = hostIf_StringType;
1039 if((devIndex && pairedDevList.m_numOfDevices) && (devIndex <= pairedDevList.m_numOfDevices)) {
1040 RDK_LOG(RDK_LOG_DEBUG, LOG_TR69HOSTIF,
"[%s]xBlueTooth: The Paired Devices (index : %d) DeviceID is \'%llu\'.\n", __FUNCTION__, devIndex-1, pairedDevList.m_deviceProperty[devIndex-1].m_deviceHandle);
1041 memset(stMsgData->
paramValue,
'\0', TR69HOSTIFMGR_MAX_PARAM_LEN);
1042 sprintf(stMsgData->
paramValue,
"%llu", pairedDevList.m_deviceProperty[devIndex-1].m_deviceHandle);
1046 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"[%s]xBlueTooth: Failed due to wrong device index %d\r\n",__FUNCTION__, devIndex);
1049 }
catch (
const std::exception& e) {
1050 RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,
"[%s]xBlueTooth: Exception : %s\r\n",__FUNCTION__, e.what());
1054 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Exiting..\n", __FUNCTION__, __LINE__);
1070 int hostIf_DeviceInfoRdk_xBT::getPairedDevice_Connected(
HOSTIF_MsgData_t *stMsgData)
1072 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Entering..\n", __FUNCTION__, __LINE__);
1076 if((devIndex && pairedDevList.m_numOfDevices) && (devIndex <= pairedDevList.m_numOfDevices)) {
1077 RDK_LOG(RDK_LOG_DEBUG, LOG_TR69HOSTIF,
"[%s]xBlueTooth: The Paired Devices (index : %d) Connection status is \'%d\'.\n", __FUNCTION__, devIndex-1, pairedDevList.m_deviceProperty[devIndex-1].m_isConnected);
1082 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"[%s]xBlueTooth: Failed due to wrong device index %d\r\n",__FUNCTION__, devIndex);
1085 }
catch (
const std::exception& e) {
1086 RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,
"[%s]xBlueTooth: Exception : %s\r\n",__FUNCTION__, e.what());
1089 stMsgData->
paramtype=hostIf_BooleanType;
1090 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Exiting..\n", __FUNCTION__, __LINE__);
1105 int hostIf_DeviceInfoRdk_xBT::getPairedDevice_DeviceType(
HOSTIF_MsgData_t *stMsgData)
1107 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Entering..\n", __FUNCTION__, __LINE__);
1111 if((devIndex && pairedDevList.m_numOfDevices) && (devIndex <= pairedDevList.m_numOfDevices)) {
1115 RDK_LOG(RDK_LOG_DEBUG, LOG_TR69HOSTIF,
"[%s]xBlueTooth: The Paired Devices (index : %d) device type is \'%s\'.\n", __FUNCTION__, devIndex-1, pType);
1121 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"[%s]xBlueTooth: Failed; Null Name\r\n",__FUNCTION__);
1127 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"[%s]xBlueTooth: Failed due to wrong device index %d\r\n",__FUNCTION__, devIndex);
1130 }
catch (
const std::exception& e) {
1131 RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,
"[%s]xBlueTooth: Exception : %s\r\n",__FUNCTION__, e.what());
1135 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Exiting..\n", __FUNCTION__, __LINE__);
1150 int hostIf_DeviceInfoRdk_xBT::getConnectedDevice_Name(
HOSTIF_MsgData_t *stMsgData)
1152 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Entering..\n", __FUNCTION__, __LINE__);
1156 if((devIndex && connectedDevList.m_numOfDevices) && (devIndex <= connectedDevList.m_numOfDevices)) {
1157 RDK_LOG(RDK_LOG_DEBUG, LOG_TR69HOSTIF,
"[%s]xBlueTooth: The Connected Devices (index : %d) profile is \'%s\'.\n", __FUNCTION__, devIndex-1, connectedDevList.m_deviceProperty[devIndex-1].m_name);
1158 strncpy(stMsgData->
paramValue, connectedDevList.m_deviceProperty[devIndex-1].m_name, TR69HOSTIFMGR_MAX_PARAM_LEN);
1162 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"[%s]xBlueTooth: Failed due to wrong device index %d\r\n",__FUNCTION__, devIndex);
1165 }
catch (
const std::exception& e) {
1166 RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,
"[%s]xBlueTooth: Exception : %s\r\n",__FUNCTION__, e.what());
1170 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Exiting..\n", __FUNCTION__, __LINE__);
1187 #if 0 // Not required
1188 int hostIf_DeviceInfoRdk_xBT::getConnectedDevice_LowEnergyEnabled(
HOSTIF_MsgData_t *stMsgData)
1190 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Entering..\n", __FUNCTION__, __LINE__);
1194 if((devIndex && connectedDevList.m_numOfDevices) && (devIndex <= connectedDevList.m_numOfDevices)) {
1195 RDK_LOG(RDK_LOG_DEBUG, LOG_TR69HOSTIF,
"[%s]xBlueTooth: The Connected Device (index : %d) IsLowEnergyEnabled \'%d\'.\n", __FUNCTION__, devIndex-1, connectedDevList.m_deviceProperty[devIndex-1].m_isLowEnergyDevice);
1196 put_int(stMsgData->
paramValue, connectedDevList.m_deviceProperty[devIndex-1].m_isLowEnergyDevice);
1200 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"[%s]xBlueTooth: Failed due to wrong device index %d\r\n",__FUNCTION__, devIndex);
1203 }
catch (
const std::exception& e) {
1204 RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,
"[%s]xBlueTooth: Exception : %s\r\n",__FUNCTION__, e.what());
1207 stMsgData->
paramtype=hostIf_UnsignedIntType;
1208 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Exiting..\n", __FUNCTION__, __LINE__);
1224 int hostIf_DeviceInfoRdk_xBT::getConnectedDevice_Active(
HOSTIF_MsgData_t *stMsgData)
1226 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Entering..\n", __FUNCTION__, __LINE__);
1230 if((devIndex && connectedDevList.m_numOfDevices) && (devIndex <= connectedDevList.m_numOfDevices)) {
1231 RDK_LOG(RDK_LOG_DEBUG, LOG_TR69HOSTIF,
"[%s]xBlueTooth: The Connected Device (index : %d) active status \'%d\'.\n", __FUNCTION__, devIndex-1, connectedDevList.m_deviceProperty[devIndex-1].m_powerStatus);
1232 if (BTRMGR_DEVICE_POWER_ACTIVE == connectedDevList.m_deviceProperty[devIndex-1].m_powerStatus)
1233 strncpy(stMsgData->
paramValue,
"ACTIVE", TR69HOSTIFMGR_MAX_PARAM_LEN);
1234 else if (BTRMGR_DEVICE_POWER_LOW == connectedDevList.m_deviceProperty[devIndex-1].m_powerStatus)
1235 strncpy(stMsgData->
paramValue,
"LOW_POWER", TR69HOSTIFMGR_MAX_PARAM_LEN);
1236 else if (BTRMGR_DEVICE_POWER_STANDBY == connectedDevList.m_deviceProperty[devIndex-1].m_powerStatus)
1237 strncpy(stMsgData->
paramValue,
"STANDBY", TR69HOSTIFMGR_MAX_PARAM_LEN);
1239 strncpy(stMsgData->
paramValue,
"UNKNOWN", TR69HOSTIFMGR_MAX_PARAM_LEN);
1243 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"[%s]xBlueTooth: Failed due to wrong device index %d\r\n",__FUNCTION__, devIndex);
1246 }
catch (
const std::exception& e) {
1247 RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,
"[%s]xBlueTooth: Exception : %s\r\n",__FUNCTION__, e.what());
1251 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Exiting..\n", __FUNCTION__, __LINE__);
1267 int hostIf_DeviceInfoRdk_xBT::getDeviceInfo_DeviceID(
HOSTIF_MsgData_t *stMsgData)
1269 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Entering..\n", __FUNCTION__, __LINE__);
1272 stMsgData->
paramtype = hostIf_StringType;;
1273 if(handle_devInfo) {
1274 RDK_LOG(RDK_LOG_DEBUG, LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: The Device ID is \'%llu\'.\n", __FUNCTION__, __LINE__, deviceProperty.m_deviceHandle);
1275 memset(stMsgData->
paramValue,
'\0', TR69HOSTIFMGR_MAX_PARAM_LEN);
1276 sprintf(stMsgData->
paramValue,
"%llu",deviceProperty.m_deviceHandle);
1280 RDK_LOG(RDK_LOG_WARN, LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Failed to get, since not Set for '%s.%s'.\r\n", __FUNCTION__,__LINE__, X_BT_ROOT_OBJ, BT_DEV_GETDEVICEINFO_STRING);
1282 }
catch (
const std::exception& e) {
1283 RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,
"[%s]xBlueTooth: Exception : %s\r\n",__FUNCTION__, e.what());
1287 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Exiting..\n", __FUNCTION__, __LINE__);
1303 int hostIf_DeviceInfoRdk_xBT::getDeviceInfo_Manufacturer(
HOSTIF_MsgData_t *stMsgData)
1305 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Entering..\n", __FUNCTION__, __LINE__);
1308 if(handle_devInfo) {
1309 RDK_LOG(RDK_LOG_DEBUG, LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: The Device Manufacturer/vendorID : \'%d\'.\n", __FUNCTION__, __LINE__, deviceProperty.m_vendorID);
1314 RDK_LOG(RDK_LOG_WARN, LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Failed to get, since not Set for '%s.%s'.\r\n", __FUNCTION__,__LINE__, X_BT_ROOT_OBJ, BT_DEV_GETDEVICEINFO_STRING);
1316 }
catch (
const std::exception& e) {
1317 RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,
"[%s]xBlueTooth: Exception : %s\r\n",__FUNCTION__, e.what());
1320 stMsgData->
paramtype=hostIf_IntegerType;
1321 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Exiting..\n", __FUNCTION__, __LINE__);
1337 int hostIf_DeviceInfoRdk_xBT::getDeviceInfo_Profile(
HOSTIF_MsgData_t *stMsgData)
1339 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Entering..\n", __FUNCTION__, __LINE__);
1345 int numOfService = deviceProperty.m_serviceInfo.m_numOfService;
1347 if(handle_devInfo && numOfService) {
1348 char serviceInfo[TR69HOSTIFMGR_MAX_PARAM_LEN];
1349 memset (&serviceInfo,
'\0',
sizeof(serviceInfo));
1350 for (
int i = 0; i < deviceProperty.m_serviceInfo.m_numOfService; i++)
1352 strcat(serviceInfo, deviceProperty.m_serviceInfo.m_profileInfo[i].m_profile);
1353 if ( (i + 1) < deviceProperty.m_serviceInfo.m_numOfService)
1354 strcat(serviceInfo,
",");
1357 RDK_LOG(RDK_LOG_DEBUG, LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Profile is \'%s\'.\n", __FUNCTION__, __LINE__, serviceInfo);
1364 RDK_LOG(RDK_LOG_WARN, LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Failed to get, since not Set for '%s.%s'.\r\n", __FUNCTION__,__LINE__, X_BT_ROOT_OBJ, BT_DEV_GETDEVICEINFO_STRING);
1367 }
catch (
const std::exception& e) {
1368 RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,
"[%s]xBlueTooth: Exception : %s\r\n",__FUNCTION__, e.what());
1371 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Exiting..\n", __FUNCTION__, __LINE__);
1387 int hostIf_DeviceInfoRdk_xBT::getDeviceInfo_MAC(
HOSTIF_MsgData_t *stMsgData)
1389 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Entering..\n", __FUNCTION__, __LINE__);
1392 if( handle_devInfo) {
1393 RDK_LOG(RDK_LOG_DEBUG, LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: The Devices MAC is \'%s\'.\n", __FUNCTION__, __LINE__, deviceProperty.m_deviceAddress);
1394 memset(stMsgData->
paramValue,
'\0', TR69HOSTIFMGR_MAX_PARAM_LEN);
1395 strncpy(stMsgData->
paramValue, deviceProperty.m_deviceAddress, TR69HOSTIFMGR_MAX_PARAM_LEN);
1399 RDK_LOG(RDK_LOG_DEBUG, LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Failed since not Set for '%s.%s'.\r\n", __FUNCTION__,__LINE__, X_BT_ROOT_OBJ, BT_DEV_GETDEVICEINFO_STRING);
1403 }
catch (
const std::exception& e) {
1404 RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,
"[%s]xBlueTooth: Exception : %s\r\n",__FUNCTION__, e.what());
1408 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Exiting..\n", __FUNCTION__, __LINE__);
1425 int hostIf_DeviceInfoRdk_xBT::getDeviceInfo_SignalLevel(
HOSTIF_MsgData_t *stMsgData)
1427 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Entering..\n", __FUNCTION__, __LINE__);
1432 memset(stMsgData->
paramValue,
'\0', TR69HOSTIFMGR_MAX_PARAM_LEN);
1433 RDK_LOG(RDK_LOG_DEBUG, LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: The Device signal level \'%d\'.\n", __FUNCTION__, __LINE__, deviceProperty.m_signalLevel);
1434 sprintf(stMsgData->
paramValue,
"%d", deviceProperty.m_signalLevel);
1438 RDK_LOG(RDK_LOG_DEBUG, LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Failed since not Set for '%s.%s'.\r\n", __FUNCTION__,__LINE__, X_BT_ROOT_OBJ, BT_DEV_GETDEVICEINFO_STRING);
1440 }
catch (
const std::exception& e) {
1441 RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,
"[%s]xBlueTooth: Exception : %s\r\n",__FUNCTION__, e.what());
1444 stMsgData->
paramtype = hostIf_StringType;
1445 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Exiting..\n", __FUNCTION__, __LINE__);
1460 int hostIf_DeviceInfoRdk_xBT::getDeviceInfo_RSSI (
HOSTIF_MsgData_t *stMsgData)
1462 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Entering..\n", __FUNCTION__, __LINE__);
1465 if(handle_devInfo) {
1466 RDK_LOG(RDK_LOG_DEBUG, LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: The DeviceInfo RSSI \'%d\'.\n", __FUNCTION__, __LINE__, deviceProperty.m_rssi);
1470 RDK_LOG(RDK_LOG_DEBUG, LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Failed since not Set for '%s.%s'.\r\n", __FUNCTION__,__LINE__, X_BT_ROOT_OBJ, BT_DEV_GETDEVICEINFO_STRING);
1472 }
catch (
const std::exception& e) {
1473 RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Exception : %s\r\n",__FUNCTION__,__LINE__, e.what());
1476 stMsgData->
paramtype=hostIf_IntegerType;
1477 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Exiting..\n", __FUNCTION__, __LINE__);
1492 int hostIf_DeviceInfoRdk_xBT::getConnectedDevice_DeviceType(
HOSTIF_MsgData_t *stMsgData) {
1493 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Entering..\n", __FUNCTION__, __LINE__);
1497 if((devIndex && connectedDevList.m_numOfDevices) && (devIndex <= connectedDevList.m_numOfDevices)) {
1501 RDK_LOG(RDK_LOG_DEBUG, LOG_TR69HOSTIF,
"[%s]xBlueTooth: The Connected Devices (index : %d) device type is \'%s\'.\n", __FUNCTION__, devIndex-1, pType);
1507 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Failed; Null Name\r\n",__FUNCTION__, __LINE__);
1513 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Failed due to wrong device index %d\r\n",__FUNCTION__, __LINE__, devIndex);
1516 }
catch (
const std::exception& e) {
1517 RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Exception : %s\r\n",__FUNCTION__, __LINE__, e.what());
1521 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Exiting..\n", __FUNCTION__, __LINE__);
1537 int hostIf_DeviceInfoRdk_xBT::getConnectedDevice_DeviceID(
HOSTIF_MsgData_t *stMsgData)
1539 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Entering..\n", __FUNCTION__, __LINE__);
1543 stMsgData->
paramtype = hostIf_StringType;;
1544 if((devIndex && connectedDevList.m_numOfDevices) && (devIndex <= connectedDevList.m_numOfDevices)) {
1545 RDK_LOG(RDK_LOG_DEBUG, LOG_TR69HOSTIF,
"[%s]xBlueTooth: The Connected Devices (index : %d) DeviceID is \'%llu\'.\n", __FUNCTION__, devIndex-1, connectedDevList.m_deviceProperty[devIndex-1].m_deviceHandle);
1546 memset(stMsgData->
paramValue,
'\0', TR69HOSTIFMGR_MAX_PARAM_LEN);
1547 sprintf(stMsgData->
paramValue,
"%llu", connectedDevList.m_deviceProperty[devIndex-1].m_deviceHandle);
1551 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"[%s]xBlueTooth: Failed due to wrong device index %d\r\n",__FUNCTION__, devIndex);
1554 }
catch (
const std::exception& e) {
1555 RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,
"[%s]xBlueTooth: Exception : %s\r\n",__FUNCTION__, e.what());
1559 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Exiting..\n", __FUNCTION__, __LINE__);
1576 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Entering..\n", __FUNCTION__, __LINE__);
1580 if(handle_devInfo) {
1581 memset(stMsgData->
paramValue,
'\0', TR69HOSTIFMGR_MAX_PARAM_LEN);
1582 sprintf(stMsgData->
paramValue,
"%llu", deviceProperty.m_deviceHandle);
1583 RDK_LOG(RDK_LOG_DEBUG, LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: GetDeviceInfo value %llu, converted string is (%s). \r\n", __FUNCTION__,__LINE__,
1584 deviceProperty.m_deviceHandle, stMsgData->
paramValue);
1588 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Failed to return any value, since this is not Set for \"%s.%s\". \r\n",__FUNCTION__, __LINE__, X_BT_ROOT_OBJ, BT_DEV_GETDEVICEINFO_STRING);
1592 }
catch (
const std::exception& e) {
1593 RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Exception : %s\r\n",__FUNCTION__,__LINE__, e.what());
1597 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Exiting..\n", __FUNCTION__, __LINE__);
1617 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Entering..\n", __FUNCTION__, __LINE__);
1622 BTRMgrDeviceHandle handle = 0;
1624 char *stopstring = NULL;
1626 handle = strtoll(stMsgData->
paramValue, NULL, 0);
1628 RDK_LOG(RDK_LOG_DEBUG, LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Received Set GetDeviceInfo value : %s and converted value as : %llu\r\n",
1629 __FUNCTION__,__LINE__, stMsgData->
paramValue, handle);
1631 memset (&deviceProperty, 0,
sizeof (deviceProperty));
1635 RDK_LOG(RDK_LOG_ERROR, LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Failed in BTRMGR_GetDeviceProperties for \'%s\'.\n", __FUNCTION__, __LINE__, stMsgData->
paramValue);
1640 handle_devInfo = handle;
1641 RDK_LOG(RDK_LOG_DEBUG, LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Successfully BTRMGR_GetDeviceProperties.\n", __FUNCTION__, __LINE__);
1646 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Failed due to empty GetDeviceInfo value %s\r\n",__FUNCTION__, __LINE__,stMsgData->
paramValue);
1649 }
catch (
const std::exception& e) {
1650 RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Exception : %s\r\n",__FUNCTION__,__LINE__, e.what());
1653 stMsgData->
paramtype=hostIf_UnsignedLongType;
1654 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Exiting..\n", __FUNCTION__, __LINE__);
1658 #ifdef BLE_TILE_PROFILE
1671 int hostIf_DeviceInfoRdk_xBT::setLimitBeaconDetection (
HOSTIF_MsgData_t *stMsgData)
1673 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Entering..\n", __FUNCTION__, __LINE__);
1678 unsigned char isLimited = 0;
1680 RDK_LOG(RDK_LOG_INFO, LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Received Set value : %s for LimitBeaconDetection\r\n",
1681 __FUNCTION__,__LINE__, stMsgData->
paramValue);
1684 RDK_LOG(RDK_LOG_INFO, LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: isLimited value : %d for LimitBeaconDetection\r\n", __FUNCTION__,__LINE__, isLimited);
1686 leLimitBeaconDetection_t param;
1687 memset(¶m, 0,
sizeof(param));
1688 param.adapterIndex = 0;
1689 param.limitBeaconDetection = isLimited;
1691 IARM_Result_t retVal = IARM_RESULT_SUCCESS;
1693 retVal =
IARM_Bus_Call(IARM_BUS_BTRLEMGR_NAME, IARM_BUS_LEMGR_API_leSetLimitBeaconDetection, (
void *)¶m,
sizeof(leLimitBeaconDetection_t));
1694 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"\n***********************************\n");
1695 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"\n \"%s\", \"%s\"", IARM_BUS_LEMGR_API_leSetLimitBeaconDetection , param.limitBeaconDetection ?
"true" :
"false");
1696 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"\n***********************************\n");
1698 if(retVal == IARM_RESULT_SUCCESS) {
1699 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Successfully Set the limit beacon detection.\n", __FUNCTION__, __LINE__);
1704 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Failed due to empty LimitBeaconDetection value \r\n",__FUNCTION__, __LINE__);
1707 }
catch (
const std::exception& e) {
1708 RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Exception : %s\r\n",__FUNCTION__,__LINE__, e.what());
1711 stMsgData->
paramtype=hostIf_BooleanType;
1712 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Exiting..\n", __FUNCTION__, __LINE__);
1727 int hostIf_DeviceInfoRdk_xBT::getLimitBeaconDetection (
HOSTIF_MsgData_t *stMsgData)
1729 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Entering..\n", __FUNCTION__, __LINE__);
1731 unsigned char isLimited = 0;
1734 IARM_Result_t retVal = IARM_RESULT_SUCCESS;
1735 leLimitBeaconDetection_t param;
1736 memset(¶m, 0,
sizeof(param));
1738 retVal =
IARM_Bus_Call(IARM_BUS_BTRLEMGR_NAME, IARM_BUS_LEMGR_API_leGetLimitBeaconDetection, (
void *)¶m,
sizeof(leLimitBeaconDetection_t));
1739 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"\n***********************************\n");
1740 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"\n \"%s\", \"%s\"", IARM_BUS_LEMGR_API_leGetLimitBeaconDetection , param.limitBeaconDetection ?
"true" :
"false");
1741 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"\n***********************************\n");
1743 if(retVal == IARM_RESULT_SUCCESS) {
1744 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Successfully get the limit beacon detection.\n", __FUNCTION__, __LINE__);
1747 isLimited = (param.limitBeaconDetection) ? 1 : 0 ;
1748 RDK_LOG(RDK_LOG_INFO, LOG_TR69HOSTIF,
"[%s][AMIT_DEBUG_DD]xBlueTooth: Is beacon detection limited : %d \n", __FUNCTION__, isLimited);
1749 }
catch (
const std::exception& e) {
1750 RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Exception : %s\r\n",__FUNCTION__, __LINE__, e.what());
1754 stMsgData->
paramtype=hostIf_BooleanType;
1755 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Exiting..\n", __FUNCTION__, __LINE__);
1769 void hostIf_DeviceInfoRdk_xBT::fetch_Bluetooth_DiscoveredDevicesList()
1773 static time_t firstExTimeDisList = 0;
1774 time_t currExTime = time (NULL);
1775 if ((currExTime - firstExTimeDisList ) > BTRMGR_QUERY_INTERVAL)
1777 memset (&disDevList,
'\0',
sizeof(disDevList));
1780 RDK_LOG(RDK_LOG_ERROR, LOG_TR69HOSTIF,
"[%s]xBlueTooth: Failed in BTRMGR_GetDiscoveredDevices. \n", __FUNCTION__);
1782 else if (disDevList.m_numOfDevices > BTRMGR_DEVICE_COUNT_MAX)
1784 RDK_LOG(RDK_LOG_ERROR, LOG_TR69HOSTIF,
"[%s]xBlueTooth: Invalid device count (%d). \n",
1785 __FUNCTION__, disDevList.m_numOfDevices);
1790 RDK_LOG(RDK_LOG_DEBUG, LOG_TR69HOSTIF,
"[%s]xBlueTooth: Successfully gets the Discovered Devices details. Total count is (%d). \n",
1791 __FUNCTION__, disDevList.m_numOfDevices);
1792 for (; j< disDevList.m_numOfDevices; j++)
1794 RDK_LOG(RDK_LOG_DEBUG, LOG_TR69HOSTIF,
"%d \t %llu \t %s \t %s\n", j,
1795 disDevList.m_deviceProperty[j].m_deviceHandle,
1796 disDevList.m_deviceProperty[j].m_name,
1797 disDevList.m_deviceProperty[j].m_deviceAddress);
1800 firstExTimeDisList = time (NULL);
1803 RDK_LOG (RDK_LOG_DEBUG, LOG_TR69HOSTIF,
"[%s] disDevList.m_numOfDevices = %hu, noOfDiscoveredDevice = %d\n",
1804 __FUNCTION__, disDevList.m_numOfDevices, noOfDiscoveredDevice);
1805 char objectPath[TR69HOSTIFMGR_MAX_PARAM_LEN];
1806 snprintf (objectPath, TR69HOSTIFMGR_MAX_PARAM_LEN,
"%s.", X_BT_DISCOVERED_DEV_OBJ);
1807 sendAddRemoveEvents (mUpdateCallback, disDevList.m_numOfDevices, noOfDiscoveredDevice, objectPath);
1820 void hostIf_DeviceInfoRdk_xBT::fetch_Bluetooth_PairedDevicesList()
1824 static time_t firstExTimePairedList = 0;
1825 time_t currExTime = time (NULL);
1826 if ((currExTime - firstExTimePairedList ) > BTRMGR_QUERY_INTERVAL)
1828 memset (&pairedDevList, 0,
sizeof(pairedDevList));
1832 RDK_LOG(RDK_LOG_ERROR, LOG_TR69HOSTIF,
"[%s]xBlueTooth: Failed in BTRMGR_GetPairedDevices. \n", __FUNCTION__);
1834 else if (pairedDevList.m_numOfDevices > BTRMGR_DEVICE_COUNT_MAX)
1836 RDK_LOG(RDK_LOG_ERROR, LOG_TR69HOSTIF,
"[%s]xBlueTooth: Invalid device count (%d). \n",
1837 __FUNCTION__, pairedDevList.m_numOfDevices);
1842 RDK_LOG(RDK_LOG_DEBUG, LOG_TR69HOSTIF,
"[%s]xBlueTooth: Successfully get Paired Devices details. Total count is (%d). \n",
1843 __FUNCTION__, pairedDevList.m_numOfDevices);
1844 for (; j< pairedDevList.m_numOfDevices; j++)
1846 RDK_LOG(RDK_LOG_DEBUG, LOG_TR69HOSTIF,
"%d \t %llu \t %s \t %s\n", j,
1847 pairedDevList.m_deviceProperty[j].m_deviceHandle,
1848 pairedDevList.m_deviceProperty[j].m_name,
1849 pairedDevList.m_deviceProperty[j].m_deviceAddress);
1852 firstExTimePairedList = time (NULL);
1855 RDK_LOG (RDK_LOG_DEBUG, LOG_TR69HOSTIF,
"[%s] pairedDevList.m_numOfDevices = %hu, noOfPairedDevice = %d\n",
1856 __FUNCTION__, pairedDevList.m_numOfDevices, noOfPairedDevice);
1857 char objectPath[TR69HOSTIFMGR_MAX_PARAM_LEN];
1858 snprintf (objectPath, TR69HOSTIFMGR_MAX_PARAM_LEN,
"%s.", X_BT_PAIRED_DEV_OBJ);
1859 sendAddRemoveEvents (mUpdateCallback, pairedDevList.m_numOfDevices, noOfPairedDevice, objectPath);
1872 void hostIf_DeviceInfoRdk_xBT::fetch_Bluetooth_ConnectedDevicesList()
1876 static time_t firstExTimeConnList = 0;
1877 time_t currExTime = time (NULL);
1878 if ((currExTime - firstExTimeConnList ) > BTRMGR_QUERY_INTERVAL)
1880 memset (&connectedDevList, 0,
sizeof(connectedDevList));
1884 RDK_LOG(RDK_LOG_ERROR, LOG_TR69HOSTIF,
"[%s]xBlueTooth: Failed in BTRMGR_GetConnectedDevices. \n", __FUNCTION__);
1886 else if (connectedDevList.m_numOfDevices > BTRMGR_DEVICE_COUNT_MAX)
1888 RDK_LOG(RDK_LOG_ERROR, LOG_TR69HOSTIF,
"[%s]xBlueTooth: Invalid device count (%d). \n",
1889 __FUNCTION__, connectedDevList.m_numOfDevices);
1894 RDK_LOG(RDK_LOG_DEBUG, LOG_TR69HOSTIF,
"[%s]xBlueTooth: Successfully gets the Connected Devices details. Total count is (%d). \n",
1895 __FUNCTION__, connectedDevList.m_numOfDevices);
1896 for (; j< connectedDevList.m_numOfDevices; j++)
1898 RDK_LOG(RDK_LOG_DEBUG, LOG_TR69HOSTIF,
"%d \t %llu \t %s \t %s\n", j,
1899 connectedDevList.m_deviceProperty[j].m_deviceHandle,
1900 connectedDevList.m_deviceProperty[j].m_name,
1901 connectedDevList.m_deviceProperty[j].m_deviceAddress);
1904 firstExTimeConnList = time (NULL);
1907 RDK_LOG (RDK_LOG_DEBUG, LOG_TR69HOSTIF,
"[%s] connectedDevList.m_numOfDevices = %hu, noOfConnectedDevices = %d\n",
1908 __FUNCTION__, connectedDevList.m_numOfDevices, noOfConnectedDevices);
1909 char objectPath[TR69HOSTIFMGR_MAX_PARAM_LEN];
1910 snprintf (objectPath, TR69HOSTIFMGR_MAX_PARAM_LEN,
"%s.", X_BT_CONNECTED_DEV_OBJ);
1911 sendAddRemoveEvents (mUpdateCallback, connectedDevList.m_numOfDevices, noOfConnectedDevices, objectPath);
1914 void hostIf_DeviceInfoRdk_xBT::registerUpdateCallback(updateCallback cb)
1916 mUpdateCallback = cb;
1919 void hostIf_DeviceInfoRdk_xBT::checkForUpdates()
1923 if (mUpdateCallback == 0)
1926 std::lock_guard<std::mutex> lg(m);
1928 fetch_Bluetooth_DiscoveredDevicesList ();
1929 fetch_Bluetooth_PairedDevicesList ();
1930 fetch_Bluetooth_ConnectedDevicesList ();
1933 #ifdef BLE_TILE_PROFILE
1934 int hostIf_DeviceInfoRdk_xBT::do_Ring_A_Tile(
bool enable)
1936 if(enable ==
true) {
1937 leRingATileHandleParam_t param;
1938 memset(¶m, 0,
sizeof(param));
1940 snprintf (param.Id, TILE_ID_MAX_SIZE-1,
"%s", this->tile_Id.c_str());
1941 snprintf (param.sessionId, SESSION_ID_MAX_SIZE-1,
"%s", this->sessionId.c_str());
1942 param.triggerCmd = this->triggerFlag;
1944 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: BLE Tile: ID : %s \n", __FUNCTION__, __LINE__, param.Id);
1945 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: BLE Tile: Session ID : %s \n", __FUNCTION__, __LINE__, param.sessionId);
1946 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: BLE Tile: Ring Trigger : %d . \n", __FUNCTION__, __LINE__, param.triggerCmd);
1948 IARM_Result_t retVal = IARM_RESULT_SUCCESS;
1950 retVal =
IARM_Bus_Call_with_IPCTimeout(IARM_BUS_BTRLEMGR_NAME, IARM_BUS_LEMGR_API_leRingATile, (
void *)¶m,
sizeof(leRingATileHandleParam_t ), 15000);
1951 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"\n***********************************\n");
1952 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"\n \"%s\", \"%s\"", IARM_BUS_LEMGR_API_leRingATile , ((param.triggerCmd)?
"true":
"false"));
1953 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"\n***********************************\n");
1955 if(retVal == IARM_RESULT_SUCCESS) {
1956 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Successfully Set the Ring.\n", __FUNCTION__, __LINE__);
1957 this->tile_Id.clear();
1958 this->sessionId.clear();
1959 this->triggerFlag =
false;
1962 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Exiting..\n", __FUNCTION__, __LINE__);
1966 int hostIf_DeviceInfoRdk_xBT::process_TileCmdRequest(
HOSTIF_MsgData_t *stMsgData)
1968 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Entering..\n", __FUNCTION__, __LINE__);
1970 leTileRequestHandleParam_t param;
1971 memset(¶m, 0,
sizeof(param));
1972 IARM_Result_t retVal = IARM_RESULT_SUCCESS;
1973 snprintf(param.request, TILE_REQUEST_MAX_SIZE -1, stMsgData->
paramValue);
1975 retVal =
IARM_Bus_Call_with_IPCTimeout(IARM_BUS_BTRLEMGR_NAME, IARM_BUS_LEMGR_API_leTileRequest, (
void *)¶m,
sizeof(leTileRequestHandleParam_t ), 15000);
1977 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"\n***********************************\n");
1978 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"\n \"%s\", \"%s\"\n", IARM_BUS_LEMGR_API_leTileRequest, ((retVal == IARM_RESULT_SUCCESS) ?
"Successfully set.":
"Failed."));
1979 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"\n***********************************\n");
1981 if(retVal == IARM_RESULT_SUCCESS) {
1982 RDK_LOG(RDK_LOG_INFO,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Successfully forwarded Tile.Cmd.Request to btrLeAppMgr..\n", __FUNCTION__, __LINE__);
1985 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Failed to process Tile Cmd Request..\n", __FUNCTION__, __LINE__);
1989 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%d]xBlueTooth: Exiting..\n", __FUNCTION__, __LINE__);
1992 #endif // BLE_TILE_PROFILE
1993 #endif // USE_XRDK_BT_PROFILE