1.1.2.1.1.4.48 BLE_GAP_SetExtAdvEnable
C
uint16_t BLE_GAP_SetExtAdvEnable(bool enable, uint8_t numOfSets, BLE_GAP_ExtAdvEnableParams_T *p_advParam);
Description
Enable or disable one or more advertising sets using the advertising sets identified by the advHandle.
Note
If enable set to false and numOfSets set to 0x00, then all advertising sets are disabled.
Advertising will be disabled after set maximum extended advertising events were sent even if the set duration has not expired. Details in BLE_GAP_ExtAdvEnableParams_T.
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 and BLE_GAP_ExtAdvInit are required for this API.
Events generated
BLE_GAP_EVT_CONNECTED Generated when connectable advertising is started and connection is established.
BLE_GAP_EVT_SCAN_REQ_RECEIVED Generated when ext. adv. enabled.
BLE_GAP_EVT_ADV_SET_TERMINATED Generated when ext. adv. enabled and timeout (by duration).
Parameters
Parameter | Description |
---|---|
[in] enable | Enable or disable one or more advertising sets. Set true to start the extended advertising. |
[in] numOfSets | The number of advertising sets contained in the p_advParam. |
[in] p_advParam | Pointer to BLE_GAP_ExtAdvEnableParams_T structure buffer. |
Return values
Return value | Description |
---|---|
MBA_RES_SUCCESS | Successfully enable or disable one or more advertising sets. |
MBA_RES_OOM | Internal memory allocation failure. |
MBA_RES_INVALID_PARA | Invalid parameters. |
MBA_RES_COMMAND_DISALLOWED | Command disallowed. |
MBA_RES_UNKNOWN_ADV_ID | Unknown advertising identifier. |