nrf-softdevice-s140

Crates

git

Versions

default

Flavors

pub unsafe fn sd_ble_gap_adv_start(adv_handle: u8, conn_cfg_tag: u8) -> u32
Expand description

@brief Start advertising (GAP Discoverable, Connectable modes, Broadcast Procedure).

@note Only one advertiser may be active at any time.

@events @event{@ref BLE_GAP_EVT_CONNECTED, Generated after connection has been established through connectable advertising.} @event{@ref BLE_GAP_EVT_ADV_SET_TERMINATED, Advertising set has terminated.} @event{@ref BLE_GAP_EVT_SCAN_REQ_REPORT, A scan request was received.} @endevents

@mscs @mmsc{@ref BLE_GAP_ADV_MSC} @mmsc{@ref BLE_GAP_PERIPH_CONN_PRIV_MSC} @mmsc{@ref BLE_GAP_PRIVACY_ADV_DIR_PRIV_MSC} @mmsc{@ref BLE_GAP_WL_SHARE_MSC} @endmscs

@param[in] adv_handle Advertising handle to advertise on, received from @ref sd_ble_gap_adv_set_configure. @param[in] conn_cfg_tag Tag identifying a configuration set by @ref sd_ble_cfg_set or @ref BLE_CONN_CFG_TAG_DEFAULT to use the default connection configuration. For non-connectable advertising, this is ignored.

@retval ::NRF_SUCCESS The BLE stack has started advertising. @retval ::NRF_ERROR_INVALID_STATE adv_handle is not configured or already advertising. @retval ::NRF_ERROR_CONN_COUNT The limit of available connections for this connection configuration tag has been reached; connectable advertiser cannot be started. To increase the number of available connections, use @ref sd_ble_cfg_set with @ref BLE_GAP_CFG_ROLE_COUNT or @ref BLE_CONN_CFG_GAP. @retval ::BLE_ERROR_INVALID_ADV_HANDLE Advertising handle not found. Configure a new adveriting handle with @ref sd_ble_gap_adv_set_configure. @retval ::NRF_ERROR_NOT_FOUND conn_cfg_tag not found. @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied: - Invalid configuration of p_adv_params. See @ref ble_gap_adv_params_t. - Use of whitelist requested but whitelist has not been set, see @ref sd_ble_gap_whitelist_set. @retval ::NRF_ERROR_RESOURCES Either: - adv_handle is configured with connectable advertising, but the event_length parameter associated with conn_cfg_tag is too small to be able to establish a connection on the selected advertising phys. Use @ref sd_ble_cfg_set to increase the event length. - Not enough BLE role slots available. Stop one or more currently active roles (Central, Peripheral, Broadcaster or Observer) and try again. - p_adv_params is configured with connectable advertising, but the event_length parameter associated with conn_cfg_tag is too small to be able to establish a connection on the selected advertising phys. Use @ref sd_ble_cfg_set to increase the event length.