Fix: gatt write completed callback is not invoked 45/225045/1
authorinjun.yang <injun.yang@samsung.com>
Mon, 17 Feb 2020 02:17:01 +0000 (11:17 +0900)
committerinjun.yang <injun.yang@samsung.com>
Mon, 17 Feb 2020 04:48:22 +0000 (13:48 +0900)
[Model] All
[BinType] AP
[Customer] OPEN

[Issue#] N/A
[Request] Internal
[Occurrence Version] N/A

[Problem] bt_gatt_client_request_completed_cb not invoked
[Cause & Measure] After writen data, call callback function
[Checking Method] gatt write command not write request

[Team] Convergence BT
[Developer] Injun Yang
[Solution company] Samsung
[Change Type] Specification change

Change-Id: I4a6d41eb447a8985a242d4391d69207da81294a8

src/bluetooth-gatt.c

index e104286..2f7f3ae 100644 (file)
@@ -3909,6 +3909,9 @@ int bt_gatt_client_write_value(bt_gatt_h gatt_handle,
                        chr->write_cb = callback;
                        chr->write_user_data = user_data;
                }
+
+               if (chr->write_type == BT_GATT_WRITE_TYPE_WRITE_NO_RESPONSE)
+                       chr->write_cb(ret, gatt_handle, user_data);
        } else if (c->type == BT_GATT_TYPE_DESCRIPTOR) {
                bt_gatt_descriptor_s *desc = (bt_gatt_descriptor_s *)gatt_handle;
 
@@ -3944,6 +3947,7 @@ int bt_gatt_client_write_value(bt_gatt_h gatt_handle,
                        desc->write_cb = callback;
                        desc->write_user_data = user_data;
                }
+               desc->write_cb(ret, gatt_handle, user_data);
        } else {
                BT_ERR("Invalid handle type for write ");
        }