X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=bt-api%2Fbt-obex-server.c;h=c679d0e316fc77f57e6216fe09763db91dcce09c;hb=62a00d2e3430ed504bc220bcfe67387dd0507e22;hp=c5744d98946c183174ad614620c41ebec8a739fc;hpb=449d38c6b737be52e1e166ed281bf8c778847e62;p=platform%2Fcore%2Fconnectivity%2Fbluetooth-frwk.git diff --git a/bt-api/bt-obex-server.c b/bt-api/bt-obex-server.c index c5744d9..c679d0e 100755 --- a/bt-api/bt-obex-server.c +++ b/bt-api/bt-obex-server.c @@ -57,7 +57,7 @@ BT_EXPORT_API int bluetooth_obex_server_init(const char *dst_path) if (result == BLUETOOTH_ERROR_NONE) { _bt_set_obex_server_id(BT_NATIVE_SERVER); res = _bt_register_event(BT_OPP_SERVER_EVENT, user_info->cb, - user_info->user_data); + user_info->user_data); if (res != BLUETOOTH_ERROR_NONE) BT_ERR("Fail to _bt_register_event(%d)", res); } else { @@ -132,7 +132,7 @@ BT_EXPORT_API int bluetooth_obex_server_init_without_agent(const char *dst_path) if (result == BLUETOOTH_ERROR_NONE) { _bt_set_obex_server_id(BT_CUSTOM_SERVER); res = _bt_register_event(BT_OPP_SERVER_EVENT, user_info->cb, - user_info->user_data); + user_info->user_data); if (res != BLUETOOTH_ERROR_NONE) BT_ERR("Fail to _bt_register_event(%d)", res); @@ -188,11 +188,10 @@ BT_EXPORT_API gboolean bluetooth_obex_server_is_activated(void) result = _bt_send_request(BT_OBEX_SERVICE, BT_OBEX_SERVER_IS_ACTIVATED, in_param1, in_param2, in_param3, in_param4, &out_param); - if (result == BLUETOOTH_ERROR_NONE) { + if (result == BLUETOOTH_ERROR_NONE) is_activated = g_array_index(out_param, gboolean, 0); - } else { + else BT_ERR("Fail to send request"); - } BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param); @@ -349,7 +348,6 @@ BT_EXPORT_API int bluetooth_obex_server_cancel_transfer(int transfer_id) { int result; int server_type; - int service_function = BT_OBEX_SERVER_CANCEL_TRANSFER; BT_CHECK_ENABLED(return); @@ -357,16 +355,18 @@ BT_EXPORT_API int bluetooth_obex_server_cancel_transfer(int transfer_id) if (server_type == BT_NO_SERVER) return BLUETOOTH_ERROR_AGENT_DOES_NOT_EXIST; - else if (server_type == BT_CUSTOM_SERVER) - service_function = BT_OBEX_SERVER_CANCEL_ALL_TRANSFERS; BT_INIT_PARAMS(); BT_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param); g_array_append_vals(in_param1, &transfer_id, sizeof(int)); - result = _bt_send_request(BT_OBEX_SERVICE, service_function, - in_param1, in_param2, in_param3, in_param4, &out_param); + if (server_type == BT_CUSTOM_SERVER) + result = _bt_send_request(BT_OBEX_SERVICE, BT_OBEX_SERVER_CANCEL_ALL_TRANSFERS, + in_param1, in_param2, in_param3, in_param4, &out_param); + else + result = _bt_send_request(BT_OBEX_SERVICE, BT_OBEX_SERVER_CANCEL_TRANSFER, + in_param1, in_param2, in_param3, in_param4, &out_param); BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param); @@ -407,11 +407,10 @@ BT_EXPORT_API int bluetooth_obex_server_is_receiving(gboolean *is_receiving) result = _bt_send_request(BT_OBEX_SERVICE, BT_OBEX_SERVER_IS_RECEIVING, in_param1, in_param2, in_param3, in_param4, &out_param); - if (result == BLUETOOTH_ERROR_NONE) { + if (result == BLUETOOTH_ERROR_NONE) *is_receiving = g_array_index(out_param, gboolean, 0); - } else { + else BT_ERR("Fail to send request"); - } BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);