From 54d9ae45a5b3afaf17572e601ee5b73863e70b66 Mon Sep 17 00:00:00 2001 From: Joakim Andersson Date: Wed, 7 Aug 2019 09:46:11 +0200 Subject: [PATCH] Bluetooth: Host: Add identity addresses to conn info object Use the src and dst naming to refer to the identity addresses of the connection. Keep the device addresses used during connections but rename them to local and remote instead. Update documentation to be more descriptive. Signed-off-by: Joakim Andersson --- include/bluetooth/conn.h | 12 ++++++++++-- subsys/bluetooth/host/conn.c | 10 ++++++---- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/include/bluetooth/conn.h b/include/bluetooth/conn.h index 5d847788085..a484d385996 100644 --- a/include/bluetooth/conn.h +++ b/include/bluetooth/conn.h @@ -124,8 +124,16 @@ enum { /** LE Connection Info Structure */ struct bt_conn_le_info { - const bt_addr_le_t *src; /** Source (Local) Address */ - const bt_addr_le_t *dst; /** Destination (Remote) Address */ + /** Source (Local) Identity Address */ + const bt_addr_le_t *src; + /** Destination (Remote) Identity Address or remote Resolvable Private + * Address (RPA) before identity has been resolved. + */ + const bt_addr_le_t *dst; + /** Local device address used during connection setup. */ + const bt_addr_le_t *local; + /** Remote device address used during connection setup. */ + const bt_addr_le_t *remote; u16_t interval; /** Connection interval */ u16_t latency; /** Connection slave latency */ u16_t timeout; /** Connection supervision timeout */ diff --git a/subsys/bluetooth/host/conn.c b/subsys/bluetooth/host/conn.c index 3dbfd920f58..c07229d6e66 100644 --- a/subsys/bluetooth/host/conn.c +++ b/subsys/bluetooth/host/conn.c @@ -1778,12 +1778,14 @@ int bt_conn_get_info(const struct bt_conn *conn, struct bt_conn_info *info) switch (conn->type) { case BT_CONN_TYPE_LE: + info->le.dst = &conn->le.dst; + info->le.src = &bt_dev.id_addr[conn->id]; if (conn->role == BT_HCI_ROLE_MASTER) { - info->le.src = &conn->le.init_addr; - info->le.dst = &conn->le.resp_addr; + info->le.local = &conn->le.init_addr; + info->le.remote = &conn->le.resp_addr; } else { - info->le.src = &conn->le.resp_addr; - info->le.dst = &conn->le.init_addr; + info->le.local = &conn->le.resp_addr; + info->le.remote = &conn->le.init_addr; } info->le.interval = conn->le.interval; info->le.latency = conn->le.latency;