From: chleun.moon Date: Fri, 29 Dec 2017 02:43:34 +0000 (+0900) Subject: Fix bug X-Git-Tag: submit/tizen_4.0/20180102.074818 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Ftags%2Fsubmit%2Ftizen_4.0%2F20180102.074818;p=platform%2Fcore%2Fconnectivity%2Fasp-manager.git Fix bug Change-Id: Iecba4c567c0bb8d423281fb80ba10331fbd9b66c Signed-off-by: Cheoleun Moon --- diff --git a/include/asp-tech.h b/include/asp-tech.h index 64f79c0..e1dd2d6 100755 --- a/include/asp-tech.h +++ b/include/asp-tech.h @@ -19,6 +19,8 @@ #include +#include "asp-session.h" + typedef void (*asp_tech_session_request_cb)(gint32 error_code, const guint8 *session_mac, guint32 session_id, guint32 adv_id, const gchar *device_name, size_t name_length, const guint8 *session_info, size_t info_length, gboolean get_pin, guint32 pin, gpointer user_data); typedef void (*asp_tech_session_config_request_cb)(gint32 error_code, const guint8 *session_mac, guint32 session_id, gboolean get_pin, guint32 pin, gpointer user_data); typedef void (*asp_tech_connect_status_cb)(gint32 error_code, const guint8 *session_mac, guint32 session_id, asp_session_connect_status_e status, gpointer user_data); diff --git a/src/tech/asp-tech-infra.c b/src/tech/asp-tech-infra.c index 0411b72..67c3e90 100644 --- a/src/tech/asp-tech-infra.c +++ b/src/tech/asp-tech-infra.c @@ -232,8 +232,8 @@ static gint32 __asp_service_infra_convert_error_type(gint32 dnssd_error) static void __init_hash_tables() { - g_local_service_hash = g_hash_table_new(g_int_hash, g_int_equal); - g_browser_hash = g_hash_table_new(g_int_hash, g_int_equal); + g_local_service_hash = g_hash_table_new(g_direct_hash, g_direct_equal); + g_browser_hash = g_hash_table_new(g_direct_hash, g_direct_equal); } static void __g_hash_free_handle(gpointer key, gpointer value, gpointer user_data) @@ -393,7 +393,7 @@ gint32 asp_tech_infra_advertise(asp_service_advertise_s *service, gint32 replace ASP_LOGD("Success to register local service %u", service_handle); g_hash_table_insert(g_local_service_hash, - &service->adv_id, &service_handle); + GUINT_TO_POINTER(service->adv_id), GUINT_TO_POINTER(service_handle)); ASP_LOGD("Insert (%u, %u) to g_local_service_hash (size: %d)", service->adv_id, service_handle, @@ -448,8 +448,8 @@ gint32 asp_tech_infra_cancel_advertise(asp_service_advertise_s *service) gint32 result = 0; dnssd_service_h service_handle; - service_handle = *(dnssd_service_h*)g_hash_table_lookup(g_local_service_hash, - &service->adv_id); + service_handle = (dnssd_service_h)GPOINTER_TO_UINT(g_hash_table_lookup(g_local_service_hash, + GUINT_TO_POINTER(service->adv_id))); if (!service_handle) { /* TODO */ @@ -460,6 +460,7 @@ gint32 asp_tech_infra_cancel_advertise(asp_service_advertise_s *service) result = dnssd_deregister_local_service(service_handle); if (result != DNSSD_ERROR_NONE) { result = __asp_service_infra_convert_error_type(result); + ASP_LOGE("Failed to deregister local service %u", service_handle); return result; } ASP_LOGD("Success to deregister local service: %u", service_handle); @@ -479,7 +480,7 @@ gint32 asp_tech_infra_seek(asp_service_seek_s *service) { __ASP_LOG_FUNC_ENTER__; gint32 result = 0; - dnssd_service_h browser_handle; + dnssd_browser_h browser_handle; gchar *if_name; wifi_manager_h wifi_handle = NULL; @@ -515,7 +516,7 @@ gint32 asp_tech_infra_seek(asp_service_seek_s *service) service->service_type, browser_handle); g_hash_table_insert(g_browser_hash, - &service->search_id, &browser_handle); + GUINT_TO_POINTER(service->search_id), GUINT_TO_POINTER(browser_handle)); ASP_LOGD("Insert (%u, %u) to g_browser_hash (size: %d)", service->search_id, browser_handle, @@ -530,10 +531,10 @@ gint32 asp_tech_infra_cancel_seek(asp_service_seek_s *service) { __ASP_LOG_FUNC_ENTER__; gint32 result = 0; - dnssd_service_h browser_handle; + dnssd_browser_h browser_handle; - browser_handle = *(dnssd_service_h*)g_hash_table_lookup(g_browser_hash, - &service->search_id); + browser_handle = (dnssd_browser_h)GPOINTER_TO_UINT(g_hash_table_lookup(g_browser_hash, + GUINT_TO_POINTER(service->search_id))); if (!browser_handle) { /* TODO */