diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2010-02-13 02:21:29 +0100 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2010-02-13 02:21:29 +0100 |
commit | 4aa4bdb16ad09071cd70e7aa96fadf804fef3007 (patch) | |
tree | 7dc50797b8c20852526b6b9df5aa9129e54483a0 /lib/hci.c | |
parent | bbd888d066f801255bc538ca422b88597a044493 (diff) | |
download | bluez-4aa4bdb16ad09071cd70e7aa96fadf804fef3007.tar.gz |
Add helper functions for controller type string conversion
Diffstat (limited to 'lib/hci.c')
-rw-r--r-- | lib/hci.c | 21 |
1 files changed, 19 insertions, 2 deletions
@@ -138,9 +138,9 @@ static int hci_str2uint(hci_map *map, char *str, unsigned int *val) return set; } -char *hci_dtypetostr(int type) +char *hci_bustostr(int bus) { - switch (type) { + switch (bus) { case HCI_VIRTUAL: return "VIRTUAL"; case HCI_USB: @@ -160,6 +160,23 @@ char *hci_dtypetostr(int type) } } +char *hci_dtypetostr(int type) +{ + return hci_bustostr(type & 0x0f); +} + +char *hci_typetostr(int type) +{ + switch (type) { + case HCI_BREDR: + return "BR/EDR"; + case HCI_80211: + return "802.11"; + default: + return "UNKNOWN"; + } +} + /* HCI dev flags mapping */ static hci_map dev_flags_map[] = { { "UP", HCI_UP }, |