Function esp_idf_sys::ble_gap_adv_start

source ·
pub unsafe extern "C" fn ble_gap_adv_start(
    own_addr_type: u8,
    direct_addr: *const ble_addr_t,
    duration_ms: i32,
    adv_params: *const ble_gap_adv_params,
    cb: ble_gap_event_fn,
    cb_arg: *mut c_void,
) -> c_int
Expand description

@brief Start advertising

This function configures and start advertising procedure.

@param own_addr_type The type of address the stack should use for itself. Valid values are: - BLE_OWN_ADDR_PUBLIC - BLE_OWN_ADDR_RANDOM - BLE_OWN_ADDR_RPA_PUBLIC_DEFAULT - BLE_OWN_ADDR_RPA_RANDOM_DEFAULT @param direct_addr The peer’s address for directed advertising. This parameter shall be non-NULL if directed advertising is being used. @param duration_ms The duration of the advertisement procedure. On expiration, the procedure ends and a BLE_GAP_EVENT_ADV_COMPLETE event is reported. Units are milliseconds. Specify BLE_HS_FOREVER for no expiration. @param adv_params Additional arguments specifying the particulars of the advertising procedure. @param cb The callback to associate with this advertising procedure. If advertising ends, the event is reported through this callback. If advertising results in a connection, the connection inherits this callback as its event-reporting mechanism. @param cb_arg The optional argument to pass to the callback function.

@return 0 on success, error code on failure.