summaryrefslogtreecommitdiffstats
path: root/tools/hcitool.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2007-09-10 18:47:30 +0000
committerMarcel Holtmann <marcel@holtmann.org>2007-09-10 18:47:30 +0000
commit7d7658ad2fcd296440916cd26cd8182a8dc0a7c3 (patch)
tree13bad91615d2e82745cfcb426a790335abb54341 /tools/hcitool.c
parent3dfe93f27c455e07be72a38239f4f8335ba6a860 (diff)
Show connection link type correctly
Diffstat (limited to 'tools/hcitool.c')
-rw-r--r--tools/hcitool.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/tools/hcitool.c b/tools/hcitool.c
index 49cc6fe6..c9d3dbd6 100644
--- a/tools/hcitool.c
+++ b/tools/hcitool.c
@@ -63,6 +63,20 @@ static int dev_info(int s, int dev_id, long arg)
return 0;
}
+static char *type2str(uint8_t type)
+{
+ switch (type) {
+ case SCO_LINK:
+ return "SCO";
+ case ACL_LINK:
+ return "ACL";
+ case ESCO_LINK:
+ return "eSCO";
+ default:
+ return "Unknown";
+ }
+}
+
static int conn_list(int s, int dev_id, long arg)
{
struct hci_conn_list_req *cl;
@@ -90,8 +104,7 @@ static int conn_list(int s, int dev_id, long arg)
char addr[18];
ba2str(&ci->bdaddr, addr);
printf("\t%s %s %s handle %d state %d lm %s\n",
- ci->out ? "<" : ">",
- ci->type == ACL_LINK ? "ACL" : "SCO",
+ ci->out ? "<" : ">", type2str(ci->type),
addr, ci->handle, ci->state,
hci_lmtostr(ci->link_mode));
}