drivers/nble: Export local address for bt_conn_get_info()
The bt_conn_get_info() API also needs the local address. For now simply use an extern declaration to get access to the variable that resides in gap.c. Change-Id: I3ddb598785cfb6a5d07fc10621f6d20a610536be Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This commit is contained in:
parent
f0315be577
commit
acdee60fa5
2 changed files with 6 additions and 3 deletions
|
@ -26,6 +26,8 @@
|
|||
#include "gap_internal.h"
|
||||
#include "conn_internal.h"
|
||||
|
||||
extern bt_addr_le_t nble_bdaddr;
|
||||
|
||||
static struct bt_conn conns[CONFIG_BLUETOOTH_MAX_CONN];
|
||||
static struct bt_conn_cb *callback_list;
|
||||
|
||||
|
@ -114,6 +116,7 @@ int bt_conn_get_info(const struct bt_conn *conn, struct bt_conn_info *info)
|
|||
info->type = BT_CONN_TYPE_LE;
|
||||
info->role = conn->role;
|
||||
info->le.dst = &conn->dst;
|
||||
info->le.src = &nble_bdaddr;
|
||||
info->le.interval = conn->interval;
|
||||
info->le.latency = conn->latency;
|
||||
info->le.timeout = conn->timeout;
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
static bt_ready_cb_t bt_ready_cb;
|
||||
|
||||
/* Local Bluetooth LE Device Address */
|
||||
static bt_addr_le_t bdaddr;
|
||||
bt_addr_le_t nble_bdaddr;
|
||||
|
||||
#if defined(CONFIG_BLUETOOTH_DEBUG)
|
||||
static const char *bt_addr_le_str(const bt_addr_le_t *addr)
|
||||
|
@ -319,9 +319,9 @@ void on_nble_gap_read_bda_rsp(const struct nble_service_read_bda_response *rsp)
|
|||
return;
|
||||
}
|
||||
|
||||
bt_addr_le_copy(&bdaddr, &rsp->bd);
|
||||
bt_addr_le_copy(&nble_bdaddr, &rsp->bd);
|
||||
|
||||
BT_DBG("Local bdaddr: %s", bt_addr_le_str(&bdaddr));
|
||||
BT_DBG("Local bdaddr: %s", bt_addr_le_str(&nble_bdaddr));
|
||||
|
||||
nble_get_version_req(NULL);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue