riot_sys

Function ble_gap_connect

Source
pub unsafe extern "C" fn ble_gap_connect(
    own_addr_type: u8,
    peer_addr: *const ble_addr_t,
    duration_ms: i32,
    params: *const ble_gap_conn_params,
    cb: ble_gap_event_fn,
    cb_arg: *mut c_void,
) -> c_int
Expand description

Initiates a connect procedure.

@param own_addr_type The type of address the stack should use for itself during connection establishment. - BLE_OWN_ADDR_PUBLIC - BLE_OWN_ADDR_RANDOM - BLE_OWN_ADDR_RPA_PUBLIC_DEFAULT - BLE_OWN_ADDR_RPA_RANDOM_DEFAULT @param peer_addr The address of the peer to connect to. If this parameter is NULL, the white list is used. @param duration_ms The duration of the discovery procedure. On expiration, the procedure ends and a BLE_GAP_EVENT_DISC_COMPLETE event is reported. Units are milliseconds. @param conn_params Additional arguments specifying the particulars of the connect procedure. Specify null for default values. @param cb The callback to associate with this connect procedure. When the connect procedure completes, the result is reported through this callback. If the connect procedure succeeds, 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; BLE_HS_EALREADY if a connection attempt is already in progress; BLE_HS_EBUSY if initiating a connection is not possible because scanning is in progress; BLE_HS_EDONE if the specified peer is already connected; Other nonzero on error.