summaryrefslogtreecommitdiff
path: root/obexd/client
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2014-11-18 17:28:24 +0200
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2014-12-02 11:35:59 +0200
commit51763c0e50cd31da40e47f2c375aac04bf822e4d (patch)
tree2b37418c56586b9b904cfd1234e0c1d657d35d1c /obexd/client
parent332ad05a96c588e06223bcc7a99c8df348106c18 (diff)
downloadbluez-51763c0e50cd31da40e47f2c375aac04bf822e4d.tar.gz
obexd/client: Add support for reading version
This adds support for reading profile version via SDP_ATTR_PFILE_DESC_LIST
Diffstat (limited to 'obexd/client')
-rw-r--r--obexd/client/bluetooth.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/obexd/client/bluetooth.c b/obexd/client/bluetooth.c
index e89a92b71..589d7a51d 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;