Skip to content

Commit 835352c

Browse files
Thalleyfabiobaltieri
authored andcommitted
Bluetooth: Shell: Add indication of default_conn in connections cmd
When doing "bt connections" the currently selected ACL (default_conn) is now indicated with a "*" making it easier to determine which of the connections is currently selected. Signed-off-by: Emil Gydesen <[email protected]>
1 parent c7f9eaf commit 835352c

File tree

1 file changed

+4
-6
lines changed
  • subsys/bluetooth/shell

1 file changed

+4
-6
lines changed

subsys/bluetooth/shell/bt.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3011,21 +3011,19 @@ static void connection_info(struct bt_conn *conn, void *user_data)
30113011
#if defined(CONFIG_BT_BREDR)
30123012
case BT_CONN_TYPE_BR:
30133013
bt_addr_to_str(info.br.dst, addr, sizeof(addr));
3014-
shell_print(ctx_shell, "#%u [BR][%s] %s", info.id,
3015-
role_str(info.role), addr);
3014+
shell_print(ctx_shell, " #%u [BR][%s] %s", info.id, role_str(info.role), addr);
30163015
break;
30173016
#endif
30183017
case BT_CONN_TYPE_LE:
30193018
bt_addr_le_to_str(info.le.dst, addr, sizeof(addr));
3020-
shell_print(ctx_shell, "#%u [LE][%s] %s: Interval %u latency %u"
3021-
" timeout %u", info.id, role_str(info.role), addr,
3019+
shell_print(ctx_shell, "%s#%u [LE][%s] %s: Interval %u latency %u timeout %u",
3020+
conn == default_conn ? "*" : " ", info.id, role_str(info.role), addr,
30223021
info.le.interval, info.le.latency, info.le.timeout);
30233022
break;
30243023
#if defined(CONFIG_BT_ISO)
30253024
case BT_CONN_TYPE_ISO:
30263025
bt_addr_le_to_str(info.le.dst, addr, sizeof(addr));
3027-
shell_print(ctx_shell, "#%u [ISO][%s] %s", info.id,
3028-
role_str(info.role), addr);
3026+
shell_print(ctx_shell, " #%u [ISO][%s] %s", info.id, role_str(info.role), addr);
30293027
break;
30303028
#endif
30313029
}

0 commit comments

Comments
 (0)