summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2011-03-15 19:30:11 +0200
committerJohan Hedberg <johan.hedberg@nokia.com>2011-03-15 19:30:11 +0200
commit1c1654334546ddf6d8d02f50bafca1eb4712a903 (patch)
tree6d46ef8c2c40641befd83b6bf893427e4496a8e5
parent2854ecff1ffa1af743e9df8e3fe4cef68750c964 (diff)
downloadbluez-1c1654334546ddf6d8d02f50bafca1eb4712a903.tar.gz
mgmt: Add adapter name to read_info response
-rw-r--r--doc/mgmt-api.txt1
-rw-r--r--lib/mgmt.h1
-rw-r--r--plugins/mgmtops.c3
3 files changed, 5 insertions, 0 deletions
diff --git a/doc/mgmt-api.txt b/doc/mgmt-api.txt
index 8e0e83bb7..06c0ef507 100644
--- a/doc/mgmt-api.txt
+++ b/doc/mgmt-api.txt
@@ -80,6 +80,7 @@ Read Controller Information Command
Manufacturer (2 Octets)
HCI_Version (1 Octet)
HCI_Revision (2 Octets)
+ Name (249 Octets)
Controller_Type:0x00 Reserved
0x01 Bluetooth (BR/EDR)
diff --git a/lib/mgmt.h b/lib/mgmt.h
index 7854ab198..77fffed42 100644
--- a/lib/mgmt.h
+++ b/lib/mgmt.h
@@ -65,6 +65,7 @@ struct mgmt_rp_read_info {
uint16_t manufacturer;
uint8_t hci_ver;
uint16_t hci_rev;
+ uint8_t name[249];
} __packed;
struct mgmt_mode {
diff --git a/plugins/mgmtops.c b/plugins/mgmtops.c
index a19a6ccf1..d445558ae 100644
--- a/plugins/mgmtops.c
+++ b/plugins/mgmtops.c
@@ -780,6 +780,7 @@ static void read_info_complete(int sk, uint16_t index, void *buf, size_t len)
DBG("hci%u enabled %u discoverable %u pairable %u sec_mode %u", index,
info->enabled, info->discoverable,
info->pairable, info->sec_mode);
+ DBG("hci%u name %s", index, (char *) rp->name);
adapter = btd_manager_register_adapter(index);
if (adapter == NULL) {
@@ -798,6 +799,8 @@ static void read_info_complete(int sk, uint16_t index, void *buf, size_t len)
else
mgmt_set_powered(index, TRUE);
+ adapter_update_local_name(adapter, (char *) rp->name);
+
btd_adapter_unref(adapter);
}