linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] android/handsfree: Return default device for zero bdaddr
@ 2014-11-06  8:27 Andrei Emeltchenko
  2014-11-06 10:41 ` Szymon Janc
  0 siblings, 1 reply; 4+ messages in thread
From: Andrei Emeltchenko @ 2014-11-06  8:27 UTC (permalink / raw)
  To: linux-bluetooth

From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

For the old Android API use find_default_device() function.
---
 android/handsfree.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/android/handsfree.c b/android/handsfree.c
index 4d8dff4..98d1f56 100644
--- a/android/handsfree.c
+++ b/android/handsfree.c
@@ -290,6 +290,11 @@ static bool match_by_bdaddr(const void *data, const void *match_data)
 
 static struct hf_device *find_device(const bdaddr_t *bdaddr)
 {
+	uint8_t zero_addr[6] = { 0 };
+
+	if (!memcmp(bdaddr, zero_addr, sizeof(zero_addr)))
+		return find_default_device();
+
 	return queue_find(devices, match_by_bdaddr, bdaddr);
 }
 
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-11-06 12:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-06  8:27 [PATCH] android/handsfree: Return default device for zero bdaddr Andrei Emeltchenko
2014-11-06 10:41 ` Szymon Janc
2014-11-06 12:45   ` [PATCHv2] " Andrei Emeltchenko
2014-11-06 12:57     ` Szymon Janc

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).