1.2.2.1.1.4.48 BLE_GAP_SetExtAdvEnable

C

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

Description

Enable or disable one or more advertising sets using the advertising sets identified by the advHandle.

Note

If enable set to false and numOfSets set to 0x00, then all advertising sets are disabled.

Advertising will be disabled after set maximum extended advertising events were sent even if the set duration has not expired. Details in BLE_GAP_ExtAdvEnableParams_T.

This API belongs to extended advertising feature. It will be disallowed if any one API that belongs to legacy advertising feature is issued before. Categories of advertising APIs and events for details of advertising APIs.

BLE_GAP_AdvInit and BLE_GAP_ExtAdvInit are required for this API.

Parameters

ParameterDescription
[in] enableEnable or disable one or more advertising sets. Set true to start the extended advertising.
[in] numOfSetsThe number of advertising sets contained in the p_advParam.
[in] p_advParamPointer to BLE_GAP_ExtAdvEnableParams_T structure buffer.

Return values

Return valueDescription
MBA_RES_SUCCESSSuccessfully enable or disable one or more advertising sets.
MBA_RES_OOMInternal memory allocation failure.
MBA_RES_INVALID_PARAInvalid parameters.
MBA_RES_COMMAND_DISALLOWEDCommand disallowed.
MBA_RES_UNKNOWN_ADV_IDUnknown advertising identifier.