return UAM_ERROR_NONE;
}
-static uam_db_tech_info_t *__uam_core_get_dev_tech_info(const char *device_id, int tech_type)
+static uam_db_tech_info_t *__uam_core_get_dev_tech_info(
+ const char *device_id, int tech_type, int app_num)
{
FUNC_ENTRY;
uam_db_device_info_t *device;
retv_if(UAM_TECH_TYPE_NONE >= tech_type, NULL);
retv_if(UAM_TECH_TYPE_MAX <= tech_type, NULL);
- l = g_slist_find_custom(devices, device_id, __compare_device_id);
+ uam_device_info_s *temp_dev_info;
+
+ temp_dev_info = g_new0(uam_device_info_s, 1);
+ g_strlcpy(temp_dev_info->device_id, device_id,
+ UAM_DEVICE_ID_MAX_STRING_LEN);
+ temp_dev_info->type = tech_type;
+ temp_dev_info->app_num = app_num;
+
+ l = g_slist_find_custom(devices, temp_dev_info, __compare_device_id_and_appnum);
+ g_free(temp_dev_info);
+
if (NULL == l) {
UAM_DBG("DeviceId [%s] is not in the list", device_id);
return NULL;
}
}
- UAM_DBG("DeviceId [%s], Device type [0x%2.2X] not found", device_id, tech_type);
+ UAM_DBG("DeviceId [%s], Device type [0x%2.2X] for app [%d] not found",
+ device_id, tech_type, app_num);
FUNC_EXIT;
return NULL;
}
retv_if(UAM_TECH_TYPE_NONE >= tech_type, UAM_ERROR_INVALID_PARAMETER);
retv_if(UAM_TECH_TYPE_MAX <= tech_type, UAM_ERROR_INVALID_PARAMETER);
- tech_info = __uam_core_get_dev_tech_info(device_id, tech_type);
+ tech_info = __uam_core_get_dev_tech_info(device_id, tech_type, app_num);
retv_if(NULL == tech_info, UAM_ERROR_INVALID_PARAMETER);
l = __search_service(tech_info->svc_list, svc_name, app_num);
l = __search_service(services, svc_name, app_num);
retv_if(NULL == l, UAM_ERROR_INVALID_PARAMETER);
- tech_info = __uam_core_get_dev_tech_info(device_id, tech_type);
+ tech_info = __uam_core_get_dev_tech_info(device_id, tech_type, app_num);
retv_if(NULL == tech_info, UAM_ERROR_INVALID_PARAMETER);
l = __search_service(tech_info->svc_list, svc_name, app_num);
retv_if(UAM_TECH_TYPE_NONE >= tech_type, UAM_ERROR_INVALID_PARAMETER);
retv_if(UAM_TECH_TYPE_MAX <= tech_type, UAM_ERROR_INVALID_PARAMETER);
- tech_info = __uam_core_get_dev_tech_info(device_id, tech_type);
+ tech_info = __uam_core_get_dev_tech_info(device_id, tech_type, app_num);
retv_if(NULL == tech_info, UAM_ERROR_INVALID_PARAMETER);
/* Retrieve service from list */
/* <TO-DO> check if payload already exist */
__print_payload(payload);
- tech_info = __uam_core_get_dev_tech_info(device_id, tech_type);
+ tech_info = __uam_core_get_dev_tech_info(device_id, tech_type, app_num);
retv_if(NULL == tech_info, UAM_ERROR_INVALID_PARAMETER);
mac = __get_mac_addr(tech_info);