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 Categories of advertising APIs and events for details on advertising APIs. The BLE_GAP_AdvInit function must be called prior to using this API. If the option is set to BLE_GAP_ADV_OPTION_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
Parameter | Description |
---|---|
[in] option | Option for one time advertising. See Advertising options. |
Return values
Return value | Description |
---|---|
MBA_RES_SUCCESS | Successfully starts advertising. |
MBA_RES_OOM | Internal memory allocation failure occurred. |
MBA_RES_INVALID_PARA | The parameters provided are invalid. |
MBA_RES_COMMAND_DISALLOWED | Command disallowed when extended advertising feature is in use. |