From 184b943678169ac59cc7ce1d74ce7a5b2bd2e6b5 Mon Sep 17 00:00:00 2001 From: dengguanghong <2228266166@qq.com> Date: Fri, 15 Aug 2025 16:23:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0ble=20att=20wirte=20cmd?= =?UTF-8?q?=E4=B8=8Enotify=20cb=20Signed-off-by:dengguanghong<2228266166@q?= =?UTF-8?q?q.com>?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- services/bluetooth/service/src/gatt/gatt_client_profile.cpp | 4 +++- services/bluetooth/service/src/gatt/gatt_server_profile.cpp | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/services/bluetooth/service/src/gatt/gatt_client_profile.cpp b/services/bluetooth/service/src/gatt/gatt_client_profile.cpp index 13a00337..c635d69d 100644 --- a/services/bluetooth/service/src/gatt/gatt_client_profile.cpp +++ b/services/bluetooth/service/src/gatt/gatt_client_profile.cpp @@ -598,7 +598,9 @@ void GattClientProfile::WriteWithoutResponse( if (buffer != nullptr) { ATT_WriteCommand(connectHandle, handle, buffer); BufferFree(buffer); - } + pimpl->pClientCallBack_->OnWriteCharacteristicValueEvent(reqId, connectHandle, handle, GATT_SUCCESS); + } else { + pimpl->pClientCallBack_->OnWriteCharacteristicValueEvent(reqId, connectHandle, handle, GATT_FAILURE); } /** * @brief This sub-procedure is used to write a Characteristic Value to a server when the client knows the diff --git a/services/bluetooth/service/src/gatt/gatt_server_profile.cpp b/services/bluetooth/service/src/gatt/gatt_server_profile.cpp index c8051dcf..776d345b 100644 --- a/services/bluetooth/service/src/gatt/gatt_server_profile.cpp +++ b/services/bluetooth/service/src/gatt/gatt_server_profile.cpp @@ -2029,9 +2029,11 @@ void GattServerProfile::SendNotification( if (buffer != nullptr) { ATT_HandleValueNotification(connectHandle, handle, buffer); BufferFree(buffer); + pimpl->pServerCallBack_->OnIndicationEvent(connectHandle, handle, GATT_SUCCESS); } } else { LOG_ERROR("%{public}s: GATT_NOTIFICATION_VALUE is invalid", __FUNCTION__); + pimpl->pServerCallBack_->OnIndicationEvent(connectHandle, handle, GATT_FAILURE); } } /** -- Gitee