BLE_GAP_SetExtAdvParams

C

uint16_t BLE_GAP_SetExtAdvParams(BLE_GAP_ExtAdvParams_T *p_extAdvParams, int8_t *p_selectedTxPower);

Description

Configures the extended advertising parameters.

Note

This API is part of the extended advertising feature and is disallowed if any legacy advertising feature API has been used prior. See Categories of advertising APIs and events for advertising API details. Initialization with BLE_GAP_AdvInit or BLE_GAP_ExtAdvInit is required before calling this API. When using coded PHY, the default coding scheme is S=8 (S: Transmitted Symbols). Use BLE_GAP_SetExtAdvCodingScheme to change the coding scheme.

If legacy advertising PDU types are being used and the advertising set already contains data, the type shall be one that supports advertising data, and the amount of data shall not exceed 31 bytes. If extended advertising PDU types are being used, then: - The advertisement shall not be both connectable and scannable. - High duty cycle directed connectable advertising shall not be used (bit 3 = 0).

This API only accepts 2 configurations from the 2nd advertising set: 1. Event property is non-connectable and non-scannable: This advertising set will use Non-RPA automatically and change periodically. The default address timeout is 15 minutes if the application has not set local privacy via BLE_GAP_SetLocalPrivacy. 2. Event property is connectable or scannable: The peer address must be in the resolving list and local privacy must be enabled. This peer address should not use the same IRK as other advertising sets. This advertising set will use RPA.

It is recommended to clear and reconfigure all advertising sets after calling BLE_GAP_SetLocalPrivacy or BLE_GAP_SetResolvingList due to potential changes in privacy settings.

Parameters

ParameterDescription
[in] p_extAdvParamsPointer to the structure containing extended advertising parameters.
[out] p_selectedTxPowerPointer to the variable where the selected transmit power level will be stored. (Unit: dBm)

Return values

Return valueDescription
MBA_RES_SUCCESSSuccessfully configures the extended advertising parameters.
MBA_RES_OOMInternal memory allocation failure occurred.
MBA_RES_INVALID_PARAThe parameters provided are invalid.
MBA_RES_COMMAND_DISALLOWEDCommand disallowed due to a conflicting operation or state.