Bluetooth: Clean up address-to-string usage & implementation

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This commit is contained in:
Johan Hedberg 2017-10-03 14:56:01 +03:00 committed by Johan Hedberg
parent 8d02ab52ad
commit a2db217e15
2 changed files with 3 additions and 7 deletions

View file

@ -49,7 +49,7 @@ const char *bt_hex(const void *buf, size_t len)
#if defined(CONFIG_BT_DEBUG)
const char *bt_addr_str(const bt_addr_t *addr)
{
static char bufs[2][18];
static char bufs[2][BT_ADDR_STR_LEN];
static u8_t cur;
char *str;
@ -62,7 +62,7 @@ const char *bt_addr_str(const bt_addr_t *addr)
const char *bt_addr_le_str(const bt_addr_le_t *addr)
{
static char bufs[2][27];
static char bufs[2][BT_ADDR_LE_STR_LEN];
static u8_t cur;
char *str;

View file

@ -3767,11 +3767,7 @@ static const char *ver_str(u8_t ver)
static void show_dev_info(void)
{
char addr[BT_ADDR_LE_STR_LEN];
bt_addr_le_to_str(&bt_dev.id_addr, addr, sizeof(addr));
BT_INFO("Identity: %s", addr);
BT_INFO("Identity: %s", bt_addr_le_str(&bt_dev.id_addr));
BT_INFO("HCI: version %s (0x%02x) revision 0x%04x, manufacturer 0x%04x",
ver_str(bt_dev.hci_version), bt_dev.hci_version,
bt_dev.hci_revision, bt_dev.manufacturer);