From: DoHyun Pyun Date: Fri, 11 Jan 2019 04:02:57 +0000 (+0900) Subject: Generate the progress event before completing the transfer X-Git-Tag: submit/tizen/20190111.043317^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d0e10ad065de5425585d6976fa7beb4dee2686df;p=platform%2Fcore%2Fapi%2Fbluetooth.git Generate the progress event before completing the transfer Change-Id: I6188c23b49add7a3f5c425c32e2c51c372dd4a0f Signed-off-by: DoHyun Pyun --- diff --git a/src/bluetooth-common.c b/src/bluetooth-common.c index 3d23a02..6f62ed5 100644 --- a/src/bluetooth-common.c +++ b/src/bluetooth-common.c @@ -1715,13 +1715,20 @@ static void __bt_event_proxy(int event, bluetooth_event_param_t *param, void *us case BLUETOOTH_EVENT_OPC_TRANSFER_PROGRESS: BT_INFO("bt_opp_client_transfer_in_progress_cb() will be called"); client_info = (bt_opc_transfer_info_t *)(param->param_data); - ((bt_opp_client_push_progress_cb)bt_event_slot_container[event_index].callback) - (client_info->filename, client_info->size, client_info->percentage, bt_event_slot_container[event_index].user_data); + + /* Progress 100% event will be invoked by BLUETOOTH_EVENT_OPC_TRANSFER_COMPLETE*/ + if (client_info->percentage != 100) + ((bt_opp_client_push_progress_cb)bt_event_slot_container[event_index].callback) + (client_info->filename, client_info->size, client_info->percentage, bt_event_slot_container[event_index].user_data); break; case BLUETOOTH_EVENT_OPC_TRANSFER_COMPLETE: BT_INFO("BLUETOOTH_EVENT_OPC_TRANSFER_COMPLETE"); - /* This event don't be used in CAPI */ + client_info = (bt_opc_transfer_info_t *)(param->param_data); + + if (param->result == BLUETOOTH_ERROR_NONE) + ((bt_opp_client_push_progress_cb)bt_event_slot_container[event_index].callback) + (client_info->filename, client_info->size, 100, bt_event_slot_container[event_index].user_data); break; case BLUETOOTH_EVENT_MAP_CONNECTED: