From 1d5d02d970fd3e6fec971b8a2e75a8c3911bded4 Mon Sep 17 00:00:00 2001 From: "injun.yang" Date: Mon, 17 Feb 2020 11:17:01 +0900 Subject: [PATCH] Fix: gatt write completed callback is not invoked [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 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/bluetooth-gatt.c b/src/bluetooth-gatt.c index e104286..2f7f3ae 100644 --- a/src/bluetooth-gatt.c +++ b/src/bluetooth-gatt.c @@ -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 "); } -- 2.7.4