summaryrefslogtreecommitdiff
path: root/lib/hci.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2010-02-13 02:21:29 +0100
committerMarcel Holtmann <marcel@holtmann.org>2010-02-13 02:21:29 +0100
commit4aa4bdb16ad09071cd70e7aa96fadf804fef3007 (patch)
tree7dc50797b8c20852526b6b9df5aa9129e54483a0 /lib/hci.c
parentbbd888d066f801255bc538ca422b88597a044493 (diff)
downloadbluez-4aa4bdb16ad09071cd70e7aa96fadf804fef3007.tar.gz
Add helper functions for controller type string conversion
Diffstat (limited to 'lib/hci.c')
-rw-r--r--lib/hci.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/lib/hci.c b/lib/hci.c
index 8f1c36e2a..014b99bed 100644
--- a/lib/hci.c
+++ b/lib/hci.c
@@ -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 },