Enhance debug message
[platform/core/connectivity/bluetooth-frwk.git] / bt-api / bt-adapter.c
index 8a1051f..418613f 100644 (file)
@@ -28,7 +28,7 @@ static int __bt_fill_device_list(GArray *out_param2, GPtrArray **dev_list)
 {
        int i;
        guint size;
-       bluetooth_device_info_t info;
+       bluetooth_device_info_t *info;
 
        BT_CHECK_PARAMETER(out_param2, return);
        BT_CHECK_PARAMETER(dev_list, return);
@@ -45,10 +45,10 @@ static int __bt_fill_device_list(GArray *out_param2, GPtrArray **dev_list)
        for (i = 0; i < size; i++) {
                bluetooth_device_info_t *dev_info = NULL;
 
-               info = g_array_index(out_param2,
+               info = &g_array_index(out_param2,
                                bluetooth_device_info_t, i);
 
-               dev_info = g_memdup(&info, sizeof(bluetooth_device_info_t));
+               dev_info = g_memdup(info, sizeof(bluetooth_device_info_t));
 
                if (dev_info)
                        g_ptr_array_add(*dev_list, (gpointer)dev_info);
@@ -64,7 +64,7 @@ BT_EXPORT_API int bluetooth_check_adapter(void)
 #ifndef TIZEN_TEST_EMUL
        int ret;
 
-       ret = _bt_get_adapter_path(_bt_gdbus_get_system_gconn(), NULL);
+       ret = _bt_get_adapter_path(_bt_get_system_private_conn(), NULL);
 
        if (ret != BLUETOOTH_ERROR_NONE)
                return BLUETOOTH_ADAPTER_DISABLED;
@@ -85,11 +85,12 @@ BT_EXPORT_API int bluetooth_enable_adapter(void)
        int result;
 
        BT_INFO_C("### Enable adapter");
+       _bt_print_api_caller_name();
        retv_if(bluetooth_check_adapter() == BLUETOOTH_ADAPTER_ENABLED,
                                BLUETOOTH_ERROR_DEVICE_ALREADY_ENABLED);
 
 #ifdef TIZEN_FEATURE_BT_DPM
-       retv_if(bluetooth_dpm_is_mode_allowed() == BLUETOOTH_DPM_RESULT_ACCESS_DENIED,
+       retv_if(bluetooth_dpm_is_mode_allowed() == BLUETOOTH_ERROR_PERMISSION_DEINED,
                                BLUETOOTH_ERROR_PERMISSION_DEINED);
 #endif
 
@@ -109,6 +110,7 @@ BT_EXPORT_API int bluetooth_disable_adapter(void)
        int result;
 
        BT_INFO_C("### Disable adapter");
+       _bt_print_api_caller_name();
        BT_CHECK_ENABLED(return);
 
        BT_INIT_PARAMS();
@@ -126,7 +128,7 @@ BT_EXPORT_API int bluetooth_recover_adapter(void)
 {
        int result;
 
-       BT_INFO("Recover adapter");
+       BT_INFO_C("### Recover adapter");
        BT_CHECK_ENABLED(return);
 
        BT_INIT_PARAMS();