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
Parameter | Description |
---|---|
[in] enable | True to enable periodic advertising, false to disable it. |
[in] advHandle | Advertising set identifier to enable or disable periodic advertising for. |
Return values
Return value | Description |
---|---|
MBA_RES_SUCCESS | Successfully enables or disables the periodic advertising. |
MBA_RES_OOM | Internal memory allocation failure occurred. |
MBA_RES_INVALID_PARA | The parameters provided are invalid. |
MBA_RES_COMMAND_DISALLOWED | Command disallowed due to a conflicting operation or state. |
MBA_RES_UNKNOWN_ADV_ID | Unknown advertising identifier. |