From 1c1654334546ddf6d8d02f50bafca1eb4712a903 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Tue, 15 Mar 2011 19:30:11 +0200 Subject: [PATCH] mgmt: Add adapter name to read_info response --- doc/mgmt-api.txt | 1 + lib/mgmt.h | 1 + plugins/mgmtops.c | 3 +++ 3 files changed, 5 insertions(+) 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); } -- 2.47.3