diff --git a/drivers/nble/conn.c b/drivers/nble/conn.c index a07f9836e46..2bdd80afbc2 100644 --- a/drivers/nble/conn.c +++ b/drivers/nble/conn.c @@ -74,6 +74,12 @@ int bt_le_set_auto_conn(bt_addr_le_t *addr, return -ENOSYS; } +struct bt_conn *bt_conn_create_slave_le(const bt_addr_le_t *peer, + const struct bt_le_adv_param *param) +{ + return NULL; +} + int bt_conn_auth_cb_register(const struct bt_conn_auth_cb *cb) { return -ENOSYS; diff --git a/include/bluetooth/conn.h b/include/bluetooth/conn.h index b931de097b9..52b9d49ca15 100644 --- a/include/bluetooth/conn.h +++ b/include/bluetooth/conn.h @@ -184,6 +184,31 @@ int bt_le_set_auto_conn(bt_addr_le_t *addr, const struct bt_le_conn_param *param); #endif /* CONFIG_BLUETOOTH_CENTRAL */ +#if defined(CONFIG_BLUETOOTH_PERIPHERAL) +/** @brief Initiate directed advertising to a remote device + * + * Allows initiating a new LE connection to remote peer with the remote + * acting in central role and the local device in peripheral role. + * + * The advertising type must be either BT_LE_ADV_DIRECT_IND or + * BT_LE_ADV_DIRECT_IND_LOW_DUTY. + * + * In case of high duty cycle this will result in a callback with + * connected() with a new connection or with an error. + * + * The advertising may be cancelled with bt_conn_disconnect(). + * + * Returns a new reference that the the caller is responsible for managing. + * + * @param peer Remote address. + * @param param Directed advertising parameters. + * + * @return Valid connection object on success or NULL otherwise. + */ +struct bt_conn *bt_conn_create_slave_le(const bt_addr_le_t *peer, + const struct bt_le_adv_param *param); +#endif /* CONFIG_BLUETOOTH_PERIPHERAL */ + /** Security level. */ typedef enum __packed { BT_SECURITY_LOW, /** No encryption and no authentication. */ diff --git a/net/bluetooth/conn.c b/net/bluetooth/conn.c index 0128a364537..e83836c85d5 100644 --- a/net/bluetooth/conn.c +++ b/net/bluetooth/conn.c @@ -981,6 +981,14 @@ int bt_le_set_auto_conn(bt_addr_le_t *addr, } #endif /* CONFIG_BLUETOOTH_CENTRAL */ +#if defined(CONFIG_BLUETOOTH_PERIPHERAL) +struct bt_conn *bt_conn_create_slave_le(const bt_addr_le_t *peer, + const struct bt_le_adv_param *param) +{ + return NULL; +} +#endif /* CONFIG_BLUETOOTH_PERIPHERAL */ + int bt_conn_le_conn_update(struct bt_conn *conn, uint16_t min, uint16_t max, uint16_t latency, uint16_t timeout) {