Skip to content
Permalink
Browse files

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 <joakim.andersson@nordicsemi.no>
  • Loading branch information...
joerchan authored and carlescufi committed Aug 7, 2019
1 parent 27109e6 commit 54d9ae45a5b3afaf17572e601ee5b73863e70b66
Showing with 16 additions and 6 deletions.
  1. +10 −2 include/bluetooth/conn.h
  2. +6 −4 subsys/bluetooth/host/conn.c
@@ -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 */
@@ -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;

0 comments on commit 54d9ae4

Please sign in to comment.
You can’t perform that action at this time.