Bluetooth: Clean up address-to-string usage & implementation
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This commit is contained in:
parent
8d02ab52ad
commit
a2db217e15
|
@ -49,7 +49,7 @@ const char *bt_hex(const void *buf, size_t len)
|
||||||
#if defined(CONFIG_BT_DEBUG)
|
#if defined(CONFIG_BT_DEBUG)
|
||||||
const char *bt_addr_str(const bt_addr_t *addr)
|
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;
|
static u8_t cur;
|
||||||
char *str;
|
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)
|
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;
|
static u8_t cur;
|
||||||
char *str;
|
char *str;
|
||||||
|
|
||||||
|
|
|
@ -3767,11 +3767,7 @@ static const char *ver_str(u8_t ver)
|
||||||
|
|
||||||
static void show_dev_info(void)
|
static void show_dev_info(void)
|
||||||
{
|
{
|
||||||
char addr[BT_ADDR_LE_STR_LEN];
|
BT_INFO("Identity: %s", bt_addr_le_str(&bt_dev.id_addr));
|
||||||
|
|
||||||
bt_addr_le_to_str(&bt_dev.id_addr, addr, sizeof(addr));
|
|
||||||
|
|
||||||
BT_INFO("Identity: %s", addr);
|
|
||||||
BT_INFO("HCI: version %s (0x%02x) revision 0x%04x, manufacturer 0x%04x",
|
BT_INFO("HCI: version %s (0x%02x) revision 0x%04x, manufacturer 0x%04x",
|
||||||
ver_str(bt_dev.hci_version), bt_dev.hci_version,
|
ver_str(bt_dev.hci_version), bt_dev.hci_version,
|
||||||
bt_dev.hci_revision, bt_dev.manufacturer);
|
bt_dev.hci_revision, bt_dev.manufacturer);
|
||||||
|
|
Loading…
Reference in a new issue