Skip to content

Commit c4585b9

Browse files
clarify documentation for adv stop event
1 parent 88ede00 commit c4585b9

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

connectivity/FEATURE_BLE/include/ble/gap/Events.h

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -627,10 +627,15 @@ struct AdvertisingEndEvent {
627627
/** Create an extended advertising end event.
628628
*
629629
* @param advHandle Advertising set handle.
630-
* @param connection Connection handle.
631-
* @param completed_events Number of events created during before advertising end.
630+
* @param connection Connection handle - only valid if connected is True.
631+
* @param completed_events Number of events created during before advertising end - only valid
632+
* if advertising end has been caused by BLE_ERROR_LIMIT_REACHED, not the local user.
633+
* Check getStatus().
632634
* @param connected True if connection has been established.
633-
* @param status Error code if stop command failed.
635+
* @param status Error code showing the reason for event. BLE_ERROR_LIMIT_REACHED if set number
636+
* of events have been reached. BLE_ERROR_TIMEOUT if set time has elapsed.
637+
* BLE_ERROR_SUCCESS if connection occurred or user ended the set. Check isConnected()
638+
* to determine which.
634639
*/
635640
AdvertisingEndEvent(
636641
advertising_handle_t advHandle,

connectivity/FEATURE_BLE/source/pal/PalGap.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,9 @@ struct PalGapEventHandler {
193193

194194
/** Called when advertising set stops advertising.
195195
*
196-
* @param status SUCCESS if connection has been established.
196+
* @param status SUCCESS if connection has been established or if stopped by user.
197197
* @param advertising_handle Advertising set handle.
198-
* @param advertising_handle Connection handle.
198+
* @param advertising_handle Connection handle. Set to invalid handle if no connection made.
199199
* @param number_of_completed_extended_advertising_events Number of events created during before advertising end.
200200
*/
201201
virtual void on_advertising_set_terminated(

0 commit comments

Comments
 (0)