BLE_GAP_SetPeriAdvEnable

C

uint16_t BLE_GAP_SetPeriAdvEnable(bool enable, uint8_t advHandle);

Description

Enables or disables periodic advertising for a specified advertising set.

Note

If the advertising set is not currently enabled (see BLE_GAP_SetExtAdvEnable), periodic advertising will not start until the advertising set is enabled. Periodic advertising continues until this API is called with 'enable' set to false. This API is part of the extended advertising feature and is disallowed if any legacy advertising feature API has been used previously. See @ref BLE_GAP_ADV_CATS for details on advertising APIs. Initialization with BLE_GAP_AdvInit, BLE_GAP_ExtAdvInit, and BLE_GAP_PeriodicAdvInit is required before using this API.

Parameters

ParameterDescription
[in] enableTrue to enable periodic advertising, false to disable it.
[in] advHandleAdvertising set identifier to enable or disable periodic advertising for.

Return values

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