From: Szymon Janc <szymon.janc@tieto.com>
To: linux-bluetooth@vger.kernel.org
Cc: Szymon Janc <szymon.janc@tieto.com>
Subject: [PATCH v2 2/5] android/bluetooth: Add function for checking last seen bearer
Date: Thu, 10 Jul 2014 16:30:33 +0200 [thread overview]
Message-ID: <1405002636-10737-2-git-send-email-szymon.janc@tieto.com> (raw)
In-Reply-To: <1405002636-10737-1-git-send-email-szymon.janc@tieto.com>
---
android/bluetooth.c | 11 +++++++++++
android/bluetooth.h | 1 +
2 files changed, 12 insertions(+)
diff --git a/android/bluetooth.c b/android/bluetooth.c
index 54c69b8..a2ab445 100644
--- a/android/bluetooth.c
+++ b/android/bluetooth.c
@@ -3985,6 +3985,17 @@ static uint8_t select_device_bearer(struct device *dev)
return dev->bredr ? BDADDR_BREDR : dev->bdaddr_type;
}
+uint8_t bt_device_last_seen_bearer(const bdaddr_t *bdaddr)
+{
+ struct device *dev;
+
+ dev = find_device(bdaddr);
+ if (!dev)
+ return BDADDR_BREDR;
+
+ return select_device_bearer(dev);
+}
+
static bool device_is_paired(struct device *dev, uint8_t addr_type)
{
if (addr_type == BDADDR_BREDR)
diff --git a/android/bluetooth.h b/android/bluetooth.h
index dde477d..e00634c 100644
--- a/android/bluetooth.h
+++ b/android/bluetooth.h
@@ -58,6 +58,7 @@ bool bt_le_set_advertising(bool advertising, bt_le_set_advertising_done cb,
uint8_t bt_get_device_android_type(const bdaddr_t *addr);
bool bt_is_device_le(const bdaddr_t *addr);
+uint8_t bt_device_last_seen_bearer(const bdaddr_t *bdaddr);
const char *bt_get_adapter_name(void);
bool bt_device_is_bonded(const bdaddr_t *bdaddr);
--
1.9.1
next prev parent reply other threads:[~2014-07-10 14:30 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-10 14:30 [PATCH v2 1/5] android/gatt: Add support for GATT over BR/EDR Szymon Janc
2014-07-10 14:30 ` Szymon Janc [this message]
2014-07-10 14:30 ` [PATCH v2 3/5] android/gatt: Choose LE or BR/EDR based on last seen bearer Szymon Janc
2014-07-10 14:30 ` [PATCH v2 4/5] shared/gatt: Add function for getting service UUID Szymon Janc
2014-07-10 14:30 ` [PATCH v2 5/5] android/gatt: Register SDP records for services Szymon Janc
2014-07-11 20:10 ` [PATCH v2 1/5] android/gatt: Add support for GATT over BR/EDR Szymon Janc
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=1405002636-10737-2-git-send-email-szymon.janc@tieto.com \
--to=szymon.janc@tieto.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