1.1.2.1.1.4.59 BLE_GAP_SetPeriAdvEnable

C

uint16_t BLE_GAP_SetPeriAdvEnable(bool enable, uint8_t advHandle);

Description

Enable or disable the periodic advertising for the advertising set specified by the advHandle.

Note

If the advertising set is not currently enabled (see BLE_GAP_SetExtAdvEnable API), the periodic advertising is not started until the advertising set is enabled.

The periodic advertising should continue until this API is called with enable set to false.

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, BLE_GAP_ExtAdvInit and BLE_GAP_PeriodicAdvInit are required for this API.

Parameters

ParameterDescription
[in] enableEnable or disable the periodic advertising.
[in] advHandleIdentifies which advertising set to be enabled or disabled.

Return values

Return valueDescription
MBA_RES_SUCCESSSuccessfully enable or disable the periodic advertising.
MBA_RES_OOMInternal memory allocation failure.
MBA_RES_INVALID_PARAInvalid parameters.
MBA_RES_COMMAND_DISALLOWEDCommand disallowed.
MBA_RES_UNKNOWN_ADV_IDUnknown advertising identifier.