[PATCH v2 05/19] android/bluetooth: Add API to check if device is bonding

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Some modules like GATT might be interested in information about ongoing
bonding on device. It can be useful e.g. to take decision if GATT can do
service search or should wait until bonding is done.
---
 android/bluetooth.c | 11 +++++++++++
 android/bluetooth.h |  1 +
 2 files changed, 12 insertions(+)

diff --git a/android/bluetooth.c b/android/bluetooth.c
index 096085d..910397f 100644
--- a/android/bluetooth.c
+++ b/android/bluetooth.c
@@ -1778,6 +1778,17 @@ void bt_paired_unregister(bt_paired_device_cb cb)
 	queue_remove(paired_cb_list, cb);
 }
 
+bool bt_is_pairing(const bdaddr_t *addr)
+{
+	struct device *dev;
+
+	dev = find_device(addr);
+	if (!dev)
+		return false;
+
+	return dev->pairing;
+}
+
 static bool rssi_above_threshold(int old, int new)
 {
 	/* only 8 dBm or more */
diff --git a/android/bluetooth.h b/android/bluetooth.h
index 8e0e6e2..884aed3 100644
--- a/android/bluetooth.h
+++ b/android/bluetooth.h
@@ -94,3 +94,4 @@ void bt_unpaired_unregister(bt_unpaired_device_cb cb);
 typedef void (*bt_paired_device_cb)(const bdaddr_t *addr, uint8_t type);
 bool bt_paired_register(bt_paired_device_cb cb);
 void bt_paired_unregister(bt_paired_device_cb cb);
+bool bt_is_pairing(const bdaddr_t *addr);
-- 
1.8.4

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux