Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH BlueZ 1/8] obexd/client: Add support for reading version
@ 2014-12-01  8:47 Luiz Augusto von Dentz
  2014-12-01  8:47 ` [PATCH BlueZ 2/8] obexd/client: Parse PBAP record Luiz Augusto von Dentz
                   ` (7 more replies)
  0 siblings, 8 replies; 17+ messages in thread
From: Luiz Augusto von Dentz @ 2014-12-01  8:47 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

This adds support for reading profile version via
SDP_ATTR_PFILE_DESC_LIST
---
 obexd/client/bluetooth.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/obexd/client/bluetooth.c b/obexd/client/bluetooth.c
index e89a92b..589d7a5 100644
--- a/obexd/client/bluetooth.c
+++ b/obexd/client/bluetooth.c
@@ -25,6 +25,7 @@
 #include <config.h>
 #endif
 
+#include <stdlib.h>
 #include <errno.h>
 #include <inttypes.h>
 
@@ -482,6 +483,26 @@ static const void *bluetooth_getattribute(guint id, int attribute_id)
 		if (session->sdp_record == NULL)
 			break;
 
+		/* Read version since UUID is already known */
+		if (attribute_id == SDP_ATTR_PFILE_DESC_LIST) {
+			sdp_list_t *descs;
+
+			if (sdp_get_profile_descs(session->sdp_record,
+								&descs) < 0)
+				return NULL;
+
+			if (descs && descs->data) {
+				sdp_profile_desc_t *desc = descs->data;
+				uint16_t version = desc->version;
+
+				sdp_list_free(descs, free);
+
+				return GINT_TO_POINTER(version);
+			}
+
+			return NULL;
+		}
+
 		data = sdp_data_get(session->sdp_record, attribute_id);
 		if (!data)
 			break;
-- 
1.9.3


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

end of thread, other threads:[~2014-12-02  9:39 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-01  8:47 [PATCH BlueZ 1/8] obexd/client: Add support for reading version Luiz Augusto von Dentz
2014-12-01  8:47 ` [PATCH BlueZ 2/8] obexd/client: Parse PBAP record Luiz Augusto von Dentz
2014-12-01  8:47 ` [PATCH BlueZ 3/8] obexd/client: Add Folder property Luiz Augusto von Dentz
2014-12-01  8:47 ` [PATCH BlueZ 4/8] obexd/client: Add DatabaseIdentifier property Luiz Augusto von Dentz
2014-12-01  8:47 ` [PATCH BlueZ 5/8] obexd/client: Add folder counters properties Luiz Augusto von Dentz
2014-12-01  8:47 ` [PATCH BlueZ 6/8] obexd/client: Add FixedImageSize property Luiz Augusto von Dentz
2014-12-01  8:47 ` [PATCH BlueZ 7/8] obexd/client: Add UpdateVersion to PhonebookAccess Luiz Augusto von Dentz
2014-12-01  8:47 ` [PATCH BlueZ 8/8] obexd/client: Add supported_features support Luiz Augusto von Dentz
2014-12-01 12:17   ` Gowtham Anandha Babu
2014-12-01 12:51     ` Luiz Augusto von Dentz
2014-12-01 13:31       ` Gowtham Anandha Babu
2014-12-01 13:34         ` Luiz Augusto von Dentz
2014-12-01 14:00           ` Luiz Augusto von Dentz
     [not found]             ` <003c01d00d71$f818ba20$e84a2e60$@samsung.com>
2014-12-01 14:41               ` Luiz Augusto von Dentz
2014-12-02  6:37                 ` Gowtham Anandha Babu
2014-12-02  9:32                   ` Luiz Augusto von Dentz
2014-12-02  9:39 ` [PATCH BlueZ 1/8] obexd/client: Add support for reading version Luiz Augusto von Dentz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox