Bluetooth: Add bt_conn_get_dst function

This function allows to pick connection destination address.

Change-Id: I3e4959eec00905c64de3d8b9ef810b613c2e9f91
Signed-off-by: Szymon Janc <szymon.janc@tieto.com>
This commit is contained in:
Szymon Janc 2015-06-18 09:36:59 +02:00 committed by Anas Nashif
commit 441e01ec04
2 changed files with 13 additions and 0 deletions

View file

@ -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); 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 */ /*! Connection callback structure */
struct bt_conn_cb { struct bt_conn_cb {
void (*connected)(struct bt_conn *conn); void (*connected)(struct bt_conn *conn);

View file

@ -351,3 +351,8 @@ void bt_conn_put(struct bt_conn *conn)
conn->handle = 0; conn->handle = 0;
} }
const bt_addr_le_t *bt_conn_get_dst(const struct bt_conn *conn)
{
return &conn->dst;
}