From ceedf72c51d0ba73d8517a30441425dfad102a80 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Thu, 5 Sep 2024 11:21:40 +0300 Subject: [PATCH] Bluetooth: shell: Use common HCI version decode function There's a generally available bt_hci_get_ver_str() function, so use that instead of defining our own. Signed-off-by: Johan Hedberg --- subsys/bluetooth/shell/bt.c | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/subsys/bluetooth/shell/bt.c b/subsys/bluetooth/shell/bt.c index 246243ed6b4..1cafc52a725 100644 --- a/subsys/bluetooth/shell/bt.c +++ b/subsys/bluetooth/shell/bt.c @@ -891,20 +891,6 @@ static void security_changed(struct bt_conn *conn, bt_security_t level, #endif #if defined(CONFIG_BT_REMOTE_INFO) -static const char *ver_str(uint8_t ver) -{ - const char * const str[] = { - "1.0b", "1.1", "1.2", "2.0", "2.1", "3.0", "4.0", "4.1", "4.2", - "5.0", "5.1", "5.2", "5.3", "5.4" - }; - - if (ver < ARRAY_SIZE(str)) { - return str[ver]; - } - - return "unknown"; -} - static void remote_info_available(struct bt_conn *conn, struct bt_conn_remote_info *remote_info) { @@ -915,7 +901,7 @@ static void remote_info_available(struct bt_conn *conn, if (IS_ENABLED(CONFIG_BT_REMOTE_VERSION)) { shell_print(ctx_shell, "Remote LMP version %s (0x%02x) subversion 0x%04x " - "manufacturer 0x%04x", ver_str(remote_info->version), + "manufacturer 0x%04x", bt_hci_get_ver_str(remote_info->version), remote_info->version, remote_info->subversion, remote_info->manufacturer); }