BLE_GAP_EnableOneTimeAdv

C

uint16_t BLE_GAP_EnableOneTimeAdv(uint8_t option);

Description

Starts a one-time advertising event.

Note

This API is part of the legacy advertising feature set. It will be disallowed if any API from the extended advertising feature set has been used prior to this call. See BLE_GAP_ADV_CATS for details on advertising APIs. The BLE_GAP_AdvInit function must be called prior to using this API. If the option is set to Advertising options_STORE_PARAMS, the APIs BLE_GAP_SetAdvParams, BLE_GAP_SetAdvData, or BLE_GAP_SetScanRspData must be called beforehand to set the appropriate parameters.

Events generated

BLE_GAP_EVT_ADV_COMPL is generated when one time advertising event is completed. If a connection is established, BLE_GAP_EVT_CONNECTED is generated instead of BLE_GAP_EVT_ADV_COMPL.

Parameters

ParameterDescription
[in] optionOption for one time advertising. See Advertising options.

Return values

Return valueDescription
MBA_RES_SUCCESSSuccessfully starts advertising.
MBA_RES_OOMInternal memory allocation failure occurred.
MBA_RES_INVALID_PARAThe parameters provided are invalid.
MBA_RES_COMMAND_DISALLOWEDCommand disallowed when extended advertising feature is in use.