All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arman Uguray <armansito@chromium.org>
To: linux-bluetooth@vger.kernel.org
Cc: luiz.dentz@gmail.com, Arman Uguray <armansito@chromium.org>
Subject: [PATCH BlueZ v1 01/14] shared/att: Add bt_att_get_fd
Date: Wed, 11 Feb 2015 19:17:31 -0800	[thread overview]
Message-ID: <1423711064-7390-2-git-send-email-armansito@chromium.org> (raw)
In-Reply-To: <1423711064-7390-1-git-send-email-armansito@chromium.org>

Added the bt_att_get_fd function which returns the underlying file
descriptor of a bt_att.
---
 src/shared/att.c          | 8 ++++++++
 src/shared/att.h          | 2 ++
 src/shared/gatt-client.c  | 3 ++-
 src/shared/gatt-helpers.c | 3 ++-
 4 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/src/shared/att.c b/src/shared/att.c
index a98909e..8bf1bab 100644
--- a/src/shared/att.c
+++ b/src/shared/att.c
@@ -889,6 +889,14 @@ bool bt_att_set_close_on_unref(struct bt_att *att, bool do_close)
 	return io_set_close_on_destroy(att->io, do_close);
 }
 
+int bt_att_get_fd(struct bt_att *att)
+{
+	if (!att)
+		return -1;
+
+	return att->fd;
+}
+
 bool bt_att_set_debug(struct bt_att *att, bt_att_debug_func_t callback,
 				void *user_data, bt_att_destroy_func_t destroy)
 {
diff --git a/src/shared/att.h b/src/shared/att.h
index cd00a1e..db423fe 100644
--- a/src/shared/att.h
+++ b/src/shared/att.h
@@ -35,6 +35,8 @@ void bt_att_unref(struct bt_att *att);
 
 bool bt_att_set_close_on_unref(struct bt_att *att, bool do_close);
 
+int bt_att_get_fd(struct bt_att *att);
+
 typedef void (*bt_att_response_func_t)(uint8_t opcode, const void *pdu,
 					uint16_t length, void *user_data);
 typedef void (*bt_att_notify_func_t)(uint8_t opcode, const void *pdu,
diff --git a/src/shared/gatt-client.c b/src/shared/gatt-client.c
index bfb9427..d5a277b 100644
--- a/src/shared/gatt-client.c
+++ b/src/shared/gatt-client.c
@@ -21,8 +21,9 @@
  *
  */
 
-#include "src/shared/att.h"
 #include "lib/uuid.h"
+#include "lib/bluetooth.h"
+#include "src/shared/att.h"
 #include "src/shared/gatt-helpers.h"
 #include "src/shared/util.h"
 #include "src/shared/queue.h"
diff --git a/src/shared/gatt-helpers.c b/src/shared/gatt-helpers.c
index a33f960..b469116 100644
--- a/src/shared/gatt-helpers.c
+++ b/src/shared/gatt-helpers.c
@@ -26,9 +26,10 @@
 #include <config.h>
 #endif
 
+#include "lib/uuid.h"
+#include "lib/bluetooth.h"
 #include "src/shared/queue.h"
 #include "src/shared/att.h"
-#include "lib/uuid.h"
 #include "src/shared/gatt-helpers.h"
 #include "src/shared/util.h"
 
-- 
2.2.0.rc0.207.ga3a616c


  reply	other threads:[~2015-02-12  3:17 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-12  3:17 [PATCH BlueZ v1 00/14] Rewrite local GATT server using shared/gatt Arman Uguray
2015-02-12  3:17 ` Arman Uguray [this message]
2015-02-12 13:40   ` [PATCH BlueZ v1 01/14] shared/att: Add bt_att_get_fd Luiz Augusto von Dentz
2015-02-12 18:21     ` Arman Uguray
2015-02-12  3:17 ` [PATCH BlueZ v1 02/14] shared/gatt: Pass bt_att instead of bdaddr_t Arman Uguray
2015-02-12  3:17 ` [PATCH BlueZ v1 03/14] core: Introduce btd_gatt_database Arman Uguray
2015-02-13 16:06   ` Luiz Augusto von Dentz
2015-02-13 16:21     ` Arman Uguray
2015-02-17 12:03       ` Luiz Augusto von Dentz
2015-02-18  0:43         ` Arman Uguray
2015-02-12  3:17 ` [PATCH BlueZ v1 04/14] core: Attach gatt-server to bt_att Arman Uguray
2015-02-12  3:17 ` [PATCH BlueZ v1 05/14] core: gatt: Add GATT/GAP services to local db Arman Uguray
2015-02-12  3:17 ` [PATCH BlueZ v1 06/14] core: Add GATT UUIDs to Adapter1.UUIDs Arman Uguray
2015-02-12  3:17 ` [PATCH BlueZ v1 07/14] core: Support per-client CCC state Arman Uguray
2015-02-12  3:17 ` [PATCH BlueZ v1 08/14] core: Setup added/removed handlers in GATT database Arman Uguray
2015-02-12  3:17 ` [PATCH BlueZ v1 09/14] core: Add Service Changed characteristic Arman Uguray
2015-02-12  3:17 ` [PATCH BlueZ v1 10/14] core: device: Add getter for GATT server Arman Uguray
2015-02-12  3:17 ` [PATCH BlueZ v1 11/14] core: gatt-server: Send "Service Changed" Arman Uguray
2015-02-12  3:17 ` [PATCH BlueZ v1 12/14] core: adapter: Send UUIDs changed for GATT services Arman Uguray
2015-02-12  3:17 ` [PATCH BlueZ v1 13/14] shared/gatt: Don't incorrectly terminate discovery Arman Uguray
2015-02-12  3:17 ` [PATCH BlueZ v1 14/14] TODO: Update GATT items Arman Uguray
2015-02-16  9:13 ` [PATCH BlueZ v1 00/14] Rewrite local GATT server using shared/gatt Luiz Augusto von Dentz

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=1423711064-7390-2-git-send-email-armansito@chromium.org \
    --to=armansito@chromium.org \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=luiz.dentz@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.