Skip to main content

ble_gap_set_event_cb

Function ble_gap_set_event_cb 

Source
pub unsafe extern "C" fn ble_gap_set_event_cb(
    conn_handle: u16,
    cb: Option<unsafe extern "C" fn(*mut ble_gap_event, *mut c_void) -> i32>,
    cb_arg: *mut c_void,
) -> i32
Expand description

Configures a connection to use the specified GAP event callback. A connection’s GAP event callback is first specified when the connection is created, either via advertising or initiation. This function replaces the callback that was last configured.

@param conn_handle The handle of the connection to configure. @param cb The callback to associate with the connection. @param cb_arg An optional argument that the callback receives.

@return 0 on success, BLE_HS_ENOTCONN if there is no connection with the specified handle.