Skip to content

Commit 7dd90e1

Browse files
Docuement active set length and add informative call for querying the limit
1 parent e1cf516 commit 7dd90e1

File tree

4 files changed

+35
-0
lines changed

4 files changed

+35
-0
lines changed

features/FEATURE_BLE/ble/gap/Gap.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -544,6 +544,12 @@ class Gap {
544544
*/
545545
virtual uint16_t getMaxConnectableAdvertisingDataLength();
546546

547+
/** Return maximum advertising data length you may set if advertising set is active.
548+
*
549+
* @return Maximum advertising data length you may set if advertising set is active.
550+
*/
551+
virtual uint8_t getMaxActiveSetAdvertisingDataLength();
552+
547553
/** Create an advertising set and apply the passed in parameters. The handle returned
548554
* by this function must be used for all other calls that accept an advertising handle.
549555
* When done with advertising, remove from the system using destroyAdvertisingSet().
@@ -589,6 +595,10 @@ class Gap {
589595
* @param handle Advertising set handle.
590596
* @param payload Advertising payload.
591597
*
598+
* @note If advertising set is active you may only set payload of length equal or less
599+
* than getMaxActiveSetAdvertisingDataLength(). If you require a longer payload you must
600+
* stop the advertising set, set the payload and restart the set.
601+
*
592602
* @return BLE_ERROR_NONE on success.
593603
*
594604
* @see ble::AdvertisingDataBuilder to build a payload.
@@ -604,6 +614,10 @@ class Gap {
604614
* @param handle Advertising set handle.
605615
* @param response Advertising scan response.
606616
*
617+
* @note If advertising set is active you may only set payload of length equal or less
618+
* than getMaxActiveSetAdvertisingDataLength(). If you require a longer payload you must
619+
* stop the advertising set, set the payload and restart the set.
620+
*
607621
* @return BLE_ERROR_NONE on success.
608622
*
609623
* @see ble::AdvertisingDataBuilder to build a payload.
@@ -669,6 +683,11 @@ class Gap {
669683
* @param payload Advertising payload.
670684
* @return BLE_ERROR_NONE on success.
671685
*
686+
* @note If advertising set is active you may only set payload of length equal or less
687+
* than getMaxActiveSetAdvertisingDataLength(). If you require a longer payload you must
688+
* stop the advertising set, set the payload and restart the set. Stopping the set will
689+
* cause peers to lose sync on the periodic set.
690+
*
672691
* @see ble::AdvertisingDataBuilder to build a payload.
673692
*
674693
* @version 5+

features/FEATURE_BLE/ble/generic/GenericGap.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,10 @@ class GenericGap :
9595
*/
9696
virtual uint16_t getMaxConnectableAdvertisingDataLength();
9797

98+
/** @copydoc Gap::getMaxActiveSetAdvertisingDataLength
99+
*/
100+
virtual uint8_t getMaxActiveSetAdvertisingDataLength();
101+
98102
/** @copydoc Gap::createAdvertisingSet
99103
*/
100104
virtual ble_error_t createAdvertisingSet(

features/FEATURE_BLE/source/gap/Gap.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ uint16_t Gap::getMaxConnectableAdvertisingDataLength()
4242
return LEGACY_ADVERTISING_MAX_SIZE;
4343
}
4444

45+
uint8_t Gap::getMaxActiveSetAdvertisingDataLength()
46+
{
47+
/* Requesting action from porter(s): override this API if this capability is supported. */
48+
return LEGACY_ADVERTISING_MAX_SIZE;
49+
}
50+
4551
ble_error_t Gap::createAdvertisingSet(
4652
advertising_handle_t *handle,
4753
const AdvertisingParameters &parameters

features/FEATURE_BLE/source/generic/GenericGap.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2013,6 +2013,12 @@ uint16_t GenericGap::getMaxConnectableAdvertisingDataLength()
20132013
return _pal_gap.get_maximum_connectable_advertising_data_length();
20142014
}
20152015

2016+
uint8_t GenericGap::getMaxActiveSetAdvertisingDataLength()
2017+
{
2018+
useVersionTwoAPI();
2019+
return _pal_gap.get_max_hci_advertising_data_length();
2020+
}
2021+
20162022
ble_error_t GenericGap::createAdvertisingSet(
20172023
advertising_handle_t *handle,
20182024
const AdvertisingParameters &parameters

0 commit comments

Comments
 (0)