Code clean up 93/223793/1
authorinjun.yang <injun.yang@samsung.com>
Thu, 23 Jan 2020 06:14:43 +0000 (15:14 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Tue, 4 Feb 2020 05:01:04 +0000 (14:01 +0900)
Change-Id: I9209247bbb8492a00879aa1e96ea22f62143025b
Signed-off-by: injun.yang <injun.yang@samsung.com>
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
28 files changed:
bt-api/bt-event-handler.c
bt-api/bt-gatt-client.c [changed mode: 0755->0644]
bt-api/bt-rfcomm-client.c
bt-api/bt-telephony.c
bt-core/bt-core-adapter.c
bt-oal/bluez_hal/src/bt-hal-adapter-dbus-handler.c
bt-oal/bluez_hal/src/bt-hal-adapter-le.c
bt-oal/bluez_hal/src/bt-hal-bluetooth.c
bt-oal/bluez_hal/src/bt-hal-dbus-common-utils.c
bt-oal/bluez_hal/src/bt-hal-device-dbus-handler.c
bt-oal/bluez_hal/src/bt-hal-event-receiver.c
bt-oal/bluez_hal/src/bt-hal-gap-agent.c
bt-oal/bluez_hal/src/bt-hal-gatt-client.c
bt-oal/bluez_hal/src/bt-hal-gatt.c
bt-oal/common/oal-common.c [changed mode: 0755->0644]
bt-oal/common/oal-event-dispatcher.c
bt-oal/common/oal-utils.c [changed mode: 0755->0644]
bt-oal/oal-gatt.c
bt-service-adaptation/services/adapter/bt-service-core-adapter-le.c
bt-service-adaptation/services/adapter/bt-service-core-adapter.c
bt-service-adaptation/services/bt-request-handler.c
bt-service-adaptation/services/bt-service-common.c
bt-service-adaptation/services/device/bt-service-bonded-device.c
bt-service-adaptation/services/device/bt-service-core-device.c
bt-service-adaptation/services/gatt/bt-service-gatt.c
bt-service-adaptation/services/ipsp/bt-service-ipsp-event-receiver.c
bt-service-adaptation/services/obex/bt-service-obex-event-receiver.c
bt-service-adaptation/services/pan_nap/bt-service-pan-nap-event-receiver.c

index 3342aed..75fa248 100644 (file)
@@ -883,7 +883,6 @@ void __bt_device_event_filter(GDBusConnection *connection,
                g_variant_get(parameters, "(i&s)", &result, &address);
 
                _bt_convert_addr_string_to_type(dev_address.addr, address);
-               BT_DBG("Sending Event to Framework");
                _bt_common_event_cb(BLUETOOTH_EVENT_GATT_SERVER_CONNECTED,
                                result, &dev_address,
                                event_info->cb, event_info->user_data);
@@ -894,7 +893,6 @@ void __bt_device_event_filter(GDBusConnection *connection,
                g_variant_get(parameters, "(i&s)", &result, &address);
 
                _bt_convert_addr_string_to_type(dev_address.addr, address);
-               BT_DBG("Sending Event to Framework");
                _bt_common_event_cb(BLUETOOTH_EVENT_GATT_SERVER_DISCONNECTED,
                                result, &dev_address,
                                event_info->cb, event_info->user_data);
@@ -905,7 +903,6 @@ void __bt_device_event_filter(GDBusConnection *connection,
                g_variant_get(parameters, "(i&s)", &result, &address);
 
                _bt_convert_addr_string_to_type(dev_address.addr, address);
-               BT_DBG("Sending Event to Framework");
                _bt_common_event_cb(BLUETOOTH_EVENT_GATT_CLIENT_CONNECTED,
                                result, &dev_address,
                                event_info->cb, event_info->user_data);
@@ -916,7 +913,6 @@ void __bt_device_event_filter(GDBusConnection *connection,
                g_variant_get(parameters, "(i&s)", &result, &address);
 
                _bt_convert_addr_string_to_type(dev_address.addr, address);
-               BT_DBG("Sending Event to Framework");
                _bt_common_event_cb(BLUETOOTH_EVENT_GATT_CLIENT_DISCONNECTED,
                                result, &dev_address,
                                event_info->cb, event_info->user_data);
@@ -928,7 +924,6 @@ void __bt_device_event_filter(GDBusConnection *connection,
                g_variant_get(parameters, "(i&s)", &result, &address);
 
                _bt_convert_addr_string_to_type(dev_address.addr, address);
-               BT_DBG("Sending Event to Framework");
                _bt_common_event_cb(BLUETOOTH_EVENT_GATT_CONNECTED,
                                result, &dev_address,
                                event_info->cb, event_info->user_data);
@@ -939,7 +934,6 @@ void __bt_device_event_filter(GDBusConnection *connection,
                g_variant_get(parameters, "(i&s)", &result, &address);
 
                _bt_convert_addr_string_to_type(dev_address.addr, address);
-               BT_DBG("Sending Event to Framework");
                _bt_common_event_cb(BLUETOOTH_EVENT_GATT_DISCONNECTED,
                                result, &dev_address,
                                event_info->cb, event_info->user_data);
@@ -1019,7 +1013,6 @@ void __bt_device_event_filter(GDBusConnection *connection,
 
                conn_info.addr_type = addr_type;
                conn_info.disc_reason = 0;
-               BT_DBG("Sending Event to Framework");
                _bt_common_event_cb(BLUETOOTH_EVENT_DEVICE_CONNECTED,
                                result, &conn_info,
                                event_info->cb, event_info->user_data);
@@ -1030,8 +1023,8 @@ void __bt_device_event_filter(GDBusConnection *connection,
                bt_connection_info_t conn_info;
                bluetooth_device_address_t dev_address = { {0} };
                int rssi;
-               BT_DBG("BT_DEVICE_DISCONNECTED");
                g_variant_get(parameters, "(i&syi)", &result, &address, &addr_type, &rssi);
+               BT_DBG("BT_DEVICE_DISCONNECTED reason(%d)", result);
 
                _bt_convert_addr_string_to_type(dev_address.addr,
                                                address);
@@ -1045,7 +1038,6 @@ void __bt_device_event_filter(GDBusConnection *connection,
                conn_info.addr_type = addr_type;
                conn_info.disc_reason = result;
                conn_info.rssi = rssi;
-               BT_DBG("Sending Event to Framework, disconnect reason [0x%x]", result);
                _bt_common_event_cb(BLUETOOTH_EVENT_DEVICE_DISCONNECTED,
                                result, &conn_info,
                                event_info->cb, event_info->user_data);
@@ -3115,7 +3107,6 @@ static void __bt_tds_event_filter(GDBusConnection *connection,
                const char *address = NULL;
                char *data;
                int data_len = 0;
-               int k;
                GVariant *var = NULL;
                bluetooth_tds_transport_data_info_t *info = NULL;
 
@@ -3124,13 +3115,6 @@ static void __bt_tds_event_filter(GDBusConnection *connection,
                data = (char *)g_variant_get_data(var);
 
                if (data) {
-                       BT_DBG("Address [%s]", address);
-                       BT_DBG("Data len [%d]", data_len);
-
-                       /* DEBUG */
-                       for (k = 0; k < data_len ; k++)
-                               BT_DBG("Data[%d] [0x%x]", k, data[k]);
-
                        if (data_len == 0) {
                                BT_ERR("No data");
                                g_variant_unref(var);
@@ -3619,10 +3603,6 @@ static void __bt_gatt_client_event_filter(GDBusConnection *connection,
                memcpy(&char_prop.svc_prop.uuid, g_variant_get_data(svc_uuid_var), 16);
                char_prop.svc_prop.instance_id = svc_inst;
 
-               /* DEBUG */
-       //      for (i = 0; i < char_prop.val_len; i++)
-       //              BT_INFO("Data[%d] = [0x%x]", i, char_prop.value[i]);
-
                _bt_gatt_client_event_cb(BLUETOOTH_EVENT_GATT_CHAR_VAL_CHANGED,
                                result, &char_prop,
                                event_info->cb, event_info->user_data);
@@ -3668,10 +3648,6 @@ static void __bt_gatt_client_event_filter(GDBusConnection *connection,
                memcpy(&char_prop.svc_prop.uuid, g_variant_get_data(svc_uuid_var), 16);
                char_prop.svc_prop.instance_id = svc_inst;
 
-               /* DEBUG */
-       //      for (i = 0; i < char_prop.val_len; i++)
-       //              BT_INFO("Data[%d] = [0x%x]", i, char_prop.value[i]);
-
                _bt_gatt_client_event_cb(BLUETOOTH_EVENT_GATT_READ_CHAR,
                                result, &char_prop,
                                event_info->cb, event_info->user_data);
@@ -3727,7 +3703,6 @@ static void __bt_gatt_client_event_filter(GDBusConnection *connection,
                int svc_uuid_len = 0;
                int char_uuid_len = 0;
                int desc_uuid_len = 0;
-               unsigned int i;
 
                memset(&desc_prop, 0x00, sizeof(bt_gatt_char_descriptor_property_t));
 
@@ -3767,10 +3742,6 @@ static void __bt_gatt_client_event_filter(GDBusConnection *connection,
                memcpy(&desc_prop.svc_prop.uuid, g_variant_get_data(svc_uuid_var), 16);
                desc_prop.svc_prop.instance_id = svc_inst;
 
-               /* DEBUG */
-               for (i = 0; i < desc_prop.val_len; i++)
-                       BT_INFO("Data[%d] = [0x%x]", i, desc_prop.value[i]);
-
                _bt_gatt_client_event_cb(BLUETOOTH_EVENT_GATT_READ_DESC,
                                result, &desc_prop,
                                event_info->cb, event_info->user_data);
@@ -3894,7 +3865,6 @@ static void __bt_gatt_server_event_filter(GDBusConnection *connection,
                BT_INFO("GATT Server event[BT_GATT_SERVER_WRITE_REQUESTED]");
                const char *address = NULL;
                GVariant *data_var = NULL;
-               int i;
                bluetooth_device_address_t dev_address = { {0} };
 
                bluetooth_gatt_server_write_requested_info_t write_info;
@@ -3933,10 +3903,6 @@ static void __bt_gatt_server_event_filter(GDBusConnection *connection,
                                dev_address.addr,
                                BLUETOOTH_ADDRESS_LENGTH);
 
-               /* DEBUG */
-               for (i = 0; i < write_info.length; i++)
-                       BT_DBG("Data[%d] = [0x%x]", i, write_info.data.data[i]);
-
                _bt_gatt_server_event_cb(BLUETOOTH_EVENT_GATT_SERVER_VALUE_CHANGED,
                                BLUETOOTH_ERROR_NONE, &write_info,
                                event_info->cb, event_info->user_data);
@@ -4124,41 +4090,34 @@ int _bt_register_event(int event_type, void *event_cb, void *user_data)
                path = BT_RFCOMM_SERVER_PATH;
                break;
        case BT_HF_AGENT_EVENT:
-               BT_DBG("BT_HF_AGENT_EVENT\n");
                event_func = __bt_hf_agent_event_filter;
                path = BT_HF_AGENT_PATH;
                interface = BT_HF_SERVICE_INTERFACE;
                break;
        case BT_A2DP_SOURCE_EVENT:
-               BT_DBG("BT_A2DP_SOURCE_EVENT");
                event_func = __bt_a2dp_source_event_filter;
                path = BT_A2DP_SOURCE_PATH;
                break;
        case BT_HID_DEVICE_EVENT:
-               BT_DBG("BT_HID_DEVICE_EVENT");
                event_func = __bt_hid_device_event_filter;
                path = BT_HID_DEVICE_PATH;
                break;
 #ifdef GATT_NO_RELAY
        case BT_GATT_BLUEZ_EVENT:
-               BT_DBG("BT_GATT_BLUEZ_EVENT");
                event_func = __bt_device_event_filter;
                interface = BT_GATT_CHARACTERISTIC_INTERFACE;
                path = NULL;
                break;
 #endif
        case BT_TDS_EVENT:
-               BT_DBG("BT_TDS_EVENT");
                event_func = __bt_tds_event_filter;
                path = BT_TDS_PATH;
                break;
        case BT_OTP_EVENT:
-               BT_DBG("BT_OTP_EVENT");
                event_func = __bt_otp_event_filter;
                path = BT_OTP_PATH;
                break;
        case BT_HDP_EVENT:
-               BT_DBG("BT_HDP_EVENT");
                event_func = __bt_hdp_event_filter;
                path = BT_HDP_DEVICE_PATH;
                break;
old mode 100755 (executable)
new mode 100644 (file)
index 749088e..52ea99e
@@ -1836,7 +1836,6 @@ static void __bt_fill_service_handle_informations(bt_services_browse_info_t *pro
                bt_gatt_handle_info_t *svcs)
 {
        int count;
-       BT_INFO("Total services found [%d]", props->count);
 
        if (props->count == 0)
                return;
@@ -1844,7 +1843,7 @@ static void __bt_fill_service_handle_informations(bt_services_browse_info_t *pro
        svcs->count = props->count;
 
        for (count = 0; count < props->count; count++) {
-               BT_INFO("UUID[%d] = [%s] instance_id [%d] Is Primary [%d]",
+               BT_DBG("[%d] %s  instance_id [%d] Is Primary [%d]",
                                count, props->uuids[count], props->inst_id[count], props->primary[count]);
                g_strlcpy(svcs->uuids[count], props->uuids[count],
                                BLUETOOTH_UUID_STRING_MAX);
@@ -1856,8 +1855,6 @@ static void __bt_fill_char_handle_informations(bt_char_browse_info_t *props, bt_
 {
        int count;
        char uuid_string[BLUETOOTH_UUID_STRING_MAX];
-       BT_INFO("Total number of characteristics found [%d]",
-                       props->count);
 
        service->char_handle.count = props->count;
 
@@ -1868,7 +1865,7 @@ static void __bt_fill_char_handle_informations(bt_char_browse_info_t *props, bt_
 
        /* Now fill all the char handles [UUID and Instance ID's]*/
        for (count = 0; count < props->count; count++) {
-               BT_INFO("UUID[%d] = [%s] instance_id [%d] properties [%d]",
+               BT_INFO("[%d] %s  instance_id [%d] properties [%d]",
                                count, props->uuids[count], props->inst_id[count], props->props[count]);
 
                g_strlcpy(service->char_handle.uuids[count],
@@ -1884,7 +1881,6 @@ static void __bt_fill_desc_handle_informations(bt_descriptor_browse_info_t *prop
 {
        int count;
        char uuid_string[BLUETOOTH_UUID_STRING_MAX];
-       BT_INFO("Total descriptor count found [%d]", props->count);
 
        charc->char_desc_handle.count = props->count;
 
@@ -1894,7 +1890,7 @@ static void __bt_fill_desc_handle_informations(bt_descriptor_browse_info_t *prop
 
        /* Now fill all the descriptor handles [UUID and Instance ID's]*/
        for (count = 0; count < props->count; count++) {
-               BT_INFO("UUID[%d] = [%s] instance_id [%d]",
+               BT_INFO("[%d] %s  instance_id [%d]",
                                count, props->uuids[count], props->inst_id[count]);
 
                g_strlcpy(charc->char_desc_handle.uuids[count],
@@ -1904,7 +1900,7 @@ static void __bt_fill_desc_handle_informations(bt_descriptor_browse_info_t *prop
                charc->char_desc_handle.inst_id[count] = props->inst_id[count];
        }
        charc->permission = props->char_props_map;
-       BT_INFO("Characteritic property map val [%d]", charc->permission);
+       __convert_permission_flag_to_str(charc->permission);
 }
 
 
@@ -1921,8 +1917,6 @@ BT_EXPORT_API int bluetooth_gatt_client_init(
        BT_CHECK_PARAMETER(callback_ptr, return);
        BT_CHECK_ENABLED(return);
 
-       BT_INFO("+");
-
        BT_INIT_PARAMS();
        BT_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
 
@@ -1976,8 +1970,6 @@ BT_EXPORT_API int bluetooth_gatt_client_get_primary_services(
        int result = BLUETOOTH_ERROR_NONE;
        bt_services_browse_info_t service_props;
 
-       BT_DBG("+");
-
        BT_CHECK_PARAMETER(address, return);
        BT_CHECK_PARAMETER(prim_svc, return);
        BT_CHECK_ENABLED(return);
@@ -2003,7 +1995,6 @@ BT_EXPORT_API int bluetooth_gatt_client_get_primary_services(
 
 done:
        BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
-       BT_DBG("result = %d", result);
        return result;
 }
 
@@ -2015,7 +2006,6 @@ BT_EXPORT_API int bluetooth_gatt_client_get_service_property(
        int result = BLUETOOTH_ERROR_NONE;
        bluetooth_gatt_client_svc_prop_info_t svc_prop;
        bt_char_browse_info_t char_handles_info;
-       BT_INFO("Remote Address [%s]", address);
 
        BT_CHECK_PARAMETER(address, return);
        BT_CHECK_PARAMETER(service_handle, return);
@@ -2052,7 +2042,6 @@ BT_EXPORT_API int bluetooth_gatt_client_get_service_property(
 
 done:
        BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
-       BT_INFO("result = %d", result);
        return result;
 }
 
@@ -2065,7 +2054,6 @@ BT_EXPORT_API int bluetooth_gatt_client_get_characteristics_property(
        int result = BLUETOOTH_ERROR_NONE;
        bt_descriptor_browse_info_t desc_handles_info;
        bluetooth_gatt_client_char_prop_info_t char_prop;
-       BT_INFO("Get Properties of characteristics from remote device [%s]", address);
 
        BT_CHECK_PARAMETER(address, return);
        BT_CHECK_PARAMETER(service_handle, return);
@@ -2093,7 +2081,6 @@ BT_EXPORT_API int bluetooth_gatt_client_get_characteristics_property(
                        BT_GATT_GET_CHARACTERISTIC_PROPERTIES,
                        in_param1, in_param2, in_param3, in_param4, &out_param);
 
-       BT_INFO("result = [%d]", result);
        if (BLUETOOTH_ERROR_NONE != result)
                goto done;
 
@@ -2108,7 +2095,6 @@ BT_EXPORT_API int bluetooth_gatt_client_get_characteristics_property(
 
 done:
        BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
-       BT_INFO("result = %d", result);
        return result;
        /* Call to bt-service (sync) and send address, service_handle & char_handle infos */
 
@@ -2128,7 +2114,6 @@ BT_EXPORT_API int bluetooth_gatt_client_get_char_descriptor_property(
                bt_gatt_char_descriptor_property_t *desc_prop)
 {
        char uuid_string[BLUETOOTH_UUID_STRING_MAX];
-       BT_DBG("Remote Address [%s]", address);
 
        BT_CHECK_PARAMETER(address, return);
        BT_CHECK_PARAMETER(service_handle, return);
@@ -2315,7 +2300,6 @@ BT_EXPORT_API int bluetooth_gatt_client_watch_characteristics(
        BT_INIT_PARAMS();
        BT_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
 
-       BT_INFO("Address [%s]", address);
        memset(&param, 0x00, sizeof(bluetooth_gatt_client_char_prop_info_t));
 
        memcpy(&param.svc.uuid, service_handle->uuid, 16);
@@ -2641,7 +2625,6 @@ BT_EXPORT_API int bluetooth_gatt_client_write_characteristic_value_by_type(
                                }
 
                                fd_list_array = g_unix_fd_list_steal_fds(out_fd_list, &len);
-                               BT_INFO("Num fds in fd_list is : %d, fd_list[0]: %d", len, fd_list_array[0]);
                                fd = fd_list_array[0];
 
                                g_free(fd_list_array);
@@ -2650,7 +2633,6 @@ BT_EXPORT_API int bluetooth_gatt_client_write_characteristic_value_by_type(
                        BT_INFO("Acquired characteristic Write FD %d, mtu %d", fd, mtu);
 
                        if (fd > -1) {
-
                                bluetooth_gatt_client_create_write_io_channel(fd, char_handle->uuid, service_handle->instance_id, mtu);
 
                                result =  bluetooth_gatt_client_write_characteristics_value_to_fd(fd, data->data, data->length, mtu, NULL);
@@ -2734,20 +2716,19 @@ BT_EXPORT_API int bluetooth_gatt_client_set_service_change_watcher(
 {
        GSList *l;
        bluetooth_device_address_t *addr = NULL;
+       char device_address[BT_ADDRESS_STRING_SIZE] = { 0 };
        char secure_address[BT_ADDRESS_STRING_SIZE] = { 0 };
        int result = BLUETOOTH_ERROR_NONE;
 
-       BT_INFO("+");
-
        BT_INIT_PARAMS();
        BT_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
 
        g_array_append_vals(in_param1, address, sizeof(bluetooth_device_address_t));
        g_array_append_vals(in_param2, &enable, sizeof(gboolean));
 
-
-       _bt_convert_addr_string_to_secure_string(secure_address, (const char *)address->addr);
-       BT_INFO("Set watcher for %s with %d", secure_address, enable);
+       _bt_convert_addr_type_to_string(device_address, (unsigned char *)address->addr);
+       _bt_convert_addr_string_to_secure_string(secure_address, device_address);
+       BT_INFO("%s watcher for [%s]", enable ? "Set":"Unset", secure_address);
 
        if (enable == TRUE) {
                if (_bluetooth_gatt_check_service_change_watcher_address(address)
@@ -2832,7 +2813,7 @@ BT_EXPORT_API int bluetooth_gatt_client_deinit(
                BT_INFO("Total num of GATT client instances [%d]", *count);
 
                if (*count == 1) {
-                       BT_INFO("Currently only one GATT client instance, so remove it and unregister GATT client events");
+                       BT_DBG("Currently only one GATT client instance, so remove it and unregister GATT client events");
                        _bt_unregister_event(BT_GATT_CLIENT_EVENT);
                        _bt_set_user_data(BT_GATT_CLIENT, NULL, NULL);
                } else
index 99ad52a..3a16891 100644 (file)
@@ -1341,8 +1341,6 @@ BT_EXPORT_API int bluetooth_rfcomm_write(int fd, const char *buf, int length)
                return BLUETOOTH_ERROR_INVALID_PARAM;
        }
 
-       BT_DBG("FD : %d", fd);
-
        retv_if(length <= 0, BLUETOOTH_ERROR_INVALID_PARAM);
 
        switch (privilege_token) {
index 8ae305d..f0e0471 100644 (file)
@@ -2269,7 +2269,6 @@ static void __bt_telephony_adapter_filter(GDBusConnection *connection,
                        return;
                }
 
-               BT_DBG("Adapter Path = [%s]", path);
                if (strcasecmp(path, DEFAULT_ADAPTER_OBJECT_PATH) == 0) {
                        if (__bt_telephony_get_src_addr(optional_param))
                                BT_ERR("Fail to get the local adapter address");
index 3dcd9a8..975a5d2 100644 (file)
@@ -31,6 +31,8 @@
 #include "bt-core-dbus-handler.h"
 #include "bt-core-noti-handler.h"
 
+#include "bt-internal-types.h"
+
 #define BT_CORE_IDLE_TERM_TIME 200 /* 200ms */
 #define BT_CORE_CHECK_ADAPTER_OBJECT_PATH_MAX 50
 
@@ -224,17 +226,15 @@ static int __bt_stack_up(void)
        }
 
        /* activate bluetooth-share */
-       ret = __bt_call_systemact_service(BT_SYSTEMACT_BLUETOOTH_SHARE_START);
-       if (ret < 0) {
-               BT_ERR("Failed to call systemact service");
-               return -1;
+       if (!TIZEN_PROFILE_WEARABLE) {
+               ret = __bt_call_systemact_service(BT_SYSTEMACT_BLUETOOTH_SHARE_START);
+               if (ret < 0) {
+                       BT_ERR("Failed to call systemact service");
+                       return -1;
+               }
        }
 
-
        return 0;
-
-
-
 }
 
 int _bt_enable_adapter(void)
index 8c71c01..1bed8e3 100644 (file)
@@ -58,11 +58,9 @@ handle_stack_msg _bt_get_adapter_event_cb(void)
 
 GDBusConnection *__bt_hal_get_system_gconn(void)
 {
-       DBG("+");
        if (system_conn == NULL)
                system_conn = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, NULL);
 
-       DBG("-");
        return system_conn;
 }
 
@@ -70,7 +68,6 @@ GDBusProxy *_bt_init_core_proxy(void)
 {      GDBusProxy *proxy;
        GDBusConnection *conn;
 
-       DBG("+");
        conn = __bt_hal_get_system_gconn();
        if (!conn)
                return NULL;
@@ -87,7 +84,6 @@ GDBusProxy *_bt_init_core_proxy(void)
 
        core_proxy = proxy;
 
-       DBG("-");
        return proxy;
 }
 
@@ -210,7 +206,7 @@ int _bt_hal_dbus_enable_adapter(void)
        proxy = __bt_get_core_proxy();
 
        if (!proxy) {
-               DBG("_bt_hal_dbus_enable_adapter: Core proxy get failed!!!");
+               ERR("_bt_hal_dbus_enable_adapter: Core proxy get failed!!!");
                return BT_STATUS_FAIL;
        }
 
@@ -221,7 +217,7 @@ int _bt_hal_dbus_enable_adapter(void)
                        G_DBUS_CALL_FLAGS_NONE, BT_ENABLE_TIMEOUT,
                        NULL, &error);
        if (error) {
-               DBG("EnableAdapter failed: %s", error->message);
+               ERR("EnableAdapter failed: %s", error->message);
                g_clear_error(&error);
                error = NULL;
                _bt_hal_set_adapter_request_state(FALSE);
@@ -235,7 +231,7 @@ int _bt_hal_dbus_enable_adapter(void)
                                &error);
 
                if (error != NULL) {
-                       DBG("Bt core call failed(Error: %s)", error->message);
+                       ERR("Bt core call failed(Error: %s)", error->message);
                        g_clear_error(&error);
                }
                g_variant_unref(result);
@@ -245,7 +241,6 @@ int _bt_hal_dbus_enable_adapter(void)
                return BT_STATUS_FAIL;
        }
 
-       DBG("-");
        g_variant_unref(result);
        return BT_STATUS_SUCCESS;
 }
@@ -258,9 +253,8 @@ int _bt_hal_dbus_disable_adapter(void)
 
        DBG("+");
        proxy = __bt_get_core_proxy();
-
        if (!proxy) {
-               DBG("_bt_hal_dbus_enable_adapter: Core proxy get failed!!!");
+               ERR("_bt_hal_dbus_enable_adapter: Core proxy get failed!!!");
                return BT_STATUS_FAIL;
        }
 
@@ -269,7 +263,7 @@ int _bt_hal_dbus_disable_adapter(void)
                        G_DBUS_CALL_FLAGS_NONE, -1,
                        NULL, &error);
        if (error) {
-               DBG("DisableAdapter failed: %s", error->message);
+               ERR("DisableAdapter failed: %s", error->message);
                g_clear_error(&error);
                error = NULL;
                g_variant_unref(result);
@@ -279,7 +273,6 @@ int _bt_hal_dbus_disable_adapter(void)
                return BT_STATUS_FAIL;
        }
 
-       DBG("-");
        g_variant_unref(result);
        return BT_STATUS_SUCCESS;
 }
@@ -292,9 +285,8 @@ int _bt_hal_dbus_recover_adapter(void)
 
        DBG("+");
        proxy = __bt_get_core_proxy();
-
        if (!proxy) {
-               DBG("_bt_hal_dbus_recover_adapter: Core proxy get failed!!!");
+               ERR("_bt_hal_dbus_recover_adapter: Core proxy get failed!!!");
                return BT_STATUS_FAIL;
        }
 
@@ -303,13 +295,12 @@ int _bt_hal_dbus_recover_adapter(void)
                        G_DBUS_CALL_FLAGS_NONE, -1,
                        NULL, &error);
        if (error) {
-               DBG("RecoverAdapter failed: %s", error->message);
+               ERR("RecoverAdapter failed: %s", error->message);
                g_clear_error(&error);
                error = NULL;
                return BT_STATUS_FAIL;
        }
 
-       DBG("-");
        g_variant_unref(result);
        return BT_STATUS_SUCCESS;
 }
@@ -816,7 +807,7 @@ int _bt_hal_get_adapter_powered_state(uint8_t *state)
        adapter_path = _bt_hal_get_adapter_path();
 
        if (adapter_path == NULL) {
-               INFO("Adapter is not powered");
+               INFO("adapter_path is NULL");
                g_free(adapter_path);
                *state = 0;
                return ret;
@@ -1247,11 +1238,10 @@ int _bt_hal_dbus_get_local_name(void)
        GVariant *result;
        GVariant *temp;
        GError *error = NULL;
-       DBG("+");
 
        proxy = _bt_hal_get_adapter_properties_proxy();
        if (!proxy) {
-               DBG("_bt_hal_dbus_get_local_name: Adapter Properties proxy get failed!!!");
+               DBG("Adapter Properties proxy get failed!!!");
                return BT_STATUS_FAIL;
        }
 
@@ -1286,7 +1276,6 @@ int _bt_hal_dbus_get_local_name(void)
         */
        g_idle_add(__bt_adapter_local_name_cb, (gpointer) name);
 
-       DBG("-");
        return BT_STATUS_SUCCESS;
 }
 
@@ -1343,8 +1332,6 @@ int _bt_hal_dbus_get_local_address(void)
        GVariant *result;
        GVariant *temp;
 
-       DBG("+");
-
        proxy = _bt_hal_get_adapter_properties_proxy();
        if (!proxy) {
                DBG("_bt_hal_dbus_get_local_address: Adapter Properties proxy get failed!!!");
@@ -1386,7 +1373,6 @@ int _bt_hal_dbus_get_local_address(void)
         */
        g_idle_add(__bt_adapter_local_address_cb, (gpointer) address);
 
-       DBG("-");
        return BT_STATUS_SUCCESS;
 }
 
@@ -1472,12 +1458,9 @@ int _bt_hal_dbus_get_adapter_supported_uuids(void)
        GError *error = NULL;
        GVariant *result;
 
-       DBG("+");
-
        proxy = _bt_hal_get_adapter_properties_proxy();
-
        if (!proxy) {
-               DBG("_bt_hal_dbus_get_local_name: Adapter Properties proxy get failed!!!");
+               DBG("Adapter Properties proxy get failed!!!");
                return BT_STATUS_FAIL;
        }
 
@@ -1508,7 +1491,6 @@ int _bt_hal_dbus_get_adapter_supported_uuids(void)
         */
        g_idle_add(__bt_adapter_service_uuids_cb, (gpointer)result);
 
-       DBG("-");
        return BT_STATUS_SUCCESS;
 }
 
@@ -1615,8 +1597,6 @@ int _bt_hal_dbus_get_bonded_devices(void)
        GDBusProxy *manager_proxy;
        GVariant *result = NULL;
 
-       DBG("+");
-
        manager_proxy = _bt_hal_get_manager_proxy();
        if (manager_proxy == NULL)
                return  BT_STATUS_FAIL;
@@ -1638,15 +1618,12 @@ int _bt_hal_dbus_get_bonded_devices(void)
         */
        g_idle_add(__bt_adapter_bonded_devices_cb, (gpointer) result);
 
-       DBG("-");
        return BT_STATUS_SUCCESS;
 }
 
 int _bt_hal_dbus_get_adapter_property(bt_property_type_t property_type)
 {
-       DBG("+");
-
-       INFO("property_type: %d", property_type);
+       DBG("property_type: %d", property_type);
 
        switch (property_type) {
        case BT_PROPERTY_BDADDR:
@@ -1668,8 +1645,6 @@ int _bt_hal_dbus_get_adapter_property(bt_property_type_t property_type)
        default:
                return BT_STATUS_UNSUPPORTED;
        }
-
-       DBG("-");
 }
 
 static int __bt_hal_dbus_set_local_name(void *data)
@@ -1679,7 +1654,6 @@ static int __bt_hal_dbus_set_local_name(void *data)
        GVariant *result;
        GError *error = NULL;
 
-       DBG("+");
        DBG("Local Name: [%s]", name);
        proxy = _bt_hal_get_adapter_properties_proxy();
        if (!proxy) {
@@ -1705,7 +1679,6 @@ static int __bt_hal_dbus_set_local_name(void *data)
        }
        g_variant_unref(result);
 
-       DBG("-");
        return BT_STATUS_SUCCESS;
 }
 
@@ -1718,7 +1691,6 @@ static int __bt_hal_dbus_set_scan_mode(void *data)
        gboolean pg_scan;
        gboolean inq_scan;
 
-       DBG("+");
        DBG("Scan mode: [%d]", *mode);
        proxy = _bt_hal_get_adapter_properties_proxy();
        if (!proxy) {
@@ -1780,7 +1752,6 @@ static int __bt_hal_dbus_set_scan_mode(void *data)
        }
        g_variant_unref(result);
 
-       DBG("-");
        return BT_STATUS_SUCCESS;
 }
 
@@ -1791,9 +1762,6 @@ static int __bt_hal_dbus_set_discovery_timeout(void *data)
        GVariant *result;
        GError *error = NULL;
 
-
-       DBG("+");
-
        DBG("Discovery Timeout: [%d]", *timeout);
        proxy = _bt_hal_get_adapter_properties_proxy();
        if (!proxy) {
@@ -1819,7 +1787,6 @@ static int __bt_hal_dbus_set_discovery_timeout(void *data)
        }
        g_variant_unref(result);
 
-       DBG("-");
        return BT_STATUS_SUCCESS;
 }
 
@@ -1828,8 +1795,6 @@ int _bt_hal_dbus_set_adapter_property(const bt_property_t *property)
 {
        int result;
 
-       DBG("");
-
        if (property == NULL || property->val == NULL) {
                ERR("Invalid parameters received");
                return BT_STATUS_FAIL;
@@ -1849,6 +1814,5 @@ int _bt_hal_dbus_set_adapter_property(const bt_property_t *property)
                result = BT_STATUS_UNSUPPORTED;
        }
 
-       DBG("Result= [%d]", result);
        return result;
 }
index 0fb64e9..fb8ca81 100644 (file)
@@ -131,7 +131,6 @@ void _bt_hal_set_filter_policy_param(int filter_policy)
 
 int _bt_hal_set_le_static_random_address(uint8_t enable)
 {
-       DBG("+");
        GError *error = NULL;
        GVariant *ret;
        GDBusProxy *proxy;
@@ -403,7 +402,6 @@ gboolean _bt_is_advertising(void)
 int _bt_set_advertising(const char *sender, int adv_handle,
                        gboolean enable, gboolean use_reserved_slot)
 {
-       DBG("+");
        return BT_STATUS_UNSUPPORTED;
 }
 
@@ -434,7 +432,6 @@ static int __bt_hal_uuid_type(uint8_t* p_uuid)
 
 static void __bt_hal_parse_uuid(int len, char *src, uint8_t *dest, int *length, int is_solicit)
 {
-       DBG("+");
        int prev_byte_len = 0;
        /* dest[index] will contain the length followed by AD Type
           Move length only when different byte_len is found Ex) 2->4, 2->16, 4->16 etc */
@@ -517,7 +514,6 @@ static void __bt_hal_parse_uuid(int len, char *src, uint8_t *dest, int *length,
                src += 16;
                len -= 16;
        }
-       DBG("-");
 }
 
 static gboolean __bt_hal_is_factory_test_mode(void)
@@ -540,7 +536,6 @@ static gboolean __bt_hal_is_factory_test_mode(void)
 static gboolean __bt_hal_adv_event_cb(gpointer param)
 {
        bt_hal_adv_event_data_t *event = (bt_hal_adv_event_data_t*)param;
-       DBG("+");
 
        if (!event)
                return FALSE;
@@ -609,13 +604,11 @@ static gboolean __bt_hal_adv_event_cb(gpointer param)
 
        g_free(event);
 
-       DBG("-");
        return FALSE;
 }
 
 int _bt_hal_enable_advertising(int server_if, int adv_slot_id, bool enable, bool is_multi_adv)
 {
-       DBG("+");
        GError *error = NULL;
        GVariant *ret;
        GDBusProxy *proxy;
@@ -664,7 +657,6 @@ int _bt_hal_set_advertising_params(int server_if, int min_interval,
                int max_interval, int adv_type,
                int chnl_map, int tx_power, int timeout_s)
 {
-       DBG("+");
        GDBusProxy *proxy;
        GVariant *ret;
        GError *error = NULL;
@@ -730,7 +722,6 @@ int _bt_hal_set_advertising_params(int server_if, int min_interval,
 /* Takes care of both Scan Response and Advertising data */
 int _bt_hal_set_advertising_data(btgatt_adv_param_setup_t adv_param_setup)
 {
-       DBG("+");
        uint8_t adv_data[31];
        int index = 0;
        GDBusProxy *proxy;
@@ -903,7 +894,6 @@ int _bt_hal_adapter_le_start_scan(void)
 
        g_variant_unref(ret);
 
-       DBG("-");
        return BT_STATUS_SUCCESS;
 }
 
@@ -913,7 +903,7 @@ int _bt_hal_adapter_le_stop_scan(void)
        GError *error = NULL;
        GVariant *ret;
 
-       DBG("+");
+       DBG("");
 
        /* TODO: Check adapter and LE adapter status */
        proxy = _bt_hal_get_adapter_proxy();
@@ -944,7 +934,6 @@ int _bt_hal_adapter_le_stop_scan(void)
 
        bt_hal_release_pending_adv_ind_list();
 
-       DBG("-");
        return BT_STATUS_SUCCESS;
 }
 
@@ -1008,7 +997,6 @@ int _bt_hal_adapter_le_set_scan_parameters(
 
        g_variant_unref(ret);
 
-       DBG("-");
        return BT_STATUS_SUCCESS;
 }
 
index 7c7dd44..1cba249 100644 (file)
@@ -223,7 +223,6 @@ static int cancel_discovery(void)
 
 static int create_bond(const bt_bdaddr_t *bd_addr, int transport)
 {
-       DBG("+");
        return _bt_hal_device_create_bond(bd_addr, transport);
 }
 
@@ -234,7 +233,6 @@ static int cancel_bond(const bt_bdaddr_t *bd_addr)
 
 static int remove_bond(const bt_bdaddr_t *bd_addr)
 {
-       DBG("+");
        return _bt_hal_device_remove_bond(bd_addr);
 }
 
@@ -346,13 +344,11 @@ static int read_energy_info(void)
 static int authorize_response(const bt_bdaddr_t *bd_addr, bt_service_id_t service_id,
                uint8_t authorize, uint8_t save_settings)
 {
-       DBG("+");
        return _bt_hal_device_authorize_response(bd_addr, service_id, authorize, save_settings);
 }
 
 int set_authorization(bt_bdaddr_t *bd_addr, uint8_t auth)
 {
-       DBG("+");
        return _bt_hal_device_set_trust(bd_addr, auth);
 }
 
@@ -424,7 +420,6 @@ static int set_hal_le_request_state(int enable)
 
 static int dev_disconnect(const bt_bdaddr_t *bd_addr)
 {
-       DBG("+");
        return _bt_hal_device_disconnect(bd_addr);
 }
 #endif
@@ -609,10 +604,7 @@ static void __bt_device_props_to_hal(bt_property_t *send_props,
        void *buf = prop;
        uint8_t i;
 
-       DBG("+");
-
        for (i = 0; i < num_props; i++) {
-
                if (sizeof(*prop) + prop->len > len) {
                        ERR("invalid device properties (%zu > %u), cant process further properties!!!",
                                        sizeof(*prop) + prop->len, len);
@@ -621,8 +613,6 @@ static void __bt_device_props_to_hal(bt_property_t *send_props,
 
                send_props[i].type = prop->type;
 
-               DBG("HAL prop Type [%d]", prop->type);
-
                switch (prop->type) {
                case HAL_PROP_DEVICE_TYPE:
                {
@@ -672,7 +662,6 @@ static void __bt_device_props_to_hal(bt_property_t *send_props,
        }
 
        if (!len) {
-               DBG("-");
                return;
        }
 
@@ -683,7 +672,6 @@ static void __bt_hal_handle_adapter_property_changed(void *buf, uint16_t len)
 {
        struct hal_ev_adapter_props_changed *ev = (struct hal_ev_adapter_props_changed *)buf;
        bt_property_t props[ev->num_props];
-       DBG("+");
 
        if (!bt_hal_cbacks->adapter_properties_cb)
                return;
@@ -699,8 +687,6 @@ static void __bt_hal_handle_adapter_discovery_state_changed(void *buf, uint16_t
 {
        struct hal_ev_discovery_state_changed *ev = (struct hal_ev_discovery_state_changed *)buf;
 
-       DBG("+");
-
        if (bt_hal_cbacks->discovery_state_changed_cb)
                bt_hal_cbacks->discovery_state_changed_cb(ev->state);
 }
@@ -709,7 +695,6 @@ static void __bt_hal_handle_device_found_event(void *buf, uint16_t len)
 {
        struct hal_ev_device_found *ev =  (struct hal_ev_device_found *) buf;
        bt_property_t props[ev->num_props];
-       DBG("+");
 
        if (!bt_hal_cbacks->device_found_cb)
                return;
@@ -726,8 +711,6 @@ static void __bt_hal_handle_remote_device_properties_event(void *buf, uint16_t l
        bt_bdaddr_t bd_addr;
        bt_property_t props[ev->num_props];
 
-       DBG("+");
-
        if (!bt_hal_cbacks->remote_device_properties_cb)
                return;
 
@@ -736,7 +719,6 @@ static void __bt_hal_handle_remote_device_properties_event(void *buf, uint16_t l
        memcpy(bd_addr.address, ev->bdaddr, 6);
        bt_hal_cbacks->remote_device_properties_cb(
                        ev->status, &bd_addr, ev->num_props, props);
-       DBG("-");
 }
 
 static void __bt_hal_handle_bond_state_changed_event(void *buf, uint16_t len)
@@ -744,16 +726,8 @@ static void __bt_hal_handle_bond_state_changed_event(void *buf, uint16_t len)
 
        struct hal_ev_bond_state_changed *ev = (struct hal_ev_bond_state_changed *)buf;
        bt_bdaddr_t bd_addr;
-       DBG("+");
 
        memcpy(bd_addr.address, ev->bdaddr, 6);
-       /* BD address*/
-       DBG("[0x%x]", bd_addr.address[0]);
-       DBG("[0x%x]", bd_addr.address[1]);
-       DBG("[0x%x]", bd_addr.address[2]);
-       DBG("[0x%x]", bd_addr.address[3]);
-       DBG("[0x%x]", bd_addr.address[4]);
-       DBG("[0x%x]", bd_addr.address[5]);
 
        DBG("Bonding  State changed Status [0x%x]", ev->status);
        DBG("Bonding  State [0x%x]", ev->state);
@@ -764,26 +738,15 @@ static void __bt_hal_handle_bond_state_changed_event(void *buf, uint16_t len)
        }
 
        bt_hal_cbacks->bond_state_changed_cb(ev->status, &bd_addr, ev->state);
-       DBG("-");
 }
 
 static void __bt_hal_handle_device_acl_state_changed_event(void *buf, uint16_t len)
 {
        struct hal_ev_acl_state_changed *ev = (struct hal_ev_acl_state_changed*)buf;
        bt_bdaddr_t bd_addr;
-       DBG("+");
 
        memcpy(bd_addr.address, ev->bdaddr, 6);
-       /* BD address*/
-       DBG("[0x%x]", bd_addr.address[0]);
-       DBG("[0x%x]", bd_addr.address[1]);
-       DBG("[0x%x]", bd_addr.address[2]);
-       DBG("[0x%x]", bd_addr.address[3]);
-       DBG("[0x%x]", bd_addr.address[4]);
-       DBG("[0x%x]", bd_addr.address[5]);
-
-       DBG("ACL Status [0x%x]", ev->status);
-       DBG("ACL State  [0x%x]", ev->state);
+       INFO("ACL status[0x%x], state[0x%x]: XX:XX:XX:XX:XX:%02X", ev->status, ev->state, bd_addr.address[5]);
 
        if (!bt_hal_cbacks->acl_state_changed_cb) {
                ERR("HAL User acl_state_changed_cb is not set!!");
@@ -791,14 +754,12 @@ static void __bt_hal_handle_device_acl_state_changed_event(void *buf, uint16_t l
        }
 
        bt_hal_cbacks->acl_state_changed_cb(ev->status, &bd_addr, ev->state);
-       DBG("-");
 }
 
 static void __bt_hal_handle_device_le_conn_state_changed_event(void *buf, uint16_t len)
 {
        struct hal_ev_acl_state_changed *ev = (struct hal_ev_acl_state_changed*)buf;
        bt_bdaddr_t bd_addr;
-       DBG("+");
 
        memcpy(bd_addr.address, ev->bdaddr, 6);
        /* BD address */
@@ -816,7 +777,6 @@ static void __bt_hal_handle_device_le_conn_state_changed_event(void *buf, uint16
 
        bt_hal_cbacks->le_conn_state_changed_cb(ev->status, &bd_addr, ev->state);
 #endif
-       DBG("-");
 }
 
 static void __bt_hal_handle_authorize_request_event(void *buf, uint16_t len)
@@ -824,8 +784,6 @@ static void __bt_hal_handle_authorize_request_event(void *buf, uint16_t len)
        struct hal_ev_authorize_request *ev = (struct hal_ev_authorize_request *)buf;
        bt_bdaddr_t bd_addr;
 
-       DBG("+");
-
        memcpy(bd_addr.address, ev->bdaddr, 6);
 
        /* BD address*/
@@ -844,7 +802,6 @@ static void __bt_hal_handle_authorize_request_event(void *buf, uint16_t len)
        }
 
        bt_hal_cbacks->authorize_request_cb(&bd_addr, ev->service_id);
-       DBG("-");
 }
 
 #ifdef TIZEN_BT_HAL
@@ -857,8 +814,6 @@ static void __bt_hal_handle_socket_authorize_request_event(void *buf, uint16_t l
        uint8_t path[249] = {0, };
        uint32_t fd;
 
-       DBG("+");
-
        memcpy(bd_addr.address, ev->bdaddr, 6);
        memcpy(uuid.uu, ev->uuid, 16);
        memcpy(name, ev->name, sizeof(name) - 1);
@@ -871,7 +826,6 @@ static void __bt_hal_handle_socket_authorize_request_event(void *buf, uint16_t l
        }
 
        bt_hal_cbacks->socket_authorize_request_cb(&bd_addr, &uuid, name, path, fd);
-       DBG("-");
 }
 #endif
 
@@ -880,7 +834,6 @@ static void __bt_hal_handle_ssp_request_event(void *buf, uint16_t len)
        struct hal_ev_ssp_request *ev = (struct hal_ev_ssp_request *)buf;
        bt_bdaddr_t bd_addr;
        bt_bdname_t bd_name;
-       DBG("+");
 
        memcpy(bd_addr.address, ev->bdaddr, 6);
        memcpy(bd_name.name, ev->name, 248);
@@ -905,7 +858,6 @@ static void __bt_hal_handle_ssp_request_event(void *buf, uint16_t len)
        bt_hal_cbacks->ssp_request_cb(&bd_addr, &bd_name,
                        ev->class_of_dev,
                        ev->pairing_variant, ev->passkey);
-       DBG("-");
 }
 
 static void __bt_hal_handle_pin_request_event(void *buf, uint16_t len)
@@ -913,7 +865,6 @@ static void __bt_hal_handle_pin_request_event(void *buf, uint16_t len)
        struct hal_ev_pin_request *ev = (struct hal_ev_pin_request *)buf;
        bt_bdaddr_t bd_addr;
        bt_bdname_t bd_name;
-       DBG("+");
 
        memcpy(bd_addr.address, ev->bdaddr, 6);
        memcpy(bd_name.name, ev->name, 248);
@@ -935,14 +886,12 @@ static void __bt_hal_handle_pin_request_event(void *buf, uint16_t len)
 
        bt_hal_cbacks->pin_request_cb(&bd_addr, &bd_name,
                        ev->class_of_dev);
-       DBG("-");
 }
 
 static void __bt_hal_handle_device_trust_state_changed_event(void *buf, uint16_t len)
 {
        struct hal_ev_device_trust_state_changed *ev = (struct hal_ev_device_trust_state_changed*)buf;
        bt_bdaddr_t bd_addr;
-       DBG("+");
 
        memcpy(bd_addr.address, ev->bdaddr, 6);
        /* BD address*/
@@ -961,7 +910,6 @@ static void __bt_hal_handle_device_trust_state_changed_event(void *buf, uint16_t
        }
 
        bt_hal_cbacks->device_trust_state_changed_cb(&bd_addr, ev->trust);
-       DBG("-");
 }
 
 static void __bt_hal_handle_device_trusted_profiles_changed_event(void *buf, uint16_t len)
@@ -969,7 +917,6 @@ static void __bt_hal_handle_device_trusted_profiles_changed_event(void *buf, uin
        struct hal_ev_device_trusted_profiles_changed *ev = buf;
        bt_bdaddr_t bd_addr;
 
-       DBG("+");
 #ifdef TIZEN_BT_HAL
        memcpy(bd_addr.address, ev->bdaddr, 6);
        DBG("[0x%02X:%02X:%02X:%02X:%02X:%02X]",
@@ -984,7 +931,6 @@ static void __bt_hal_handle_device_trusted_profiles_changed_event(void *buf, uin
 
        bt_hal_cbacks->device_trusted_profiles_changed_cb(&bd_addr, ev->trust_val);
 #endif
-       DBG("-");
 }
 
 static void __bt_handle_rssi_monitor_state_changed(void *buf, uint16_t len)
@@ -992,7 +938,6 @@ static void __bt_handle_rssi_monitor_state_changed(void *buf, uint16_t len)
        struct hal_ev_rssi_monitor_state_changed *ev = buf;
        bt_bdaddr_t bd_addr;
 
-       DBG("+");
 #ifdef TIZEN_BT_HAL
        memcpy(bd_addr.address, ev->bdaddr, 6);
        DBG("[0x%02X:%02X:%02X:%02X:%02X:%02X]",
@@ -1004,7 +949,6 @@ static void __bt_handle_rssi_monitor_state_changed(void *buf, uint16_t len)
                bt_hal_cbacks->rssi_monitor_state_changed_cb(
                                &bd_addr, ev->link_type, ev->state);
 #endif
-       DBG("-");
 }
 
 static void __bt_handle_rssi_alert_recieved(void *buf, uint16_t len)
@@ -1012,7 +956,6 @@ static void __bt_handle_rssi_alert_recieved(void *buf, uint16_t len)
        struct hal_ev_rssi_alert_recieved *ev = buf;
        bt_bdaddr_t bd_addr;
 
-       DBG("+");
 #ifdef TIZEN_BT_HAL
        memcpy(bd_addr.address, ev->bdaddr, 6);
        DBG("[0x%02X:%02X:%02X:%02X:%02X:%02X]",
@@ -1024,7 +967,6 @@ static void __bt_handle_rssi_alert_recieved(void *buf, uint16_t len)
                bt_hal_cbacks->rssi_alert_cb(
                                &bd_addr, ev->link_type, ev->alert_type, ev->rssi);
 #endif
-       DBG("-");
 }
 
 static void __bt_handle_raw_rssi_recieved(void *buf, uint16_t len)
@@ -1032,7 +974,6 @@ static void __bt_handle_raw_rssi_recieved(void *buf, uint16_t len)
        struct hal_ev_raw_rssi_recieved *ev = buf;
        bt_bdaddr_t bd_addr;
 
-       DBG("+");
 #ifdef TIZEN_BT_HAL
        memcpy(bd_addr.address, ev->bdaddr, 6);
        DBG("[0x%02X:%02X:%02X:%02X:%02X:%02X]",
@@ -1044,25 +985,21 @@ static void __bt_handle_raw_rssi_recieved(void *buf, uint16_t len)
                bt_hal_cbacks->raw_rssi_received_cb(
                                &bd_addr, ev->link_type, ev->rssi);
 #endif
-       DBG("-");
 }
 
 static void __bt_handle_dbfw_plus_info_recieved(void *buf, uint16_t len)
 {
        struct hal_ev_dbfw_plus_info_recieved *info = buf;
 
-       DBG("+");
 #ifdef TIZEN_BT_HAL
        if (bt_hal_cbacks->dbfw_plus_info_received_cb)
                bt_hal_cbacks->dbfw_plus_info_received_cb(
                                info->data, info->data_len, info->event_code);
 #endif
-       DBG("-");
 }
 
 static void __bt_hal_handle_stack_messages(int message, void *buf, uint16_t len)
 {
-       DBG("+");
        switch (message) {
        case HAL_EV_ADAPTER_STATE_CHANGED:
                DBG("Event: HAL_EV_ADAPTER_STATE_CHANGED");
@@ -1146,5 +1083,4 @@ static void __bt_hal_handle_stack_messages(int message, void *buf, uint16_t len)
                DBG("Event Currently not handled!!");
                break;
        }
-       DBG("-");
 }
index aba8e3c..71dee23 100644 (file)
@@ -144,8 +144,6 @@ static GDBusProxy *__bt_hal_init_manager_proxy(void)
 {
        GDBusProxy *proxy;
 
-       DBG("+");
-
        if (system_conn == NULL) {
                system_conn = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, NULL);
                if (system_conn == NULL)
@@ -161,7 +159,6 @@ static GDBusProxy *__bt_hal_init_manager_proxy(void)
 
        manager_gproxy = proxy;
 
-       DBG("-");
        return proxy;
 }
 
@@ -387,15 +384,11 @@ char *_bt_hal_get_control_device_path(bt_bdaddr_t *bd_addr)
        char *control_path;
        char connected_address[BT_HAL_ADDRESS_STRING_SIZE];
 
-       DBG("+");
-
        if (avrcp_control_path != NULL)
                return avrcp_control_path;
 
        _bt_hal_convert_addr_type_to_string(connected_address, bd_addr->address);
 
-       DBG("device address = %s", connected_address);
-
        control_path = __bt_hal_get_control_device_object_path(connected_address);
        if (control_path == NULL)
                return NULL;
@@ -410,15 +403,11 @@ char *_bt_hal_get_transport_device_path(bt_bdaddr_t *bd_addr)
        char *transport_path;
        char connected_address[BT_HAL_ADDRESS_STRING_SIZE];
 
-       DBG("+");
-
        if (avrcp_transport_path != NULL)
                return avrcp_transport_path;
 
        _bt_hal_convert_addr_type_to_string(connected_address, bd_addr->address);
 
-       DBG("device address = %s", connected_address);
-
        transport_path = __bt_hal_get_transport_device_object_path(connected_address);
        if (transport_path == NULL)
                return NULL;
@@ -471,7 +460,6 @@ static GDBusProxy *__bt_hal_init_avrcp_ctrl_proxy(bt_bdaddr_t *bd_addr)
 
 GDBusProxy *_bt_hal_get_manager_proxy(void)
 {
-       DBG("+");
        if (manager_gproxy) {
                const gchar *path =  g_dbus_proxy_get_object_path(manager_gproxy);
                if (path == NULL) {
@@ -480,7 +468,6 @@ GDBusProxy *_bt_hal_get_manager_proxy(void)
                }
                return manager_gproxy;
        }
-       DBG("-");
        return  __bt_hal_init_manager_proxy();
 }
 
@@ -531,7 +518,6 @@ GDBusProxy *_bt_hal_get_avrcp_ctrl_properties_proxy(bt_bdaddr_t *bd_addr)
        char *control_path = NULL;
        GDBusConnection *conn = NULL;
 
-       DBG("+");
        control_path = _bt_hal_get_control_device_path(bd_addr);
        if (control_path == NULL)
                return  NULL;
@@ -556,7 +542,6 @@ GDBusProxy *_bt_hal_get_avrcp_ctrl_properties_proxy(bt_bdaddr_t *bd_addr)
                return NULL;
        }
 
-       DBG("-");
        return proxy;
 }
 
@@ -567,7 +552,6 @@ GDBusProxy *_bt_hal_get_avrcp_transport_properties_proxy(bt_bdaddr_t *bd_addr)
        char *transport_path = NULL;
        GDBusConnection *conn = NULL;
 
-       DBG("+");
        transport_path = _bt_hal_get_transport_device_path(bd_addr);
        if (transport_path == NULL)
                return  NULL;
@@ -592,7 +576,6 @@ GDBusProxy *_bt_hal_get_avrcp_transport_properties_proxy(bt_bdaddr_t *bd_addr)
                return NULL;
        }
 
-       DBG("-");
        return proxy;
 }
 
@@ -667,7 +650,6 @@ char *_bt_hal_get_adapter_path(void)
        GVariantIter *iter = NULL;
        char *adapter_path = NULL;
 
-       DBG("+");
        conn = _bt_hal_get_system_gconn();
        if (conn == NULL)
                return  NULL;
@@ -693,7 +675,7 @@ char *_bt_hal_get_adapter_path(void)
        adapter_path = __bt_hal_extract_adapter_path(iter);
        g_variant_iter_free(iter);
        g_variant_unref(result);
-       DBG("-");
+
        return adapter_path;
 }
 
@@ -970,7 +952,6 @@ int _bt_hal_copy_utf8_string(char *dest, const char *src, unsigned int length)
 
 gboolean _bt_hal_utf8_validate(char *name)
 {
-       DBG("+");
        gunichar2 *u16;
        glong items_written = 0;
 
@@ -986,7 +967,6 @@ gboolean _bt_hal_utf8_validate(char *name)
        if (items_written != g_utf8_strlen(name, -1))
                return FALSE;
 
-       DBG("-");
        return TRUE;
 }
 
@@ -1090,7 +1070,6 @@ GVariant *_bt_hal_get_managed_objects(void)
        GVariant *result = NULL;
        GError *error = NULL;
 
-       DBG("+");
        conn = _bt_hal_get_system_gconn();
        if (conn == NULL)
                return NULL;
@@ -1755,8 +1734,6 @@ int _bt_hal_discover_service_uuids(char *address, char *remote_uuid)
        GVariant *ret = NULL;
        int result = BT_STATUS_FAIL;
 
-       DBG("+");
-
        if (remote_uuid == NULL) {
                ERR("remote_uuid == NULL, return");
                return BT_STATUS_FAIL;
@@ -1843,7 +1820,6 @@ done:
        if (uuid_value)
                g_free(uuid_value);
 
-       DBG("-");
        return result;
 }
 
@@ -1963,8 +1939,6 @@ gboolean _bt_hal_is_service_enabled(const char *uuid)
        gchar *uuid_str;
        gboolean ret = FALSE;
 
-       DBG("+");
-
        proxy = _bt_hal_get_adapter_properties_proxy();
        if (!proxy) {
                DBG("_bt_hal_dbus_get_local_name: Adapter Properties proxy get failed!!!");
@@ -2004,6 +1978,6 @@ gboolean _bt_hal_is_service_enabled(const char *uuid)
        g_variant_iter_free(iter);
        g_variant_unref(result);
        g_variant_unref(temp);
-       DBG("-");
+
        return ret;
 }
index 7453f51..c705a9e 100644 (file)
@@ -231,7 +231,6 @@ int _bt_hal_device_remove_bond(const bt_bdaddr_t *bd_addr)
                        (GAsyncReadyCallback)__bt_hal_unbond_device_cb,
                        (gpointer)device_path);
 
-       DBG("-");
        return BT_STATUS_SUCCESS;
 }
 
@@ -711,7 +710,6 @@ static void __bt_hal_bond_device_cb(GDBusProxy *proxy, GAsyncResult *res,
        struct hal_ev_bond_state_changed ev;
        memset(&ev, 0, sizeof(ev));
        char dev_address[18];
-       DBG("+");
 
 #if TODO_40
        /* Terminate ALL system popup */
@@ -721,9 +719,7 @@ static void __bt_hal_bond_device_cb(GDBusProxy *proxy, GAsyncResult *res,
 
        g_dbus_proxy_call_finish(proxy, res, &err);
        device_path = g_dbus_proxy_get_object_path(proxy);
-       DBG("Device path: %s", device_path);
        _bt_hal_convert_device_path_to_address(device_path, dev_address);
-       DBG("Remote Device address [%s]", dev_address);
 
        if (err != NULL) {
                g_dbus_error_strip_remote_error(err);
@@ -785,10 +781,9 @@ static void __bt_hal_bond_device_cb(GDBusProxy *proxy, GAsyncResult *res,
                        event_cb(HAL_EV_BOND_STATE_CHANGED, (void*)&ev, sizeof(ev));
                }
        } else {
-               DBG("Bonding Success!!");
+               DBG("Bonding Success!! [%s]", dev_address);
        }
 
-       DBG("-");
 }
 
 static void __bt_hal_unbond_device_cb(GDBusProxy *proxy, GAsyncResult *res,
@@ -800,7 +795,6 @@ static void __bt_hal_unbond_device_cb(GDBusProxy *proxy, GAsyncResult *res,
        int result = BT_STATUS_SUCCESS;
        struct hal_ev_bond_state_changed ev;
        memset(&ev, 0, sizeof(ev));
-       DBG("+");
 
        g_dbus_proxy_call_finish(proxy, res, &err);
        if (err != NULL) {
@@ -826,8 +820,6 @@ static void __bt_hal_unbond_device_cb(GDBusProxy *proxy, GAsyncResult *res,
                }
        }
        g_free(device_path);
-
-       DBG("-");
 }
 
 static gboolean __bt_device_bonded_device_info_cb(gpointer user_data)
@@ -926,7 +918,7 @@ static gboolean __bt_device_bonded_device_info_cb(gpointer user_data)
                                        uint8_t uuid[BT_HAL_STACK_UUID_SIZE];
                                        memset(uuid, 0x00, BT_HAL_STACK_UUID_SIZE);
                                        uuid_str = g_strdup(uuid_value[i]);
-                                       DBG("UUID string [%s]\n", uuid_str);
+                                       DBG("[%d] [%s]", i, uuid_str);
                                        _bt_hal_convert_uuid_string_to_type(uuid, uuid_str);
                                        memcpy(uuids + i * BT_HAL_STACK_UUID_SIZE, uuid, BT_HAL_STACK_UUID_SIZE);
                                        g_free(uuid_str);
@@ -961,11 +953,10 @@ static gboolean __bt_device_bonded_device_info_cb(gpointer user_data)
                                        HAL_PROP_DEVICE_IS_ALIAS_SET, sizeof(uint8_t), &is_alias_set);
                        ev->num_props++;
                } else {
-                       ERR("Unhandled Property:[%s]", key);
+                       DBG("Unhandled Property:[%s]", key);
                }
        }
 
-       DBG("trust: %d, paired: %d", trust, paired);
        if (!event_cb)
                event_cb = _bt_hal_get_stack_message_handler();
        if (!event_cb) {
index 442506b..1bbd4c3 100644 (file)
@@ -126,7 +126,6 @@ static gboolean __bt_hal_discovery_finished_cb(gpointer user_data)
        struct hal_ev_discovery_state_changed ev;
        ev.state = HAL_DISCOVERY_STATE_STOPPED;
        event_cb(HAL_EV_DISCOVERY_STATE_CHANGED, &ev, sizeof(ev));
-       DBG("-");
 
        return FALSE;
 }
@@ -226,8 +225,6 @@ static void __bt_hal_adapter_property_changed_event(GVariant *msg)
        ev->num_props = 0;
        ev->status = BT_STATUS_SUCCESS;
 
-       DBG("+");
-
        while (g_variant_iter_loop(&value_iter, "{sv}", &key, &value)) {
                if (!g_strcmp0(key, "Address")) {
                        uint8_t bdaddr[6];
@@ -366,7 +363,6 @@ static void __bt_hal_adapter_property_changed_event(GVariant *msg)
                        DBG("##Discovering = [%d]", is_discovering);
 
                        if (is_discovering == FALSE) {
-                               DBG("###### Adapter Has stopped Discovering ######");
                                /* In Tizen Bluez, this actually does not mean Discovery is stopped
                                   in Bluez. Tizen Bluez sends this event after a certain timeout,
                                   Therefore, we must forecefully call StopDiscovery to stop discovery in BlueZ */
@@ -404,7 +400,6 @@ static void __bt_hal_adapter_property_changed_event(GVariant *msg)
                                }
 
                        } else {
-                               DBG("###### Adapter Has started Discovering ######");
                                struct hal_ev_discovery_state_changed ev;
                                ev.state = HAL_DISCOVERY_STATE_STARTED;
                                event_cb(HAL_EV_DISCOVERY_STATE_CHANGED, &ev, sizeof(ev));
@@ -508,8 +503,6 @@ static void __bt_hal_adapter_property_changed_event(GVariant *msg)
                DBG("Send Adapter properties changed event to HAL user, Num Prop [%d] total size [%zd]", ev->num_props, size);
                event_cb(HAL_EV_ADAPTER_PROPS_CHANGED, buf, size);
        }
-
-       DBG("-");
 }
 
 static void __bt_hal_flight_ps_mode_cb(keynode_t *node, void *data)
@@ -550,20 +543,16 @@ static void _bt_hal_register_vconf_handler(void)
 
 void _bt_hal_handle_adapter_event(GVariant *msg, const char *member)
 {
-       DBG("+");
-
        if (member == NULL)
                return;
 
        if (strcasecmp(member, "DeviceCreated") == 0) {
                DBG("DeviceCreated: Unhandled");
        } else if (strcasecmp(member, "AdvertisingEnabled") == 0) {
-               DBG("AdvertisingEnabled");
-               DBG("Advertising Enabled");
                int slot_id;
                gboolean status = FALSE;
                g_variant_get(msg, "(ib)", &slot_id, &status);
-               DBG("Advertising Enabled : server_slot_id [%d]  status [%d]", slot_id, status);
+
                /* Send event to application */
                _bt_hal_set_advertising_status(slot_id, status);
        } else if (strcasecmp(member, "RssiEnabled") == 0) {
@@ -661,8 +650,6 @@ void _bt_hal_handle_adapter_event(GVariant *msg, const char *member)
                }
 #endif
        }
-
-       DBG("-");
 }
 
 static gboolean __bt_hal_parse_device_properties(GVariant *item)
@@ -675,7 +662,6 @@ static gboolean __bt_hal_parse_device_properties(GVariant *item)
 
        if (!item)
                return FALSE;
-       DBG("+");
 
        /* Buffer and propety count management */
        uint8_t buf[BT_HAL_MAX_PROPERTY_BUF_SIZE];
@@ -797,10 +783,9 @@ static gboolean __bt_hal_parse_device_properties(GVariant *item)
                } else if (strcasecmp(key, "LegacyManufacturerData") == 0) {
                        /* TODO: To be handled later*/
                } else {
-                       ERR("Unhandled Property:[%s]", key);
+                       DBG("Unhandled Property:[%s]", key);
                }
        }
-       DBG("-");
 
        if (size > 1 && is_bredr_dev) {
                DBG("Send Device found event to HAL user, Num Prop [%d] total size [%zd]", ev->num_props, size);
@@ -914,8 +899,6 @@ static void __bt_hal_handle_device_event(GVariant *value, GVariant *parameters)
                g_variant_unref(value);
                return;
        }
-
-       DBG("-");
 }
 
 static void __bt_hal_send_hid_connection_state_event(
@@ -980,8 +963,6 @@ static void __bt_hal_handle_input_event(GVariant *msg, const char *path)
                g_variant_unref(val);
                g_variant_unref(child);
        }
-
-       DBG("-");
 }
 
 static gboolean __bt_hal_parse_interface(GVariant *msg)
@@ -1087,8 +1068,10 @@ static gboolean __bt_hal_event_manager(gpointer data)
                } else {
                        bt_event = __bt_hal_parse_event(value);
                        if (bt_event == BT_HAL_DEVICE_EVENT) {
+                               DBG("InterfacesAdded %s ", obj_path);
                                __bt_hal_handle_device_event(value, param->parameters);
                        } else if (bt_event == BT_HAL_AVRCP_CONTROL_EVENT) {
+                               DBG("InterfacesAdded %s ", obj_path);
                                _bt_hal_set_control_device_path(obj_path);
                        }
                }
@@ -1101,7 +1084,7 @@ static gboolean __bt_hal_event_manager(gpointer data)
                /*TODO: Handle Interfaces Removed Signal from stack */
 
                g_variant_get(param->parameters, "(&oas)", &obj_path, &iter);
-
+               DBG("InterfacesRemoved %s ", obj_path);
                while (g_variant_iter_loop(iter, "s", &str)) {
                        if (g_strcmp0(str, BT_HAL_PLAYER_CONTROL_INTERFACE) == 0)
                                _bt_hal_remove_control_device_path(obj_path);
@@ -1152,13 +1135,16 @@ static gboolean __bt_hal_event_manager(gpointer data)
        } else if (g_strcmp0(param->interface_name, BT_HAL_PROPERTIES_INTERFACE) == 0) {
                __bt_hal_handle_property_changed_event(param->parameters, param->object_path);
        } else if (g_strcmp0(param->interface_name, BT_HAL_ADAPTER_INTERFACE) == 0) {
+               DBG("Manager Event: Interface Name: BT_HAL_ADAPTER_INTERFACE");
                _bt_hal_handle_adapter_event(param->parameters, param->signal_name);
        } else if (g_strcmp0(param->interface_name, BT_HAL_INPUT_INTERFACE) == 0) {
+               DBG("Manager Event: Interface Name: BT_HAL_INPUT_INTERFACE");
                __bt_hal_handle_input_event(param->parameters, param->object_path);
        } else if (g_strcmp0(param->interface_name, BT_HAL_NETWORK_SERVER_INTERFACE) == 0) {
                /* TODO: Handle Network Server events from stack */
                DBG("Manager Event: Interface Name: BT_HAL_NETWORK_SERVER_INTERFACE");
        } else if (g_strcmp0(param->interface_name, BT_HAL_HEADSET_INTERFACE) == 0) {
+               DBG("Manager Event: Interface Name: BT_HAL_HEADSET_INTERFACE");
                __bt_hal_handle_headset_events(param->parameters, param->signal_name, param->object_path);
        } else if (g_strcmp0(param->interface_name, BT_HAL_SINK_INTERFACE) == 0) {
                /* TODO: Handle Sink interface events from stack */
@@ -1167,12 +1153,16 @@ static gboolean __bt_hal_event_manager(gpointer data)
                /* TODO: Handle Agent events from stack */
                DBG("Manager Event: Interface Name:BT_HAL_AGENT_INTERFACE");
        } else if (g_strcmp0(param->interface_name, BT_HAL_DEVICE_INTERFACE) == 0) {
+               DBG("Manager Event: Interface Name:BT_HAL_DEVICE_INTERFACE");
                __bt_hal_handle_device_specific_events(param->parameters, param->signal_name, param->object_path);
        } else if (g_strcmp0(param->interface_name, BT_HAL_PLAYER_CONTROL_INTERFACE) == 0) {
+               DBG("Manager Event: Interface Name: BT_HAL_PLAYER_CONTROL_INTERFACE");
                __bt_hal_handle_avrcp_ctrl_events(param->parameters, param->signal_name, param->object_path);
        } else if (g_strcmp0(param->interface_name, BT_HAL_MEDIATRANSPORT_INTERFACE) == 0) {
+               DBG("Manager Event: Interface Name: BT_HAL_MEDIATRANSPORT_INTERFACE");
                __bt_hal_handle_avrcp_transport_events(param->parameters, param->signal_name, param->object_path);
        } else if (g_strcmp0(param->interface_name, BT_HAL_GATT_CHAR_INTERFACE) == 0) {
+               DBG("Manager Event: Interface Name: BT_HAL_GATT_CHAR_INTERFACE");
                __bt_hal_handle_gatt_char_event(param->parameters, param->signal_name);
        } else if (g_strcmp0(param->interface_name, BT_HAL_GATT_SERVICE_INTERFACE) == 0) {
                DBG("Manager Event: Interface Name: BT_HAL_GATT_SERVICE_INTERFACE");
@@ -1296,8 +1286,6 @@ static int __bt_hal_register_manager_subscribe_signal(GDBusConnection *conn,
        static int subs_property_id = -1;
        static int subs_adapter_id = -1;
 
-       INFO_C("+");
-
        if (subscribe) {
                if (subs_interface_added_id == -1) {
                        subs_interface_added_id = g_dbus_connection_signal_subscribe(conn,
@@ -1361,7 +1349,6 @@ static int __bt_hal_register_manager_subscribe_signal(GDBusConnection *conn,
                }
        }
 
-       INFO_C("-");
        return 0;
 }
 
@@ -1370,7 +1357,6 @@ static int __bt_hal_register_device_subscribe_signal(GDBusConnection *conn,
 {
        static int subs_device_id = -1;
 
-       DBG("+");
        if (conn == NULL)
                return -1;
 
@@ -1390,7 +1376,6 @@ static int __bt_hal_register_device_subscribe_signal(GDBusConnection *conn,
                }
        }
 
-       DBG("-");
        return 0;
 }
 
@@ -1398,8 +1383,6 @@ static int __bt_hal_register_input_subscribe_signal(GDBusConnection *conn, int s
 {
        static int subs_input_id = -1;
 
-       DBG("+");
-
        if (conn == NULL)
                return -1;
 
@@ -1419,8 +1402,6 @@ static int __bt_hal_register_input_subscribe_signal(GDBusConnection *conn, int s
                }
        }
 
-       DBG("-");
-
        return 0;
 }
 
@@ -1465,8 +1446,6 @@ static int __bt_hal_register_gatt_subscribe_signal(GDBusConnection *conn,
 
 static int __bt_hal_register_service_event(GDBusConnection *g_conn, int event_type)
 {
-       DBG("+");
-
        if (g_conn == NULL)
                return  BT_HAL_ERROR_INTERNAL;
 
@@ -1572,8 +1551,6 @@ fail:
                manager_conn = NULL;
        }
 
-       DBG("-");
-
        return BT_HAL_ERROR_INTERNAL;
 }
 
@@ -1598,7 +1575,6 @@ int _bt_hal_initialize_event_receiver(handle_stack_msg cb)
        _bt_hal_register_vconf_handler();
 
        event_cb = cb;
-       DBG("-");
 
        return BT_HAL_ERROR_NONE;
 }
@@ -1609,13 +1585,12 @@ static void __bt_hal_device_property_changed_event(GVariant *msg, const char *pa
        GVariant *value = NULL;
        char *key = NULL;
        g_variant_iter_init(&value_iter, msg);
-       DBG("+");
 
        while (g_variant_iter_loop(&value_iter, "{sv}", &key, &value)) {
                if (!g_strcmp0(key, "Connected")) {
                        guint connected = 0;
                        g_variant_get(value, "i", &connected);
-                       DBG("Device property changed : Connected [%d]", connected);
+                       INFO("Device property changed : Connected [%d]", connected);
                } else if (!g_strcmp0(key, "RSSI")) {
                        DBG("Device property changed : RSSI");
                        __bt_hal_dbus_device_found_properties(path);
@@ -1679,10 +1654,9 @@ static void __bt_hal_device_property_changed_event(GVariant *msg, const char *pa
                        DBG("Address: %s, TrustedProfiles: 0x%X", address, trust_val);
                        __bt_hal_send_device_trusted_profile_changed_event(trust_val, address);
                } else {
-                       ERR("Unhandled Property:[%s]", key);
+                       DBG("Unhandled Property:[%s]", key);
                }
        }
-       DBG("-");
 }
 
 static void __bt_hal_dbus_device_found_properties(const char *device_path)
@@ -1692,7 +1666,6 @@ static void __bt_hal_dbus_device_found_properties(const char *device_path)
        GDBusProxy *device_proxy;
        GDBusConnection *conn;
        GVariant *result;
-       DBG("+");
 
        if (!device_path) {
                ERR("Invalid device path");
@@ -1741,8 +1714,6 @@ static void __bt_hal_dbus_device_found_properties(const char *device_path)
 
        g_object_unref(device_proxy);
        g_free(address);
-
-       DBG("-");
 }
 
 static void __bt_hal_device_properties_lookup(GVariant *result, char *address)
@@ -1945,7 +1916,6 @@ static void __bt_hal_device_properties_lookup(GVariant *result, char *address)
                DBG("Send Device found event to HAL user, Num Prop [%d] total size [%zd]", ev->num_props, size);
                event_cb(HAL_EV_DEVICE_FOUND, (void*) buf, size);
        }
-       DBG("-");
 }
 
 static void __bt_hal_send_device_acl_connection_state_event(int status, gboolean connected, const char *address)
@@ -1964,7 +1934,6 @@ static void __bt_hal_send_device_acl_connection_state_event(int status, gboolean
                ERR("Bluetooth HAL event handler not registered");
        else
                event_cb(HAL_EV_ACL_STATE_CHANGED, &ev, sizeof(ev));
-       DBG("-");
 }
 
 static void __bt_hal_send_device_le_connection_state_event(int status, gboolean connected, const char *address)
@@ -1983,7 +1952,6 @@ static void __bt_hal_send_device_le_connection_state_event(int status, gboolean
                ERR("Bluetooth HAL event handler not registered");
        else
                event_cb(HAL_EV_LE_CONN_STATE_CHANGED, &ev, sizeof(ev));
-       DBG("-");
 }
 
 static void __bt_hal_send_device_trust_state_event(gboolean is_trusted,
@@ -2002,7 +1970,6 @@ static void __bt_hal_send_device_trust_state_event(gboolean is_trusted,
                ERR("Bluetooth HAL event handler not registered");
        else
                event_cb(HAL_EV_DEVICE_TRUST_CHANGED, &ev, sizeof(ev));
-       DBG("-");
 }
 
 static void __bt_hal_send_device_trusted_profile_changed_event(
@@ -2018,7 +1985,6 @@ static void __bt_hal_send_device_trusted_profile_changed_event(
                ERR("Bluetooth HAL event handler not registered");
        else
                event_cb(HAL_EV_DEVICE_TRUSTED_PROFILES_CHANGED, &ev, sizeof(ev));
-       DBG("-");
 }
 
 static void __bt_hal_handle_device_specific_events(GVariant *msg, const char *member,
@@ -2593,7 +2559,6 @@ static void __bt_hal_handle_avrcp_transport_events(GVariant *msg, const char *me
                }
        }
 
-       DBG("-");
        g_free((char *)property);
        g_variant_unref(value);
 }
@@ -2601,7 +2566,6 @@ static void __bt_hal_handle_avrcp_transport_events(GVariant *msg, const char *me
 /* A2DP Src Role(Remote:Sink) Events */
 static void __bt_hal_send_av_connection_state_event(gboolean connected, const char *address)
 {
-       DBG("+");
        struct hal_ev_a2dp_conn_state ev;
 
        if (connected == TRUE)
@@ -2624,7 +2588,6 @@ static void __bt_hal_send_av_connection_state_event(gboolean connected, const ch
 /* A2DP Sink Role(Remote:Source) Events */
 static void __bt_hal_send_a2dp_sink_connection_state_event(gboolean connected, const char *address)
 {
-       DBG("+");
        struct hal_ev_a2dp_conn_state ev;
 
        if (connected == TRUE)
@@ -2648,7 +2611,6 @@ static void __bt_hal_send_a2dp_sink_connection_state_event(gboolean connected, c
 static void __bt_hal_send_hf_audio_connection_state_event(gboolean connected,
                                                const char *address)
 {
-       DBG("+");
        struct hal_ev_handsfree_audio_state ev;
 
        if (connected == TRUE)
@@ -2672,7 +2634,6 @@ static void __bt_hal_send_hf_audio_connection_state_event(gboolean connected,
 static void __bt_hal_send_hf_connection_state_event(gboolean connected,
                                                const char *address)
 {
-       DBG("+");
        struct hal_ev_handsfree_conn_state ev;
 
        if (connected == TRUE)
index 47cbba4..6fd38bf 100644 (file)
@@ -84,22 +84,16 @@ static void __bt_hal_free_osp_server(gpointer data)
 {
        bt_hal_agent_osp_server_t *server = data;
 
-       DBG("+");
-
        if (!server)
                return;
 
        g_free(server->uuid);
        g_free(server->path);
        g_free(server);
-
-       DBG("-");
 }
 
 static void __bt_hal_gap_agent_remove_osp_servers(GSList *osp_servers)
 {
-       DBG("+");
-
        if (!osp_servers) {
                ERR("osp_servers is NULL");
                return;
@@ -107,8 +101,6 @@ static void __bt_hal_gap_agent_remove_osp_servers(GSList *osp_servers)
        }
 
        g_slist_free_full(osp_servers, __bt_hal_free_osp_server);
-
-       DBG("-");
 }
 #endif
 
@@ -261,7 +253,6 @@ void _gap_agent_setup_dbus(GapAgentPrivate *agent, GAP_AGENT_FUNC_CB *func_cb,
        GDBusProxy *proxy;
        GDBusNodeInfo *node_info;
        GError *error = NULL;
-       DBG("+");
 
        priv->path = g_strdup(path);
 
@@ -325,7 +316,6 @@ void _gap_agent_setup_dbus(GapAgentPrivate *agent, GAP_AGENT_FUNC_CB *func_cb,
                g_object_unref(proxy);
                DBG("Busname: %s", priv->busname);
        }
-       DBG("-");
 }
 
 void _gap_agent_reset_dbus(GapAgentPrivate *agent)
@@ -468,12 +458,8 @@ static void __bt_gap_agent_method(GDBusConnection *connection,
                        GDBusMethodInvocation *invocation,
                        gpointer user_data)
 {
-       DBG("+");
        FN_START;
 
-       DBG("Method[%s] Object Path[%s] Interface Name[%s]",
-                       method_name, object_path, interface_name);
-
        GError *err = NULL;
        if (g_strcmp0(method_name, "RequestPinCode") == 0) {
                GapAgentPrivate *agent = user_data;
@@ -486,7 +472,7 @@ static void __bt_gap_agent_method(GDBusConnection *connection,
                        return;
 
                g_variant_get(parameters, "(&o)", &path);
-               DBG("Request pin code, Device Path :%s", path);
+               INFO("Request pin code, Device Path :%s", path);
 
                /* Need to check
                   if (g_strcmp0(sender, agent->busname) != 0)
@@ -540,7 +526,7 @@ static void __bt_gap_agent_method(GDBusConnection *connection,
                        return;
 
                g_variant_get(parameters, "(&o)", &path);
-               DBG("Request passkey : sender %s priv->busname %s Device Path :%s",
+               INFO("Request passkey : sender %s priv->busname %s Device Path :%s",
                                sender, priv->busname, path);
                /* Need to check
                   if (g_strcmp0(sender, agent->busname) != 0)
@@ -595,7 +581,7 @@ static void __bt_gap_agent_method(GDBusConnection *connection,
                if (sender == NULL)
                        return;
                g_variant_get(parameters, "(&ouq)", &path, &passkey, &entered);
-               DBG("Request passkey display :sender %s priv->busname %s"
+               INFO("Request passkey display :sender %s priv->busname %s"
                                " Device Path :%s, Passkey: %d, Entered: %d",
                                sender, priv->busname, path, passkey, entered);
                /* Do not show popup for Key event while typing*/
@@ -643,7 +629,7 @@ static void __bt_gap_agent_method(GDBusConnection *connection,
                        return;
 
                g_variant_get(parameters, "(&ou)", &path, &passkey);
-               DBG("Request passkey confirmation, Device Path :%s, Passkey: %d",
+               INFO("Request passkey confirmation, Device Path :%s, Passkey: %d",
                                path, passkey);
 
                DBG("Sender: [%s] priv->busname: [%s]", sender, priv->busname);
@@ -700,7 +686,7 @@ static void __bt_gap_agent_method(GDBusConnection *connection,
                        return;
 
                g_variant_get(parameters, "(&o&s)", &path, &uuid);
-               DBG("Request authorization :sender %s priv->busname %s "
+               INFO("Request authorization :sender %s priv->busname %s "
                                "Device Path :%s UUID: %s",
                                sender, priv->busname, path, uuid);
 
@@ -763,7 +749,7 @@ static void __bt_gap_agent_method(GDBusConnection *connection,
 
                if (sender == NULL)
                        return;
-               DBG("Cancelled : agent %p sender %p", priv, sender);
+               INFO("Cancelled : agent %p sender %p", priv, sender);
                /* Need to check
                   if (g_strcmp0(sender, agent->busname) != 0)
                   return;
@@ -804,7 +790,7 @@ static void __bt_gap_agent_method(GDBusConnection *connection,
                if (sender == NULL)
                        return;
 
-               DBG("Released : sender %s\n", sender);
+               INFO("Released : sender %s\n", sender);
 
                /* Need to check
                if (g_strcmp0(sender, agent->busname) != 0)
@@ -829,7 +815,7 @@ static void __bt_gap_agent_method(GDBusConnection *connection,
                guint accept;
 
                g_variant_get(parameters, "(u&s)", &accept, &pin_code);
-               DBG("Accept: %d PinCode: %s", accept, pin_code);
+               INFO("Accept: %d PinCode: %s", accept, pin_code);
                gap_agent_reply_pin_code(priv, accept, pin_code, invocation);
        } else if (g_strcmp0(method_name, "ReplyPasskey") == 0) {
                GapAgentPrivate *priv = user_data;
@@ -837,32 +823,31 @@ static void __bt_gap_agent_method(GDBusConnection *connection,
                guint accept;
 
                g_variant_get(parameters, "(u&s)", &accept, &passkey);
-               DBG("Accept: %d PinCode: %s", accept, passkey);
+               INFO("Accept: %d PinCode: %s", accept, passkey);
                gap_agent_reply_passkey(priv, accept, passkey, invocation);
        } else if (g_strcmp0(method_name, "ReplyConfirmation") == 0) {
                GapAgentPrivate *priv = user_data;
                guint accept;
 
                g_variant_get(parameters, "(u)", &accept);
-               DBG("Accept: %d", accept);
+               INFO("Accept: %d", accept);
                gap_agent_reply_confirmation(priv, accept, invocation);
        } else if (g_strcmp0(method_name, "ReplyAuthorize") == 0) {
                GapAgentPrivate *priv = user_data;
                guint accept;
 
                g_variant_get(parameters, "(u)", &accept);
-               DBG("Accept: %d", accept);
+               INFO("Accept: %d", accept);
                gap_agent_reply_authorize(priv, accept, invocation);
+       } else {
+               ERR("Invalid method[%s] Object Path[%s] Interface Name[%s]",
+                       method_name, object_path, interface_name);
        }
-       DBG("-");
 }
 
 gboolean gap_agent_reply_confirmation(GapAgentPrivate *agent, const guint accept,
                GDBusMethodInvocation *context)
 {
-
-       DBG("+");
-
        GapAgentPrivate *priv = agent;
 
        /* Fix : NULL_RETURNS */
@@ -898,7 +883,6 @@ gboolean gap_agent_reply_confirmation(GapAgentPrivate *agent, const guint accept
        priv->reply_context = NULL;
        memset(priv->pairing_addr, 0x00, sizeof(priv->pairing_addr));
 
-       DBG("-");
        return TRUE;
 }
 
@@ -906,7 +890,6 @@ gboolean gap_agent_reply_pin_code(GapAgentPrivate *agent, const guint accept,
                const char *pin_code,
                GDBusMethodInvocation *context)
 {
-       DBG("+");
        GapAgentPrivate *priv = agent;
 
        /* Fix : NULL_RETURNS */
@@ -942,7 +925,6 @@ gboolean gap_agent_reply_pin_code(GapAgentPrivate *agent, const guint accept,
        priv->reply_context = NULL;
        memset(priv->pairing_addr, 0x00, sizeof(priv->pairing_addr));
 
-       DBG("-");
        return TRUE;
 }
 
@@ -950,7 +932,6 @@ gboolean gap_agent_reply_passkey(GapAgentPrivate *agent, const guint accept,
                const char *passkey,
                GDBusMethodInvocation *context)
 {
-       DBG("+");
        GapAgentPrivate *priv = agent;
 
        /* Fix : NULL_RETURNS */
@@ -988,7 +969,6 @@ gboolean gap_agent_reply_passkey(GapAgentPrivate *agent, const guint accept,
        priv->reply_context = NULL;
        memset(priv->pairing_addr, 0x00, sizeof(priv->pairing_addr));
 
-       DBG("-");
        return TRUE;
 }
 
@@ -997,7 +977,6 @@ gboolean gap_agent_reply_authorize(GapAgentPrivate *agent, const guint accept,
 {
        gboolean ret = TRUE;
        GapAgentPrivate *priv = agent;
-       DBG("+");
 
        /* Fix : NULL_RETURNS */
        if (priv == NULL)
@@ -1042,7 +1021,6 @@ gboolean gap_agent_reply_authorize(GapAgentPrivate *agent, const guint accept,
        priv->reply_context = NULL;
        memset(priv->authorize_addr, 0x00, sizeof(priv->authorize_addr));
 
-       DBG("-");
        return ret;
 }
 
@@ -1074,8 +1052,6 @@ gboolean _bt_hal_gap_agent_register_osp_server(GapAgentPrivate *agent, unsigned
 {
        bt_hal_agent_osp_server_t *server;
 
-       DBG("+");
-
        GapAgentPrivate *priv = agent;
        if (priv == NULL)
                return FALSE;
@@ -1092,7 +1068,6 @@ gboolean _bt_hal_gap_agent_register_osp_server(GapAgentPrivate *agent, unsigned
        }
        priv->osp_servers = g_slist_append(priv->osp_servers, server);
 
-       DBG("-");
        return TRUE;
 }
 
@@ -1102,7 +1077,6 @@ gboolean _bt_hal_gap_agent_unregister_osp_server(GapAgentPrivate *agent, unsigne
 
        GapAgentPrivate *priv = agent;
 
-       DBG("+");
        if (priv == NULL)
                return FALSE;
 
@@ -1116,7 +1090,6 @@ gboolean _bt_hal_gap_agent_unregister_osp_server(GapAgentPrivate *agent, unsigne
        priv->osp_servers = g_slist_remove(priv->osp_servers, server);
        __bt_hal_free_osp_server(server);
 
-       DBG("-");
        return TRUE;
 }
 #endif
index 71571a2..4fced83 100644 (file)
@@ -208,7 +208,6 @@ static gboolean __bt_hal_register_client_cb(gpointer user_data)
        struct hal_ev_gatt_client_registered ev;
        hal_gatt_client_app *client_info = user_data;
 
-       DBG("+");
        /* Prepare to send AV connecting event */
        memset(&ev, 0, sizeof(ev));
        ev.status = BT_STATUS_SUCCESS;
@@ -266,7 +265,6 @@ static bt_status_t __hal_gattc_register_client_app(bt_uuid_t *app_uuid)
        hal_gatt_client_app *gattc_app = NULL;
        hal_gatt_client_app *client_app_info = NULL;
 
-       DBG("+");
        /* add gatt client in list */
        gattc_app = __hal_gattc_add_client_app(app_uuid);
        if (gattc_app == NULL) {
@@ -289,7 +287,6 @@ static bt_status_t __hal_gattc_register_client_app(bt_uuid_t *app_uuid)
 bt_status_t btif_gattc_register_client(bt_uuid_t *uuid)
 {
        CHECK_BTGATT_INIT();
-       DBG("+");
 
        return __hal_gattc_register_client_app(uuid);
 }
@@ -351,7 +348,6 @@ bt_status_t __hal_gattc_unregister_client(int client_if)
 bt_status_t btif_gattc_unregister_client(int client_if)
 {
        CHECK_BTGATT_INIT();
-       DBG("+");
 
        return __hal_gattc_unregister_client(client_if);
 }
@@ -378,7 +374,6 @@ bt_status_t btif_gattc_client_connect(int client_if, const bt_bdaddr_t *bd_addr,
        int ret = BT_STATUS_SUCCESS;
 
        CHECK_BTGATT_INIT();
-       DBG("+");
 
        if (NULL == bd_addr)
                return BT_STATUS_PARM_INVALID;
@@ -520,8 +515,6 @@ bt_status_t btif_gattc_client_disconnect(int client_if, const bt_bdaddr_t *bd_ad
 {
        CHECK_BTGATT_INIT();
 
-       DBG("+");
-
        return _hal_gattc_disconnect(client_if, bd_addr, conn_id);
 }
 
@@ -534,8 +527,6 @@ bt_status_t refresh(int client_if, const bt_bdaddr_t *bd_addr)
 
 static hal_gattc_service_t* _gattc_find_service_from_uuid(hal_gattc_server_info_t *conn_info, bt_uuid_t *svc_uuid)
 {
-       DBG("+");
-
        GSList *l;
        hal_gattc_service_t *info = NULL;
 
@@ -544,11 +535,10 @@ static hal_gattc_service_t* _gattc_find_service_from_uuid(hal_gattc_server_info_
                if (info == NULL)
                        continue;
 
-               if (!memcmp(&info->svc_uuid, svc_uuid, sizeof(bt_uuid_t))) {
-                       INFO("Found GATT service uuid");
+               if (!memcmp(&info->svc_uuid, svc_uuid, sizeof(bt_uuid_t)))
                        return info;
                }
-       }
+
        return NULL;
 }
 
@@ -556,8 +546,6 @@ static hal_gattc_service_t* _gattc_find_service_from_uuid(hal_gattc_server_info_
 static hal_gattc_char_t* _gattc_find_char_from_uuid(hal_gattc_service_t *gattc_svc, bt_uuid_t *char_uuid,
                                bt_gatt_characteristic_property_t prop)
 {
-       DBG("+");
-
        GSList *l;
        hal_gattc_char_t *info = NULL;
 
@@ -568,7 +556,6 @@ static hal_gattc_char_t* _gattc_find_char_from_uuid(hal_gattc_service_t *gattc_s
 
                if (!memcmp(&info->chr_uuid, char_uuid, sizeof(bt_uuid_t)) &&
                        (info->permission & prop)) {
-                       INFO("Found GATT char uuid");
                        return info;
                }
        }
@@ -577,8 +564,6 @@ static hal_gattc_char_t* _gattc_find_char_from_uuid(hal_gattc_service_t *gattc_s
 
 static hal_gattc_char_t* _gattc_find_char_from_uuid_for_notify(hal_gattc_service_t *gattc_svc, bt_uuid_t *char_uuid)
 {
-       DBG("+");
-
        GSList *l;
        hal_gattc_char_t *info = NULL;
 
@@ -590,7 +575,6 @@ static hal_gattc_char_t* _gattc_find_char_from_uuid_for_notify(hal_gattc_service
                if (!memcmp(&info->chr_uuid, char_uuid, sizeof(bt_uuid_t)) &&
                        ((info->permission & HAL_GATT_CHARACTERISTIC_PROPERTY_NOTIFY) ||
                                (info->permission & HAL_GATT_CHARACTERISTIC_PROPERTY_INDICATE))) {
-                       INFO("Found GATT char uuid");
                        return info;
                }
        }
@@ -599,8 +583,6 @@ static hal_gattc_char_t* _gattc_find_char_from_uuid_for_notify(hal_gattc_service
 
 static hal_gattc_desc_t* _gattc_find_desc_from_uuid(hal_gattc_char_t *gattc_char, bt_uuid_t *desc_uuid)
 {
-       DBG("+");
-
        GSList *l;
        hal_gattc_desc_t *info = NULL;
 
@@ -609,11 +591,9 @@ static hal_gattc_desc_t* _gattc_find_desc_from_uuid(hal_gattc_char_t *gattc_char
                if (info == NULL)
                        continue;
 
-               if (!memcmp(&info->desc_uuid, desc_uuid, sizeof(bt_uuid_t))) {
-                       INFO("Found GATT descriptor uuid");
+               if (!memcmp(&info->desc_uuid, desc_uuid, sizeof(bt_uuid_t)))
                        return info;
                }
-       }
        return NULL;
 }
 
@@ -621,7 +601,6 @@ static hal_gattc_desc_t* _gattc_find_desc_from_uuid(hal_gattc_char_t *gattc_char
 static hal_gattc_service_t* _hal_gatt_client_add_service(hal_gattc_server_info_t *conn_info,
                const char *uuid_str, const char *object_path, int is_primary)
 {
-       DBG("+");
        hal_gattc_service_t *gattc_service = NULL;
 
        gattc_service = g_malloc0(sizeof(hal_gattc_service_t));
@@ -629,18 +608,15 @@ static hal_gattc_service_t* _hal_gatt_client_add_service(hal_gattc_server_info_t
        _bt_hal_convert_uuid_string_to_type(gattc_service->svc_uuid.uu, uuid_str);
        gattc_service->is_primary = is_primary;
 
-       DBG("service count[%d]", g_slist_length(conn_info->gatt_list_services));
+       INFO("[%d] [%s] [%s]", g_slist_length(conn_info->gatt_list_services), object_path + 15, uuid_str);
 
        conn_info->gatt_list_services = g_slist_append(conn_info->gatt_list_services, gattc_service);
 
-       DBG("svc path [%s] svc uuid [%s]", object_path, uuid_str);
-
        return gattc_service;
 }
 
 static void _hal_gattc_add_characteristic(hal_gattc_service_t *gatt_svc, char *char_handle)
 {
-       DBG("+");
        hal_gattc_char_t *gattc_char = NULL;
 
        gattc_char = g_malloc0(sizeof(hal_gattc_char_t));
@@ -659,8 +635,6 @@ static void _gattc_create_new_service(hal_gattc_server_info_t *conn_info, gboole
        int i;
        gchar *gp_char_path = NULL;
 
-       DBG("+");
-
        /* add the service */
        gatt_svc = _hal_gatt_client_add_service(conn_info, uuid_str, object_path, is_primary);
        if (gatt_svc == NULL) {
@@ -685,9 +659,6 @@ static void _hal_gattc_add_descriptor(hal_gattc_char_t *gattc_char, char *desc_p
        gattc_desc->desc_path = g_strdup(desc_path);
 
        gattc_char->gatt_list_descs = g_slist_append(gattc_char->gatt_list_descs, gattc_desc);
-
-       DBG("char path: [%s]", gattc_char->chr_path);
-       DBG("desc path: [%s]", gattc_desc->desc_path);
 }
 
 static void _hal_gattc_update_char_property(hal_gattc_char_t *gattc_char, const char* char_uuid_str,
@@ -696,17 +667,12 @@ static void _hal_gattc_update_char_property(hal_gattc_char_t *gattc_char, const
        gchar *gp_desc_path = NULL;
        int i;
 
-       DBG("+");
-
        if (char_uuid_str == NULL) {
                DBG("char_uuid_str is NULL");
                return;
        }
 
        //update the char uuid
-       DBG("char UUID: [%s] ", char_uuid_str);
-       DBG("char path: [%s]", gattc_char->chr_path);
-
        _bt_hal_convert_uuid_string_to_type(gattc_char->chr_uuid.uu, char_uuid_str);
 
        //update char permission
@@ -721,8 +687,6 @@ static void _hal_gattc_update_char_property(hal_gattc_char_t *gattc_char, const
 
 static void _hal_gattc_update_desc_property(hal_gattc_desc_t *gattc_desc, const char* desc_uuid_str)
 {
-       DBG("+");
-
        if (desc_uuid_str == NULL) {
                DBG("char_uuid_str is NULL");
                return;
@@ -747,34 +711,26 @@ static void browse_service_char(int conn_id)
 
        conn_info = __bt_find_gatt_conn_info_from_conn_id(conn_id);
        if (conn_info == NULL) {
-               ERR("conn_info is NULL");
+               ERR("Failed to get the conn_info for conn_id [%d]", conn_id);
                return;
        }
 
-       DBG("service count[%d]", g_slist_length(conn_info->gatt_list_services));
-
        for (l = conn_info->gatt_list_services; l != NULL; l = g_slist_next(l)) {
                svc_info = (hal_gattc_service_t*)l->data;
                if (svc_info == NULL)
                        continue;
 
-               DBG("[%s]", svc_info->svc_path);
-
                /* find characteristic object path */
                for (k = svc_info->gatt_list_chars; k != NULL; k = g_slist_next(k)) {
                        char_info = (hal_gattc_char_t *)k->data;
                        if (char_info == NULL)
                                continue;
 
-                       DBG("[%s]", char_info->chr_path);
-
                        /* descriptor */
                        for (m = char_info->gatt_list_descs; m != NULL; m = g_slist_next(m)) {
                                desc_info = (hal_gattc_desc_t *)m->data;
                                if (desc_info == NULL)
                                        continue;
-
-                               DBG("[%s]", desc_info->desc_path);
                        }
                }
        }
@@ -813,11 +769,9 @@ static bt_status_t _gattc_client_search_service(int conn_id)
        GVariantIter *char_iter = NULL;
        GPtrArray *gp_char_array  = NULL;
 
-       DBG("+");
-
        conn_info = __bt_find_gatt_conn_info_from_conn_id(conn_id);
        if (NULL == conn_info) {
-               ERR("Failed to get the conn_info");
+               ERR("Failed to get the conn_info for conn_id [%d]", conn_id);
                return BT_STATUS_FAIL;
        }
 
@@ -872,19 +826,16 @@ static bt_status_t _gattc_client_search_service(int conn_id)
                        while (g_variant_iter_loop(svc_iter, "{sv}", &key, &value)) {
                                if (g_strcmp0(key, "Primary") == 0) {
                                        is_primary = g_variant_get_boolean(value);
-                                       DBG("primary");
                                        if (is_primary) {
                                                g_ptr_array_add(gp_array, (gpointer)object_path);
                                                svc_count++;
                                        }
                                } else if (g_strcmp0(key, "UUID") == 0) {
                                        uuid_str = g_variant_get_string(value, &len);
-                                       DBG(" UUID: [%s]", uuid_str);
                                } else if (g_strcmp0(key, "Characteristics") == 0) {
                                        g_variant_get(value, "ao", &char_iter);
                                        if (char_iter != NULL) {
                                                while (g_variant_iter_loop(char_iter, "&o", &char_handle)) {
-                                                       DBG("char handle : %s", char_handle);
                                                        g_ptr_array_add(gp_char_array, (gpointer)char_handle);
                                                }
                                        }
@@ -892,7 +843,6 @@ static bt_status_t _gattc_client_search_service(int conn_id)
                        }
 
                        if (uuid_str) {
-                               DBG("send search service result event");
                                _bt_hal_send_search_service_result_event(conn_id, is_primary,
                                                uuid_str, conn_info->inst_id);
 
@@ -950,8 +900,6 @@ static void _bt_hal_send_client_char_search_result_event(int conn_id, int status
                return;
        }
 
-       DBG("sending gatt client search char result event conn_id[%d] status[%d]", conn_id, status);
-
        memset(&ev, 0, sizeof(ev));
        ev.conn_id = conn_id;
        ev.inst_id = svc_id->id.inst_id;
@@ -960,13 +908,12 @@ static void _bt_hal_send_client_char_search_result_event(int conn_id, int status
        memcpy(ev.svc_uuid, svc_id->id.uuid.uu, sizeof(ev.svc_uuid));
 
        if (status == BT_STATUS_SUCCESS) {
-               DBG("building char uuid");
+               /* building char uuid */
                memcpy(ev.char_uuid, char_uuid->uu, sizeof(ev.char_uuid));
                ev.char_prop = char_prop;
        }
 
-       DBG("sending the char search event");
-
+       DBG("sending the char search event.  conn_id[%d] status[%d]", conn_id, status);
        event_cb(HAL_EV_GATT_CLIENT_CHARAC_SEARCH_RESULT, (void *)&ev, sizeof(ev));
 }
 
@@ -1009,6 +956,40 @@ static int _hal_get_permission_flag(char *permission)
        return ret;
 }
 
+static void __hal_convert_permission_flag_to_str(unsigned int permission)
+{
+       char perm[200] = { 0, };
+
+       if (permission & HAL_GATT_CHARACTERISTIC_PROPERTY_BROADCAST)
+               g_strlcat(perm, "broadcast ", sizeof(perm));
+       if (permission & HAL_GATT_CHARACTERISTIC_PROPERTY_READ)
+               g_strlcat(perm, "read ", sizeof(perm));
+       if (permission & HAL_GATT_CHARACTERISTIC_PROPERTY_WRITE_NO_RESPONSE)
+               g_strlcat(perm, "write-without-response ", sizeof(perm));
+       if (permission & HAL_GATT_CHARACTERISTIC_PROPERTY_WRITE)
+               g_strlcat(perm, "write ", sizeof(perm));
+       if (permission & HAL_GATT_CHARACTERISTIC_PROPERTY_NOTIFY)
+               g_strlcat(perm, "notify ", sizeof(perm));
+       if (permission & HAL_GATT_CHARACTERISTIC_PROPERTY_INDICATE)
+               g_strlcat(perm, "indicate ", sizeof(perm));
+       if (permission & HAL_GATT_CHARACTERISTIC_PROPERTY_SIGNED_WRITE)
+               g_strlcat(perm, "authenticated-signed-writes ", sizeof(perm));
+       if (permission & HAL_GATT_CHARACTERISTIC_PROPERTY_RELIABLE_WRITE)
+               g_strlcat(perm, "reliable-write ", sizeof(perm));
+       if (permission & HAL_GATT_CHARACTERISTIC_PROPERTY_WRITABLE_AUXILIARIES)
+               g_strlcat(perm, "writable-auxiliaries ", sizeof(perm));
+       if (permission & HAL_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_READ)
+               g_strlcat(perm, "encrypt-read ", sizeof(perm));
+       if (permission & HAL_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_WRITE)
+               g_strlcat(perm, "encrypt-write ", sizeof(perm));
+       if (permission & HAL_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_AUTHENTICATED_READ)
+               g_strlcat(perm, "encrypt-authenticated-read ", sizeof(perm));
+       if (permission & HAL_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_AUTHENTICATED_WRITE)
+               g_strlcat(perm, "encrypt-authenticated-write ", sizeof(perm));
+
+       DBG("permission [0x%04x] : %s\n", permission, perm);
+       return;
+}
 
 static bt_status_t _hal_gattc_get_characteristic_info(hal_gattc_char_t *gattc_char)
 {
@@ -1035,8 +1016,6 @@ static bt_status_t _hal_gattc_get_characteristic_info(hal_gattc_char_t *gattc_ch
        }
        char_handle = gattc_char->chr_path;
 
-       DBG("char path:[%s]", gattc_char->chr_path);
-
        g_conn = _bt_hal_get_system_gconn();
        if (NULL == g_conn) {
                 ERR("_bt_gdbus_get_system_gconn returned NULL");
@@ -1079,20 +1058,18 @@ static bt_status_t _hal_gattc_get_characteristic_info(hal_gattc_char_t *gattc_ch
        while (g_variant_iter_loop(property_iter, "{sv}", &key, &value)) {
                if (!g_strcmp0(key, "UUID")) {
                        char_uuid_str = g_variant_dup_string(value, &len);
-                       DBG("char UUID [%s]", char_uuid_str);
+                       INFO("%s [%s]", char_handle + 37, char_uuid_str);
                } else if (!g_strcmp0(key, "Flags")) {
                        g_variant_get(value, "as", &char_perm_iter);
                                char_permission = 0x00;
 
                        while (g_variant_iter_loop(char_perm_iter, "s", &permission)) {
-                               DBG("char permission: [%s]", permission);
                                char_permission |= _hal_get_permission_flag(permission);
                        }
+                       __hal_convert_permission_flag_to_str(char_permission);
                } else if (!g_strcmp0(key, "Descriptors")) {
                        g_variant_get(value, "ao", &char_desc_iter);
                        while (g_variant_iter_loop(char_desc_iter, "&o", &char_desc_handle)) {
-                               DBG("char descriptor : %s", char_desc_handle);
-
                                g_ptr_array_add(gp_desc_array, (gpointer)char_desc_handle);
                        }
                }
@@ -1119,11 +1096,9 @@ static bt_status_t _gattc_get_all_characteristic(int conn_id,
        char svc_uuid_str[BT_HAL_UUID_STRING_LEN];
        int status = BT_STATUS_FAIL;
 
-       DBG("conn_id[%d]", conn_id);
-
        conn_info = __bt_find_gatt_conn_info_from_conn_id(conn_id);
        if (NULL == conn_info) {
-               ERR("Failed to get the conn_info for conn_id[%d]", conn_id);
+               ERR("Failed to get the conn_info for conn_id [%d]", conn_id);
                return BT_STATUS_FAIL;
        }
 
@@ -1144,14 +1119,11 @@ static bt_status_t _gattc_get_all_characteristic(int conn_id,
 
                /* send event */
                if (BT_STATUS_SUCCESS == status) {
-                       DBG("Sending the success charateristics event");
                        _bt_hal_send_client_char_search_result_event(conn_id, status, srvc_id,
                                        &gattc_char->chr_uuid, gattc_char->permission);
                }
        }
 
-       DBG("sending final event");
-
        status = BT_STATUS_FAIL;
        _bt_hal_send_client_char_search_result_event(conn_id, status, srvc_id, NULL, 0);
 
@@ -1168,7 +1140,6 @@ static bt_status_t _gattc_get_all_characteristic(int conn_id,
 bt_status_t btif_gattc_get_characteristic(int conn_id,
                btgatt_srvc_id_t *srvc_id, btgatt_gatt_id_t *start_char_id)
 {
-       DBG("+");
        CHECK_BTGATT_INIT();
 
        if (start_char_id == NULL) {
@@ -1194,16 +1165,12 @@ static bt_status_t _hal_gattc_get_descriptor_info(hal_gattc_desc_t *gattc_desc)
        char* desc_handle = NULL;
        const gchar *desc_uuid_str = NULL;
 
-       DBG("+");
-
        if (gattc_desc->desc_path == NULL) {
                DBG("desc path is NULL");
                return BT_STATUS_FAIL;
        }
        desc_handle = gattc_desc->desc_path;
 
-       DBG("desc path:[%s]", gattc_desc->desc_path);
-
        g_conn = _bt_hal_get_system_gconn();
        if (NULL == g_conn) {
                ERR("_bt_gdbus_get_system_gconn returned NULL");
@@ -1244,7 +1211,6 @@ static bt_status_t _hal_gattc_get_descriptor_info(hal_gattc_desc_t *gattc_desc)
        while (g_variant_iter_loop(property_iter, "{sv}", &key, &value)) {
                if (!g_strcmp0(key, "UUID")) {
                        desc_uuid_str = g_variant_get_string(value, &len);
-                       DBG("desc UUID [%s]", desc_uuid_str);
                        _hal_gattc_update_desc_property(gattc_desc, desc_uuid_str);
                        break;
                }
@@ -1267,8 +1233,6 @@ static void _bt_hal_send_client_desc_search_result_event(int conn_id, int status
                return;
        }
 
-       DBG("sending gatt client search desc result event conn_id[%d] status[%d]", conn_id, status);
-
        memset(&ev, 0, sizeof(ev));
        ev.conn_id = conn_id;
        ev.inst_id = svc_id->id.inst_id;
@@ -1279,11 +1243,11 @@ static void _bt_hal_send_client_desc_search_result_event(int conn_id, int status
        memcpy(ev.char_uuid, char_id->uuid.uu, sizeof(ev.char_uuid));
 
        if (status == BT_STATUS_SUCCESS) {
-               DBG("building desc uuid");
+               /* building desc uuid */
                memcpy(ev.desc_uuid, desc_uuid->uu, sizeof(ev.desc_uuid));
        }
 
-       DBG("sending the desc search event");
+       DBG("sending the desc search event. conn_id[%d] status[%d]", conn_id, status);
 
        event_cb(HAL_EV_GATT_CLIENT_DESC_SEARCH_RESULT, (void *)&ev, sizeof(ev));
 }
@@ -1303,7 +1267,7 @@ static bt_status_t _hal_gattc_get_all_descriptor(int conn_id,
 
        conn_info = __bt_find_gatt_conn_info_from_conn_id(conn_id);
        if (NULL == conn_info) {
-               ERR("Failed to get the conn_info for conn_id[%d]", conn_id);
+               ERR("Failed to get the conn_info for conn_id [%d]", conn_id);
                return BT_STATUS_FAIL;
        }
 
@@ -1338,7 +1302,6 @@ static bt_status_t _hal_gattc_get_all_descriptor(int conn_id,
 
                                /* send event */
                                if (BT_STATUS_SUCCESS == status) {
-                                       DBG("Sending the success descriptor event");
                                        _bt_hal_send_client_desc_search_result_event(conn_id, status, srvc_id,
                                                        char_id, &gattc_desc->desc_uuid);
                                }
@@ -1346,8 +1309,6 @@ static bt_status_t _hal_gattc_get_all_descriptor(int conn_id,
                }
        }
 
-       DBG("sending final event");
-
        status = BT_STATUS_FAIL;
        _bt_hal_send_client_desc_search_result_event(conn_id, status, srvc_id, char_id, NULL);
 
@@ -1365,11 +1326,9 @@ bt_status_t btif_gattc_get_descriptor(int conn_id,
                btgatt_srvc_id_t *srvc_id, btgatt_gatt_id_t *char_id,
                btgatt_gatt_id_t *start_descr_id)
 {
-       DBG("+");
        CHECK_BTGATT_INIT();
 
        if (start_descr_id == NULL) {
-               DBG("Get all the descriptors");
                return _hal_gattc_get_all_descriptor(conn_id, srvc_id, char_id);
        } else {
                DBG("TBD Get specific descriptor");
@@ -1386,8 +1345,6 @@ static void __hal_send_char_read_event(hal_gatt_resp_data_t *resp_data, int resu
                return;
        }
 
-       DBG("sending gatt client charac read conn_id[%d] status[%d]", resp_data->conn_id, result);
-
        memset(&ev, 0, sizeof(ev));
        ev.conn_id = resp_data->conn_id;
        ev.inst_id = resp_data->srvc_id.id.inst_id;
@@ -1399,11 +1356,11 @@ static void __hal_send_char_read_event(hal_gatt_resp_data_t *resp_data, int resu
 
        ev.len = len;
        if (len > 0) {
-               DBG("building the char read value [%d]", len);
+               /* building the char read value */
                memcpy(ev.value, value, len);
        }
 
-       DBG("sending the gatt client read charac event");
+       DBG("sending gatt client charac read event. conn_id[%d] status[%d]", resp_data->conn_id, result);
 
        event_cb(HAL_EV_GATT_CLIENT_READ_CHARAC, (void *)&ev, sizeof(ev));
 }
@@ -1420,8 +1377,6 @@ static void __hal_internal_read_char_cb(GObject *source_object,
        hal_gatt_resp_data_t *resp_data = user_data;
        int result = BT_STATUS_SUCCESS;
 
-       DBG("+");
-
        system_gconn = _bt_hal_get_system_gconn();
        value = g_dbus_connection_call_finish(system_gconn, res, &error);
 
@@ -1442,11 +1397,6 @@ static void __hal_internal_read_char_cb(GObject *source_object,
        while (g_variant_iter_loop(iter, "y", &g_byte))
                g_byte_array_append(gp_byte_array, &g_byte, 1);
 
-/*
-       DBG("value is");
-       for (i = 0; i < gp_byte_array->len; i++)
-               DBG("%02x", gp_byte_array->data[i]);
-*/
 
        //send value  event
        __hal_send_char_read_event(resp_data, result, gp_byte_array->data, gp_byte_array->len);
@@ -1457,10 +1407,8 @@ static void __hal_internal_read_char_cb(GObject *source_object,
        g_variant_iter_free(iter);
        g_variant_unref(value);
 
-       DBG("-");
 }
 
-
 static bt_status_t _hal_read_characteristic_value(int conn_id, btgatt_srvc_id_t *srvc_id,
                btgatt_gatt_id_t *char_id, int auth_req)
 {
@@ -1478,7 +1426,7 @@ static bt_status_t _hal_read_characteristic_value(int conn_id, btgatt_srvc_id_t
        /* get the connection info */
        conn_info = __bt_find_gatt_conn_info_from_conn_id(conn_id);
        if (NULL == conn_info) {
-               ERR("Failed to get the conn_info for conn_id[%d]", conn_id);
+               ERR("Failed to get the conn_info for conn_id [%d]", conn_id);
                return BT_STATUS_FAIL;
        }
 
@@ -1490,7 +1438,6 @@ static bt_status_t _hal_read_characteristic_value(int conn_id, btgatt_srvc_id_t
        }
 
        _bt_hal_convert_uuid_type_to_string(svc_uuid_str, gattc_service->svc_uuid.uu);
-       DBG("%s %s", gattc_service->svc_path + 37, svc_uuid_str);
 
        /* find characteristic */
        gattc_char = _gattc_find_char_from_uuid(gattc_service, &char_id->uuid,
@@ -1522,8 +1469,6 @@ static bt_status_t _hal_read_characteristic_value(int conn_id, btgatt_srvc_id_t
 
        char_handle = gattc_char->chr_path;
 
-       DBG("calling char read value");
-
        g_dbus_connection_call(g_conn, BT_HAL_BLUEZ_NAME, char_handle, BT_HAL_GATT_CHAR_INTERFACE,
                        "ReadValue", g_variant_new("(a{sv})", builder),
                        G_VARIANT_TYPE("(ay)"), G_DBUS_CALL_FLAGS_NONE, -1, NULL,
@@ -1540,7 +1485,6 @@ bt_status_t btif_read_characteristic(int conn_id,
                int auth_req)
 {
        CHECK_BTGATT_INIT();
-       DBG("+");
 
        return _hal_read_characteristic_value(conn_id, srvc_id, char_id, auth_req);
 }
@@ -1554,8 +1498,6 @@ static void __hal_send_char_write_event(hal_gatt_resp_data_t *resp_data, int res
                return;
        }
 
-       DBG("sending gatt client charac write conn_id[%d] status[%d]", resp_data->conn_id, result);
-
        memset(&ev, 0, sizeof(ev));
        ev.conn_id = resp_data->conn_id;
        ev.inst_id = resp_data->srvc_id.id.inst_id;
@@ -1565,7 +1507,7 @@ static void __hal_send_char_write_event(hal_gatt_resp_data_t *resp_data, int res
        memcpy(ev.svc_uuid, resp_data->srvc_id.id.uuid.uu, sizeof(ev.svc_uuid));
        memcpy(ev.char_uuid, resp_data->char_id.uuid.uu, sizeof(ev.char_uuid));
 
-       DBG("sending the gatt client write charac event");
+       DBG("sending gatt client charac write event. conn_id[%d] status[%d]", resp_data->conn_id, result);
 
        event_cb(HAL_EV_GATT_CLIENT_WRITE_CHARAC, (void *)&ev, sizeof(ev));
 }
@@ -1660,7 +1602,7 @@ static int __bluetooth_gatt_acquire_write_fd(const char *chr, int *fd, int *mtu)
        g_variant_get(value, "(hq)", &idx, &att_mtu);
        *fd = g_unix_fd_list_get(fd_list, idx, NULL);
 
-       INFO("FD is %d index is %d mtu is %d", *fd, idx, att_mtu);
+       INFO("Acquired Write fd %d,  index %d, mtu %d", *fd, idx, att_mtu);
        *mtu = att_mtu;
 
        g_object_unref(fd_list);
@@ -1711,7 +1653,7 @@ static int __bluetooth_gatt_acquire_notify_fd(const char *chr, int *fd, int *mtu
        notify_fd = g_unix_fd_list_get(fd_list, idx, NULL);
        *mtu = att_mtu;
 
-       INFO("Acquired characteristic Notify fd %d, mtu %d", notify_fd, *mtu);
+       INFO("Acquired Notify fd %d, mtu %d", notify_fd, *mtu);
 
        *fd = notify_fd;
 
@@ -1742,8 +1684,6 @@ static bt_status_t _hal_write_characteristic_value(int conn_id, btgatt_srvc_id_t
        bt_gatt_characteristic_property_t write_prop = HAL_GATT_CHARACTERISTIC_PROPERTY_WRITE;
        int ret = BT_STATUS_SUCCESS;
 
-       DBG("+");
-
        ret = __hal_get_write_prop(write_type, &write_prop);
        if (BT_STATUS_FAIL == ret) {
                DBG("received invalid  write type:[%d] ", write_type);
@@ -1753,7 +1693,7 @@ static bt_status_t _hal_write_characteristic_value(int conn_id, btgatt_srvc_id_t
        /* get the connection info */
        conn_info = __bt_find_gatt_conn_info_from_conn_id(conn_id);
        if (NULL == conn_info) {
-               ERR("Failed to get the conn_info for conn_id[%d]", conn_id);
+               ERR("Failed to get the conn_info for conn_id [%d]", conn_id);
                return BT_STATUS_FAIL;
        }
 
@@ -1832,13 +1772,12 @@ bt_status_t btif_get_acquire_write_fd(int conn_id,
        bt_gatt_characteristic_property_t write_prop = HAL_GATT_CHARACTERISTIC_PROPERTY_WRITE_NO_RESPONSE;
        int ret = BT_STATUS_SUCCESS;
 
-       DBG("+");
        DBG("svc isntance id:[%d]", srvc_id->id.inst_id);
 
        /* get the connection info */
        conn_info = __bt_find_gatt_conn_info_from_conn_id(conn_id);
        if (NULL == conn_info) {
-               ERR("Failed to get the conn_info for conn_id[%d]", conn_id);
+               ERR("Failed to get the conn_info for conn_id [%d]", conn_id);
                return BT_STATUS_FAIL;
        }
 
@@ -1862,7 +1801,6 @@ bt_status_t btif_get_acquire_write_fd(int conn_id,
        if (ret != BT_STATUS_SUCCESS)
                return ret;
 
-       INFO("Characterstics FD erite  characterstics fd is %d", *fd);
        return ret;
 }
 
@@ -1879,13 +1817,12 @@ bt_status_t btif_get_acquire_notify_fd(int conn_id,
        bt_gatt_characteristic_property_t write_prop = HAL_GATT_CHARACTERISTIC_PROPERTY_NOTIFY;
        int ret = BT_STATUS_SUCCESS;
 
-       DBG("+");
-       DBG("svc isntance id:[%d]", srvc_id->id.inst_id);
+       DBG("svc isntance id [%d]", srvc_id->id.inst_id);
 
        /* get the connection info */
        conn_info = __bt_find_gatt_conn_info_from_conn_id(conn_id);
        if (NULL == conn_info) {
-               ERR("Failed to get the conn_info for conn_id[%d]", conn_id);
+               ERR("Failed to get the conn_info for conn_id [%d]", conn_id);
                return BT_STATUS_FAIL;
        }
 
@@ -1909,8 +1846,6 @@ bt_status_t btif_get_acquire_notify_fd(int conn_id,
        if (ret != BT_STATUS_SUCCESS)
                return ret;
 
-       INFO("Characterstics FD write characterstics fd is %d", *fd);
-
        return ret;
 }
 
@@ -1923,8 +1858,6 @@ bt_status_t btif_write_characteristic(int conn_id,
 {
        CHECK_BTGATT_INIT();
 
-       DBG("+");
-
        DBG("svc isntance id:[%d]", srvc_id->id.inst_id);
        return _hal_write_characteristic_value(conn_id, srvc_id, char_id, write_type,
                                len, auth_req, p_value);
@@ -1939,8 +1872,6 @@ static void __hal_send_desc_read_event(hal_gatt_resp_data_t *resp_data, int resu
                return;
        }
 
-       DBG("sending gatt client desc read conn_id[%d] status[%d]", resp_data->conn_id, result);
-
        memset(&ev, 0, sizeof(ev));
        ev.conn_id = resp_data->conn_id;
        ev.inst_id = resp_data->srvc_id.id.inst_id;
@@ -1953,11 +1884,11 @@ static void __hal_send_desc_read_event(hal_gatt_resp_data_t *resp_data, int resu
 
        ev.len = len;
        if (len > 0) {
-               DBG("building the desc read value [%d]", len);
+               /* building the desc read value */
                memcpy(ev.value, value, len);
        }
 
-       DBG("sending the gatt client read descriptor event");
+       DBG("sending gatt client desc read conn_id[%d] status[%d]", resp_data->conn_id, result);
 
        event_cb(HAL_EV_GATT_CLIENT_READ_DESC, (void *)&ev, sizeof(ev));
 }
@@ -2032,12 +1963,10 @@ static bt_status_t _hal_read_descriptor_value(int conn_id, btgatt_srvc_id_t *srv
 
        hal_gattc_desc_t *gattc_desc = NULL;
 
-       DBG("+");
-
        /* get the connection info */
        conn_info = __bt_find_gatt_conn_info_from_conn_id(conn_id);
        if (NULL == conn_info) {
-               ERR("Failed to get the conn_info for conn_id[%d]", conn_id);
+               ERR("Failed to get the conn_info for conn_id [%d]", conn_id);
                return BT_STATUS_FAIL;
        }
 
@@ -2128,8 +2057,6 @@ static void __hal_send_desc_write_event(hal_gatt_resp_data_t *resp_data, int res
                return;
        }
 
-       DBG("sending gatt client charac write conn_id[%d] status[%d]", resp_data->conn_id, result);
-
        memset(&ev, 0, sizeof(ev));
        ev.conn_id = resp_data->conn_id;
        ev.inst_id = resp_data->srvc_id.id.inst_id;
@@ -2140,7 +2067,7 @@ static void __hal_send_desc_write_event(hal_gatt_resp_data_t *resp_data, int res
        memcpy(ev.char_uuid, resp_data->char_id.uuid.uu, sizeof(ev.char_uuid));
        memcpy(ev.desc_uuid, resp_data->desc_id.uuid.uu, sizeof(ev.desc_uuid));
 
-       DBG("sending the gatt client write charac event");
+       DBG("sending gatt client charac write event. conn_id[%d] status[%d]", resp_data->conn_id, result);
 
        event_cb(HAL_EV_GATT_CLIENT_WRITE_DESC, (void *)&ev, sizeof(ev));
 }
@@ -2213,7 +2140,7 @@ static bt_status_t _hal_write_descriptor_value(int conn_id, btgatt_srvc_id_t *sr
        /* get the connection info */
        conn_info = __bt_find_gatt_conn_info_from_conn_id(conn_id);
        if (NULL == conn_info) {
-               ERR("Failed to get the conn_info for conn_id[%d]", conn_id);
+               ERR("Failed to get the conn_info for conn_id [%d]", conn_id);
                return BT_STATUS_FAIL;
        }
 
@@ -2702,8 +2629,6 @@ bt_status_t btif_gattc_conn_parameter_update(bt_bdaddr_t *bd, int min_int, int m
 {
        CHECK_BTGATT_INIT();
 
-       DBG("+");
-
        return __hal_update_conn_parameter(bd, min_int, max_int, latency, timeout);
 }
 
@@ -2723,8 +2648,6 @@ static void __bt_request_att_mtu_device_cb(GDBusProxy *proxy, GAsyncResult *res,
        struct hal_ev_gatt_client_mtu_exchange_completed  ev;
        struct conn_mtu_s *conn_mtu = (struct conn_mtu_s *)user_data;
 
-       DBG("+");
-
        reply = g_dbus_proxy_call_finish(proxy, res, &g_error);
        g_object_unref(proxy);
        if (reply == NULL) {
@@ -3316,13 +3239,11 @@ const btgatt_client_interface_t btgatt_client_interface = {
        .batchscan_enb_batch_scan = batchscan_enb_batch_scan,
        .batchscan_dis_batch_scan = batchscan_dis_batch_scan,
        .batchscan_read_reports = batchscan_read_reports,
-       .add_connection_info = btif_gattc_add_connection_info
+       .add_connection_info = btif_gattc_add_connection_info,
 };
 
 static hal_gattc_server_info_t *__bt_find_gatt_conn_info(const bt_bdaddr_t *serv_addr)
 {
-       DBG("+");
-
        GSList *l;
        hal_gattc_server_info_t *info = NULL;
 
@@ -3331,18 +3252,15 @@ static hal_gattc_server_info_t *__bt_find_gatt_conn_info(const bt_bdaddr_t *serv
                if (info == NULL)
                        continue;
 
-               if (!memcmp(&info->bd_addr, serv_addr, sizeof(bt_bdaddr_t))) {
-                       INFO("GATT connection found addr");
+               if (!memcmp(&info->bd_addr, serv_addr, sizeof(bt_bdaddr_t)))
                        return info;
                }
-       }
+
        return NULL;
 }
 
 static hal_gattc_client_info_t *__bt_find_gatt_client_info(bt_bdaddr_t *serv_addr)
 {
-       DBG("+");
-
        GSList *l;
        hal_gattc_client_info_t *info = NULL;
 
@@ -3351,11 +3269,10 @@ static hal_gattc_client_info_t *__bt_find_gatt_client_info(bt_bdaddr_t *serv_add
                if (info == NULL)
                        continue;
 
-               if (!memcmp(&info->bd_addr, serv_addr, sizeof(bt_bdaddr_t))) {
-                       INFO("GATT client info found addr");
+               if (!memcmp(&info->bd_addr, serv_addr, sizeof(bt_bdaddr_t)))
                        return info;
                }
-       }
+
        return NULL;
 }
 
@@ -3369,11 +3286,10 @@ static hal_gattc_client_info_t *__bt_find_gatt_client_info_from_conn_id(int conn
                if (info == NULL)
                        continue;
 
-               if (info->conn_id == conn_id) {
-                       INFO("GATT client info found for conn_id [%d]", conn_id);
+               if (info->conn_id == conn_id)
                        return info;
                }
-       }
+
        return NULL;
 }
 
@@ -3396,7 +3312,6 @@ static hal_gattc_server_info_t *__bt_find_gatt_conn_info_from_conn_id(int  conn_
 
                if ((info->inst_id == gattc_client->inst_id) &&
                        !memcmp(&info->bd_addr, &gattc_client->bd_addr, sizeof(bt_bdaddr_t))) {
-                       INFO("GATT connection found for conn_id [%d]", conn_id);
                        return info;
                }
        }
@@ -3733,7 +3648,7 @@ static void _bt_hal_send_search_service_result_event(int conn_id, int is_primary
                return;
        }
 
-       DBG("sending gatt client search service result event conn_id[%d]", conn_id);
+       DBG("Send service searching result. [%s] conn_id[%d]", uuid_str, conn_id);
 
        memset(&ev, 0, sizeof(ev));
        ev.conn_id = conn_id;
index af388a7..e80c9d7 100644 (file)
@@ -290,7 +290,7 @@ static void __bt_hal_handle_gatt_server_mtu_changed(void *buf, uint16_t len)
 
 static void __bt_hal_gatt_events(int message, void *buf, uint16_t len)
 {
-       DBG("+");
+       DBG("GATT event 0x%x", message);
        /* Check if GATT interface is Ready */
        if (!interface_ready())
                return;
@@ -441,7 +441,6 @@ static void __bt_hal_gatt_events(int message, void *buf, uint16_t len)
                DBG("Event Currently not handled!!");
                break;
        }
-       DBG("-");
 }
 
 /************************************* GATT CLIENT EVENTS ****************************************/
old mode 100755 (executable)
new mode 100644 (file)
index 816a857..032b2c6
@@ -49,11 +49,7 @@ void parse_device_properties(int num_properties, bt_property_t *properties,
        service_uuid_t *uuids;
        bt_device_type_t dev_type;
 
-       BT_DBG("num_properties: %d", num_properties);
-
        for (i = 0; i < num_properties; i++) {
-               BT_DBG("===>Prop type: %d, Len: %d<===", properties[i].type, properties[i].len);
-
                switch (properties[i].type) {
                case BT_PROPERTY_BDADDR: {
                        addr = (bt_bdaddr_t *)properties[i].val;
@@ -118,7 +114,7 @@ void parse_device_properties(int num_properties, bt_property_t *properties,
                                } else {
                                        BT_DBG("Duplicate UUID found:%s\n", lcl_uuid);
                                }
-                               BT_DBG("%d.BT_PROPERTY_UUIDS:%s", dev_info->uuid_count, lcl_uuid);
+                               BT_DBG("[%d] %s", dev_info->uuid_count, lcl_uuid);
                        }
                        break;
                }
index 3fd6796..3eb9989 100644 (file)
@@ -92,14 +92,12 @@ static void event_data_free(event_t *event_info)
 static gboolean dispatch_idle(gpointer user_data)
 {
        event_t *event_info = user_data;
-       BT_DBG("+");
 
        if (NULL == event_handler_cb)
                BT_ERR("Upstream handler not registered");
        else
                (*event_handler_cb)(event_info->event, event_info->event_data, event_info->size);
 
-       BT_DBG("-");
        return G_SOURCE_REMOVE;
 }
 
old mode 100755 (executable)
new mode 100644 (file)
index 76861f1..f0de707
@@ -147,7 +147,6 @@ void uuid_to_stringname(service_uuid_t *p_uuid, char *str)
        uint32_t uuid0, uuid4;
        uint16_t uuid1, uuid2, uuid3, uuid5;
        const char *uuid_name;
-       const char *uuid_name1;
 
        memcpy(&uuid0, &(p_uuid->uuid[0]), 4);
        memcpy(&uuid1, &(p_uuid->uuid[4]), 2);
@@ -156,12 +155,7 @@ void uuid_to_stringname(service_uuid_t *p_uuid, char *str)
        memcpy(&uuid4, &(p_uuid->uuid[10]), 4);
        memcpy(&uuid5, &(p_uuid->uuid[14]), 2);
 
-
        uuid_name = dump_uuid_name(ntohl(uuid0));
-       uuid_name1 = dump_uuid_name((ntohl(uuid4) >> 16));
-
-       BT_DBG("UUID Name [%s]", uuid_name);
-       BT_DBG("UUID Name Shifted [%s]", uuid_name1);
 
        snprintf((char *)str, 2*BT_UUID_STRING_MAX, "%.8x-%.4x-%.4x-%.4x-%.8x%.4x--%s",
                        ntohl(uuid0), ntohs(uuid1),
index 400f662..bf4a07b 100644 (file)
@@ -1409,13 +1409,10 @@ static void cb_gattc_register_app(int status, int clientIf, bt_uuid_t *app_uuid)
        char uuid_str[BT_UUID_STRING_MAX];
        event_gattc_register_t *event;
 
-       BT_INFO("+");
-
        /* Check if GATT client registered for Default GATT client UUID */
        uuid_to_string((service_uuid_t *)app_uuid, uuid_str);
-       BT_INFO("UUID:%s", uuid_str);
 
-       BT_INFO("BTGATT CLIENT REGISTER APP CB, status:%d, clientIf:%d", status, clientIf);
+       BT_INFO("GATT CLIENT REGISTER APP CB, status:%d, clientIf:%d, %s", status, clientIf, uuid_str);
        event = g_new0(event_gattc_register_t, 1);
        event->client_if = clientIf;
        event->status = (status == 0 ? OAL_STATUS_SUCCESS : OAL_STATUS_INTERNAL_ERROR);
@@ -1479,7 +1476,7 @@ static void cb_gattc_search_result(int conn_id, btgatt_srvc_id_t *srvc_id)
        BT_INFO("BTGATT Client Service Search Result cb, conn_id:%d", conn_id);
 
        uuid_to_stringname((oal_uuid_t *)&(srvc_id->id.uuid), uuid_str);
-       BT_INFO("Service=> UUID: [%s], Inst_id: [%u], Type: [%s]",
+       BT_INFO("Service=> [%s], Inst_id [%u], Type [%s]",
                uuid_str, srvc_id->id.inst_id, srvc_id->is_primary ? "Primary" : "Secondary");
 
        event_gattc_service_result_t *event = g_new0(event_gattc_service_result_t, 1);
@@ -1509,9 +1506,10 @@ static void cb_gattc_get_characteristics(int conn_id, int status, btgatt_srvc_id
        char uuid_str1[2*BT_UUID_STRING_MAX];
        char uuid_str2[2*BT_UUID_STRING_MAX];
        char str[50];
+
        BT_INFO("BTGATT Client Get Characteristic Callback, conn_id:%d, status:%d", conn_id, status);
        uuid_to_stringname((oal_uuid_t *)&(srvc_id->id.uuid), uuid_str1);
-       BT_INFO("Service=> UUID: [%s], Inst_id: [%u], Type: [%s]",
+       BT_INFO("Service=> [%s], Inst_id [%u], Type [%s]",
                uuid_str1, srvc_id->id.inst_id, srvc_id->is_primary ? "Primary" : "Secondary");
 
        event_gattc_characteristic_result_t *event = g_new0(event_gattc_characteristic_result_t, 1);
@@ -1521,7 +1519,7 @@ static void cb_gattc_get_characteristics(int conn_id, int status, btgatt_srvc_id
 
        if (status == 0) {
                uuid_to_stringname((oal_uuid_t *)&(char_id->uuid), uuid_str2);
-               BT_INFO("Charac=> UUID: [%s], Inst_id: [%u], Prop: [%s]",
+               BT_INFO("Charac => [%s], Inst_id [%u], Prop [%s]",
                        uuid_str2, char_id->inst_id, char_prop_to_string(char_prop, str));
                event->char_prop = char_prop;
                memcpy(&(event->char_id), char_id, sizeof(oal_gatt_id_t));
@@ -1539,9 +1537,9 @@ static void cb_gattc_get_descriptor(int conn_id, int status, btgatt_srvc_id_t *s
        BT_INFO("BTGATT Client Get Descriptor Callback, conn_id:%d, status:%d", conn_id, status);
        uuid_to_stringname((oal_uuid_t *)&(srvc_id->id.uuid), uuid_str1);
        uuid_to_stringname((oal_uuid_t *)&(char_id->uuid), uuid_str2);
-       BT_INFO("Service=> UUID: [%s], Inst_id: [%u], Type: [%s]",
+       BT_INFO("Service=> [%s], Inst_id [%u], Type [%s]",
                uuid_str1, srvc_id->id.inst_id, srvc_id->is_primary ? "Primary" : "Secondary");
-       BT_INFO("Charac=> UUID: [%s], Inst_id: [%u]", uuid_str2, char_id->inst_id);
+       BT_INFO("Charac => [%s], Inst_id [%u]", uuid_str2, char_id->inst_id);
 
        event_gattc_descriptor_result_t *event = g_new0(event_gattc_descriptor_result_t, 1);
        event->conn_status.conn_id = conn_id;
@@ -1551,7 +1549,7 @@ static void cb_gattc_get_descriptor(int conn_id, int status, btgatt_srvc_id_t *s
 
        if (status == 0) {
                uuid_to_stringname((oal_uuid_t *)&(descr_id->uuid), uuid_str3);
-               BT_INFO("Desc=> UUID: [%s], Inst_id: [%u]", uuid_str3, descr_id->inst_id);
+               BT_INFO("Desc   => [%s], Inst_id [%u]", uuid_str3, descr_id->inst_id);
                memcpy(&(event->descr_id), descr_id, sizeof(oal_gatt_id_t));
        }
        send_event(OAL_EVENT_GATTC_DESC_SERACH_RESULT, event, sizeof(*event));
@@ -1565,8 +1563,8 @@ static void cb_gattc_register_for_notification(int client_if, int registered, in
                client_if, status, registered == 1 ? "REGISTERED" : "DEREGISTERED");
        uuid_to_stringname((oal_uuid_t *)&(srvc_id->id.uuid), uuid_str1);
        uuid_to_stringname((oal_uuid_t *)&(char_id->uuid), uuid_str2);
-       BT_INFO("Service=> UUID: [%s], Inst_id: [%u], Type: [%s]", uuid_str1, srvc_id->id.inst_id, srvc_id->is_primary ? "Primary" : "Secondary");
-       BT_INFO("Charac=> UUID: [%s], Inst_id: [%u]", uuid_str2, char_id->inst_id);
+       BT_INFO("Service=> [%s], Inst_id [%u], Type [%s]", uuid_str1, srvc_id->id.inst_id, srvc_id->is_primary ? "Primary" : "Secondary");
+       BT_INFO("Charac => [%s], Inst_id [%u]", uuid_str2, char_id->inst_id);
 
        event_gattc_regdereg_notify_t *event = g_new0(event_gattc_regdereg_notify_t, 1);
        oal_event_t event_type = (registered == 1 ? OAL_EVENT_GATTC_NOTIFICATION_REGISTERED : OAL_EVENT_GATTC_NOTIFICATION_DEREGISTERED);
@@ -1591,9 +1589,9 @@ static void cb_gattc_notify(int conn_id, btgatt_notify_params_t *p_data)
        uuid_to_stringname((oal_uuid_t *)&(p_data->srvc_id.id.uuid), uuid_str1);
        uuid_to_stringname((oal_uuid_t *)&(p_data->char_id.uuid), uuid_str2);
 
-       BT_INFO("Service=> UUID: [%s], Inst_id: [%u], Type: [%s]",
+       BT_INFO("Service=> [%s], Inst_id [%u], Type [%s]",
                uuid_str1, p_data->srvc_id.id.inst_id, p_data->srvc_id.is_primary ? "Primary" : "Secondary");
-       BT_INFO("Charac=> UUID: [%s], Inst_id: [%u]", uuid_str2, p_data->char_id.inst_id);
+       BT_INFO("Charac => [%s], Inst_id [%u]", uuid_str2, p_data->char_id.inst_id);
 
        if (p_data->len > 0) {
                char *data = NULL;
@@ -1645,10 +1643,10 @@ static void cb_gattc_read_characteristic(int conn_id, int status, btgatt_read_pa
        if (status == 0) {
                uuid_to_stringname((oal_uuid_t *)&(p_data->srvc_id.id.uuid), uuid_str1);
                uuid_to_stringname((oal_uuid_t *)&(p_data->char_id.uuid), uuid_str2);
-               BT_INFO("Service=> UUID: [%s], Inst_id: [%u], Type: [%s]", uuid_str1,
+               BT_INFO("Service=> [%s], Inst_id [%u], Type [%s]", uuid_str1,
                        p_data->srvc_id.id.inst_id, p_data->srvc_id.is_primary ? "Primary" : "Secondary");
-               BT_INFO("Charac=> UUID: [%s], Inst_id: [%u]", uuid_str2, p_data->char_id.inst_id);
-               BT_INFO("Len: %u, value_type: %u", p_data->value.len, p_data->value_type);
+               BT_INFO("Charac => [%s], Inst_id [%u]", uuid_str2, p_data->char_id.inst_id);
+               BT_DBG("Len: %u, value_type: %u", p_data->value.len, p_data->value_type);
                if (p_data->value.len > 0 && event->value_type == GATTC_READ_VALUE_TYPE_VALUE) {
                        char *data = NULL;
                        data = g_malloc(3*p_data->value.len+1);
@@ -1658,7 +1656,7 @@ static void cb_gattc_read_characteristic(int conn_id, int status, btgatt_read_pa
                                return;
                        }
                        convert_hex_2_str((unsigned char *)p_data->value.value, p_data->value.len, data);
-                       BT_INFO("Read Data: [%s]", data);
+                       BT_DBG("Read Data: [%s]", data);
                        event->data_len = p_data->value.len;
                        memcpy(&(event->data), &(p_data->value.value), event->data_len);
                        g_free(data);
@@ -1681,9 +1679,9 @@ static void cb_gattc_write_characteristic(int conn_id, int status, btgatt_write_
        if (status == 0) {
                uuid_to_stringname((oal_uuid_t *)&(p_data->srvc_id.id.uuid), uuid_str1);
                uuid_to_stringname((oal_uuid_t *)&(p_data->char_id.uuid), uuid_str2);
-               BT_INFO("Service=> UUID: [%s], Inst_id: [%u], Type: [%s]", uuid_str1,
+               BT_INFO("Service=> [%s], Inst_id [%u], Type [%s]", uuid_str1,
                        p_data->srvc_id.id.inst_id, p_data->srvc_id.is_primary ? "Primary" : "Secondary");
-               BT_INFO("Charac=> UUID: [%s], Inst_id: [%u]", uuid_str2, p_data->char_id.inst_id);
+               BT_INFO("Charac => [%s], Inst_id [%u]", uuid_str2, p_data->char_id.inst_id);
        }
        send_event(OAL_EVENT_GATTC_WRITE_CHARAC, event, sizeof(*event));
 }
@@ -1705,10 +1703,10 @@ static void cb_gattc_write_descriptor(int conn_id, int status, btgatt_write_para
                uuid_to_stringname((oal_uuid_t *)&(p_data->srvc_id.id.uuid), uuid_str1);
                uuid_to_stringname((oal_uuid_t *)&(p_data->char_id.uuid), uuid_str2);
                uuid_to_stringname((oal_uuid_t *)&(p_data->descr_id.uuid), uuid_str3);
-               BT_INFO("Service=> UUID: [%s], Inst_id: [%u], Type: [%s]", uuid_str1,
+               BT_INFO("Service=> [%s], Inst_id [%u], Type [%s]", uuid_str1,
                        p_data->srvc_id.id.inst_id, p_data->srvc_id.is_primary ? "Primary" : "Secondary");
-               BT_INFO("Charac=> UUID: [%s], Inst_id: [%u]", uuid_str2, p_data->char_id.inst_id);
-               BT_INFO("Desc=> UUID: [%s], Inst_id: [%u]", uuid_str3, p_data->descr_id.inst_id);
+               BT_INFO("Charac => [%s], Inst_id [%u]", uuid_str2, p_data->char_id.inst_id);
+               BT_INFO("Desc   => [%s], Inst_id [%u]", uuid_str3, p_data->descr_id.inst_id);
        }
        send_event(OAL_EVENT_GATTC_WRITE_DESCR, event, sizeof(*event));
 }
@@ -1734,11 +1732,11 @@ static void cb_gattc_read_descriptor(int conn_id, int status, btgatt_read_params
                uuid_to_stringname((oal_uuid_t *)&(p_data->srvc_id.id.uuid), uuid_str1);
                uuid_to_stringname((oal_uuid_t *)&(p_data->char_id.uuid), uuid_str2);
                uuid_to_stringname((oal_uuid_t *)&(p_data->descr_id.uuid), uuid_str3);
-               BT_INFO("Service=> UUID: [%s], Inst_id: [%u], Type: [%s]", uuid_str1,
+               BT_INFO("Service=> [%s], Inst_id [%u], Type [%s]", uuid_str1,
                        p_data->srvc_id.id.inst_id, p_data->srvc_id.is_primary ? "Primary" : "Secondary");
-               BT_INFO("Charac=> UUID: [%s], Inst_id: [%u]", uuid_str2, p_data->char_id.inst_id);
-               BT_INFO("Desc=> UUID: [%s], Inst_id: [%u]", uuid_str3, p_data->descr_id.inst_id);
-               BT_INFO("Len: %u, value_type: %u", p_data->value.len, p_data->value_type);
+               BT_INFO("Charac => [%s], Inst_id [%u]", uuid_str2, p_data->char_id.inst_id);
+               BT_INFO("Desc   => [%s], Inst_id [%u]", uuid_str3, p_data->descr_id.inst_id);
+               BT_DBG("Len: %u, value_type: %u", p_data->value.len, p_data->value_type);
                if (p_data->value.len > 0 && event->value_type == GATTC_READ_VALUE_TYPE_VALUE) {
                        char *data = NULL;
                        data = g_malloc(3*p_data->value.len+1);
@@ -1748,7 +1746,7 @@ static void cb_gattc_read_descriptor(int conn_id, int status, btgatt_read_params
                                return;
                        }
                        convert_hex_2_str((unsigned char *)p_data->value.value, p_data->value.len, data);
-                       BT_INFO("Read Data: [%s]", data);
+                       BT_DBG("Read Data: [%s]", data);
                        event->data_len = p_data->value.len;
                        memcpy(&(event->data), &(p_data->value.value), event->data_len);
                        g_free(data);
index a4fda40..fbe1660 100644 (file)
@@ -271,7 +271,6 @@ static void __bt_adapter_le_handle_pending_request_info(int result,
        GSList *l;
        GArray *out_param;
        invocation_info_t *req_info = NULL;
-       BT_DBG("+");
 
        for (l = _bt_get_invocation_list(); l != NULL; ) {
                req_info = l->data;
@@ -287,7 +286,6 @@ static void __bt_adapter_le_handle_pending_request_info(int result,
                        int *saved_handle;
                        bt_pending_adv_data_set_t *data;
 
-                       BT_DBG("Service function: [%d]", service_function);
                        ret_if(param == NULL);
 
                        saved_handle = (int*)req_info->user_data;
@@ -332,10 +330,10 @@ static void __bt_adapter_le_handle_pending_request_info(int result,
                        break;
                }
                default:
+                       BT_DBG("Unknown function(%d)", service_function);
                        break;
                }
        }
-       BT_DBG("-");
 }
 
 static void __bt_le_handle_server_instance_registered(event_gatts_register_t *data)
@@ -503,14 +501,13 @@ static void __bt_le_multi_advertising_set_data(event_ble_multiadv_status *event)
        if (sender == NULL) {
                BT_ERR("Abnormal!!");
        } else {
-               BT_DBG("Sender [%s], adv handle [%d]",  sender, adv_handle);
+               BT_INFO("Sender [%s], adv handle [%d]",  sender, adv_handle);
                if (event->status != OAL_STATUS_SUCCESS)
                        result = BLUETOOTH_ERROR_INTERNAL;
 
                info = g_malloc0(sizeof(bt_pending_adv_data_set_t));
                info->sender = sender;
                info->adv_handle = adv_handle;
-               BT_DBG("Sender [%s], adv handle [%d]",  info->sender, info->adv_handle);
                __bt_adapter_le_handle_pending_request_info(result,
                                BT_SET_SCAN_RESPONSE_DATA,
                                (void*)info, sizeof(bt_pending_adv_data_set_t));
@@ -531,7 +528,6 @@ static int __get_advertisement_data(unsigned char *dest, unsigned char *src)
                int len = src[i];
 
                if ((len == 0) || (31 < (i + len))) {
-                       BT_INFO("length: %d", length);
                        memcpy(dest, src, length);
                        break;
                }
@@ -634,7 +630,7 @@ static gboolean __bt_check_scan_result_with_filter(const char *device_address,
        int idx;
 
        if (scanner->filter_list == NULL) {
-               BT_INFO("This scanner is on Full Scan.");
+               BT_DBG("This scanner is on Full Scan.");
                return TRUE;
        }
 
@@ -911,13 +907,11 @@ static void __bt_le_handle_device_found(event_ble_scan_result_info *scan_result)
        unsigned char scan_resp_data[BLUETOOTH_SCAN_RESP_DATA_LENGTH_MAX];
        int adv_ind_len = 0;
        int scan_resp_len = 0;
-       char *tmp_str = NULL;
        GVariant *scan_data_param;
        GVariant *adv_data_param;
        GVariant *param;
        GSList *l;
 
-       BT_DBG("+");
        ret_if(NULL == scan_result);
 
        _bt_convert_addr_type_to_string(address, scan_result->address.addr);
@@ -938,24 +932,9 @@ static void __bt_le_handle_device_found(event_ble_scan_result_info *scan_result)
                return;
        }
 
-       BT_INFO("Address: %s, RSSI: %d, adv_ind_len: %d, scan_resp_len: %d",
+       BT_DBG("Address: %s, RSSI: %d, adv_ind_len: %d, scan_resp_len: %d",
                        address, scan_result->rssi, adv_ind_len, scan_resp_len);
 
-       tmp_str = _bt_service_convert_hex_to_string(scan_result->adv_data, 62);
-       BT_INFO("Complete Data: [%s]", tmp_str);
-       g_free(tmp_str);
-       tmp_str = NULL;
-
-       tmp_str = _bt_service_convert_hex_to_string(adv_ind_data, adv_ind_len);
-       BT_INFO("Adv Ind Data: [%s]", tmp_str);
-       g_free(tmp_str);
-       tmp_str = NULL;
-
-       tmp_str = _bt_service_convert_hex_to_string(scan_resp_data, scan_resp_len);
-       BT_INFO("Scan resp Data: [%s]", tmp_str);
-       g_free(tmp_str);
-       tmp_str = NULL;
-
        for (l = scanner_list; l != NULL; l = g_slist_next(l)) {
                scanner = l->data;
                if (scanner->is_scanning == FALSE)
@@ -979,8 +958,6 @@ static void __bt_le_handle_device_found(event_ble_scan_result_info *scan_result)
                _bt_send_event_to_dest(scanner->sender, BT_LE_ADAPTER_EVENT,
                                BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND, param);
        }
-
-       BT_DBG("-");
 }
 
 static void __bt_le_state_change_callback(int bt_status)
@@ -1014,7 +991,7 @@ static void __bt_le_state_change_callback(int bt_status)
 
 static void __bt_le_event_handler(int event_type, gpointer event_data)
 {
-       BT_INFO("OAL event = 0x%x, \n", event_type);
+       BT_INFO("OAL event = %d", event_type);
 
        switch (event_type) {
        case OAL_EVENT_BLE_ENABLED: {
@@ -1082,7 +1059,6 @@ static void __bt_le_event_handler(int event_type, gpointer event_data)
        }
        case OAL_EVENT_BLE_REMOTE_DEVICE_FOUND: {
                event_ble_scan_result_info *scan_result = event_data;
-               BT_INFO("OAL Event: OAL_EVENT_BLE_REMOTE_DEVICE_FOUND");
                __bt_le_handle_device_found(scan_result);
                break;
        }
@@ -1127,19 +1103,15 @@ static void __bt_le_event_handler(int event_type, gpointer event_data)
 
 int _bt_le_init(void)
 {
-       BT_DBG("+");
        /* Register LE event handler */
        _bt_service_register_event_handler_callback(BT_ADAPTER_LE_MODULE, __bt_le_event_handler);
-       BT_DBG("-");
        return BLUETOOTH_ERROR_NONE;
 }
 
 void _bt_le_deinit(void)
 {
-       BT_DBG("+");
        /* Un-register LE event handler */
        _bt_service_unregister_event_handler_callback(BT_ADAPTER_LE_MODULE);
-       BT_DBG("-");
 }
 
 static void __bt_le_update_discovery_status(bt_adapter_discovery_state_t status)
@@ -1151,7 +1123,6 @@ static void __bt_le_update_discovery_status(bt_adapter_discovery_state_t status)
 static int __bt_le_state_handle_request(gboolean enable)
 {
        int result = BLUETOOTH_ERROR_NONE;
-       BT_DBG("");
 
        switch (_bt_adapter_get_le_status()) {
        case BT_LE_ACTIVATING: {
@@ -1348,7 +1319,6 @@ int _bt_set_custom_advertising(const char *sender, int adv_handle,
        int server_instance;
        bt_pending_adv_data_set_t *info = NULL;
        int result = OAL_STATUS_SUCCESS;
-       BT_DBG("+");
 
        if (__bt_is_factory_test_mode()) {
                BT_ERR("Unable to start advertising in factory binary !!");
@@ -1468,7 +1438,6 @@ static int __bt_set_multi_adv_param(oal_ble_multi_adv_param_setup_t *adv_setup,
        unsigned char *ptr;
        int num_uuids;
 
-       BT_INFO("+");
        retv_if(NULL == adv_data, BLUETOOTH_ERROR_INVALID_PARAM);
        retv_if(NULL == adv_setup, BLUETOOTH_ERROR_INVALID_PARAM);
 
@@ -1476,7 +1445,7 @@ static int __bt_set_multi_adv_param(oal_ble_multi_adv_param_setup_t *adv_setup,
                int len = ptr[0];
                int type = ptr[1];
 
-               BT_INFO("len: %d, type: %x", len, type);
+               BT_DBG("len: %d, type: 0x%x", len, type);
 
                switch (type) {
                case 0xFF: /* Manufacturer Data */
@@ -1496,7 +1465,6 @@ static int __bt_set_multi_adv_param(oal_ble_multi_adv_param_setup_t *adv_setup,
                        break;
                        case 0x14: {  /* 16 bit Solicit UUID */
                        int c;
-                       int k;
                        num_uuids = (len -1)/2;
                        adv_setup->solicit_uuid = g_malloc0(sizeof(char) * 16 * num_uuids);
                        char *tmp = adv_setup->solicit_uuid;
@@ -1510,14 +1478,10 @@ static int __bt_set_multi_adv_param(oal_ble_multi_adv_param_setup_t *adv_setup,
                                if (c < num_uuids)
                                        tmp += 16;
                        }
-                       /* DEBUG: Test*/
-                       for (k = 0; k < 16 * num_uuids; k++)
-                               BT_DBG("%x", adv_setup->solicit_uuid[k]);
                        break;
                }
                case 0x02: { /* 16 bit Service UUID */
                        int c;
-                       int k;
                        num_uuids = (len -1)/2;
                        adv_setup->service_uuid = g_malloc0(sizeof(char) * 16 * num_uuids);
                        char *tmp = adv_setup->service_uuid;
@@ -1531,9 +1495,6 @@ static int __bt_set_multi_adv_param(oal_ble_multi_adv_param_setup_t *adv_setup,
                                if (c < num_uuids)
                                        tmp += 16;
                        }
-                       /* DEBUG: Test*/
-                       for (k = 0; k < 16 * num_uuids; k++)
-                               BT_DBG("%x", adv_setup->service_uuid[k]);
                        break;
                }
                case 0x16: { /* Service Data */
@@ -1568,7 +1529,6 @@ static int __bt_set_multi_adv_param(oal_ble_multi_adv_param_setup_t *adv_setup,
                ptr += len + 1;
        }
 
-       BT_INFO("-");
        return BLUETOOTH_ERROR_NONE;
 }
 
@@ -1649,7 +1609,7 @@ int _bt_set_advertising_data(const char *sender, int adv_handle,
        /* Set Server instance[Product Requirement] */
        adv_setup.tx_power = 4;
 
-       BT_DBG("####Service UUID len [%d], service data len [%d] Solicit UUID len [%d]",
+       BT_DBG("Service UUID len [%d], service data len [%d] Solicit UUID len [%d]",
                                adv_setup.solicit_uuid_len, adv_setup.service_uuid_len, adv_setup.service_data_len);
        result = adapter_ble_multi_adv_set_inst_data(server_instance, &adv_setup);
        if (result != OAL_STATUS_SUCCESS) {
index 777aa2b..453022f 100644 (file)
@@ -1496,7 +1496,6 @@ int _bt_set_le_request_state(int enable)
 static int __bt_adapter_state_handle_request(gboolean enable)
 {
        int result = BLUETOOTH_ERROR_NONE;
-       BT_DBG("");
 
        switch (adapter_state) {
        case BT_ACTIVATING:
index 8fa62ae..df21be2 100644 (file)
@@ -4426,24 +4426,22 @@ void _bt_service_method_return(GDBusMethodInvocation *invocation,
                GArray *out_param, int result)
 {
        GVariant *out_var;
-       BT_DBG("+");
+       BT_DBG("");
        out_var = g_variant_new_from_data((const GVariantType *)"ay",
                        out_param->data, out_param->len, TRUE, NULL, NULL);
 
        g_dbus_method_invocation_return_value(invocation,
                        g_variant_new("(iv)", result, out_var));
-       BT_DBG("-");
 }
 
 void _bt_service_method_return_with_unix_fd_list(GDBusMethodInvocation *invocation,
                GArray *out_param, int result, GUnixFDList *fd_list)
 {
        GVariant *out_var;
-       BT_DBG("+");
+       BT_DBG("");
        out_var = g_variant_new_from_data((const GVariantType *)"ay",
                        out_param->data, out_param->len, TRUE, NULL, NULL);
 
        g_dbus_method_invocation_return_value_with_unix_fd_list(invocation,
                        g_variant_new("(iv)", result, out_var), fd_list);
-       BT_DBG("-");
 }
index 2ee265c..008003c 100644 (file)
@@ -1072,6 +1072,7 @@ const char * _bt_convert_disc_reason_to_string(int reason)
        }
 }
 
+
 void _bt_logging_connection(gboolean connect, int addr_type)
 {
        static int le_conn = 0;
@@ -1161,8 +1162,6 @@ void _bt_copy_remote_dev(bt_remote_dev_info_t *dev_info, remote_device_t *oal_de
 {
        unsigned int i;
 
-       BT_DBG("+");
-
        dev_info->address = g_new0(char, BT_ADDRESS_STRING_SIZE);
        _bt_convert_addr_type_to_string(dev_info->address, oal_device->address.addr);
        BT_INFO("Address [%s]", dev_info->address);
@@ -1208,7 +1207,6 @@ void _bt_copy_remote_dev(bt_remote_dev_info_t *dev_info, remote_device_t *oal_de
        dev_info->device_type = (int)oal_device->type;
        dev_info->is_alias_set = ((oal_device->is_alias_set == 0) ? FALSE : TRUE);
 
-       BT_DBG("-");
 }
 
 void _bt_free_remote_dev(bt_remote_dev_info_t *dev_info)
@@ -1217,8 +1215,6 @@ void _bt_free_remote_dev(bt_remote_dev_info_t *dev_info)
 
        ret_if(NULL == dev_info);
 
-       BT_INFO("+");
-
        g_free(dev_info->address);
        g_free(dev_info->name);
        g_free(dev_info->alias);
@@ -1229,7 +1225,6 @@ void _bt_free_remote_dev(bt_remote_dev_info_t *dev_info)
        g_free(dev_info->uuids);
        g_free(dev_info);
 
-       BT_INFO("-");
 }
 
 static void __bt_get_service_list(bt_remote_dev_info_t *info, bluetooth_device_info_t *dev)
@@ -1238,8 +1233,6 @@ static void __bt_get_service_list(bt_remote_dev_info_t *info, bluetooth_device_i
        char **uuids;
        char **parts;
 
-       BT_DBG("+");
-
        ret_if(info == NULL);
        ret_if(dev == NULL);
 
@@ -1265,13 +1258,10 @@ static void __bt_get_service_list(bt_remote_dev_info_t *info, bluetooth_device_i
                dev->service_index++;
        }
 
-       BT_DBG("-");
 }
 
 void _bt_copy_remote_device(bt_remote_dev_info_t *rem_dev, bluetooth_device_info_t *dev)
 {
-       BT_DBG("+");
-
        memset(dev, 0x00, sizeof(bluetooth_device_info_t));
        __bt_get_service_list(rem_dev, dev);
        _bt_convert_addr_string_to_type(dev->device_address.addr, rem_dev->address);
@@ -1302,7 +1292,6 @@ void _bt_copy_remote_device(bt_remote_dev_info_t *rem_dev, bluetooth_device_info
                dev->manufacturer_data.data_len = 0;
        }
 
-       BT_DBG("-");
 }
 
 void _bt_service_print_dev_info(bluetooth_device_info_t *dev_info)
@@ -1430,8 +1419,6 @@ invocation_info_t* _bt_get_request_info_data_from_function_name(int service_func
        GSList *l;
        invocation_info_t *req_info = NULL;
 
-       BT_DBG("+");
-
        /* Get method invocation context */
        for (l = _bt_get_invocation_list(); l != NULL; l = g_slist_next(l)) {
                req_info = l->data;
@@ -1440,7 +1427,7 @@ invocation_info_t* _bt_get_request_info_data_from_function_name(int service_func
                return req_info;
        }
 
-       BT_DBG("-");
+       BT_DBG("Not existed");
        return NULL;
 }
 #endif
@@ -1512,25 +1499,20 @@ int _bt_get_ad_data_by_type(char *in_data, int in_len,
 
 void _bt_copy_remote_dev_info(bt_remote_dev_info_t *dest, bt_remote_dev_info_t *src)
 {
-       BT_DBG("+");
-
        ret_if(NULL == src);
 
        if (!dest->address) {
                dest->address = g_strdup(src->address);
-               BT_DBG("Address: [%s]", dest->address);
        }
 
        if (src->name) {
                g_free(dest->name);
                dest->name = g_strdup(src->name);
-               BT_DBG("Name: [%s]", dest->name);
        }
 
        if (src->alias) {
                g_free(dest->alias);
                dest->alias = g_strdup(src->alias);
-               BT_DBG("Alias: [%s]", dest->alias);
        }
 
        if (src->uuid_count > 0 && src->uuids) {
@@ -1548,18 +1530,15 @@ void _bt_copy_remote_dev_info(bt_remote_dev_info_t *dest, bt_remote_dev_info_t *
                        dest->uuids[i] = g_strdup(src->uuids[i]);
 
                dest->uuid_count = src->uuid_count;
-               BT_DBG("UUID count: %d", dest->uuid_count);
        }
 
        if (src->manufacturer_data_len > 0 && src->manufacturer_data) {
-               BT_DBG("Manufacturer data length: %d", dest->manufacturer_data_len);
                if (dest->manufacturer_data)
                        g_free(dest->manufacturer_data);
 
                dest->manufacturer_data_len = src->manufacturer_data_len;
                dest->manufacturer_data = g_memdup(
                        src->manufacturer_data, src->manufacturer_data_len);
-               BT_DBG("Manufacturer data length: %d", dest->manufacturer_data_len);
        }
 
        dest->rssi = src->rssi;
@@ -1573,7 +1552,6 @@ void _bt_copy_remote_dev_info(bt_remote_dev_info_t *dest, bt_remote_dev_info_t *
        dest->device_type = src->device_type;
        dest->is_alias_set = src->is_alias_set;
 
-       BT_DBG("-");
 }
 
 #define BT_PERMANENT_LOG_FILE_PATH "/opt/usr/home/owner/media/Downloads/.bt_dump/permanent_log.txt"
index 7f1683e..1047fb2 100644 (file)
@@ -71,7 +71,6 @@ bt_remote_dev_info_t *_bt_service_get_remote_dev_info(const char *address)
 {
        GSList *l;
 
-       BT_DBG("+");
        retv_if(NULL == address, NULL);
 
        for (l = paired_list; NULL != l; l = g_slist_next(l)) {
@@ -80,13 +79,10 @@ bt_remote_dev_info_t *_bt_service_get_remote_dev_info(const char *address)
                if (!rem_info)
                        continue;
 
-               if (!strncasecmp(rem_info->address, address, BT_ADDRESS_STRING_SIZE)) {
-                       BT_DBG("Device found");
+               if (!strncasecmp(rem_info->address, address, BT_ADDRESS_STRING_SIZE))
                        return rem_info;
                }
-       }
 
-       BT_DBG("-");
        return NULL;
 }
 
@@ -320,8 +316,6 @@ void _bt_update_remote_dev_property(
 {
        bt_remote_dev_info_t *rem_info;
 
-       BT_DBG("+");
-
        BT_DBG("Property type: %d", type);
        rem_info = _bt_service_get_remote_dev_info(address);
        ret_if(NULL == rem_info);
@@ -388,14 +382,12 @@ void _bt_update_remote_dev_property(
                return;
        }
 
-       BT_DBG("-");
 }
 
 void _bt_service_add_device_to_bonded_list(bt_remote_dev_info_t *rem_info)
 {
        bt_remote_dev_info_t *dev_info;
 
-       BT_DBG("+");
        ret_if(NULL == rem_info);
 
        dev_info = _bt_service_get_remote_dev_info(rem_info->address);
@@ -431,7 +423,6 @@ void _bt_service_add_device_to_bonded_list(bt_remote_dev_info_t *rem_info)
                }
        }
 
-       BT_DBG("-");
 }
 
 void _bt_service_remove_device_from_bonded_list(const char *address)
index 01c0461..a95b3b7 100644 (file)
@@ -686,12 +686,10 @@ static void __bt_device_authorization_request_callback(event_dev_authorize_req_t
 static void __bt_handle_ongoing_bond(bt_remote_dev_info_t *remote_dev_info, gboolean incoming_bond)
 {
        GVariant *param = NULL;
-       BT_DBG("+");
 
        if ((remote_dev_info->name || remote_dev_info->alias)
                        && remote_dev_info->address
                        && remote_dev_info->uuids) {
-               BT_INFO("All properties updated,  time to send bonding finished event");
                GVariant *uuids = NULL;
                GVariantBuilder *builder = NULL;
                GVariant *manufacturer_data;
@@ -731,6 +729,7 @@ static void __bt_handle_ongoing_bond(bt_remote_dev_info_t *remote_dev_info, gboo
                                BLUETOOTH_EVENT_BONDING_FINISHED,
                                param);
                BT_PERMANENT_LOG("Paired %s", remote_dev_info->address + 12);
+               BT_INFO_C("### Paired %s", remote_dev_info->address);
                if (incoming_bond) {
                        __bt_free_bond_info(BT_DEVICE_INCOMING_BOND_INFO);
                } else {
@@ -747,8 +746,6 @@ static void __handle_incoming_bond_created_event(bt_address_t *bd_addr)
        char address[BT_ADDRESS_STRING_SIZE];
        bluetooth_device_address_t dev_addr;
 
-       BT_INFO("+");
-
        /*
         * BlueZ sends paired signal for each paired device, during activation,
         * We should ignore this, otherwise application thinks that a new device
@@ -783,7 +780,6 @@ static void __handle_incoming_bond_created_event(bt_address_t *bd_addr)
                __bt_free_bond_info(BT_DEVICE_INCOMING_BOND_INFO);
        }
 
-       BT_INFO("-");
 }
 
 static void __bt_device_handle_bond_completion_event(bt_address_t *bd_addr)
@@ -791,8 +787,6 @@ static void __bt_device_handle_bond_completion_event(bt_address_t *bd_addr)
        gchar address[BT_ADDRESS_STR_LEN];
        bluetooth_device_address_t dev_addr;
 
-       BT_INFO("+");
-
        if (trigger_bond_info == NULL) {
                /* Send reply */
                BT_DBG("trigger_bond_info == NULL, Handle incomming bond event");
@@ -833,8 +827,6 @@ static void __bt_device_handle_bond_completion_event(bt_address_t *bd_addr)
                __bt_free_bond_info(BT_DEVICE_BOND_INFO);
                __bt_free_pairing_info(&trigger_pairing_info);
        }
-
-       BT_INFO("-");
 }
 
 /**********************************************************************************************
@@ -1563,7 +1555,6 @@ static void __bt_device_remote_device_found_callback(gpointer event_data, gboole
        GVariantBuilder *builder = NULL;
        unsigned int i;
 
-       BT_INFO("+");
        ret_if(_bt_is_discovering() == FALSE);
        ret_if(event_data == NULL);
 
@@ -1622,7 +1613,6 @@ static void __bt_device_remote_device_found_callback(gpointer event_data, gboole
                        param);
 
        _bt_free_remote_dev(dev_info);
-       BT_DBG("-");
 }
 
 static void __bt_device_trusted_callback(gboolean trusted, event_dev_trust_t* info)
@@ -1631,7 +1621,6 @@ static void __bt_device_trusted_callback(gboolean trusted, event_dev_trust_t* in
        int result = BLUETOOTH_ERROR_NONE;
        GVariant *param = NULL;
        int event;
-       BT_DBG("+");
 
        _bt_convert_addr_type_to_string(address, info->address.addr);
 
@@ -1646,12 +1635,10 @@ static void __bt_device_trusted_callback(gboolean trusted, event_dev_trust_t* in
                        event,
                        param);
 
-       BT_DBG("-");
 }
 
 static void __bt_free_pairing_info(bt_pairing_data_t **p_info)
 {
-       BT_DBG("+");
        bt_pairing_data_t * info = *p_info;
        if (info) {
                if (info->addr)
@@ -1660,13 +1647,10 @@ static void __bt_free_pairing_info(bt_pairing_data_t **p_info)
                g_free(info);
        }
        *p_info = NULL;
-       BT_DBG("-");
 }
 
 static void __bt_free_bond_info(uint8_t type)
 {
-       BT_INFO("+");
-
        switch (type) {
        case BT_DEVICE_BOND_INFO:
                if (!trigger_bond_info)
@@ -1704,7 +1688,6 @@ static void __bt_free_bond_info(uint8_t type)
                trigger_unbond_info = NULL;
                break;
        }
-       BT_INFO("-");
 }
 
 static void __bt_free_service_search_info(bt_service_search_info_data_t **p_info)
index 3e04413..8bfdf8a 100644 (file)
@@ -803,7 +803,6 @@ static void __bt_gatt_handle_pending_request_info(int result,
        GArray *out_param;
        invocation_info_t *req_info = NULL;
        ret_if(data == NULL);
-       BT_DBG("+");
 
        for (l = _bt_get_invocation_list(); l != NULL; ) {
                req_info = l->data;
@@ -1340,7 +1339,7 @@ struct gatt_client_info_t *_bt_find_remote_gatt_client_info(char *address)
                        continue;
 
                if (!g_strcmp0(info->addr, address)) {
-                       BT_INFO("Remote GATT client found addr[%s]", info->addr);
+                       BT_DBG("Remote GATT client found addr[%s]", info->addr);
                        return info;
                }
        }
@@ -1376,7 +1375,7 @@ struct gatt_server_info_t *_bt_find_remote_gatt_server_info(char *address)
                        continue;
 
                if (!g_strcmp0(info->addr, address)) {
-                       BT_INFO("Remote GATT Server found addr[%s]", info->addr);
+                       BT_DBG("Remote GATT Server found addr[%s]", info->addr);
                        return info;
                }
        }
@@ -2167,7 +2166,6 @@ static void __bt_gatt_event_handler(int event_type, gpointer event_data)
        default:
                break;
        }
-       BT_DBG("-");
 }
 
 int _bt_gatt_server_add_service(char *sender, int service_type,
@@ -2787,8 +2785,6 @@ static void __bt_build_char_browse_info(int conn_id,
        int count = 0;
        char uuid_string[BLUETOOTH_UUID_STRING_MAX];
 
-       BT_INFO("+");
-
        conn_info = __bt_find_remote_gatt_server_info_from_conn_id(conn_id);
        if (!conn_info)
                return;
@@ -2804,7 +2800,6 @@ static void __bt_build_char_browse_info(int conn_id,
        }
 
        info->count = g_slist_length(svc_info->chars);
-       BT_INFO("Total count of Characteristics [%d]", info->count);
 
        for (l = svc_info->chars; l != NULL; l = g_slist_next(l)) {
                char_info = (bt_gatt_char_info_t*)l->data;
@@ -2827,7 +2822,7 @@ static void __bt_build_char_browse_info(int conn_id,
                /* Increment count of services browsed */
                count++;
        }
-       BT_INFO("Total characteristics browsed [%d]", count);
+       BT_DBG("Total characteristics browsed [%d]", count);
 }
 
 static void __bt_build_descriptor_browse_info(int conn_id,
@@ -2856,7 +2851,6 @@ static void __bt_build_descriptor_browse_info(int conn_id,
        info->char_props_map = char_info->props;
 
        info->count = g_slist_length(char_info->descs);
-       BT_INFO("Total count of Descriptors [%d]", info->count);
 
        if (!char_info->descs) {
                BT_ERR("No Descriptors browsed for address [%s]", conn_info->addr);
@@ -2963,7 +2957,7 @@ int _bt_register_gatt_client_instance(const char *sender,
        oal_uuid_t uuid;
 
        /* App should ensure that it should not send */
-       BT_INFO("###Check on which instance GATT Client instance can be initialized....");
+       BT_INFO("### Check on which instance GATT Client instance can be initialized....");
        for (k = 1; k < MAX_APPS_SUPPORTED; k++) {
                if (numapps[k].is_initialized == 1) {
                        BT_INFO("Instance ID [%d] is already in use..Check next slot",
@@ -3029,11 +3023,8 @@ static void __bt_handle_client_instance_registered(event_gattc_register_t *data)
 
        /* Platform GATT client framwork does not use Default GATT client instance
           This GATT client instance is never deregistred in the lifetime of bt-service */
-       BT_INFO("Default UUID [%s] current registered uuid [%s]",
-                       DEFAULT_GATT_CLIENT_UUID, uuid_string);
        if (g_strcmp0(uuid_string, DEFAULT_GATT_CLIENT_UUID) == 0) {
-               BT_INFO("Default client Instance Registered [%s] Client instance [%d]",
-                               uuid_string, data->client_if);
+               BT_INFO("Default client Instance Registered");
                gatt_default_client = data->client_if;
                g_free(uuid_string);
                return;
@@ -3043,8 +3034,7 @@ static void __bt_handle_client_instance_registered(event_gattc_register_t *data)
                info = &numapps[k];
 
                if (g_strcmp0(info->uuid, uuid_string) == 0) {
-                       BT_INFO("Found GATT client.. UUID [%s], sender [%s]", info->uuid, info->sender);
-                       BT_INFO("Slot [%d] occupied", k);
+                       BT_INFO("Found GATT client..  sender [%s]  Slot [%d] occupied", info->sender, k);
                        info->is_initialized = TRUE;
                        info->client_id = data->client_if;
                        __bt_gatt_handle_pending_request_info(BLUETOOTH_ERROR_NONE, BT_GATT_CLIENT_REGISTER,
@@ -3195,37 +3185,32 @@ static void __bt_handle_client_disconnected(event_gattc_conn_t *event_data)
 static void __bt_handle_client_service_search_result(
                event_gattc_service_result_t *event_data)
 {
-       BT_INFO("received the gatt service search result");
        /* Pre: status is never fail from OAL */
 
        /* Find service list from address */
        bt_gatt_service_info_list_t *svc_info_list;
        bt_gatt_service_info_t *svc_info;
-       BT_INFO("Search Result: status [%d] conn_id [%d]",
-                       event_data->conn_status.status,
-                       event_data->conn_status.conn_id);
 
        svc_info_list = __bt_get_service_info_list(event_data->conn_status.conn_id);
        if (!svc_info_list) {
-               BT_INFO("Service info list not present for this connection ID, means first time browse");
+               BT_DBG("Service info list not present for connection ID %d, means first time browse", event_data->conn_status.conn_id);
                /* Means for this conn_id, no services are ever browsed, first time,
                   create service info list for this conn_id */
                svc_info_list = g_malloc0(sizeof(bt_gatt_service_info_list_t));
                svc_info_list->conn_id = event_data->conn_status.conn_id;
                list_gatt_info = g_slist_append(list_gatt_info, svc_info_list);
-       } else {
-               BT_INFO("Service info list Already present for this connection ID, means not first time browse for this conn ID ");
        }
 
        /* send list and current service's uuid and instance id to find it  */
        svc_info = __bt_find_matching_service(svc_info_list, &event_data->srvc_id);
+
+
        /* If not found, check if service changed, if yes, means this is a new service added
           in remote GATT device, update uuid info in svc info list structure, to be used when
           search is completed */
        if (!svc_info) {
-               BT_INFO("Service Not found in svc info list for this connection ID");
                if (svc_info_list->info.is_changed) {
-                       BT_INFO("Service Changed indication already found for this connection ID");
+                       BT_DBG("Service Changed indication already found for connection ID %d", event_data->conn_status.conn_id);
                        memcpy(svc_info_list->info.uuid, event_data->srvc_id.id.uuid.uuid, BLUETOOTH_UUID_HEX_MAX_LEN);
                }
                /* Create and add new service in service list */
@@ -3234,9 +3219,8 @@ static void __bt_handle_client_service_search_result(
                svc_info->inst_id = event_data->srvc_id.id.inst_id;
                svc_info->is_primary = event_data->srvc_id.is_prmry;
                svc_info_list->services = g_slist_append(svc_info_list->services, svc_info);
-               BT_INFO("Service created and added in Svc info listf or this connection ID");
+               BT_DBG("Service created and added in Svc info list or connection ID %d", event_data->conn_status.conn_id);
        } else {
-               BT_INFO("Service Already found to be present inside the svc info list for this connection ID");
                /* If returned matching service info, then just update service_rmeoved value inside it to 0 */
                svc_info->is_removed = 0;
        }
@@ -3245,7 +3229,6 @@ static void __bt_handle_client_service_search_result(
 static void __bt_handle_client_service_search_completed(
                event_gattc_conn_status_t *event_data)
 {
-       BT_INFO("+");
        struct gatt_server_info_t *conn_info = NULL;
        bt_gatt_service_info_list_t *svc_info_list;
        bt_gatt_service_info_t *svc_info;
@@ -3329,9 +3312,6 @@ static void __bt_handle_client_characteristic_search_result(
        bt_gatt_char_info_t *char_info;
        bt_char_browse_info_t browse_info;
 
-       BT_INFO("Characteristic search result status [%d]",
-                       event_data->conn_status.status);
-
        memset(&browse_info, 0x00, sizeof(bt_char_browse_info_t));
 
        /* If success */
@@ -3343,6 +3323,7 @@ static void __bt_handle_client_characteristic_search_result(
                        return;
                }
 
+
                /* Find matching service info from svc info list */
                svc_info = __bt_find_matching_service(svc_info_list, &event_data->srvc_id);
                if (svc_info == NULL) {
@@ -3352,9 +3333,10 @@ static void __bt_handle_client_characteristic_search_result(
 
                /* Find Matching char from service info in event */
                char_info = __bt_find_matching_charc(svc_info, &event_data->char_id);
+
                /* If not found, then add new characteristic and return */
                if (!char_info) {
-                       BT_INFO(" add new characteristic");
+                       BT_DBG("Add new characteristic");
                        char_info = g_malloc0(sizeof(bt_gatt_char_info_t));
                        memcpy(char_info->uuid, event_data->char_id.uuid.uuid, BLUETOOTH_UUID_HEX_MAX_LEN);
 
@@ -3363,7 +3345,7 @@ static void __bt_handle_client_characteristic_search_result(
                        svc_info->chars = g_slist_append(svc_info->chars, char_info);
                } else {
                        /* If found, then return */
-                       BT_INFO("update char property as Characteristic browsed is already present");
+                       BT_DBG("update char property as Characteristic browsed is already present");
                        char_info->props |= event_data->char_prop;
                }
        } else {
@@ -4116,18 +4098,17 @@ gboolean _bt_is_remote_gatt_device_connected(bluetooth_device_address_t *address
        char *addr;
        struct gatt_server_info_t *conn_info =  NULL;
        gboolean connected = FALSE;
-       BT_INFO("+");
 
        addr = g_malloc0(BT_ADDRESS_STRING_SIZE);
        _bt_convert_addr_type_to_string(addr,
                        (unsigned char *)&(address->addr));
 
-       BT_INFO("Check Connected or not for [%s]", addr);
+       BT_DBG("Check GATT connection status of [%s]", addr);
        /* Check if device is already in connected list */
        conn_info = _bt_find_remote_gatt_server_info(addr);
 
        if (conn_info) {
-               BT_INFO("Remote GATT Server device [%s] is Connected", conn_info->addr);
+               BT_DBG("Remote GATT Server device [%s] is Connected", conn_info->addr);
                connected = TRUE;
        } else {
                struct gatt_client_info_t *client_info = NULL;
@@ -4138,7 +4119,7 @@ gboolean _bt_is_remote_gatt_device_connected(bluetooth_device_address_t *address
                client_info = _bt_find_remote_gatt_client_info(addr);
 
                if (client_info) {
-                       BT_INFO("Remote Client device [%s] is Connected", client_info->addr);
+                       BT_DBG("Remote Client device [%s] is Connected", client_info->addr);
                        connected = TRUE;
                } else {
                        BT_INFO("Remote GATT Client Device [%s] is not Connected", addr);
@@ -4163,8 +4144,6 @@ int _bt_connect_le_device(bluetooth_device_address_t *address,
 
        BT_CHECK_PARAMETER(address, return);
 
-       BT_INFO("+");
-
        addr = g_malloc0(sizeof(char) * BT_ADDRESS_STRING_SIZE);
        _bt_convert_addr_type_to_string(addr, address->addr);
        BT_INFO("GATT Client connect request for address [%s] client instance [%d]",
@@ -4269,7 +4248,6 @@ int _bt_gatt_get_all_characteristic(bluetooth_gatt_client_svc_prop_info_t *svc)
        oal_gatt_srvc_id_t srvc_id;
        int ret = OAL_STATUS_SUCCESS;
        char *addr;
-       BT_INFO("+");
 
        /* Check if any app is already browsing characteristics of the same service on the same remote GATT Server */
        req_info = _bt_get_request_info_data_from_function_name(BT_GATT_GET_SERVICE_PROPERTIES);
@@ -4290,7 +4268,7 @@ int _bt_gatt_get_all_characteristic(bluetooth_gatt_client_svc_prop_info_t *svc)
        /* Check if remote GATT Server is connected or not */
        conn_info = _bt_find_remote_gatt_server_info(addr);
        if (conn_info) {
-               BT_INFO("GATT Server [%s] is connected, conn Id [%d]",
+               BT_DBG("GATT Server [%s] is connected, conn Id [%d]",
                                conn_info->addr, conn_info->connection_id);
        } else {
                BT_ERR("GATT Server is not yet connected..");
@@ -4326,8 +4304,6 @@ int _bt_gatt_get_all_characteristic_properties(
 
        BT_CHECK_PARAMETER(chr, return);
 
-       BT_INFO("+");
-
        /* Check if any app is already browsing descriptors of the same char of
           particular service on the same remote GATT Server */
        req_info = _bt_get_request_info_data_from_function_name(BT_GATT_GET_CHARACTERISTIC_PROPERTIES);
@@ -4350,7 +4326,7 @@ int _bt_gatt_get_all_characteristic_properties(
        /* Check if remote GATT Server is connected or not */
        conn_info = _bt_find_remote_gatt_server_info(addr);
        if (conn_info) {
-               BT_INFO("GATT Server [%s] is connected, conn Id [%d]",
+               BT_DBG("GATT Server [%s] is connected, conn Id [%d]",
                                conn_info->addr, conn_info->connection_id);
        } else {
                BT_ERR("GATT Server is not yet connected..");
@@ -4389,8 +4365,6 @@ int _bt_gatt_read_characteristic_value(
 
        BT_CHECK_PARAMETER(chr, return);
 
-       BT_INFO("+");
-
        /* Check if any app is already Reading characteristic of the same char of
           particular service on the same remote GATT Server */
        req_info = _bt_get_request_info_data_from_function_name(BT_GATT_READ_CHARACTERISTIC);
@@ -4413,7 +4387,7 @@ int _bt_gatt_read_characteristic_value(
        /* Check if remote GATT Server is connected or not */
        conn_info = _bt_find_remote_gatt_server_info(addr);
        if (conn_info) {
-               BT_INFO("GATT Server [%s] is connected, conn Id [%d]",
+               BT_DBG("GATT Server [%s] is connected, conn Id [%d]",
                                conn_info->addr, conn_info->connection_id);
        } else {
                BT_ERR("GATT Server is not yet connected..");
@@ -4453,8 +4427,6 @@ int _bt_gatt_read_descriptor_value(
 
        BT_CHECK_PARAMETER(desc, return);
 
-       BT_INFO("+");
-
        /* Check if any app is already Reading descriptors of the same char of
           particular service on the same remote GATT Server */
        req_info = _bt_get_request_info_data_from_function_name(BT_GATT_READ_DESCRIPTOR_VALUE);
@@ -4479,7 +4451,7 @@ int _bt_gatt_read_descriptor_value(
        /* Check if remote GATT Server is connected or not */
        conn_info = _bt_find_remote_gatt_server_info(addr);
        if (conn_info) {
-               BT_INFO("GATT Server [%s] is connected, conn Id [%d]",
+               BT_DBG("GATT Server [%s] is connected, conn Id [%d]",
                                conn_info->addr, conn_info->connection_id);
        } else {
                BT_ERR("GATT Server is not yet connected..");
@@ -4520,15 +4492,13 @@ int _bt_gatt_acquire_notify(bluetooth_gatt_client_char_prop_info_t *chr, int *fd
 
        BT_CHECK_PARAMETER(chr, return);
 
-       BT_INFO("+");
-
        addr = g_malloc0(sizeof(char) * BT_ADDRESS_STRING_SIZE);
        _bt_convert_addr_type_to_string(addr, chr->device_address.addr);
 
        /* Check if remote GATT Server is connected or not */
        conn_info = _bt_find_remote_gatt_server_info(addr);
        if (conn_info) {
-               BT_INFO("GATT Server [%s] is connected, conn Id [%d]",
+               BT_DBG("GATT Server [%s] is connected, conn Id [%d]",
                                conn_info->addr, conn_info->connection_id);
        } else {
                BT_ERR("GATT Server is not yet connected..");
@@ -4567,15 +4537,13 @@ int _bt_gatt_acquire_write(bluetooth_gatt_client_char_prop_info_t *chr, int *fd,
 
        BT_CHECK_PARAMETER(chr, return);
 
-       BT_INFO("+");
-
        addr = g_malloc0(sizeof(char) * BT_ADDRESS_STRING_SIZE);
        _bt_convert_addr_type_to_string(addr, chr->device_address.addr);
 
        /* Check if remote GATT Server is connected or not */
        conn_info = _bt_find_remote_gatt_server_info(addr);
        if (conn_info) {
-               BT_INFO("GATT Server [%s] is connected, conn Id [%d]",
+               BT_DBG("GATT Server [%s] is connected, conn Id [%d]",
                                conn_info->addr, conn_info->connection_id);
        } else {
                BT_ERR("GATT Server is not yet connected..");
@@ -4892,8 +4860,8 @@ int _bt_gatt_watch_service_changed_indication(const char *sender,
        int k;
        bt_service_app_info_t *info = NULL;
 
-       BT_INFO("Enable Servic changed Indication watcher [%d] for app [%s]",
-                       is_enabled, sender);
+       BT_INFO("%s Servic changed Indication watcher for app [%s]",
+                       is_enabled ? "Enable":"Disable", sender);
 
        for (k = 1; k < MAX_APPS_SUPPORTED; k++) {
                info = &numapps[k];
@@ -4901,7 +4869,7 @@ int _bt_gatt_watch_service_changed_indication(const char *sender,
                if (g_strcmp0(sender, info->sender) == 0 &&
                                memcmp(info->address.addr, address->addr,
                                        sizeof(bluetooth_device_address_t)) == 0) {
-                       BT_INFO("Found GATT client App.. UUID [%s], sender [%s]", info->uuid, info->sender);
+                       BT_DBG("Found GATT client App.. [%s], sender [%s]", info->uuid, info->sender);
                        info->is_watcher_enabled = is_enabled;
                }
        }
index 6269569..9a35cb9 100644 (file)
@@ -326,13 +326,11 @@ static void __bt_ipsp_property_changed_event(GVariant *msg, const char *path)
        GVariant *param = NULL;
        g_variant_iter_init(&value_iter, msg);
        while ((g_variant_iter_loop(&value_iter, "{sv}", &property, &val))) {
-               BT_INFO("Property %s", property);
-
                if (strcasecmp(property, "IpspInitStateChanged") == 0) {
                        gboolean ipsp_initialized = FALSE;
 
                        g_variant_get(val, "b", &ipsp_initialized);
-                       BT_DBG("IPSP init state changed: %d", ipsp_initialized);
+                       BT_INFO("IPSP init state changed: %d", ipsp_initialized);
                        param = g_variant_new("(b)", ipsp_initialized);
 
                        /* Send event to application */
index 286e37e..7e897c1 100644 (file)
@@ -104,10 +104,17 @@ void _bt_convert_addr_string_to_secure_string(char *addr,
        len = strlen(address);
        ret_if(len != BT_ADDRESS_STRING_SIZE - 1);
 
-       g_strlcpy(addr, address, BT_ADDRESS_STRING_SIZE);
-
-       addr[len-1] = 'X';
-       addr[len-2] = 'X';
+       strncpy(addr, address, len);
+       addr[len] = '\0';
+
+       addr[len-7] = 'X';
+       addr[len-8] = 'X';
+       addr[len-10] = 'X';
+       addr[len-11] = 'X';
+       addr[len-13] = 'X';
+       addr[len-14] = 'X';
+       addr[len-16] = 'X';
+       addr[len-17] = 'X';
 
        return;
 }
@@ -1064,29 +1071,22 @@ int _bt_register_map_client_subscribe_signal(GDBusConnection *conn,
 
 int _bt_register_service_event(GDBusConnection *g_conn, int event_type)
 {
-       BT_DBG("+");
-
        retv_if(g_conn == NULL, BLUETOOTH_ERROR_INTERNAL);
 
        switch (event_type) {
        case BT_MANAGER_EVENT:
-               BT_DBG("BT_MANAGER_EVENT: register service event");
                _bt_register_manager_subscribe_signal(g_conn, TRUE);
                break;
        case BT_DEVICE_EVENT:
-               BT_DBG("BT_DEVICE_EVENT: register service event");
                _bt_register_device_subscribe_signal(g_conn, TRUE);
                break;
        case BT_OPP_SERVER_EVENT:
-               BT_DBG("BT_OPP_SERVER_EVENT: register service event");
                _bt_register_opp_server_subscribe_signal(g_conn, TRUE);
                break;
        case BT_OPP_CLIENT_EVENT:
-               BT_DBG("BT_OPP_CLIENT_EVENT: register service event");
                _bt_register_opp_client_subscribe_signal(g_conn, TRUE);
                break;
        case BT_MAP_CLIENT_EVENT:
-               BT_DBG("BT_MAP_CLIENT_EVENT: register service event");
                _bt_register_map_client_subscribe_signal(g_conn, TRUE);
                break;
        default:
index 09fb7c5..3d6078b 100644 (file)
@@ -104,7 +104,6 @@ int _bt_register_network_subscribe_signal(GDBusConnection *conn,
 
        if (subscribe) {
                if (subs_serv_id == -1) {
-                               BT_DBG("_bt_register_network_subscribe_signal  SUBSCRIBE SERVER SUCCESS>>>>>>>>>>>>>>>>>>>>> ..");
                        subs_serv_id = g_dbus_connection_signal_subscribe(conn,
                                NULL, BT_NETWORK_SERVER_INTERFACE,
                                NULL, NULL, NULL, 0,
@@ -112,7 +111,6 @@ int _bt_register_network_subscribe_signal(GDBusConnection *conn,
                                NULL, NULL);
                }
                if (subs_client_id == -1) {
-                               BT_DBG("_bt_register_network_subscribe_signal  SUBSCRIBE CLIENT SUCCESS>>>>>>>>>>>>>>>>>>>>> ..");
                        subs_client_id = g_dbus_connection_signal_subscribe(conn,
                                NULL, BT_NETWORK_CLIENT_INTERFACE,
                                NULL, NULL, NULL, 0,