Docuement active set length and add informative call for querying the limit

pull/9096/head
paul-szczepanek-arm 2018-12-11 17:01:17 +00:00
parent e1cf516100
commit 7dd90e1810
4 changed files with 35 additions and 0 deletions

View File

@ -544,6 +544,12 @@ public:
*/
virtual uint16_t getMaxConnectableAdvertisingDataLength();
/** Return maximum advertising data length you may set if advertising set is active.
*
* @return Maximum advertising data length you may set if advertising set is active.
*/
virtual uint8_t getMaxActiveSetAdvertisingDataLength();
/** Create an advertising set and apply the passed in parameters. The handle returned
* by this function must be used for all other calls that accept an advertising handle.
* When done with advertising, remove from the system using destroyAdvertisingSet().
@ -589,6 +595,10 @@ public:
* @param handle Advertising set handle.
* @param payload Advertising payload.
*
* @note If advertising set is active you may only set payload of length equal or less
* than getMaxActiveSetAdvertisingDataLength(). If you require a longer payload you must
* stop the advertising set, set the payload and restart the set.
*
* @return BLE_ERROR_NONE on success.
*
* @see ble::AdvertisingDataBuilder to build a payload.
@ -604,6 +614,10 @@ public:
* @param handle Advertising set handle.
* @param response Advertising scan response.
*
* @note If advertising set is active you may only set payload of length equal or less
* than getMaxActiveSetAdvertisingDataLength(). If you require a longer payload you must
* stop the advertising set, set the payload and restart the set.
*
* @return BLE_ERROR_NONE on success.
*
* @see ble::AdvertisingDataBuilder to build a payload.
@ -669,6 +683,11 @@ public:
* @param payload Advertising payload.
* @return BLE_ERROR_NONE on success.
*
* @note If advertising set is active you may only set payload of length equal or less
* than getMaxActiveSetAdvertisingDataLength(). If you require a longer payload you must
* stop the advertising set, set the payload and restart the set. Stopping the set will
* cause peers to lose sync on the periodic set.
*
* @see ble::AdvertisingDataBuilder to build a payload.
*
* @version 5+

View File

@ -95,6 +95,10 @@ public:
*/
virtual uint16_t getMaxConnectableAdvertisingDataLength();
/** @copydoc Gap::getMaxActiveSetAdvertisingDataLength
*/
virtual uint8_t getMaxActiveSetAdvertisingDataLength();
/** @copydoc Gap::createAdvertisingSet
*/
virtual ble_error_t createAdvertisingSet(

View File

@ -42,6 +42,12 @@ uint16_t Gap::getMaxConnectableAdvertisingDataLength()
return LEGACY_ADVERTISING_MAX_SIZE;
}
uint8_t Gap::getMaxActiveSetAdvertisingDataLength()
{
/* Requesting action from porter(s): override this API if this capability is supported. */
return LEGACY_ADVERTISING_MAX_SIZE;
}
ble_error_t Gap::createAdvertisingSet(
advertising_handle_t *handle,
const AdvertisingParameters &parameters

View File

@ -2013,6 +2013,12 @@ uint16_t GenericGap::getMaxConnectableAdvertisingDataLength()
return _pal_gap.get_maximum_connectable_advertising_data_length();
}
uint8_t GenericGap::getMaxActiveSetAdvertisingDataLength()
{
useVersionTwoAPI();
return _pal_gap.get_max_hci_advertising_data_length();
}
ble_error_t GenericGap::createAdvertisingSet(
advertising_handle_t *handle,
const AdvertisingParameters &parameters