diff --git a/include/bluetooth/conn.h b/include/bluetooth/conn.h index 36dc2da0308..17045479620 100644 --- a/include/bluetooth/conn.h +++ b/include/bluetooth/conn.h @@ -69,6 +69,14 @@ void bt_conn_put(struct bt_conn *conn); */ struct bt_conn *bt_conn_lookup_addr_le(const bt_addr_le_t *peer); +/*! @brief Get destination (peer) address of a connection. + * + * @param conn Connection object. + * + * @return Destination address. + */ +const bt_addr_le_t *bt_conn_get_dst(const struct bt_conn *conn); + /*! Connection callback structure */ struct bt_conn_cb { void (*connected)(struct bt_conn *conn); diff --git a/net/bluetooth/conn.c b/net/bluetooth/conn.c index 7dda11c3a35..4ea726d229b 100644 --- a/net/bluetooth/conn.c +++ b/net/bluetooth/conn.c @@ -351,3 +351,8 @@ void bt_conn_put(struct bt_conn *conn) conn->handle = 0; } + +const bt_addr_le_t *bt_conn_get_dst(const struct bt_conn *conn) +{ + return &conn->dst; +}