From: "Frédéric Danis" <frederic.danis@linux.intel.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH v9 4/5] input: Retrieve device name from device object
Date: Fri, 26 Oct 2012 12:08:16 +0200 [thread overview]
Message-ID: <1351246097-22285-4-git-send-email-frederic.danis@linux.intel.com> (raw)
In-Reply-To: <1351246097-22285-1-git-send-email-frederic.danis@linux.intel.com>
---
profiles/input/device.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/profiles/input/device.c b/profiles/input/device.c
index fbc3d6f..108be39 100644
--- a/profiles/input/device.c
+++ b/profiles/input/device.c
@@ -777,7 +777,7 @@ static struct input_device *input_device_new(struct btd_device *device,
{
struct btd_adapter *adapter = device_get_adapter(device);
struct input_device *idev;
- char name[249], src_addr[18], dst_addr[18];
+ char name[HCI_MAX_NAME_LENGTH + 1];
idev = g_new0(struct input_device, 1);
bacpy(&idev->src, adapter_get_address(adapter));
@@ -787,11 +787,8 @@ static struct input_device *input_device_new(struct btd_device *device,
idev->handle = handle;
idev->disable_sdp = disable_sdp;
- ba2str(&idev->src, src_addr);
- ba2str(&idev->dst, dst_addr);
-
- if (read_device_name(src_addr, dst_addr, device_get_addr_type(device),
- name) == 0)
+ device_get_name(device, name, HCI_MAX_NAME_LENGTH);
+ if (strlen(name) > 0)
idev->name = g_strdup(name);
if (g_dbus_register_interface(btd_get_dbus_connection(),
--
1.7.9.5
next prev parent reply other threads:[~2012-10-26 10:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-26 10:08 [PATCH v9 1/5] doc: Update settings-storage.txt Frédéric Danis
2012-10-26 10:08 ` [PATCH v9 2/5] device: Retrieve name from storage Frédéric Danis
2012-10-26 10:08 ` [PATCH v9 3/5] dbusoob: Set device name in device object Frédéric Danis
2012-10-26 10:08 ` Frédéric Danis [this message]
2012-10-26 10:08 ` [PATCH v9 5/5] hcitool: Retrieve names from cache directory Frédéric Danis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1351246097-22285-4-git-send-email-frederic.danis@linux.intel.com \
--to=frederic.danis@linux.intel.com \
--cc=linux-bluetooth@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).