bt_br_set_connectable

Function bt_br_set_connectable 

Source
pub unsafe extern "C" fn bt_br_set_connectable(
    enable: bool,
    func: Option<unsafe extern "C" fn(*const bt_addr_t, u32) -> u32>,
) -> i32
Expand description

@brief Enable/disable set controller in connectable state.

Allows make local controller to be connectable. It means the controller start listen to devices requests on PAGE SCAN channel. If disabled also resets discoverability if was set.

@param enable Value allowing/disallowing controller to be connectable. @param func Callback function to handle incoming connection requests. If the @p enable is false, this parameter is ignored. If @p func is NULL, the conn_req will be accepted internally. The default role is peripheral. The role switch request can be performed if the @kconfig{BT_ACCEPT_CONN_AS_CENTRAL} is enabled. If @p func is provided, the conn_req will be passed to the callback function for the application to decide whether to accept or reject the connection, and the desired role for the connection.

@return Negative if fail set to requested state or requested state has been already set. Zero if done successfully.