From 57630b4c2e2821b33693869876f6904b69de1a65 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sat, 5 Feb 2022 14:19:41 +0100 Subject: Add BTGattHandler::NativeGattCharLister::mtuResponse(..) for high level info; Fix FwdGattServerHandler::replyExchangeMTUReq(..) mtu minimum --- api/direct_bt/BTGattHandler.hpp | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'api') diff --git a/api/direct_bt/BTGattHandler.hpp b/api/direct_bt/BTGattHandler.hpp index 10b849e7..96c56243 100644 --- a/api/direct_bt/BTGattHandler.hpp +++ b/api/direct_bt/BTGattHandler.hpp @@ -340,6 +340,24 @@ namespace direct_bt { [[maybe_unused]] BTDeviceRef serverSource, [[maybe_unused]] BTDeviceRef clientDest) { } + /** + * Informal notification about a complete MTU exchange request and response to and from this GATTRole::Server, optional. + * + * @param clientMTU the client MTU request + * @param pduReply the response + * @param error_reply in case of an AttErrorRsp reply, the AttErrorRsp::ErrorCode is passed for convenience, otherwise AttErrorRsp::ErrorCode::NO_ERROR. + * @param serverMTU the replied server MTU, passed for convenience + * @param usedMTU the MTU minimum of client and server to be used, passed for convenience + * @param serverReplier the GATTRole::Server replier device, never nullptr + * @param clientRequester the GATTRole::Client requester device, only known and not nullptr for DBGattServer::Mode:FWD GattServerHandler + */ + virtual void mtuResponse([[maybe_unused]] const uint16_t clientMTU, + [[maybe_unused]] const AttPDUMsg& pduReply, + [[maybe_unused]] const AttErrorRsp::ErrorCode error_reply, + [[maybe_unused]] const uint16_t serverMTU, + [[maybe_unused]] const uint16_t usedMTU, + [[maybe_unused]] BTDeviceRef serverReplier, + [[maybe_unused]] BTDeviceRef clientRequester) { } /** * Informal notification about a completed write request sent to this GATTRole::Server, optional. * @@ -879,6 +897,23 @@ namespace direct_bt { */ void notifyNativeReplyReceived(const AttPDUMsg& pduReply, BTDeviceRef clientDest) noexcept; + /** + * Notify all NativeGattCharListener about a completed MTU exchange request and response to and from this GATTRole::Server. + * + * This functionality has an informal character only. + * + * @param clientMTU the client MTU request + * @param pduReply the response + * @param error_reply in case of an AttErrorRsp reply, the AttErrorRsp::ErrorCode is passed for convenience, otherwise AttErrorRsp::ErrorCode::NO_ERROR. + * @param serverMTU the replied server MTU, passed for convenience + * @param usedMTU the MTU minimum of client and server to be used, passed for convenience + * @param clientRequester the GATTRole::Client requester device, only known and not nullptr for DBGattServer::Mode:FWD GattServerHandler + */ + void notifyNativeMTUResponse(const uint16_t clientMTU, + const AttPDUMsg& pduReply, const AttErrorRsp::ErrorCode error_reply, + const uint16_t serverMTU, const uint16_t usedMTU, + BTDeviceRef clientRequester) noexcept; + /** * Notify all NativeGattCharListener about a completed write request sent to this GATTRole::Server. * -- cgit v1.2.3