BLE_GAP_SetExtAdvEnable

C

uint16_t BLE_GAP_SetExtAdvEnable(bool enable, uint8_t numOfSets, BLE_GAP_ExtAdvEnableParams_T *p_advParam);

Description

Enables or disables one or more advertising sets.

Note

If enable is set to false and numOfSets is 0x00, then all advertising sets are disabled. Advertising will be disabled after the maximum number of extended advertising events have been sent, even if the set duration has not expired. For more details, see BLE_GAP_ExtAdvEnableParams_T. This API is part of the extended advertising feature and is incompatible with legacy advertising APIs. See Categories of advertising APIs and events for details on advertising APIs. Initialization with BLE_GAP_AdvInit and BLE_GAP_ExtAdvInit is required before calling this API. Set the advertising parameters with BLE_GAP_SetExtAdvParams before calling this API. Set the advertising and scan response data with BLE_GAP_SetExtAdvData and BLE_GAP_SetExtScanRspData before calling this API.

Parameters

ParameterDescription
[in] enableEnable (true) or disable (false) one or more advertising sets.
[in] numOfSetsThe number of advertising sets to be enabled or disabled.
[in] p_advParamPointer to a BLE_GAP_ExtAdvEnableParams_T structure containing the enable parameters.

Return values

Return valueDescription
MBA_RES_SUCCESSSuccessfully enables or disables the advertising sets.
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.
MBA_RES_UNKNOWN_ADV_IDUnknown advertising identifier.