Skip to content

Commit dace32a

Browse files
authored
Merge pull request #14602 from paul-szczepanek-arm/conf
Deprecate indications event onConfirmationReceived
2 parents 31d638d + b61fc6b commit dace32a

File tree

3 files changed

+11
-21
lines changed

3 files changed

+11
-21
lines changed

connectivity/FEATURE_BLE/include/ble/GattServer.h

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,9 @@ class GattServer {
122122
}
123123

124124
/**
125-
* Function invoked when the server has sent data to a client as
126-
* part of a notification/indication.
125+
* Function invoked when the server has sent data to a client. For
126+
* notifications this is triggered when data is sent, for indications
127+
* it's only triggered when the confirmation has been received.
127128
*
128129
* @note params has a temporary scope and should be copied by the
129130
* application if needed later
@@ -188,12 +189,13 @@ class GattServer {
188189
}
189190

190191
/**
191-
* Function invoked when an ACK has been received for an
192-
* indication sent to the client.
192+
* Event not used.
193193
*
194194
* @note params has a temporary scope and should be copied by the
195195
* application if needed later
196196
*/
197+
MBED_DEPRECATED_SINCE("mbed-os-6.11.0", "This event is never triggered. Indication triggers onDataSent"
198+
"when confirmation is received.")
197199
virtual void onConfirmationReceived(const GattConfirmationReceivedCallbackParams &params) {
198200
(void)params;
199201
}
@@ -274,7 +276,7 @@ class GattServer {
274276
* Event handler that handles subscription to characteristic updates,
275277
* unsubscription from characteristic updates and notification confirmation.
276278
*
277-
* @see onUpdatesEnabled() onUpdateDisabled() onConfirmationReceived()
279+
* @see onUpdatesEnabled() onUpdateDisabled()
278280
*/
279281
typedef FunctionPointerWithContext<GattAttribute::Handle_t> EventCallback_t;
280282

@@ -705,7 +707,8 @@ class GattServer {
705707
* @param[in] callback Event handler being registered.
706708
*/
707709
MBED_DEPRECATED_SINCE("mbed-os-6.3.0", "Individual callback-registering functions have"
708-
"been replaced by GattServer::setEventHandler. Use that function instead.")
710+
"been replaced by an event handler. Indication confirmation triggers"
711+
"GattServer::onDataSent event instead.")
709712
void onConfirmationReceived(EventCallback_t callback);
710713

711714
#if !defined(DOXYGEN_ONLY)

connectivity/FEATURE_BLE/source/cordio/source/GattServerImpl.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1767,21 +1767,6 @@ void GattServer::handleEvent(
17671767
updatesDisabledCallback(attributeHandle);
17681768
}
17691769
break;
1770-
case GattServerEvents::GATT_EVENT_CONFIRMATION_RECEIVED:
1771-
tr_debug("Confirmation received for attribute %d on connection %d", attributeHandle, connHandle);
1772-
if(eventHandler) {
1773-
GattConfirmationReceivedCallbackParams params({
1774-
.connHandle = connHandle,
1775-
.attHandle = attributeHandle
1776-
});
1777-
eventHandler->onConfirmationReceived(params);
1778-
}
1779-
1780-
// Execute deprecated callback
1781-
if (confirmationReceivedCallback) {
1782-
confirmationReceivedCallback(attributeHandle);
1783-
}
1784-
break;
17851770

17861771
case GattServerEvents::GATT_EVENT_DATA_SENT:
17871772
tr_debug("Data sent for attribute %d on connection %d", attributeHandle, connHandle);

connectivity/FEATURE_BLE/source/generic/GattServerEvents.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ class GattServerEvents
6363

6464
/**
6565
* Response received from Characteristic Value Indication message.
66+
* @deprecated This event is never used. Indications use GATT_EVENT_DATA_SENT
67+
* only after confirmation is received.
6668
*/
6769
GATT_EVENT_CONFIRMATION_RECEIVED = 5,
6870

0 commit comments

Comments
 (0)