[PATCH v16 13/14] adapter: Add API to get fast connectable mode

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

---
 src/adapter.c |   15 ++++++++++++++-
 src/adapter.h |    1 +
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/src/adapter.c b/src/adapter.c
index b7691d0..24fa704 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -151,6 +151,8 @@ struct btd_adapter {
 	GSList *pin_callbacks;
 
 	GSList *loaded_drivers;
+
+	gboolean fast_connectable;
 };
 
 static void dev_info_free(void *data)
@@ -3391,10 +3393,21 @@ void btd_adapter_unregister_powered_callback(struct btd_adapter *adapter,
 int btd_adapter_set_fast_connectable(struct btd_adapter *adapter,
 							gboolean enable)
 {
+	int ret;
+
 	if (!adapter->up)
 		return -EINVAL;
 
-	return mgmt_set_fast_connectable(adapter->dev_id, enable);
+	ret = mgmt_set_fast_connectable(adapter->dev_id, enable);
+	if (ret == 0)
+		adapter->fast_connectable = enable;
+
+	return ret;
+}
+
+gboolean btd_adapter_get_fast_connectable(struct btd_adapter *adapter)
+{
+	return adapter->fast_connectable;
 }
 
 int btd_adapter_read_clock(struct btd_adapter *adapter, bdaddr_t *bdaddr,
diff --git a/src/adapter.h b/src/adapter.h
index d8a1bb1..6e22dbc 100644
--- a/src/adapter.h
+++ b/src/adapter.h
@@ -185,6 +185,7 @@ void btd_adapter_unregister_powered_callback(struct btd_adapter *adapter,
  * type to default values. Valid for both connectable and discoverable modes. */
 int btd_adapter_set_fast_connectable(struct btd_adapter *adapter,
 							gboolean enable);
+gboolean btd_adapter_get_fast_connectable(struct btd_adapter *adapter);
 
 int btd_adapter_read_clock(struct btd_adapter *adapter, bdaddr_t *bdaddr,
 				int which, int timeout, uint32_t *clock,
-- 
1.7.9.5

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


[Bluez Devel]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Yosemite News]    [Yosemite Photos]    [Free Online Dating]     [Bluez Devel]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Big List of Linux Books]

Add to Google Powered by Linux