All of lore.kernel.org
 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

* [PATCH BlueZ 2/8] obexd/client: Parse PBAP record
  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 ` Luiz Augusto von Dentz
  2014-12-01  8:47 ` [PATCH BlueZ 3/8] obexd/client: Add Folder property Luiz Augusto von Dentz
                   ` (6 subsequent siblings)
  7 siblings, 0 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 add parsing to PBAP record to extract version and supported
features.
---
 obexd/client/pbap.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)

diff --git a/obexd/client/pbap.c b/obexd/client/pbap.c
index 11574e7..c33de3f 100644
--- a/obexd/client/pbap.c
+++ b/obexd/client/pbap.c
@@ -33,6 +33,7 @@
 #include <gdbus/gdbus.h>
 
 #include <bluetooth/bluetooth.h>
+#include <bluetooth/sdp.h>
 #include <gobex/gobex-apparam.h>
 
 #include "log.h"
@@ -73,6 +74,17 @@
 #define PHONEBOOKSIZE_TAG	0X08
 #define NEWMISSEDCALLS_TAG	0X09
 
+#define DOWNLOAD_FEATURE	0x00000001
+#define BROWSE_FEATURE		0x00000002
+#define DATABASEID_FEATURE	0x00000004
+#define FOLDER_VERSION_FEATURE	0x00000008
+#define VCARD_SELECTING_FEATURE	0x00000010
+#define ENHANCED_CALLS_FEATURE	0x00000020
+#define UCI_FEATURE		0x00000040
+#define UID_FEATURE		0x00000080
+#define REFERENCING_FEATURE	0x00000100
+#define DEFAULT_IMAGE_FEATURE	0x00000200
+
 static const char *filter_list[] = {
 	"VERSION",
 	"FN",
@@ -119,6 +131,8 @@ static const char *filter_list[] = {
 struct pbap_data {
 	struct obc_session *session;
 	char *path;
+	uint16_t version;
+	uint32_t supported_features;
 };
 
 struct pending_request {
@@ -966,6 +980,35 @@ static void pbap_free(void *data)
 	g_free(pbap);
 }
 
+static void parse_service_record(struct pbap_data *pbap)
+{
+	const void *data;
+
+	/* Version */
+	data = obc_session_get_attribute(pbap->session,
+						SDP_ATTR_PFILE_DESC_LIST);
+	if (!data)
+		return;
+
+	pbap->version = GPOINTER_TO_UINT(data);
+
+	/*
+	 * If the PbapSupportedFeatures attribute is not present
+	 * 0x00000003 shall be assumed for a remote PSE.
+	 */
+	pbap->supported_features = 0x00000003;
+
+	if (pbap->version < 0x0102)
+		return;
+
+	/* Supported Feature Bits */
+	data = obc_session_get_attribute(pbap->session,
+					SDP_ATTR_PBAP_SUPPORTED_FEATURES);
+	if (data)
+		pbap->supported_features = *(uint32_t *) data;
+
+}
+
 static int pbap_probe(struct obc_session *session)
 {
 	struct pbap_data *pbap;
@@ -981,6 +1024,11 @@ static int pbap_probe(struct obc_session *session)
 
 	pbap->session = obc_session_ref(session);
 
+	parse_service_record(pbap);
+
+	DBG("%s, version 0x%04x supported features 0x%08x", path, pbap->version,
+						pbap->supported_features);
+
 	if (!g_dbus_register_interface(conn, path, PBAP_INTERFACE, pbap_methods,
 						NULL, NULL, pbap, pbap_free)) {
 		pbap_free(pbap);
-- 
1.9.3


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

* [PATCH BlueZ 3/8] obexd/client: Add Folder property
  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 ` Luiz Augusto von Dentz
  2014-12-01  8:47 ` [PATCH BlueZ 4/8] obexd/client: Add DatabaseIdentifier property Luiz Augusto von Dentz
                   ` (5 subsequent siblings)
  7 siblings, 0 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 Folder property to PhonebookAccess interface.
---
 obexd/client/pbap.c | 32 +++++++++++++++++++++++++++++++-
 1 file changed, 31 insertions(+), 1 deletion(-)

diff --git a/obexd/client/pbap.c b/obexd/client/pbap.c
index c33de3f..57f58ee 100644
--- a/obexd/client/pbap.c
+++ b/obexd/client/pbap.c
@@ -256,6 +256,10 @@ static void pbap_setpath_cb(struct obc_session *session,
 
 	if (err != NULL)
 		pbap_reset_path(pbap);
+	else
+		g_dbus_emit_property_changed(conn,
+					obc_session_get_path(pbap->session),
+					PBAP_INTERFACE, "Folder");
 
 	if (err) {
 		DBusMessage *reply = g_dbus_create_error(request->msg,
@@ -971,6 +975,31 @@ static const GDBusMethodTable pbap_methods[] = {
 	{ }
 };
 
+static gboolean folder_exists(const GDBusPropertyTable *property, void *data)
+{
+	struct pbap_data *pbap = data;
+
+	return pbap->path != NULL;
+}
+
+static gboolean get_folder(const GDBusPropertyTable *property,
+					DBusMessageIter *iter, void *data)
+{
+	struct pbap_data *pbap = data;
+
+	if (!pbap->path)
+		return FALSE;
+
+	dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING, &pbap->path);
+
+	return TRUE;
+}
+
+static const GDBusPropertyTable pbap_properties[] = {
+	{ "Folder", "s", get_folder, NULL, folder_exists },
+	{ }
+};
+
 static void pbap_free(void *data)
 {
 	struct pbap_data *pbap = data;
@@ -1030,7 +1059,8 @@ static int pbap_probe(struct obc_session *session)
 						pbap->supported_features);
 
 	if (!g_dbus_register_interface(conn, path, PBAP_INTERFACE, pbap_methods,
-						NULL, NULL, pbap, pbap_free)) {
+						NULL, pbap_properties, pbap,
+						pbap_free)) {
 		pbap_free(pbap);
 		return -ENOMEM;
 	}
-- 
1.9.3


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

* [PATCH BlueZ 4/8] obexd/client: Add DatabaseIdentifier property
  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 ` Luiz Augusto von Dentz
  2014-12-01  8:47 ` [PATCH BlueZ 5/8] obexd/client: Add folder counters properties Luiz Augusto von Dentz
                   ` (4 subsequent siblings)
  7 siblings, 0 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 DatabaseIdentifier property to PhonebookAccess interface.
---
 doc/obex-api.txt    |  4 ++-
 obexd/client/pbap.c | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++--
 2 files changed, 72 insertions(+), 3 deletions(-)

diff --git a/doc/obex-api.txt b/doc/obex-api.txt
index 349fe4c..ea82e39 100644
--- a/doc/obex-api.txt
+++ b/doc/obex-api.txt
@@ -500,8 +500,10 @@ Properties	string Folder [readonly]
 
 		string DatabaseIdentifier [readonly, optional]
 
-			128 bits persistent identifier.
+			128 bits persistent database identifier.
 
+			Possible values: 32-character hexadecimal such
+			as A1A2A3A4B1B2C1C2D1D2E1E2E3E4E5E6
 
 Synchronization hierarchy
 =========================
diff --git a/obexd/client/pbap.c b/obexd/client/pbap.c
index 57f58ee..97c7cb9 100644
--- a/obexd/client/pbap.c
+++ b/obexd/client/pbap.c
@@ -73,6 +73,7 @@
 #define FORMAT_TAG		0X07
 #define PHONEBOOKSIZE_TAG	0X08
 #define NEWMISSEDCALLS_TAG	0X09
+#define DATABASEID_TAG		0X0D
 
 #define DOWNLOAD_FEATURE	0x00000001
 #define BROWSE_FEATURE		0x00000002
@@ -133,6 +134,7 @@ struct pbap_data {
 	char *path;
 	uint16_t version;
 	uint32_t supported_features;
+	uint8_t databaseid[16];
 };
 
 struct pending_request {
@@ -272,8 +274,33 @@ static void pbap_setpath_cb(struct obc_session *session,
 	pending_request_free(request);
 }
 
+static void read_databaseid(struct pbap_data *pbap, GObexApparam *apparam)
+{
+	const guint8 *data;
+	guint8 value[16];
+	gsize len;
+
+	if (!(pbap->supported_features & DATABASEID_FEATURE))
+		return;
+
+	if (!g_obex_apparam_get_bytes(apparam, DATABASEID_TAG, &data, &len)) {
+		len = sizeof(value);
+		memset(value, 0, len);
+		data = value;
+	}
+
+	if (memcmp(data, pbap->databaseid, len)) {
+		memcpy(pbap->databaseid, data, len);
+		g_dbus_emit_property_changed(conn,
+					obc_session_get_path(pbap->session),
+					PBAP_INTERFACE, "DatabaseIdentifier");
+	}
+}
+
 static void read_return_apparam(struct obc_transfer *transfer,
-				guint16 *phone_book_size, guint8 *new_missed_calls)
+					struct pbap_data *pbap,
+					guint16 *phone_book_size,
+					guint8 *new_missed_calls)
 {
 	GObexApparam *apparam;
 
@@ -288,6 +315,8 @@ static void read_return_apparam(struct obc_transfer *transfer,
 							phone_book_size);
 	g_obex_apparam_get_uint8(apparam, NEWMISSEDCALLS_TAG,
 							new_missed_calls);
+
+	read_databaseid(pbap, apparam);
 }
 
 static void phonebook_size_callback(struct obc_session *session,
@@ -308,7 +337,8 @@ static void phonebook_size_callback(struct obc_session *session,
 
 	reply = dbus_message_new_method_return(request->msg);
 
-	read_return_apparam(transfer, &phone_book_size, &new_missed_calls);
+	read_return_apparam(transfer, request->pbap, &phone_book_size,
+							&new_missed_calls);
 
 	dbus_message_append_args(reply,
 			DBUS_TYPE_UINT16, &phone_book_size,
@@ -995,8 +1025,45 @@ static gboolean get_folder(const GDBusPropertyTable *property,
 	return TRUE;
 }
 
+static gboolean databaseid_exists(const GDBusPropertyTable *property,
+								void *data)
+{
+	struct pbap_data *pbap = data;
+
+	return pbap->supported_features & DATABASEID_FEATURE;
+}
+
+static int u128_to_string(uint8_t *data, char *str, size_t len)
+{
+	return snprintf(str, len, "%02X%02X%02X%02X%02X%02X%02X%02X"
+					"%02X%02X%02X%02X%02X%02X%02X%02X",
+					data[0], data[1], data[2], data[3],
+					data[3], data[5], data[6], data[7],
+					data[8], data[9], data[10], data[11],
+					data[12], data[13], data[14], data[15]);
+}
+
+static gboolean get_databaseid(const GDBusPropertyTable *property,
+					DBusMessageIter *iter, void *data)
+{
+	struct pbap_data *pbap = data;
+	char value[33];
+	const char *pvalue = value;
+
+	if (!pbap->databaseid)
+		return FALSE;
+
+	if (u128_to_string(pbap->databaseid, value, sizeof(value)) < 0)
+		return FALSE;
+
+	dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING, &pvalue);
+
+	return TRUE;
+}
+
 static const GDBusPropertyTable pbap_properties[] = {
 	{ "Folder", "s", get_folder, NULL, folder_exists },
+	{ "DatabaseIdentifier", "s", get_databaseid, NULL, databaseid_exists },
 	{ }
 };
 
-- 
1.9.3


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

* [PATCH BlueZ 5/8] obexd/client: Add folder counters properties
  2014-12-01  8:47 [PATCH BlueZ 1/8] obexd/client: Add support for reading version Luiz Augusto von Dentz
                   ` (2 preceding siblings ...)
  2014-12-01  8:47 ` [PATCH BlueZ 4/8] obexd/client: Add DatabaseIdentifier property Luiz Augusto von Dentz
@ 2014-12-01  8:47 ` Luiz Augusto von Dentz
  2014-12-01  8:47 ` [PATCH BlueZ 6/8] obexd/client: Add FixedImageSize property Luiz Augusto von Dentz
                   ` (3 subsequent siblings)
  7 siblings, 0 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 PrimaryCounter and SecondaryCounter properties to
PhonebookAccess interface.
---
 doc/obex-api.txt    | 14 +++++++++
 obexd/client/pbap.c | 89 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 103 insertions(+)

diff --git a/doc/obex-api.txt b/doc/obex-api.txt
index ea82e39..44af2fa 100644
--- a/doc/obex-api.txt
+++ b/doc/obex-api.txt
@@ -505,6 +505,20 @@ Properties	string Folder [readonly]
 			Possible values: 32-character hexadecimal such
 			as A1A2A3A4B1B2C1C2D1D2E1E2E3E4E5E6
 
+		string PrimaryCounter [readonly, optional]
+
+			128 bits primary version counter.
+
+			Possible values: 32-character hexadecimal such
+			as A1A2A3A4B1B2C1C2D1D2E1E2E3E4E5E6
+
+		string SecondaryCounter [readonly, optional]
+
+			128 bits primary version counter.
+
+			Possible values: 32-character hexadecimal such
+			as A1A2A3A4B1B2C1C2D1D2E1E2E3E4E5E6
+
 Synchronization hierarchy
 =========================
 
diff --git a/obexd/client/pbap.c b/obexd/client/pbap.c
index 97c7cb9..f048aaf 100644
--- a/obexd/client/pbap.c
+++ b/obexd/client/pbap.c
@@ -73,6 +73,8 @@
 #define FORMAT_TAG		0X07
 #define PHONEBOOKSIZE_TAG	0X08
 #define NEWMISSEDCALLS_TAG	0X09
+#define PRIMARY_COUNTER_TAG	0X0A
+#define SECONDARY_COUNTER_TAG	0X0B
 #define DATABASEID_TAG		0X0D
 
 #define DOWNLOAD_FEATURE	0x00000001
@@ -135,6 +137,8 @@ struct pbap_data {
 	uint16_t version;
 	uint32_t supported_features;
 	uint8_t databaseid[16];
+	uint8_t primary[16];
+	uint8_t secondary[16];
 };
 
 struct pending_request {
@@ -274,6 +278,44 @@ static void pbap_setpath_cb(struct obc_session *session,
 	pending_request_free(request);
 }
 
+static void read_version(struct pbap_data *pbap, GObexApparam *apparam)
+{
+	const guint8 *data;
+	uint8_t value[16];
+	gsize len;
+
+	if (!(pbap->supported_features & FOLDER_VERSION_FEATURE))
+		return;
+
+	if (!g_obex_apparam_get_bytes(apparam, PRIMARY_COUNTER_TAG, &data,
+								&len)) {
+		len = sizeof(value);
+		memset(value, 0, len);
+		data = value;
+	}
+
+	if (memcmp(pbap->primary, data, len)) {
+		memcpy(pbap->primary, data, len);
+		g_dbus_emit_property_changed(conn,
+					obc_session_get_path(pbap->session),
+					PBAP_INTERFACE, "PrimaryCounter");
+	}
+
+	if (!g_obex_apparam_get_bytes(apparam, SECONDARY_COUNTER_TAG, &data,
+								&len)) {
+		len = sizeof(value);
+		memset(value, 0, len);
+		data = value;
+	}
+
+	if (memcmp(pbap->secondary, data, len)) {
+		memcpy(pbap->secondary, data, len);
+		g_dbus_emit_property_changed(conn,
+					obc_session_get_path(pbap->session),
+					PBAP_INTERFACE, "SecondaryCounter");
+	}
+}
+
 static void read_databaseid(struct pbap_data *pbap, GObexApparam *apparam)
 {
 	const guint8 *data;
@@ -316,6 +358,7 @@ static void read_return_apparam(struct obc_transfer *transfer,
 	g_obex_apparam_get_uint8(apparam, NEWMISSEDCALLS_TAG,
 							new_missed_calls);
 
+	read_version(pbap, apparam);
 	read_databaseid(pbap, apparam);
 }
 
@@ -1061,9 +1104,55 @@ static gboolean get_databaseid(const GDBusPropertyTable *property,
 	return TRUE;
 }
 
+static gboolean version_exists(const GDBusPropertyTable *property,
+								void *data)
+{
+	struct pbap_data *pbap = data;
+
+	return pbap->supported_features & FOLDER_VERSION_FEATURE;
+}
+
+static gboolean get_primary(const GDBusPropertyTable *property,
+					DBusMessageIter *iter, void *data)
+{
+	struct pbap_data *pbap = data;
+	char value[33];
+	const char *pvalue = value;
+
+	if (!pbap->primary)
+		return FALSE;
+
+	if (u128_to_string(pbap->primary, value, sizeof(value)) < 0)
+		return FALSE;
+
+	dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING, &pvalue);
+
+	return TRUE;
+}
+
+static gboolean get_secondary(const GDBusPropertyTable *property,
+					DBusMessageIter *iter, void *data)
+{
+	struct pbap_data *pbap = data;
+	char value[33];
+	const char *pvalue = value;
+
+	if (!pbap->secondary)
+		return FALSE;
+
+	if (u128_to_string(pbap->secondary, value, sizeof(value)) < 0)
+		return FALSE;
+
+	dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING, &pvalue);
+
+	return TRUE;
+}
+
 static const GDBusPropertyTable pbap_properties[] = {
 	{ "Folder", "s", get_folder, NULL, folder_exists },
 	{ "DatabaseIdentifier", "s", get_databaseid, NULL, databaseid_exists },
+	{ "PrimaryCounter", "s", get_primary, NULL, version_exists },
+	{ "SecondaryCounter", "s", get_secondary, NULL, version_exists },
 	{ }
 };
 
-- 
1.9.3


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

* [PATCH BlueZ 6/8] obexd/client: Add FixedImageSize property
  2014-12-01  8:47 [PATCH BlueZ 1/8] obexd/client: Add support for reading version Luiz Augusto von Dentz
                   ` (3 preceding siblings ...)
  2014-12-01  8:47 ` [PATCH BlueZ 5/8] obexd/client: Add folder counters properties Luiz Augusto von Dentz
@ 2014-12-01  8:47 ` Luiz Augusto von Dentz
  2014-12-01  8:47 ` [PATCH BlueZ 7/8] obexd/client: Add UpdateVersion to PhonebookAccess Luiz Augusto von Dentz
                   ` (2 subsequent siblings)
  7 siblings, 0 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 FixedImageSize property to PhonebookAccess interface.
---
 doc/obex-api.txt    |  7 +++++++
 obexd/client/pbap.c | 19 +++++++++++++++++++
 2 files changed, 26 insertions(+)

diff --git a/doc/obex-api.txt b/doc/obex-api.txt
index 44af2fa..32f9a79 100644
--- a/doc/obex-api.txt
+++ b/doc/obex-api.txt
@@ -519,6 +519,13 @@ Properties	string Folder [readonly]
 			Possible values: 32-character hexadecimal such
 			as A1A2A3A4B1B2C1C2D1D2E1E2E3E4E5E6
 
+		bool FixedImageSize [readonly, optional]
+
+			Indicate support for fixed image size.
+
+			Possible values: True if image is JPEG 300x300 pixels
+			otherwise False.
+
 Synchronization hierarchy
 =========================
 
diff --git a/obexd/client/pbap.c b/obexd/client/pbap.c
index f048aaf..2398071 100644
--- a/obexd/client/pbap.c
+++ b/obexd/client/pbap.c
@@ -1148,11 +1148,30 @@ static gboolean get_secondary(const GDBusPropertyTable *property,
 	return TRUE;
 }
 
+static gboolean image_size_exists(const GDBusPropertyTable *property,
+								void *data)
+{
+	struct pbap_data *pbap = data;
+
+	return pbap->supported_features & DEFAULT_IMAGE_FEATURE;
+}
+
+static gboolean get_image_size(const GDBusPropertyTable *property,
+					DBusMessageIter *iter, void *data)
+{
+	dbus_bool_t value = TRUE;
+
+	dbus_message_iter_append_basic(iter, DBUS_TYPE_BOOLEAN, &value);
+
+	return TRUE;
+}
+
 static const GDBusPropertyTable pbap_properties[] = {
 	{ "Folder", "s", get_folder, NULL, folder_exists },
 	{ "DatabaseIdentifier", "s", get_databaseid, NULL, databaseid_exists },
 	{ "PrimaryCounter", "s", get_primary, NULL, version_exists },
 	{ "SecondaryCounter", "s", get_secondary, NULL, version_exists },
+	{ "FixedImageSize", "b", get_image_size, NULL, image_size_exists },
 	{ }
 };
 
-- 
1.9.3


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

* [PATCH BlueZ 7/8] obexd/client: Add UpdateVersion to PhonebookAccess
  2014-12-01  8:47 [PATCH BlueZ 1/8] obexd/client: Add support for reading version Luiz Augusto von Dentz
                   ` (4 preceding siblings ...)
  2014-12-01  8:47 ` [PATCH BlueZ 6/8] obexd/client: Add FixedImageSize property Luiz Augusto von Dentz
@ 2014-12-01  8:47 ` 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-02  9:39 ` [PATCH BlueZ 1/8] obexd/client: Add support for reading version Luiz Augusto von Dentz
  7 siblings, 0 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 UpdateVersion method to PhonebookAccess interface.
---
 doc/obex-api.txt    |  8 ++++----
 obexd/client/pbap.c | 23 ++++++++++++++++++++---
 2 files changed, 24 insertions(+), 7 deletions(-)

diff --git a/doc/obex-api.txt b/doc/obex-api.txt
index 32f9a79..0cd359b 100644
--- a/doc/obex-api.txt
+++ b/doc/obex-api.txt
@@ -433,12 +433,12 @@ Methods		void Select(string location, string phonebook)
 			Possible errors: org.bluez.obex.Error.Forbidden
 					 org.bluez.obex.Error.Failed
 
-		uint16, uint16 GetVersion()
+		void UpdateVersion()
 
-			Return the primary and secondary folder version counters
-			for the selected phonebook.
+			Attempt to update PrimaryCounter and SecondaryCounter.
 
-			Possible errors: org.bluez.obex.Error.Forbidden
+			Possible errors: org.bluez.obex.Error.NotSupported
+					 org.bluez.obex.Error.Forbidden
 					 org.bluez.obex.Error.Failed
 
 		array{string} ListFilterFields()
diff --git a/obexd/client/pbap.c b/obexd/client/pbap.c
index 2398071..812a7fb 100644
--- a/obexd/client/pbap.c
+++ b/obexd/client/pbap.c
@@ -383,9 +383,11 @@ static void phonebook_size_callback(struct obc_session *session,
 	read_return_apparam(transfer, request->pbap, &phone_book_size,
 							&new_missed_calls);
 
-	dbus_message_append_args(reply,
-			DBUS_TYPE_UINT16, &phone_book_size,
-			DBUS_TYPE_INVALID);
+	if (dbus_message_is_method_call(request->msg, PBAP_INTERFACE,
+								"GetSize"))
+		dbus_message_append_args(reply,
+					DBUS_TYPE_UINT16, &phone_book_size,
+					DBUS_TYPE_INVALID);
 
 send:
 	g_dbus_send_message(conn, reply);
@@ -1014,6 +1016,19 @@ static DBusMessage *pbap_list_filter_fields(DBusConnection *connection,
 	return reply;
 }
 
+static DBusMessage *pbap_update_version(DBusConnection *connection,
+					DBusMessage *message, void *user_data)
+{
+	struct pbap_data *pbap = user_data;
+
+	if (!(pbap->supported_features & FOLDER_VERSION_FEATURE))
+		return g_dbus_create_error(message,
+					ERROR_INTERFACE ".NotSupported",
+					"Operation is not supported");
+
+	return pbap_get_size(connection, message, user_data);
+}
+
 static const GDBusMethodTable pbap_methods[] = {
 	{ GDBUS_ASYNC_METHOD("Select",
 			GDBUS_ARGS({ "location", "s" }, { "phonebook", "s" }),
@@ -1045,6 +1060,8 @@ static const GDBusMethodTable pbap_methods[] = {
 	{ GDBUS_METHOD("ListFilterFields",
 				NULL, GDBUS_ARGS({ "fields", "as" }),
 				pbap_list_filter_fields) },
+	{ GDBUS_ASYNC_METHOD("UpdateVersion", NULL, NULL,
+				pbap_update_version) },
 	{ }
 };
 
-- 
1.9.3


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

* [PATCH BlueZ 8/8] obexd/client: Add supported_features support
  2014-12-01  8:47 [PATCH BlueZ 1/8] obexd/client: Add support for reading version Luiz Augusto von Dentz
                   ` (5 preceding siblings ...)
  2014-12-01  8:47 ` [PATCH BlueZ 7/8] obexd/client: Add UpdateVersion to PhonebookAccess Luiz Augusto von Dentz
@ 2014-12-01  8:47 ` Luiz Augusto von Dentz
  2014-12-01 12:17   ` Gowtham Anandha Babu
  2014-12-02  9:39 ` [PATCH BlueZ 1/8] obexd/client: Add support for reading version Luiz Augusto von Dentz
  7 siblings, 1 reply; 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 supported_features support to obc_driver so driver can
provide this information when connecting.

This is required by PBAP 1.2 (page 48):

  'Mandatory if the PSE advertises a PbapSupportedFeatures attribute in
   its SDP record, else excluded.'
---
 obexd/client/driver.h  |  1 +
 obexd/client/pbap.c    | 36 ++++++++++++++++++++++++++++++++++++
 obexd/client/session.c | 25 ++++++++++++++++++++++++-
 3 files changed, 61 insertions(+), 1 deletion(-)

diff --git a/obexd/client/driver.h b/obexd/client/driver.h
index f1c0646..0112219 100644
--- a/obexd/client/driver.h
+++ b/obexd/client/driver.h
@@ -26,6 +26,7 @@ struct obc_driver {
 	const char *uuid;
 	void *target;
 	gsize target_len;
+	void *(*supported_features) (struct obc_session *session);
 	int (*probe) (struct obc_session *session);
 	void (*remove) (struct obc_session *session);
 };
diff --git a/obexd/client/pbap.c b/obexd/client/pbap.c
index 812a7fb..57632b4 100644
--- a/obexd/client/pbap.c
+++ b/obexd/client/pbap.c
@@ -76,6 +76,7 @@
 #define PRIMARY_COUNTER_TAG	0X0A
 #define SECONDARY_COUNTER_TAG	0X0B
 #define DATABASEID_TAG		0X0D
+#define SUPPORTED_FEATURES_TAG  0x10
 
 #define DOWNLOAD_FEATURE	0x00000001
 #define BROWSE_FEATURE		0x00000002
@@ -1230,6 +1231,40 @@ static void parse_service_record(struct pbap_data *pbap)
 
 }
 
+static void *pbap_supported_features(struct obc_session *session)
+{
+	const void *data;
+	uint16_t version;
+
+	/* Version */
+	data = obc_session_get_attribute(session, SDP_ATTR_PFILE_DESC_LIST);
+	if (!data)
+		return NULL;
+
+	version = GPOINTER_TO_UINT(data);
+
+	if (version < 0x0102)
+		return NULL;
+
+	/* Supported Feature Bits */
+	data = obc_session_get_attribute(session,
+					SDP_ATTR_PBAP_SUPPORTED_FEATURES);
+	if (!data)
+		return NULL;
+
+	return g_obex_apparam_set_uint32(NULL, SUPPORTED_FEATURES_TAG,
+						DOWNLOAD_FEATURE |
+						BROWSE_FEATURE |
+						DATABASEID_FEATURE |
+						FOLDER_VERSION_FEATURE |
+						VCARD_SELECTING_FEATURE |
+						ENHANCED_CALLS_FEATURE |
+						UCI_FEATURE |
+						UID_FEATURE |
+						REFERENCING_FEATURE |
+						DEFAULT_IMAGE_FEATURE);
+}
+
 static int pbap_probe(struct obc_session *session)
 {
 	struct pbap_data *pbap;
@@ -1274,6 +1309,7 @@ static struct obc_driver pbap = {
 	.uuid = PBAP_UUID,
 	.target = OBEX_PBAP_UUID,
 	.target_len = OBEX_PBAP_UUID_LEN,
+	.supported_features = pbap_supported_features,
 	.probe = pbap_probe,
 	.remove = pbap_remove
 };
diff --git a/obexd/client/session.c b/obexd/client/session.c
index 9bba6c6..d2ae4fd 100644
--- a/obexd/client/session.c
+++ b/obexd/client/session.c
@@ -345,6 +345,7 @@ static void transport_func(GIOChannel *io, GError *err, gpointer user_data)
 	struct obc_driver *driver = session->driver;
 	struct obc_transport *transport = session->transport;
 	GObex *obex;
+	GObexApparam *apparam;
 	GObexTransportType type;
 	int tx_mtu = -1;
 	int rx_mtu = -1;
@@ -370,7 +371,29 @@ static void transport_func(GIOChannel *io, GError *err, gpointer user_data)
 
 	g_io_channel_set_close_on_unref(io, TRUE);
 
-	if (driver->target != NULL)
+	apparam = NULL;
+
+	if (driver->supported_features)
+		apparam = driver->supported_features(session);
+
+	if (apparam) {
+		uint8_t buf[1024];
+		ssize_t len;
+
+		len = g_obex_apparam_encode(apparam, buf, sizeof(buf));
+		if (driver->target)
+			g_obex_connect(obex, connect_cb, callback, &err,
+					G_OBEX_HDR_TARGET,
+					driver->target, driver->target_len,
+					G_OBEX_HDR_APPARAM,
+					buf, len,
+					G_OBEX_HDR_INVALID);
+		else
+			g_obex_connect(obex, connect_cb, callback, &err,
+					G_OBEX_HDR_APPARAM, buf, len,
+					G_OBEX_HDR_INVALID);
+		g_obex_apparam_free(apparam);
+	} else if (driver->target)
 		g_obex_connect(obex, connect_cb, callback, &err,
 			G_OBEX_HDR_TARGET, driver->target, driver->target_len,
 			G_OBEX_HDR_INVALID);
-- 
1.9.3


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

* RE: [PATCH BlueZ 8/8] obexd/client: Add supported_features support
  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
  0 siblings, 1 reply; 17+ messages in thread
From: Gowtham Anandha Babu @ 2014-12-01 12:17 UTC (permalink / raw)
  To: 'Luiz Augusto von Dentz'; +Cc: linux-bluetooth

Hi Luiz,

> -----Original Message-----
> From: linux-bluetooth-owner@vger.kernel.org [mailto:linux-bluetooth-
> owner@vger.kernel.org] On Behalf Of Luiz Augusto von Dentz
> Sent: Monday, December 01, 2014 2:17 PM
> To: linux-bluetooth@vger.kernel.org
> Subject: [PATCH BlueZ 8/8] obexd/client: Add supported_features support
> 
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> 
> This adds supported_features support to obc_driver so driver can provide
> this information when connecting.
> 
> This is required by PBAP 1.2 (page 48):
> 
>   'Mandatory if the PSE advertises a PbapSupportedFeatures attribute in
>    its SDP record, else excluded.'
> ---
>  obexd/client/driver.h  |  1 +
>  obexd/client/pbap.c    | 36 ++++++++++++++++++++++++++++++++++++
>  obexd/client/session.c | 25 ++++++++++++++++++++++++-
>  3 files changed, 61 insertions(+), 1 deletion(-)
> 
> diff --git a/obexd/client/driver.h b/obexd/client/driver.h index
> f1c0646..0112219 100644
> --- a/obexd/client/driver.h
> +++ b/obexd/client/driver.h
> @@ -26,6 +26,7 @@ struct obc_driver {
>  	const char *uuid;
>  	void *target;
>  	gsize target_len;
> +	void *(*supported_features) (struct obc_session *session);
>  	int (*probe) (struct obc_session *session);
>  	void (*remove) (struct obc_session *session);  }; diff --git
> a/obexd/client/pbap.c b/obexd/client/pbap.c index 812a7fb..57632b4
> 100644
> --- a/obexd/client/pbap.c
> +++ b/obexd/client/pbap.c
> @@ -76,6 +76,7 @@
>  #define PRIMARY_COUNTER_TAG	0X0A
>  #define SECONDARY_COUNTER_TAG	0X0B
>  #define DATABASEID_TAG		0X0D
> +#define SUPPORTED_FEATURES_TAG  0x10
> 
>  #define DOWNLOAD_FEATURE	0x00000001
>  #define BROWSE_FEATURE		0x00000002
> @@ -1230,6 +1231,40 @@ static void parse_service_record(struct pbap_data
> *pbap)
> 
>  }
> 
> +static void *pbap_supported_features(struct obc_session *session) {
> +	const void *data;
> +	uint16_t version;
> +
> +	/* Version */
> +	data = obc_session_get_attribute(session,
> SDP_ATTR_PFILE_DESC_LIST);
> +	if (!data)
> +		return NULL;
> +
> +	version = GPOINTER_TO_UINT(data);
> +
> +	if (version < 0x0102)
> +		return NULL;
> +
> +	/* Supported Feature Bits */
> +	data = obc_session_get_attribute(session,
> +
> 	SDP_ATTR_PBAP_SUPPORTED_FEATURES);
> +	if (!data)
> +		return NULL;
> +
> +	return g_obex_apparam_set_uint32(NULL,
> SUPPORTED_FEATURES_TAG,
> +						DOWNLOAD_FEATURE |
> +						BROWSE_FEATURE |
> +						DATABASEID_FEATURE |
> +						FOLDER_VERSION_FEATURE
> |
> +						VCARD_SELECTING_FEATURE
> |
> +						ENHANCED_CALLS_FEATURE
> |
> +						UCI_FEATURE |
> +						UID_FEATURE |
> +						REFERENCING_FEATURE |
> +						DEFAULT_IMAGE_FEATURE);
> +}
> +
>  static int pbap_probe(struct obc_session *session)  {
>  	struct pbap_data *pbap;
> @@ -1274,6 +1309,7 @@ static struct obc_driver pbap = {
>  	.uuid = PBAP_UUID,
>  	.target = OBEX_PBAP_UUID,
>  	.target_len = OBEX_PBAP_UUID_LEN,
> +	.supported_features = pbap_supported_features,
>  	.probe = pbap_probe,
>  	.remove = pbap_remove
>  };
> diff --git a/obexd/client/session.c b/obexd/client/session.c index
> 9bba6c6..d2ae4fd 100644
> --- a/obexd/client/session.c
> +++ b/obexd/client/session.c
> @@ -345,6 +345,7 @@ static void transport_func(GIOChannel *io, GError
> *err, gpointer user_data)
>  	struct obc_driver *driver = session->driver;
>  	struct obc_transport *transport = session->transport;
>  	GObex *obex;
> +	GObexApparam *apparam;
>  	GObexTransportType type;
>  	int tx_mtu = -1;
>  	int rx_mtu = -1;
> @@ -370,7 +371,29 @@ static void transport_func(GIOChannel *io, GError
> *err, gpointer user_data)
> 
>  	g_io_channel_set_close_on_unref(io, TRUE);
> 
> -	if (driver->target != NULL)
> +	apparam = NULL;
> +
> +	if (driver->supported_features)
> +		apparam = driver->supported_features(session);
> +
> +	if (apparam) {
> +		uint8_t buf[1024];
> +		ssize_t len;
> +
> +		len = g_obex_apparam_encode(apparam, buf, sizeof(buf));
> +		if (driver->target)
> +			g_obex_connect(obex, connect_cb, callback, &err,
> +					G_OBEX_HDR_TARGET,
> +					driver->target, driver->target_len,
> +					G_OBEX_HDR_APPARAM,
> +					buf, len,
> +					G_OBEX_HDR_INVALID);
> +		else
> +			g_obex_connect(obex, connect_cb, callback, &err,
> +					G_OBEX_HDR_APPARAM, buf, len,
> +					G_OBEX_HDR_INVALID);
> +		g_obex_apparam_free(apparam);
> +	} else if (driver->target)
>  		g_obex_connect(obex, connect_cb, callback, &err,
>  			G_OBEX_HDR_TARGET, driver->target, driver-
> >target_len,
>  			G_OBEX_HDR_INVALID);
> --
> 1.9.3
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth"
in
> the body of a message to majordomo@vger.kernel.org More majordomo
> info at  http://vger.kernel.org/majordomo-info.html



I applied this patch locally and tested with PTS. 
The PTS test case: TP/SSM/BV-09-C [PCE Shares PbapSupportedFeature bits] is
failing.
According to PBAP V1.2 Spec - Section 6.4 - OBEX Connect request format, the
PbapSupportedFeatures 
are shared during obex connect(after applying the this patch). 
Still the above test case is failing.
Am I mapping anything wrong?


Regards,
Gowtham Anandha Babu


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

* Re: [PATCH BlueZ 8/8] obexd/client: Add supported_features support
  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
  0 siblings, 1 reply; 17+ messages in thread
From: Luiz Augusto von Dentz @ 2014-12-01 12:51 UTC (permalink / raw)
  To: Gowtham Anandha Babu; +Cc: linux-bluetooth

Hi Gowtham,

On Mon, Dec 1, 2014 at 2:17 PM, Gowtham Anandha Babu
<gowtham.ab@samsung.com> wrote:
> Hi Luiz,
>
>> -----Original Message-----
>> From: linux-bluetooth-owner@vger.kernel.org [mailto:linux-bluetooth-
>> owner@vger.kernel.org] On Behalf Of Luiz Augusto von Dentz
>> Sent: Monday, December 01, 2014 2:17 PM
>> To: linux-bluetooth@vger.kernel.org
>> Subject: [PATCH BlueZ 8/8] obexd/client: Add supported_features support
>>
>> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
>>
>> This adds supported_features support to obc_driver so driver can provide
>> this information when connecting.
>>
>> This is required by PBAP 1.2 (page 48):
>>
>>   'Mandatory if the PSE advertises a PbapSupportedFeatures attribute in
>>    its SDP record, else excluded.'
>> ---
>>  obexd/client/driver.h  |  1 +
>>  obexd/client/pbap.c    | 36 ++++++++++++++++++++++++++++++++++++
>>  obexd/client/session.c | 25 ++++++++++++++++++++++++-
>>  3 files changed, 61 insertions(+), 1 deletion(-)
>>
>> diff --git a/obexd/client/driver.h b/obexd/client/driver.h index
>> f1c0646..0112219 100644
>> --- a/obexd/client/driver.h
>> +++ b/obexd/client/driver.h
>> @@ -26,6 +26,7 @@ struct obc_driver {
>>       const char *uuid;
>>       void *target;
>>       gsize target_len;
>> +     void *(*supported_features) (struct obc_session *session);
>>       int (*probe) (struct obc_session *session);
>>       void (*remove) (struct obc_session *session);  }; diff --git
>> a/obexd/client/pbap.c b/obexd/client/pbap.c index 812a7fb..57632b4
>> 100644
>> --- a/obexd/client/pbap.c
>> +++ b/obexd/client/pbap.c
>> @@ -76,6 +76,7 @@
>>  #define PRIMARY_COUNTER_TAG  0X0A
>>  #define SECONDARY_COUNTER_TAG        0X0B
>>  #define DATABASEID_TAG               0X0D
>> +#define SUPPORTED_FEATURES_TAG  0x10
>>
>>  #define DOWNLOAD_FEATURE     0x00000001
>>  #define BROWSE_FEATURE               0x00000002
>> @@ -1230,6 +1231,40 @@ static void parse_service_record(struct pbap_data
>> *pbap)
>>
>>  }
>>
>> +static void *pbap_supported_features(struct obc_session *session) {
>> +     const void *data;
>> +     uint16_t version;
>> +
>> +     /* Version */
>> +     data = obc_session_get_attribute(session,
>> SDP_ATTR_PFILE_DESC_LIST);
>> +     if (!data)
>> +             return NULL;
>> +
>> +     version = GPOINTER_TO_UINT(data);
>> +
>> +     if (version < 0x0102)
>> +             return NULL;
>> +
>> +     /* Supported Feature Bits */
>> +     data = obc_session_get_attribute(session,
>> +
>>       SDP_ATTR_PBAP_SUPPORTED_FEATURES);
>> +     if (!data)
>> +             return NULL;
>> +
>> +     return g_obex_apparam_set_uint32(NULL,
>> SUPPORTED_FEATURES_TAG,
>> +                                             DOWNLOAD_FEATURE |
>> +                                             BROWSE_FEATURE |
>> +                                             DATABASEID_FEATURE |
>> +                                             FOLDER_VERSION_FEATURE
>> |
>> +                                             VCARD_SELECTING_FEATURE
>> |
>> +                                             ENHANCED_CALLS_FEATURE
>> |
>> +                                             UCI_FEATURE |
>> +                                             UID_FEATURE |
>> +                                             REFERENCING_FEATURE |
>> +                                             DEFAULT_IMAGE_FEATURE);
>> +}
>> +
>>  static int pbap_probe(struct obc_session *session)  {
>>       struct pbap_data *pbap;
>> @@ -1274,6 +1309,7 @@ static struct obc_driver pbap = {
>>       .uuid = PBAP_UUID,
>>       .target = OBEX_PBAP_UUID,
>>       .target_len = OBEX_PBAP_UUID_LEN,
>> +     .supported_features = pbap_supported_features,
>>       .probe = pbap_probe,
>>       .remove = pbap_remove
>>  };
>> diff --git a/obexd/client/session.c b/obexd/client/session.c index
>> 9bba6c6..d2ae4fd 100644
>> --- a/obexd/client/session.c
>> +++ b/obexd/client/session.c
>> @@ -345,6 +345,7 @@ static void transport_func(GIOChannel *io, GError
>> *err, gpointer user_data)
>>       struct obc_driver *driver = session->driver;
>>       struct obc_transport *transport = session->transport;
>>       GObex *obex;
>> +     GObexApparam *apparam;
>>       GObexTransportType type;
>>       int tx_mtu = -1;
>>       int rx_mtu = -1;
>> @@ -370,7 +371,29 @@ static void transport_func(GIOChannel *io, GError
>> *err, gpointer user_data)
>>
>>       g_io_channel_set_close_on_unref(io, TRUE);
>>
>> -     if (driver->target != NULL)
>> +     apparam = NULL;
>> +
>> +     if (driver->supported_features)
>> +             apparam = driver->supported_features(session);
>> +
>> +     if (apparam) {
>> +             uint8_t buf[1024];
>> +             ssize_t len;
>> +
>> +             len = g_obex_apparam_encode(apparam, buf, sizeof(buf));
>> +             if (driver->target)
>> +                     g_obex_connect(obex, connect_cb, callback, &err,
>> +                                     G_OBEX_HDR_TARGET,
>> +                                     driver->target, driver->target_len,
>> +                                     G_OBEX_HDR_APPARAM,
>> +                                     buf, len,
>> +                                     G_OBEX_HDR_INVALID);
>> +             else
>> +                     g_obex_connect(obex, connect_cb, callback, &err,
>> +                                     G_OBEX_HDR_APPARAM, buf, len,
>> +                                     G_OBEX_HDR_INVALID);
>> +             g_obex_apparam_free(apparam);
>> +     } else if (driver->target)
>>               g_obex_connect(obex, connect_cb, callback, &err,
>>                       G_OBEX_HDR_TARGET, driver->target, driver-
>> >target_len,
>>                       G_OBEX_HDR_INVALID);
>> --
>> 1.9.3
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth"
> in
>> the body of a message to majordomo@vger.kernel.org More majordomo
>> info at  http://vger.kernel.org/majordomo-info.html
>
>
>
> I applied this patch locally and tested with PTS.
> The PTS test case: TP/SSM/BV-09-C [PCE Shares PbapSupportedFeature bits] is
> failing.
> According to PBAP V1.2 Spec - Section 6.4 - OBEX Connect request format, the
> PbapSupportedFeatures
> are shared during obex connect(after applying the this patch).
> Still the above test case is failing.
> Am I mapping anything wrong?

Have you applied the full set? Maybe the PCE record needs updating as
well, but normally it is not mandatory.


-- 
Luiz Augusto von Dentz

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

* RE: [PATCH BlueZ 8/8] obexd/client: Add supported_features support
  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
  0 siblings, 1 reply; 17+ messages in thread
From: Gowtham Anandha Babu @ 2014-12-01 13:31 UTC (permalink / raw)
  To: 'Luiz Augusto von Dentz'; +Cc: linux-bluetooth

Hi Luiz,

> -----Original Message-----
> From: linux-bluetooth-owner@vger.kernel.org [mailto:linux-bluetooth-
> owner@vger.kernel.org] On Behalf Of Luiz Augusto von Dentz
> Sent: Monday, December 01, 2014 6:22 PM
> To: Gowtham Anandha Babu
> Cc: linux-bluetooth@vger.kernel.org
> Subject: Re: [PATCH BlueZ 8/8] obexd/client: Add supported_features
> support
> 
> Hi Gowtham,
> 
> On Mon, Dec 1, 2014 at 2:17 PM, Gowtham Anandha Babu
> <gowtham.ab@samsung.com> wrote:
> > Hi Luiz,
> >
> >> -----Original Message-----
> >> From: linux-bluetooth-owner@vger.kernel.org [mailto:linux-bluetooth-
> >> owner@vger.kernel.org] On Behalf Of Luiz Augusto von Dentz
> >> Sent: Monday, December 01, 2014 2:17 PM
> >> To: linux-bluetooth@vger.kernel.org
> >> Subject: [PATCH BlueZ 8/8] obexd/client: Add supported_features
> >> support
> >>
> >> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> >>
> >> This adds supported_features support to obc_driver so driver can
> >> provide this information when connecting.
> >>
> >> This is required by PBAP 1.2 (page 48):
> >>
> >>   'Mandatory if the PSE advertises a PbapSupportedFeatures attribute in
> >>    its SDP record, else excluded.'
> >> ---
> >>  obexd/client/driver.h  |  1 +
> >>  obexd/client/pbap.c    | 36
> ++++++++++++++++++++++++++++++++++++
> >>  obexd/client/session.c | 25 ++++++++++++++++++++++++-
> >>  3 files changed, 61 insertions(+), 1 deletion(-)
> >>
> >> diff --git a/obexd/client/driver.h b/obexd/client/driver.h index
> >> f1c0646..0112219 100644
> >> --- a/obexd/client/driver.h
> >> +++ b/obexd/client/driver.h
> >> @@ -26,6 +26,7 @@ struct obc_driver {
> >>       const char *uuid;
> >>       void *target;
> >>       gsize target_len;
> >> +     void *(*supported_features) (struct obc_session *session);
> >>       int (*probe) (struct obc_session *session);
> >>       void (*remove) (struct obc_session *session);  }; diff --git
> >> a/obexd/client/pbap.c b/obexd/client/pbap.c index 812a7fb..57632b4
> >> 100644
> >> --- a/obexd/client/pbap.c
> >> +++ b/obexd/client/pbap.c
> >> @@ -76,6 +76,7 @@
> >>  #define PRIMARY_COUNTER_TAG  0X0A
> >>  #define SECONDARY_COUNTER_TAG        0X0B
> >>  #define DATABASEID_TAG               0X0D
> >> +#define SUPPORTED_FEATURES_TAG  0x10
> >>
> >>  #define DOWNLOAD_FEATURE     0x00000001
> >>  #define BROWSE_FEATURE               0x00000002
> >> @@ -1230,6 +1231,40 @@ static void parse_service_record(struct
> >> pbap_data
> >> *pbap)
> >>
> >>  }
> >>
> >> +static void *pbap_supported_features(struct obc_session *session) {
> >> +     const void *data;
> >> +     uint16_t version;
> >> +
> >> +     /* Version */
> >> +     data = obc_session_get_attribute(session,
> >> SDP_ATTR_PFILE_DESC_LIST);
> >> +     if (!data)
> >> +             return NULL;
> >> +
> >> +     version = GPOINTER_TO_UINT(data);
> >> +
> >> +     if (version < 0x0102)
> >> +             return NULL;
> >> +
> >> +     /* Supported Feature Bits */
> >> +     data = obc_session_get_attribute(session,
> >> +
> >>       SDP_ATTR_PBAP_SUPPORTED_FEATURES);
> >> +     if (!data)
> >> +             return NULL;
> >> +
> >> +     return g_obex_apparam_set_uint32(NULL,
> >> SUPPORTED_FEATURES_TAG,
> >> +                                             DOWNLOAD_FEATURE |
> >> +                                             BROWSE_FEATURE |
> >> +                                             DATABASEID_FEATURE |
> >> +                                             FOLDER_VERSION_FEATURE
> >> |
> >> +                                             VCARD_SELECTING_FEATURE
> >> |
> >> +                                             ENHANCED_CALLS_FEATURE
> >> |
> >> +                                             UCI_FEATURE |
> >> +                                             UID_FEATURE |
> >> +                                             REFERENCING_FEATURE |
> >> +                                             DEFAULT_IMAGE_FEATURE);
> >> +}
> >> +
> >>  static int pbap_probe(struct obc_session *session)  {
> >>       struct pbap_data *pbap;
> >> @@ -1274,6 +1309,7 @@ static struct obc_driver pbap = {
> >>       .uuid = PBAP_UUID,
> >>       .target = OBEX_PBAP_UUID,
> >>       .target_len = OBEX_PBAP_UUID_LEN,
> >> +     .supported_features = pbap_supported_features,
> >>       .probe = pbap_probe,
> >>       .remove = pbap_remove
> >>  };
> >> diff --git a/obexd/client/session.c b/obexd/client/session.c index
> >> 9bba6c6..d2ae4fd 100644
> >> --- a/obexd/client/session.c
> >> +++ b/obexd/client/session.c
> >> @@ -345,6 +345,7 @@ static void transport_func(GIOChannel *io, GError
> >> *err, gpointer user_data)
> >>       struct obc_driver *driver = session->driver;
> >>       struct obc_transport *transport = session->transport;
> >>       GObex *obex;
> >> +     GObexApparam *apparam;
> >>       GObexTransportType type;
> >>       int tx_mtu = -1;
> >>       int rx_mtu = -1;
> >> @@ -370,7 +371,29 @@ static void transport_func(GIOChannel *io,
> >> GError *err, gpointer user_data)
> >>
> >>       g_io_channel_set_close_on_unref(io, TRUE);
> >>
> >> -     if (driver->target != NULL)
> >> +     apparam = NULL;
> >> +
> >> +     if (driver->supported_features)
> >> +             apparam = driver->supported_features(session);
> >> +
> >> +     if (apparam) {
> >> +             uint8_t buf[1024];
> >> +             ssize_t len;
> >> +
> >> +             len = g_obex_apparam_encode(apparam, buf, sizeof(buf));
> >> +             if (driver->target)
> >> +                     g_obex_connect(obex, connect_cb, callback, &err,
> >> +                                     G_OBEX_HDR_TARGET,
> >> +                                     driver->target, driver->target_len,
> >> +                                     G_OBEX_HDR_APPARAM,
> >> +                                     buf, len,
> >> +                                     G_OBEX_HDR_INVALID);
> >> +             else
> >> +                     g_obex_connect(obex, connect_cb, callback, &err,
> >> +                                     G_OBEX_HDR_APPARAM, buf, len,
> >> +                                     G_OBEX_HDR_INVALID);
> >> +             g_obex_apparam_free(apparam);
> >> +     } else if (driver->target)
> >>               g_obex_connect(obex, connect_cb, callback, &err,
> >>                       G_OBEX_HDR_TARGET, driver->target, driver-
> >> >target_len,
> >>                       G_OBEX_HDR_INVALID);
> >> --
> >> 1.9.3
> >>
> >> --
> >> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth"
> > in
> >> the body of a message to majordomo@vger.kernel.org More majordomo
> >> info at  http://vger.kernel.org/majordomo-info.html
> >
> >
> >
> > I applied this patch locally and tested with PTS.
> > The PTS test case: TP/SSM/BV-09-C [PCE Shares PbapSupportedFeature
> > bits] is failing.
> > According to PBAP V1.2 Spec - Section 6.4 - OBEX Connect request
> > format, the PbapSupportedFeatures are shared during obex connect(after
> > applying the this patch).
> > Still the above test case is failing.
> > Am I mapping anything wrong?
> 
> Have you applied the full set? Maybe the PCE record needs updating as well,
> but normally it is not mandatory.
> 
> 
> --
> Luiz Augusto von Dentz
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
> the body of a message to majordomo@vger.kernel.org More majordomo
> info at  http://vger.kernel.org/majordomo-info.html


Yes, I applied the complete set and tested it. Still that TC is failing.
Just want to know how it is failing, because I tried 
1) Applying this patch set - not passing
2) Added below attribute in the src/profile PCE record at the end as below - not passing
               <attribute id=\"0x0317\">                                
                        <uint32 value=\"0x00000003\"/>                  
                </attribute>                           

May be it’s a PTS Issue. Anyway it's not mandatory.

Regards,
Gowtham Anandha Babu


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

* Re: [PATCH BlueZ 8/8] obexd/client: Add supported_features support
  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
  0 siblings, 1 reply; 17+ messages in thread
From: Luiz Augusto von Dentz @ 2014-12-01 13:34 UTC (permalink / raw)
  To: Gowtham Anandha Babu; +Cc: linux-bluetooth

Hi Gowtham,

On Mon, Dec 1, 2014 at 3:31 PM, Gowtham Anandha Babu
<gowtham.ab@samsung.com> wrote:
> Hi Luiz,
>
>> -----Original Message-----
>> From: linux-bluetooth-owner@vger.kernel.org [mailto:linux-bluetooth-
>> owner@vger.kernel.org] On Behalf Of Luiz Augusto von Dentz
>> Sent: Monday, December 01, 2014 6:22 PM
>> To: Gowtham Anandha Babu
>> Cc: linux-bluetooth@vger.kernel.org
>> Subject: Re: [PATCH BlueZ 8/8] obexd/client: Add supported_features
>> support
>>
>> Hi Gowtham,
>>
>> On Mon, Dec 1, 2014 at 2:17 PM, Gowtham Anandha Babu
>> <gowtham.ab@samsung.com> wrote:
>> > Hi Luiz,
>> >
>> >> -----Original Message-----
>> >> From: linux-bluetooth-owner@vger.kernel.org [mailto:linux-bluetooth-
>> >> owner@vger.kernel.org] On Behalf Of Luiz Augusto von Dentz
>> >> Sent: Monday, December 01, 2014 2:17 PM
>> >> To: linux-bluetooth@vger.kernel.org
>> >> Subject: [PATCH BlueZ 8/8] obexd/client: Add supported_features
>> >> support
>> >>
>> >> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
>> >>
>> >> This adds supported_features support to obc_driver so driver can
>> >> provide this information when connecting.
>> >>
>> >> This is required by PBAP 1.2 (page 48):
>> >>
>> >>   'Mandatory if the PSE advertises a PbapSupportedFeatures attribute in
>> >>    its SDP record, else excluded.'
>> >> ---
>> >>  obexd/client/driver.h  |  1 +
>> >>  obexd/client/pbap.c    | 36
>> ++++++++++++++++++++++++++++++++++++
>> >>  obexd/client/session.c | 25 ++++++++++++++++++++++++-
>> >>  3 files changed, 61 insertions(+), 1 deletion(-)
>> >>
>> >> diff --git a/obexd/client/driver.h b/obexd/client/driver.h index
>> >> f1c0646..0112219 100644
>> >> --- a/obexd/client/driver.h
>> >> +++ b/obexd/client/driver.h
>> >> @@ -26,6 +26,7 @@ struct obc_driver {
>> >>       const char *uuid;
>> >>       void *target;
>> >>       gsize target_len;
>> >> +     void *(*supported_features) (struct obc_session *session);
>> >>       int (*probe) (struct obc_session *session);
>> >>       void (*remove) (struct obc_session *session);  }; diff --git
>> >> a/obexd/client/pbap.c b/obexd/client/pbap.c index 812a7fb..57632b4
>> >> 100644
>> >> --- a/obexd/client/pbap.c
>> >> +++ b/obexd/client/pbap.c
>> >> @@ -76,6 +76,7 @@
>> >>  #define PRIMARY_COUNTER_TAG  0X0A
>> >>  #define SECONDARY_COUNTER_TAG        0X0B
>> >>  #define DATABASEID_TAG               0X0D
>> >> +#define SUPPORTED_FEATURES_TAG  0x10
>> >>
>> >>  #define DOWNLOAD_FEATURE     0x00000001
>> >>  #define BROWSE_FEATURE               0x00000002
>> >> @@ -1230,6 +1231,40 @@ static void parse_service_record(struct
>> >> pbap_data
>> >> *pbap)
>> >>
>> >>  }
>> >>
>> >> +static void *pbap_supported_features(struct obc_session *session) {
>> >> +     const void *data;
>> >> +     uint16_t version;
>> >> +
>> >> +     /* Version */
>> >> +     data = obc_session_get_attribute(session,
>> >> SDP_ATTR_PFILE_DESC_LIST);
>> >> +     if (!data)
>> >> +             return NULL;
>> >> +
>> >> +     version = GPOINTER_TO_UINT(data);
>> >> +
>> >> +     if (version < 0x0102)
>> >> +             return NULL;
>> >> +
>> >> +     /* Supported Feature Bits */
>> >> +     data = obc_session_get_attribute(session,
>> >> +
>> >>       SDP_ATTR_PBAP_SUPPORTED_FEATURES);
>> >> +     if (!data)
>> >> +             return NULL;
>> >> +
>> >> +     return g_obex_apparam_set_uint32(NULL,
>> >> SUPPORTED_FEATURES_TAG,
>> >> +                                             DOWNLOAD_FEATURE |
>> >> +                                             BROWSE_FEATURE |
>> >> +                                             DATABASEID_FEATURE |
>> >> +                                             FOLDER_VERSION_FEATURE
>> >> |
>> >> +                                             VCARD_SELECTING_FEATURE
>> >> |
>> >> +                                             ENHANCED_CALLS_FEATURE
>> >> |
>> >> +                                             UCI_FEATURE |
>> >> +                                             UID_FEATURE |
>> >> +                                             REFERENCING_FEATURE |
>> >> +                                             DEFAULT_IMAGE_FEATURE);
>> >> +}
>> >> +
>> >>  static int pbap_probe(struct obc_session *session)  {
>> >>       struct pbap_data *pbap;
>> >> @@ -1274,6 +1309,7 @@ static struct obc_driver pbap = {
>> >>       .uuid = PBAP_UUID,
>> >>       .target = OBEX_PBAP_UUID,
>> >>       .target_len = OBEX_PBAP_UUID_LEN,
>> >> +     .supported_features = pbap_supported_features,
>> >>       .probe = pbap_probe,
>> >>       .remove = pbap_remove
>> >>  };
>> >> diff --git a/obexd/client/session.c b/obexd/client/session.c index
>> >> 9bba6c6..d2ae4fd 100644
>> >> --- a/obexd/client/session.c
>> >> +++ b/obexd/client/session.c
>> >> @@ -345,6 +345,7 @@ static void transport_func(GIOChannel *io, GError
>> >> *err, gpointer user_data)
>> >>       struct obc_driver *driver = session->driver;
>> >>       struct obc_transport *transport = session->transport;
>> >>       GObex *obex;
>> >> +     GObexApparam *apparam;
>> >>       GObexTransportType type;
>> >>       int tx_mtu = -1;
>> >>       int rx_mtu = -1;
>> >> @@ -370,7 +371,29 @@ static void transport_func(GIOChannel *io,
>> >> GError *err, gpointer user_data)
>> >>
>> >>       g_io_channel_set_close_on_unref(io, TRUE);
>> >>
>> >> -     if (driver->target != NULL)
>> >> +     apparam = NULL;
>> >> +
>> >> +     if (driver->supported_features)
>> >> +             apparam = driver->supported_features(session);
>> >> +
>> >> +     if (apparam) {
>> >> +             uint8_t buf[1024];
>> >> +             ssize_t len;
>> >> +
>> >> +             len = g_obex_apparam_encode(apparam, buf, sizeof(buf));
>> >> +             if (driver->target)
>> >> +                     g_obex_connect(obex, connect_cb, callback, &err,
>> >> +                                     G_OBEX_HDR_TARGET,
>> >> +                                     driver->target, driver->target_len,
>> >> +                                     G_OBEX_HDR_APPARAM,
>> >> +                                     buf, len,
>> >> +                                     G_OBEX_HDR_INVALID);
>> >> +             else
>> >> +                     g_obex_connect(obex, connect_cb, callback, &err,
>> >> +                                     G_OBEX_HDR_APPARAM, buf, len,
>> >> +                                     G_OBEX_HDR_INVALID);
>> >> +             g_obex_apparam_free(apparam);
>> >> +     } else if (driver->target)
>> >>               g_obex_connect(obex, connect_cb, callback, &err,
>> >>                       G_OBEX_HDR_TARGET, driver->target, driver-
>> >> >target_len,
>> >>                       G_OBEX_HDR_INVALID);
>> >> --
>> >> 1.9.3
>> >>
>> >> --
>> >> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth"
>> > in
>> >> the body of a message to majordomo@vger.kernel.org More majordomo
>> >> info at  http://vger.kernel.org/majordomo-info.html
>> >
>> >
>> >
>> > I applied this patch locally and tested with PTS.
>> > The PTS test case: TP/SSM/BV-09-C [PCE Shares PbapSupportedFeature
>> > bits] is failing.
>> > According to PBAP V1.2 Spec - Section 6.4 - OBEX Connect request
>> > format, the PbapSupportedFeatures are shared during obex connect(after
>> > applying the this patch).
>> > Still the above test case is failing.
>> > Am I mapping anything wrong?
>>
>> Have you applied the full set? Maybe the PCE record needs updating as well,
>> but normally it is not mandatory.
>>
>>
>> --
>> Luiz Augusto von Dentz
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
>> the body of a message to majordomo@vger.kernel.org More majordomo
>> info at  http://vger.kernel.org/majordomo-info.html
>
>
> Yes, I applied the complete set and tested it. Still that TC is failing.
> Just want to know how it is failing, because I tried
> 1) Applying this patch set - not passing
> 2) Added below attribute in the src/profile PCE record at the end as below - not passing
>                <attribute id=\"0x0317\">
>                         <uint32 value=\"0x00000003\"/>
>                 </attribute>
>
> May be it’s a PTS Issue. Anyway it's not mandatory.

I will try it as well, btw does the logs indicate anything useful?

-- 
Luiz Augusto von Dentz

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

* Re: [PATCH BlueZ 8/8] obexd/client: Add supported_features support
  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>
  0 siblings, 1 reply; 17+ messages in thread
From: Luiz Augusto von Dentz @ 2014-12-01 14:00 UTC (permalink / raw)
  To: Gowtham Anandha Babu; +Cc: linux-bluetooth

Hi Gowtham,

On Mon, Dec 1, 2014 at 3:34 PM, Luiz Augusto von Dentz
<luiz.dentz@gmail.com> wrote:
> Hi Gowtham,
>
> On Mon, Dec 1, 2014 at 3:31 PM, Gowtham Anandha Babu
> <gowtham.ab@samsung.com> wrote:
>> Hi Luiz,
>>
>>> -----Original Message-----
>>> From: linux-bluetooth-owner@vger.kernel.org [mailto:linux-bluetooth-
>>> owner@vger.kernel.org] On Behalf Of Luiz Augusto von Dentz
>>> Sent: Monday, December 01, 2014 6:22 PM
>>> To: Gowtham Anandha Babu
>>> Cc: linux-bluetooth@vger.kernel.org
>>> Subject: Re: [PATCH BlueZ 8/8] obexd/client: Add supported_features
>>> support
>>>
>>> Hi Gowtham,
>>>
>>> On Mon, Dec 1, 2014 at 2:17 PM, Gowtham Anandha Babu
>>> <gowtham.ab@samsung.com> wrote:
>>> > Hi Luiz,
>>> >
>>> >> -----Original Message-----
>>> >> From: linux-bluetooth-owner@vger.kernel.org [mailto:linux-bluetooth-
>>> >> owner@vger.kernel.org] On Behalf Of Luiz Augusto von Dentz
>>> >> Sent: Monday, December 01, 2014 2:17 PM
>>> >> To: linux-bluetooth@vger.kernel.org
>>> >> Subject: [PATCH BlueZ 8/8] obexd/client: Add supported_features
>>> >> support
>>> >>
>>> >> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
>>> >>
>>> >> This adds supported_features support to obc_driver so driver can
>>> >> provide this information when connecting.
>>> >>
>>> >> This is required by PBAP 1.2 (page 48):
>>> >>
>>> >>   'Mandatory if the PSE advertises a PbapSupportedFeatures attribute in
>>> >>    its SDP record, else excluded.'
>>> >> ---
>>> >>  obexd/client/driver.h  |  1 +
>>> >>  obexd/client/pbap.c    | 36
>>> ++++++++++++++++++++++++++++++++++++
>>> >>  obexd/client/session.c | 25 ++++++++++++++++++++++++-
>>> >>  3 files changed, 61 insertions(+), 1 deletion(-)
>>> >>
>>> >> diff --git a/obexd/client/driver.h b/obexd/client/driver.h index
>>> >> f1c0646..0112219 100644
>>> >> --- a/obexd/client/driver.h
>>> >> +++ b/obexd/client/driver.h
>>> >> @@ -26,6 +26,7 @@ struct obc_driver {
>>> >>       const char *uuid;
>>> >>       void *target;
>>> >>       gsize target_len;
>>> >> +     void *(*supported_features) (struct obc_session *session);
>>> >>       int (*probe) (struct obc_session *session);
>>> >>       void (*remove) (struct obc_session *session);  }; diff --git
>>> >> a/obexd/client/pbap.c b/obexd/client/pbap.c index 812a7fb..57632b4
>>> >> 100644
>>> >> --- a/obexd/client/pbap.c
>>> >> +++ b/obexd/client/pbap.c
>>> >> @@ -76,6 +76,7 @@
>>> >>  #define PRIMARY_COUNTER_TAG  0X0A
>>> >>  #define SECONDARY_COUNTER_TAG        0X0B
>>> >>  #define DATABASEID_TAG               0X0D
>>> >> +#define SUPPORTED_FEATURES_TAG  0x10
>>> >>
>>> >>  #define DOWNLOAD_FEATURE     0x00000001
>>> >>  #define BROWSE_FEATURE               0x00000002
>>> >> @@ -1230,6 +1231,40 @@ static void parse_service_record(struct
>>> >> pbap_data
>>> >> *pbap)
>>> >>
>>> >>  }
>>> >>
>>> >> +static void *pbap_supported_features(struct obc_session *session) {
>>> >> +     const void *data;
>>> >> +     uint16_t version;
>>> >> +
>>> >> +     /* Version */
>>> >> +     data = obc_session_get_attribute(session,
>>> >> SDP_ATTR_PFILE_DESC_LIST);
>>> >> +     if (!data)
>>> >> +             return NULL;
>>> >> +
>>> >> +     version = GPOINTER_TO_UINT(data);
>>> >> +
>>> >> +     if (version < 0x0102)
>>> >> +             return NULL;
>>> >> +
>>> >> +     /* Supported Feature Bits */
>>> >> +     data = obc_session_get_attribute(session,
>>> >> +
>>> >>       SDP_ATTR_PBAP_SUPPORTED_FEATURES);
>>> >> +     if (!data)
>>> >> +             return NULL;
>>> >> +
>>> >> +     return g_obex_apparam_set_uint32(NULL,
>>> >> SUPPORTED_FEATURES_TAG,
>>> >> +                                             DOWNLOAD_FEATURE |
>>> >> +                                             BROWSE_FEATURE |
>>> >> +                                             DATABASEID_FEATURE |
>>> >> +                                             FOLDER_VERSION_FEATURE
>>> >> |
>>> >> +                                             VCARD_SELECTING_FEATURE
>>> >> |
>>> >> +                                             ENHANCED_CALLS_FEATURE
>>> >> |
>>> >> +                                             UCI_FEATURE |
>>> >> +                                             UID_FEATURE |
>>> >> +                                             REFERENCING_FEATURE |
>>> >> +                                             DEFAULT_IMAGE_FEATURE);
>>> >> +}
>>> >> +
>>> >>  static int pbap_probe(struct obc_session *session)  {
>>> >>       struct pbap_data *pbap;
>>> >> @@ -1274,6 +1309,7 @@ static struct obc_driver pbap = {
>>> >>       .uuid = PBAP_UUID,
>>> >>       .target = OBEX_PBAP_UUID,
>>> >>       .target_len = OBEX_PBAP_UUID_LEN,
>>> >> +     .supported_features = pbap_supported_features,
>>> >>       .probe = pbap_probe,
>>> >>       .remove = pbap_remove
>>> >>  };
>>> >> diff --git a/obexd/client/session.c b/obexd/client/session.c index
>>> >> 9bba6c6..d2ae4fd 100644
>>> >> --- a/obexd/client/session.c
>>> >> +++ b/obexd/client/session.c
>>> >> @@ -345,6 +345,7 @@ static void transport_func(GIOChannel *io, GError
>>> >> *err, gpointer user_data)
>>> >>       struct obc_driver *driver = session->driver;
>>> >>       struct obc_transport *transport = session->transport;
>>> >>       GObex *obex;
>>> >> +     GObexApparam *apparam;
>>> >>       GObexTransportType type;
>>> >>       int tx_mtu = -1;
>>> >>       int rx_mtu = -1;
>>> >> @@ -370,7 +371,29 @@ static void transport_func(GIOChannel *io,
>>> >> GError *err, gpointer user_data)
>>> >>
>>> >>       g_io_channel_set_close_on_unref(io, TRUE);
>>> >>
>>> >> -     if (driver->target != NULL)
>>> >> +     apparam = NULL;
>>> >> +
>>> >> +     if (driver->supported_features)
>>> >> +             apparam = driver->supported_features(session);
>>> >> +
>>> >> +     if (apparam) {
>>> >> +             uint8_t buf[1024];
>>> >> +             ssize_t len;
>>> >> +
>>> >> +             len = g_obex_apparam_encode(apparam, buf, sizeof(buf));
>>> >> +             if (driver->target)
>>> >> +                     g_obex_connect(obex, connect_cb, callback, &err,
>>> >> +                                     G_OBEX_HDR_TARGET,
>>> >> +                                     driver->target, driver->target_len,
>>> >> +                                     G_OBEX_HDR_APPARAM,
>>> >> +                                     buf, len,
>>> >> +                                     G_OBEX_HDR_INVALID);
>>> >> +             else
>>> >> +                     g_obex_connect(obex, connect_cb, callback, &err,
>>> >> +                                     G_OBEX_HDR_APPARAM, buf, len,
>>> >> +                                     G_OBEX_HDR_INVALID);
>>> >> +             g_obex_apparam_free(apparam);
>>> >> +     } else if (driver->target)
>>> >>               g_obex_connect(obex, connect_cb, callback, &err,
>>> >>                       G_OBEX_HDR_TARGET, driver->target, driver-
>>> >> >target_len,
>>> >>                       G_OBEX_HDR_INVALID);
>>> >> --
>>> >> 1.9.3
>>> >>
>>> >> --
>>> >> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth"
>>> > in
>>> >> the body of a message to majordomo@vger.kernel.org More majordomo
>>> >> info at  http://vger.kernel.org/majordomo-info.html
>>> >
>>> >
>>> >
>>> > I applied this patch locally and tested with PTS.
>>> > The PTS test case: TP/SSM/BV-09-C [PCE Shares PbapSupportedFeature
>>> > bits] is failing.
>>> > According to PBAP V1.2 Spec - Section 6.4 - OBEX Connect request
>>> > format, the PbapSupportedFeatures are shared during obex connect(after
>>> > applying the this patch).
>>> > Still the above test case is failing.
>>> > Am I mapping anything wrong?
>>>
>>> Have you applied the full set? Maybe the PCE record needs updating as well,
>>> but normally it is not mandatory.
>>>
>>>
>>> --
>>> Luiz Augusto von Dentz
>>> --
>>> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
>>> the body of a message to majordomo@vger.kernel.org More majordomo
>>> info at  http://vger.kernel.org/majordomo-info.html
>>
>>
>> Yes, I applied the complete set and tested it. Still that TC is failing.
>> Just want to know how it is failing, because I tried
>> 1) Applying this patch set - not passing
>> 2) Added below attribute in the src/profile PCE record at the end as below - not passing
>>                <attribute id=\"0x0317\">
>>                         <uint32 value=\"0x00000003\"/>
>>                 </attribute>
>>
>> May be it’s a PTS Issue. Anyway it's not mandatory.
>
> I will try it as well, btw does the logs indicate anything useful?

Btw, what TC is failing?


-- 
Luiz Augusto von Dentz

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

* Re: [PATCH BlueZ 8/8] obexd/client: Add supported_features support
       [not found]             ` <003c01d00d71$f818ba20$e84a2e60$@samsung.com>
@ 2014-12-01 14:41               ` Luiz Augusto von Dentz
  2014-12-02  6:37                 ` Gowtham Anandha Babu
  0 siblings, 1 reply; 17+ messages in thread
From: Luiz Augusto von Dentz @ 2014-12-01 14:41 UTC (permalink / raw)
  To: Gowtham Anandha Babu; +Cc: linux-bluetooth

Hi Gowtham,

On Mon, Dec 1, 2014 at 4:19 PM, Gowtham Anandha Babu
<gowtham.ab@samsung.com> wrote:
> Hi Luiz,
>
>> -----Original Message-----
>> From: linux-bluetooth-owner@vger.kernel.org [mailto:linux-bluetooth-
>> owner@vger.kernel.org] On Behalf Of Luiz Augusto von Dentz
>> Sent: Monday, December 01, 2014 7:30 PM
>> To: Gowtham Anandha Babu
>> Cc: linux-bluetooth@vger.kernel.org
>> Subject: Re: [PATCH BlueZ 8/8] obexd/client: Add supported_features
>> support
>>
>> Hi Gowtham,
>>
>> On Mon, Dec 1, 2014 at 3:34 PM, Luiz Augusto von Dentz
>> <luiz.dentz@gmail.com> wrote:
>> > Hi Gowtham,
>> >
>> > On Mon, Dec 1, 2014 at 3:31 PM, Gowtham Anandha Babu
>> > <gowtham.ab@samsung.com> wrote:
>> >> Hi Luiz,
>> >>
>> >>> -----Original Message-----
>> >>> From: linux-bluetooth-owner@vger.kernel.org [mailto:linux-bluetooth-
>> >>> owner@vger.kernel.org] On Behalf Of Luiz Augusto von Dentz
>> >>> Sent: Monday, December 01, 2014 6:22 PM
>> >>> To: Gowtham Anandha Babu
>> >>> Cc: linux-bluetooth@vger.kernel.org
>> >>> Subject: Re: [PATCH BlueZ 8/8] obexd/client: Add supported_features
>> >>> support
>> >>>
>> >>> Hi Gowtham,
>> >>>
>> >>> On Mon, Dec 1, 2014 at 2:17 PM, Gowtham Anandha Babu
>> >>> <gowtham.ab@samsung.com> wrote:
>> >>> > Hi Luiz,
>> >>> >
>> >>> >> -----Original Message-----
>> >>> >> From: linux-bluetooth-owner@vger.kernel.org
>> >>> >> [mailto:linux-bluetooth- owner@vger.kernel.org] On Behalf Of Luiz
>> >>> >> Augusto von Dentz
>> >>> >> Sent: Monday, December 01, 2014 2:17 PM
>> >>> >> To: linux-bluetooth@vger.kernel.org
>> >>> >> Subject: [PATCH BlueZ 8/8] obexd/client: Add supported_features
>> >>> >> support
>> >>> >>
>> >>> >> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
>> >>> >>
>> >>> >> This adds supported_features support to obc_driver so driver can
>> >>> >> provide this information when connecting.
>> >>> >>
>> >>> >> This is required by PBAP 1.2 (page 48):
>> >>> >>
>> >>> >>   'Mandatory if the PSE advertises a PbapSupportedFeatures attribute
>> in
>> >>> >>    its SDP record, else excluded.'
>> >>> >> ---
>> >>> >>  obexd/client/driver.h  |  1 +
>> >>> >>  obexd/client/pbap.c    | 36
>> >>> ++++++++++++++++++++++++++++++++++++
>> >>> >>  obexd/client/session.c | 25 ++++++++++++++++++++++++-
>> >>> >>  3 files changed, 61 insertions(+), 1 deletion(-)
>> >>> >>
>> >>> >> diff --git a/obexd/client/driver.h b/obexd/client/driver.h index
>> >>> >> f1c0646..0112219 100644
>> >>> >> --- a/obexd/client/driver.h
>> >>> >> +++ b/obexd/client/driver.h
>> >>> >> @@ -26,6 +26,7 @@ struct obc_driver {
>> >>> >>       const char *uuid;
>> >>> >>       void *target;
>> >>> >>       gsize target_len;
>> >>> >> +     void *(*supported_features) (struct obc_session *session);
>> >>> >>       int (*probe) (struct obc_session *session);
>> >>> >>       void (*remove) (struct obc_session *session);  }; diff
>> >>> >> --git a/obexd/client/pbap.c b/obexd/client/pbap.c index
>> >>> >> 812a7fb..57632b4
>> >>> >> 100644
>> >>> >> --- a/obexd/client/pbap.c
>> >>> >> +++ b/obexd/client/pbap.c
>> >>> >> @@ -76,6 +76,7 @@
>> >>> >>  #define PRIMARY_COUNTER_TAG  0X0A
>> >>> >>  #define SECONDARY_COUNTER_TAG        0X0B
>> >>> >>  #define DATABASEID_TAG               0X0D
>> >>> >> +#define SUPPORTED_FEATURES_TAG  0x10
>> >>> >>
>> >>> >>  #define DOWNLOAD_FEATURE     0x00000001
>> >>> >>  #define BROWSE_FEATURE               0x00000002
>> >>> >> @@ -1230,6 +1231,40 @@ static void parse_service_record(struct
>> >>> >> pbap_data
>> >>> >> *pbap)
>> >>> >>
>> >>> >>  }
>> >>> >>
>> >>> >> +static void *pbap_supported_features(struct obc_session *session)
>> {
>> >>> >> +     const void *data;
>> >>> >> +     uint16_t version;
>> >>> >> +
>> >>> >> +     /* Version */
>> >>> >> +     data = obc_session_get_attribute(session,
>> >>> >> SDP_ATTR_PFILE_DESC_LIST);
>> >>> >> +     if (!data)
>> >>> >> +             return NULL;
>> >>> >> +
>> >>> >> +     version = GPOINTER_TO_UINT(data);
>> >>> >> +
>> >>> >> +     if (version < 0x0102)
>> >>> >> +             return NULL;
>> >>> >> +
>> >>> >> +     /* Supported Feature Bits */
>> >>> >> +     data = obc_session_get_attribute(session,
>> >>> >> +
>> >>> >>       SDP_ATTR_PBAP_SUPPORTED_FEATURES);
>> >>> >> +     if (!data)
>> >>> >> +             return NULL;
>> >>> >> +
>> >>> >> +     return g_obex_apparam_set_uint32(NULL,
>> >>> >> SUPPORTED_FEATURES_TAG,
>> >>> >> +                                             DOWNLOAD_FEATURE |
>> >>> >> +                                             BROWSE_FEATURE |
>> >>> >> +                                             DATABASEID_FEATURE |
>> >>> >> +
>> >>> >> + FOLDER_VERSION_FEATURE
>> >>> >> |
>> >>> >> +
>> >>> >> + VCARD_SELECTING_FEATURE
>> >>> >> |
>> >>> >> +
>> >>> >> + ENHANCED_CALLS_FEATURE
>> >>> >> |
>> >>> >> +                                             UCI_FEATURE |
>> >>> >> +                                             UID_FEATURE |
>> >>> >> +                                             REFERENCING_FEATURE |
>> >>> >> +
>> >>> >> +DEFAULT_IMAGE_FEATURE); }
>> >>> >> +
>> >>> >>  static int pbap_probe(struct obc_session *session)  {
>> >>> >>       struct pbap_data *pbap;
>> >>> >> @@ -1274,6 +1309,7 @@ static struct obc_driver pbap = {
>> >>> >>       .uuid = PBAP_UUID,
>> >>> >>       .target = OBEX_PBAP_UUID,
>> >>> >>       .target_len = OBEX_PBAP_UUID_LEN,
>> >>> >> +     .supported_features = pbap_supported_features,
>> >>> >>       .probe = pbap_probe,
>> >>> >>       .remove = pbap_remove
>> >>> >>  };
>> >>> >> diff --git a/obexd/client/session.c b/obexd/client/session.c
>> >>> >> index 9bba6c6..d2ae4fd 100644
>> >>> >> --- a/obexd/client/session.c
>> >>> >> +++ b/obexd/client/session.c
>> >>> >> @@ -345,6 +345,7 @@ static void transport_func(GIOChannel *io,
>> >>> >> GError *err, gpointer user_data)
>> >>> >>       struct obc_driver *driver = session->driver;
>> >>> >>       struct obc_transport *transport = session->transport;
>> >>> >>       GObex *obex;
>> >>> >> +     GObexApparam *apparam;
>> >>> >>       GObexTransportType type;
>> >>> >>       int tx_mtu = -1;
>> >>> >>       int rx_mtu = -1;
>> >>> >> @@ -370,7 +371,29 @@ static void transport_func(GIOChannel *io,
>> >>> >> GError *err, gpointer user_data)
>> >>> >>
>> >>> >>       g_io_channel_set_close_on_unref(io, TRUE);
>> >>> >>
>> >>> >> -     if (driver->target != NULL)
>> >>> >> +     apparam = NULL;
>> >>> >> +
>> >>> >> +     if (driver->supported_features)
>> >>> >> +             apparam = driver->supported_features(session);
>> >>> >> +
>> >>> >> +     if (apparam) {
>> >>> >> +             uint8_t buf[1024];
>> >>> >> +             ssize_t len;
>> >>> >> +
>> >>> >> +             len = g_obex_apparam_encode(apparam, buf, sizeof(buf));
>> >>> >> +             if (driver->target)
>> >>> >> +                     g_obex_connect(obex, connect_cb, callback, &err,
>> >>> >> +                                     G_OBEX_HDR_TARGET,
>> >>> >> +                                     driver->target, driver->target_len,
>> >>> >> +                                     G_OBEX_HDR_APPARAM,
>> >>> >> +                                     buf, len,
>> >>> >> +                                     G_OBEX_HDR_INVALID);
>> >>> >> +             else
>> >>> >> +                     g_obex_connect(obex, connect_cb, callback, &err,
>> >>> >> +                                     G_OBEX_HDR_APPARAM, buf, len,
>> >>> >> +                                     G_OBEX_HDR_INVALID);
>> >>> >> +             g_obex_apparam_free(apparam);
>> >>> >> +     } else if (driver->target)
>> >>> >>               g_obex_connect(obex, connect_cb, callback, &err,
>> >>> >>                       G_OBEX_HDR_TARGET, driver->target, driver-
>> >>> >> >target_len,
>> >>> >>                       G_OBEX_HDR_INVALID);
>> >>> >> --
>> >>> >> 1.9.3
>> >>> >>
>> >>> >> --
>> >>> >> To unsubscribe from this list: send the line "unsubscribe linux-
>> bluetooth"
>> >>> > in
>> >>> >> the body of a message to majordomo@vger.kernel.org More
>> majordomo
>> >>> >> info at  http://vger.kernel.org/majordomo-info.html
>> >>> >
>> >>> >
>> >>> >
>> >>> > I applied this patch locally and tested with PTS.
>> >>> > The PTS test case: TP/SSM/BV-09-C [PCE Shares
>> PbapSupportedFeature
>> >>> > bits] is failing.
>> >>> > According to PBAP V1.2 Spec - Section 6.4 - OBEX Connect request
>> >>> > format, the PbapSupportedFeatures are shared during obex
>> >>> > connect(after applying the this patch).
>> >>> > Still the above test case is failing.
>> >>> > Am I mapping anything wrong?
>> >>>
>> >>> Have you applied the full set? Maybe the PCE record needs updating
>> >>> as well, but normally it is not mandatory.
>> >>>
>> >>>
>> >>> --
>> >>> Luiz Augusto von Dentz
>> >>> --
>> >>> To unsubscribe from this list: send the line "unsubscribe
>> >>> linux-bluetooth" in the body of a message to
>> >>> majordomo@vger.kernel.org More majordomo info at
>> >>> http://vger.kernel.org/majordomo-info.html
>> >>
>> >>
>> >> Yes, I applied the complete set and tested it. Still that TC is failing.
>> >> Just want to know how it is failing, because I tried
>> >> 1) Applying this patch set - not passing
>> >> 2) Added below attribute in the src/profile PCE record at the end as below
>> - not passing
>> >>                <attribute id=\"0x0317\">
>> >>                         <uint32 value=\"0x00000003\"/>
>> >>                 </attribute>
>> >>
>> >> May be it’s a PTS Issue. Anyway it's not mandatory.
>> >
>> > I will try it as well, btw does the logs indicate anything useful?
>>
>> Btw, what TC is failing?
>>
>
> The PTS test case: TP/SSM/BV-09-C [PCE Shares PbapSupportedFeature bits] is failing.
> Test objective is to verify that the PCE can share its PbapSupportedFeatures bits with a server.
>
> Steps I followed:
> 1) Ran Bluetoothd
> 2) Ran obexd
> 3) Initiated the above mentioned TC in PTS tool.
> 4) ./pbap-client 00:1B:DC:07:33:4E >> err.txt
>
> Bluetoothd logs:
>
> bluetoothd[2740]: src/adapter.c:connected_callback() hci0 device 00:1B:DC:07:33:4E connected eir_len 21
> bluetoothd[2740]: src/adapter.c:dev_disconnected() Device 00:1B:DC:07:33:4E disconnected, reason 2
> bluetoothd[2740]: src/adapter.c:adapter_remove_connection()
> bluetoothd[2740]: plugins/policy.c:disconnect_cb() reason 2
> bluetoothd[2740]: src/adapter.c:bonding_attempt_complete() hci0 bdaddr 00:1B:DC:07:33:4E type 0 status 0xe
> bluetoothd[2740]: src/device.c:device_bonding_complete() bonding (nil) status 0x0e
> bluetoothd[2740]: src/device.c:device_bonding_failed() status 14
> bluetoothd[2740]: src/adapter.c:resume_discovery()
>
> Obexd logs: Nothing while executing the TC

It is probably better if you can use obexctl> connect <address> pbap,
also it would be good to have the HCI traces to be able to detect if
PTS is really setting the record properly, for example if it is not
advertising 0x0102 in the record we will not attempt to send the
parameters.

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

* RE: [PATCH BlueZ 8/8] obexd/client: Add supported_features support
  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
  0 siblings, 1 reply; 17+ messages in thread
From: Gowtham Anandha Babu @ 2014-12-02  6:37 UTC (permalink / raw)
  To: 'Luiz Augusto von Dentz'; +Cc: linux-bluetooth

Hi Luiz,

> -----Original Message-----
> From: linux-bluetooth-owner@vger.kernel.org [mailto:linux-bluetooth-
> owner@vger.kernel.org] On Behalf Of Luiz Augusto von Dentz
> Sent: Monday, December 01, 2014 8:12 PM
> To: Gowtham Anandha Babu
> Cc: linux-bluetooth@vger.kernel.org
> Subject: Re: [PATCH BlueZ 8/8] obexd/client: Add supported_features
> support
> 
> Hi Gowtham,
> 
> On Mon, Dec 1, 2014 at 4:19 PM, Gowtham Anandha Babu
> <gowtham.ab@samsung.com> wrote:
> > Hi Luiz,
> >
> >> -----Original Message-----
> >> From: linux-bluetooth-owner@vger.kernel.org [mailto:linux-bluetooth-
> >> owner@vger.kernel.org] On Behalf Of Luiz Augusto von Dentz
> >> Sent: Monday, December 01, 2014 7:30 PM
> >> To: Gowtham Anandha Babu
> >> Cc: linux-bluetooth@vger.kernel.org
> >> Subject: Re: [PATCH BlueZ 8/8] obexd/client: Add supported_features
> >> support
> >>
> >> Hi Gowtham,
> >>
> >> On Mon, Dec 1, 2014 at 3:34 PM, Luiz Augusto von Dentz
> >> <luiz.dentz@gmail.com> wrote:
> >> > Hi Gowtham,
> >> >
> >> > On Mon, Dec 1, 2014 at 3:31 PM, Gowtham Anandha Babu
> >> > <gowtham.ab@samsung.com> wrote:
> >> >> Hi Luiz,
> >> >>
> >> >>> -----Original Message-----
> >> >>> From: linux-bluetooth-owner@vger.kernel.org
> >> >>> [mailto:linux-bluetooth- owner@vger.kernel.org] On Behalf Of Luiz
> >> >>> Augusto von Dentz
> >> >>> Sent: Monday, December 01, 2014 6:22 PM
> >> >>> To: Gowtham Anandha Babu
> >> >>> Cc: linux-bluetooth@vger.kernel.org
> >> >>> Subject: Re: [PATCH BlueZ 8/8] obexd/client: Add
> >> >>> supported_features support
> >> >>>
> >> >>> Hi Gowtham,
> >> >>>
> >> >>> On Mon, Dec 1, 2014 at 2:17 PM, Gowtham Anandha Babu
> >> >>> <gowtham.ab@samsung.com> wrote:
> >> >>> > Hi Luiz,
> >> >>> >
> >> >>> >> -----Original Message-----
> >> >>> >> From: linux-bluetooth-owner@vger.kernel.org
> >> >>> >> [mailto:linux-bluetooth- owner@vger.kernel.org] On Behalf Of
> >> >>> >> Luiz Augusto von Dentz
> >> >>> >> Sent: Monday, December 01, 2014 2:17 PM
> >> >>> >> To: linux-bluetooth@vger.kernel.org
> >> >>> >> Subject: [PATCH BlueZ 8/8] obexd/client: Add
> >> >>> >> supported_features support
> >> >>> >>
> >> >>> >> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> >> >>> >>
> >> >>> >> This adds supported_features support to obc_driver so driver
> >> >>> >> can provide this information when connecting.
> >> >>> >>
> >> >>> >> This is required by PBAP 1.2 (page 48):
> >> >>> >>
> >> >>> >>   'Mandatory if the PSE advertises a PbapSupportedFeatures
> >> >>> >> attribute
> >> in
> >> >>> >>    its SDP record, else excluded.'
> >> >>> >> ---
> >> >>> >>  obexd/client/driver.h  |  1 +
> >> >>> >>  obexd/client/pbap.c    | 36
> >> >>> ++++++++++++++++++++++++++++++++++++
> >> >>> >>  obexd/client/session.c | 25 ++++++++++++++++++++++++-
> >> >>> >>  3 files changed, 61 insertions(+), 1 deletion(-)
> >> >>> >>
> >> >>> >> diff --git a/obexd/client/driver.h b/obexd/client/driver.h
> >> >>> >> index
> >> >>> >> f1c0646..0112219 100644
> >> >>> >> --- a/obexd/client/driver.h
> >> >>> >> +++ b/obexd/client/driver.h
> >> >>> >> @@ -26,6 +26,7 @@ struct obc_driver {
> >> >>> >>       const char *uuid;
> >> >>> >>       void *target;
> >> >>> >>       gsize target_len;
> >> >>> >> +     void *(*supported_features) (struct obc_session
> >> >>> >> + *session);
> >> >>> >>       int (*probe) (struct obc_session *session);
> >> >>> >>       void (*remove) (struct obc_session *session);  }; diff
> >> >>> >> --git a/obexd/client/pbap.c b/obexd/client/pbap.c index
> >> >>> >> 812a7fb..57632b4
> >> >>> >> 100644
> >> >>> >> --- a/obexd/client/pbap.c
> >> >>> >> +++ b/obexd/client/pbap.c
> >> >>> >> @@ -76,6 +76,7 @@
> >> >>> >>  #define PRIMARY_COUNTER_TAG  0X0A
> >> >>> >>  #define SECONDARY_COUNTER_TAG        0X0B
> >> >>> >>  #define DATABASEID_TAG               0X0D
> >> >>> >> +#define SUPPORTED_FEATURES_TAG  0x10
> >> >>> >>
> >> >>> >>  #define DOWNLOAD_FEATURE     0x00000001
> >> >>> >>  #define BROWSE_FEATURE               0x00000002
> >> >>> >> @@ -1230,6 +1231,40 @@ static void parse_service_record(struct
> >> >>> >> pbap_data
> >> >>> >> *pbap)
> >> >>> >>
> >> >>> >>  }
> >> >>> >>
> >> >>> >> +static void *pbap_supported_features(struct obc_session
> >> >>> >> +*session)
> >> {
> >> >>> >> +     const void *data;
> >> >>> >> +     uint16_t version;
> >> >>> >> +
> >> >>> >> +     /* Version */
> >> >>> >> +     data = obc_session_get_attribute(session,
> >> >>> >> SDP_ATTR_PFILE_DESC_LIST);
> >> >>> >> +     if (!data)
> >> >>> >> +             return NULL;
> >> >>> >> +
> >> >>> >> +     version = GPOINTER_TO_UINT(data);
> >> >>> >> +
> >> >>> >> +     if (version < 0x0102)
> >> >>> >> +             return NULL;
> >> >>> >> +
> >> >>> >> +     /* Supported Feature Bits */
> >> >>> >> +     data = obc_session_get_attribute(session,
> >> >>> >> +
> >> >>> >>       SDP_ATTR_PBAP_SUPPORTED_FEATURES);
> >> >>> >> +     if (!data)
> >> >>> >> +             return NULL;
> >> >>> >> +
> >> >>> >> +     return g_obex_apparam_set_uint32(NULL,
> >> >>> >> SUPPORTED_FEATURES_TAG,
> >> >>> >> +                                             DOWNLOAD_FEATURE |
> >> >>> >> +                                             BROWSE_FEATURE |
> >> >>> >> +
> >> >>> >> + DATABASEID_FEATURE |
> >> >>> >> +
> >> >>> >> + FOLDER_VERSION_FEATURE
> >> >>> >> |
> >> >>> >> +
> >> >>> >> + VCARD_SELECTING_FEATURE
> >> >>> >> |
> >> >>> >> +
> >> >>> >> + ENHANCED_CALLS_FEATURE
> >> >>> >> |
> >> >>> >> +                                             UCI_FEATURE |
> >> >>> >> +                                             UID_FEATURE |
> >> >>> >> +
> >> >>> >> + REFERENCING_FEATURE |
> >> >>> >> +
> >> >>> >> +DEFAULT_IMAGE_FEATURE); }
> >> >>> >> +
> >> >>> >>  static int pbap_probe(struct obc_session *session)  {
> >> >>> >>       struct pbap_data *pbap;
> >> >>> >> @@ -1274,6 +1309,7 @@ static struct obc_driver pbap = {
> >> >>> >>       .uuid = PBAP_UUID,
> >> >>> >>       .target = OBEX_PBAP_UUID,
> >> >>> >>       .target_len = OBEX_PBAP_UUID_LEN,
> >> >>> >> +     .supported_features = pbap_supported_features,
> >> >>> >>       .probe = pbap_probe,
> >> >>> >>       .remove = pbap_remove
> >> >>> >>  };
> >> >>> >> diff --git a/obexd/client/session.c b/obexd/client/session.c
> >> >>> >> index 9bba6c6..d2ae4fd 100644
> >> >>> >> --- a/obexd/client/session.c
> >> >>> >> +++ b/obexd/client/session.c
> >> >>> >> @@ -345,6 +345,7 @@ static void transport_func(GIOChannel *io,
> >> >>> >> GError *err, gpointer user_data)
> >> >>> >>       struct obc_driver *driver = session->driver;
> >> >>> >>       struct obc_transport *transport = session->transport;
> >> >>> >>       GObex *obex;
> >> >>> >> +     GObexApparam *apparam;
> >> >>> >>       GObexTransportType type;
> >> >>> >>       int tx_mtu = -1;
> >> >>> >>       int rx_mtu = -1;
> >> >>> >> @@ -370,7 +371,29 @@ static void transport_func(GIOChannel
> >> >>> >> *io, GError *err, gpointer user_data)
> >> >>> >>
> >> >>> >>       g_io_channel_set_close_on_unref(io, TRUE);
> >> >>> >>
> >> >>> >> -     if (driver->target != NULL)
> >> >>> >> +     apparam = NULL;
> >> >>> >> +
> >> >>> >> +     if (driver->supported_features)
> >> >>> >> +             apparam = driver->supported_features(session);
> >> >>> >> +
> >> >>> >> +     if (apparam) {
> >> >>> >> +             uint8_t buf[1024];
> >> >>> >> +             ssize_t len;
> >> >>> >> +
> >> >>> >> +             len = g_obex_apparam_encode(apparam, buf,
> sizeof(buf));
> >> >>> >> +             if (driver->target)
> >> >>> >> +                     g_obex_connect(obex, connect_cb, callback, &err,
> >> >>> >> +                                     G_OBEX_HDR_TARGET,
> >> >>> >> +                                     driver->target, driver->target_len,
> >> >>> >> +                                     G_OBEX_HDR_APPARAM,
> >> >>> >> +                                     buf, len,
> >> >>> >> +                                     G_OBEX_HDR_INVALID);
> >> >>> >> +             else
> >> >>> >> +                     g_obex_connect(obex, connect_cb, callback, &err,
> >> >>> >> +                                     G_OBEX_HDR_APPARAM, buf, len,
> >> >>> >> +                                     G_OBEX_HDR_INVALID);
> >> >>> >> +             g_obex_apparam_free(apparam);
> >> >>> >> +     } else if (driver->target)
> >> >>> >>               g_obex_connect(obex, connect_cb, callback, &err,
> >> >>> >>                       G_OBEX_HDR_TARGET, driver->target,
> >> >>> >> driver-
> >> >>> >> >target_len,
> >> >>> >>                       G_OBEX_HDR_INVALID);
> >> >>> >> --
> >> >>> >> 1.9.3
> >> >>> >>
> >> >>> >> --
> >> >>> >> To unsubscribe from this list: send the line "unsubscribe
> >> >>> >> linux-
> >> bluetooth"
> >> >>> > in
> >> >>> >> the body of a message to majordomo@vger.kernel.org More
> >> majordomo
> >> >>> >> info at  http://vger.kernel.org/majordomo-info.html
> >> >>> >
> >> >>> >
> >> >>> >
> >> >>> > I applied this patch locally and tested with PTS.
> >> >>> > The PTS test case: TP/SSM/BV-09-C [PCE Shares
> >> PbapSupportedFeature
> >> >>> > bits] is failing.
> >> >>> > According to PBAP V1.2 Spec - Section 6.4 - OBEX Connect
> >> >>> > request format, the PbapSupportedFeatures are shared during
> >> >>> > obex connect(after applying the this patch).
> >> >>> > Still the above test case is failing.
> >> >>> > Am I mapping anything wrong?
> >> >>>
> >> >>> Have you applied the full set? Maybe the PCE record needs
> >> >>> updating as well, but normally it is not mandatory.
> >> >>>
> >> >>>
> >> >>> --
> >> >>> Luiz Augusto von Dentz
> >> >>> --
> >> >>> To unsubscribe from this list: send the line "unsubscribe
> >> >>> linux-bluetooth" in the body of a message to
> >> >>> majordomo@vger.kernel.org More majordomo info at
> >> >>> http://vger.kernel.org/majordomo-info.html
> >> >>
> >> >>
> >> >> Yes, I applied the complete set and tested it. Still that TC is failing.
> >> >> Just want to know how it is failing, because I tried
> >> >> 1) Applying this patch set - not passing
> >> >> 2) Added below attribute in the src/profile PCE record at the end
> >> >> as below
> >> - not passing
> >> >>                <attribute id=\"0x0317\">
> >> >>                         <uint32 value=\"0x00000003\"/>
> >> >>                 </attribute>
> >> >>
> >> >> May be it’s a PTS Issue. Anyway it's not mandatory.
> >> >
> >> > I will try it as well, btw does the logs indicate anything useful?
> >>
> >> Btw, what TC is failing?
> >>
> >
> > The PTS test case: TP/SSM/BV-09-C [PCE Shares PbapSupportedFeature
> bits] is failing.
> > Test objective is to verify that the PCE can share its
> PbapSupportedFeatures bits with a server.
> >
> > Steps I followed:
> > 1) Ran Bluetoothd
> > 2) Ran obexd
> > 3) Initiated the above mentioned TC in PTS tool.
> > 4) ./pbap-client 00:1B:DC:07:33:4E >> err.txt
> >
> > Bluetoothd logs:
> >
> > bluetoothd[2740]: src/adapter.c:connected_callback() hci0 device
> > 00:1B:DC:07:33:4E connected eir_len 21
> > bluetoothd[2740]: src/adapter.c:dev_disconnected() Device
> > 00:1B:DC:07:33:4E disconnected, reason 2
> > bluetoothd[2740]: src/adapter.c:adapter_remove_connection()
> > bluetoothd[2740]: plugins/policy.c:disconnect_cb() reason 2
> > bluetoothd[2740]: src/adapter.c:bonding_attempt_complete() hci0 bdaddr
> > 00:1B:DC:07:33:4E type 0 status 0xe
> > bluetoothd[2740]: src/device.c:device_bonding_complete() bonding (nil)
> > status 0x0e
> > bluetoothd[2740]: src/device.c:device_bonding_failed() status 14
> > bluetoothd[2740]: src/adapter.c:resume_discovery()
> >
> > Obexd logs: Nothing while executing the TC
> 
> It is probably better if you can use obexctl> connect <address> pbap, also it
> would be good to have the HCI traces to be able to detect if PTS is really
> setting the record properly, for example if it is not advertising 0x0102 in the
> record we will not attempt to send the parameters.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
> the body of a message to majordomo@vger.kernel.org More majordomo
> info at  http://vger.kernel.org/majordomo-info.html

After changing the "PBAP Role:  as 1.2 " in PICS, it is passing.

HCI trace: 

HCI sniffer - Bluetooth packet analyzer ver 5.25
device: hci0 snap_len: 1500 filter: 0xffffffffffffffff
< HCI Command: Create Connection (0x01|0x0005) plen 13
    bdaddr 00:1B:DC:07:33:4E ptype 0xcc18 rswitch 0x01 clkoffset 0x0000
    Packet type: DM1 DM3 DM5 DH1 DH3 DH5 
> HCI Event: Command Status (0x0f) plen 4
    Create Connection (0x01|0x0005) status 0x00 ncmd 1
> HCI Event: Connect Complete (0x03) plen 11
    status 0x00 handle 76 bdaddr 00:1B:DC:07:33:4E type ACL encrypt 0x00
< HCI Command: Read Remote Supported Features (0x01|0x001b) plen 2
    handle 76
> HCI Event: Command Status (0x0f) plen 4
    Read Remote Supported Features (0x01|0x001b) status 0x00 ncmd 0
> HCI Event: Page Scan Repetition Mode Change (0x20) plen 7
    bdaddr 00:1B:DC:07:33:4E mode 1
> HCI Event: Max Slots Change (0x1b) plen 3
    handle 76 slots 5
> HCI Event: Command Status (0x0f) plen 4
    Unknown (0x00|0x0000) status 0x00 ncmd 1
> HCI Event: Read Remote Supported Features (0x0b) plen 11
    status 0x00 handle 76
    Features: 0xff 0xff 0x8f 0x7e 0xd8 0x1f 0x5b 0x87
< HCI Command: Read Remote Extended Features (0x01|0x001c) plen 3
    handle 76 page 1
> HCI Event: Command Status (0x0f) plen 4
    Read Remote Extended Features (0x01|0x001c) status 0x00 ncmd 1
> HCI Event: Read Remote Extended Features (0x23) plen 13
    status 0x00 handle 76 page 1 max 1
    Features: 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00
< HCI Command: Remote Name Request (0x01|0x0019) plen 10
    bdaddr 00:1B:DC:07:33:4E mode 2 clkoffset 0x0000
< ACL data: handle 76 flags 0x00 dlen 10
    L2CAP(s): Info req: type 2
> HCI Event: Command Status (0x0f) plen 4
    Remote Name Request (0x01|0x0019) status 0x00 ncmd 1
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 76 packets 1
> ACL data: handle 76 flags 0x02 dlen 16
    L2CAP(s): Info rsp: type 2 result 0
      Extended feature mask 0x0038
        Enhanced Retransmission mode
        Streaming mode
        FCS Option
< ACL data: handle 76 flags 0x00 dlen 12
    L2CAP(s): Connect req: psm 1 scid 0x0040
> HCI Event: Remote Name Req Complete (0x07) plen 255
    status 0x00 bdaddr 00:1B:DC:07:33:4E name 'PTS-PBAP-GOWTHAM-AB'
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 76 packets 1
> ACL data: handle 76 flags 0x02 dlen 16
    L2CAP(s): Connect rsp: dcid 0x0040 scid 0x0040 result 1 status 0
      Connection pending - No futher information available
> ACL data: handle 76 flags 0x02 dlen 10
    L2CAP(s): Info req: type 2
< ACL data: handle 76 flags 0x00 dlen 16
    L2CAP(s): Info rsp: type 2 result 0
      Extended feature mask 0x02b8
        Enhanced Retransmission mode
        Streaming mode
        FCS Option
        Fixed Channels
        Unicast Connectless Data Reception
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 76 packets 1
> ACL data: handle 76 flags 0x02 dlen 16
    L2CAP(s): Connect rsp: dcid 0x0040 scid 0x0040 result 0 status 0
      Connection successful
< ACL data: handle 76 flags 0x00 dlen 23
    L2CAP(s): Config req: dcid 0x0040 flags 0x00 clen 11
      RFC 0x00 (Basic) 
> ACL data: handle 76 flags 0x02 dlen 16
    L2CAP(s): Config req: dcid 0x0040 flags 0x00 clen 4
      MTU 1024 
< ACL data: handle 76 flags 0x00 dlen 18
    L2CAP(s): Config rsp: scid 0x0040 flags 0x00 result 0 clen 4
      MTU 1024 
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 76 packets 1
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 76 packets 1
> ACL data: handle 76 flags 0x02 dlen 18
    L2CAP(s): Config rsp: scid 0x0040 flags 0x00 result 0 clen 4
      MTU 672 
< ACL data: handle 76 flags 0x00 dlen 38
    L2CAP(d): cid 0x0040 len 34 [psm 1]
        SDP SSA Req: tid 0x0 len 0x1d
          pat uuid-128 0000112f-0000-1000-8000-00805f9b34fb
          max 65535
          aid(s) 0x0000 - 0xffff
          cont 00
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 76 packets 1
> ACL data: handle 76 flags 0x02 dlen 115
    L2CAP(d): cid 0x0040 len 111 [psm 1]
        SDP SSA Rsp: tid 0x0 len 0x6a
          count 103
          record #0
              aid 0x0000 (SrvRecHndl)
                 uint 0x1000b
              aid 0x0001 (SrvClassIDList)
                 < uuid-16 0x112f (PBAP PSE) >
              aid 0x0004 (ProtocolDescList)
                 < < uuid-16 0x0100 (L2CAP) > <
                 uuid-16 0x0003 (RFCOMM) uint 0x2 > <
                 uuid-16 0x0008 (OBEX) > >
              aid 0x0009 (BTProfileDescList)
                 < < uuid-16 0x1130 (PBAP) uint 0x102 > >
              aid 0x0100 (SrvName)
                 str 50 68 6f 6e 65 62 6f 6f 6b 0a 41 63 63 65 73 73 20 50 53 45 20 50 54 53
              aid 0x0200 (VersionNumList)
                 uint 0x1005
              aid 0x0314 (SuppRepositories)
                 uint 0xf
              aid 0x0317 (unknown)
                 uint 0x3ff
          cont 00
< HCI Command: Authentication Requested (0x01|0x0011) plen 2
    handle 76
< ACL data: handle 76 flags 0x00 dlen 12
    L2CAP(s): Disconn req: dcid 0x0040 scid 0x0040
> HCI Event: Command Status (0x0f) plen 4
    Authentication Requested (0x01|0x0011) status 0x00 ncmd 1
> HCI Event: Link Key Request (0x17) plen 6
    bdaddr 00:1B:DC:07:33:4E
< HCI Command: Link Key Request Reply (0x01|0x000b) plen 22
    bdaddr 00:1B:DC:07:33:4E key E07D49C59D7D98B121A2CFCD41E05458
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 76 packets 1
> HCI Event: Command Complete (0x0e) plen 10
    Link Key Request Reply (0x01|0x000b) ncmd 1
    status 0x00 bdaddr 00:1B:DC:07:33:4E
> ACL data: handle 76 flags 0x02 dlen 12
    L2CAP(s): Disconn rsp: dcid 0x0040 scid 0x0040
> HCI Event: Auth Complete (0x06) plen 3
    status 0x00 handle 76
< HCI Command: Set Connection Encryption (0x01|0x0013) plen 3
    handle 76 encrypt 0x01
> HCI Event: Command Status (0x0f) plen 4
    Set Connection Encryption (0x01|0x0013) status 0x00 ncmd 1
> HCI Event: Encrypt Change (0x08) plen 4
    status 0x00 handle 76 encrypt 0x01
< ACL data: handle 76 flags 0x00 dlen 12
    L2CAP(s): Connect req: psm 4101 scid 0x0041
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 76 packets 1
> ACL data: handle 76 flags 0x02 dlen 16
    L2CAP(s): Connect rsp: dcid 0x0040 scid 0x0041 result 1 status 0
      Connection pending - No futher information available
> ACL data: handle 76 flags 0x02 dlen 16
    L2CAP(s): Connect rsp: dcid 0x0040 scid 0x0041 result 0 status 0
      Connection successful
< ACL data: handle 76 flags 0x00 dlen 27
    L2CAP(s): Config req: dcid 0x0040 flags 0x00 clen 15
      MTU 32767 
      RFC 0x03 (Enhanced Retransmission, TxWin 63, MaxTx 3, RTo 2000, MTo 12000, MPS 298) 
> ACL data: handle 76 flags 0x02 dlen 27
    L2CAP(s): Config req: dcid 0x0041 flags 0x00 clen 15
      MTU 4096 
      RFC 0x03 (Enhanced Retransmission, TxWin 8, MaxTx 16, RTo 0, MTo 0, MPS 1691) 
< ACL data: handle 76 flags 0x00 dlen 29
    L2CAP(s): Config rsp: scid 0x0040 flags 0x00 result 0 clen 15
      MTU 4096 
      RFC 0x03 (Enhanced Retransmission, TxWin 8, MaxTx 16, RTo 2000, MTo 12000, MPS 298) 
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 76 packets 1
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 76 packets 1
> ACL data: handle 76 flags 0x02 dlen 29
    L2CAP(s): Config rsp: scid 0x0041 flags 0x00 result 0 clen 15
      MTU 4096 
      RFC 0x03 (Enhanced Retransmission, TxWin 24, MaxTx 0, RTo 256, MTo 256, MPS 298) 
< ACL data: handle 76 flags 0x00 dlen 43
    L2CAP(d): cid 0x0040 len 39 ctrl 0x0000 fcs 0x1dc9 [psm 4101]
      I-frame: Unsegmented TxSeq 0 ReqSeq 0
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 76 packets 1
> ACL data: handle 76 flags 0x02 dlen 8
    L2CAP(d): cid 0x0041 len 4 ctrl 0x0101 fcs 0xe8d5 [psm 4101]
      S-frame: Receiver Ready (RR) ReqSeq 1
> ACL data: handle 76 flags 0x02 dlen 39
    L2CAP(d): cid 0x0041 len 35 ctrl 0x0100 fcs 0x1c79 [psm 4101]
      I-frame: Unsegmented TxSeq 0 ReqSeq 1
< ACL data: handle 76 flags 0x00 dlen 8
    L2CAP(d): cid 0x0040 len 4 ctrl 0x0101 fcs 0x14d4 [psm 4101]
      S-frame: Receiver Ready (RR) ReqSeq 1
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 76 packets 1
> ACL data: handle 76 flags 0x02 dlen 12
    L2CAP(s): Disconn req: dcid 0x0041 scid 0x0040
< ACL data: handle 76 flags 0x00 dlen 12
    L2CAP(s): Disconn rsp: dcid 0x0041 scid 0x0040
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 76 packets 1
> HCI Event: Disconn Complete (0x05) plen 4
    status 0x00 handle 76 reason 0x13
    Reason: Remote User Terminated Connection

PTS Output:

Test case : TC_PCE_SSM_BV_09_C started
	- SPP Service successfully registered
	- SDP Service record: 'HFP-AG Service Record' successfully registered
	- SDP Service record successfully registered
	- PBAP successfully initialized
	- MTC: IUT successfully sent OBEX CONNECT request.
	- MTC: Extract Support Feature Successful
	- MTC: SDP Record contained Supported Feature
	- MTC: No more incoming message.
	- CM_PTC_EXIT
	- PBAP : Test case ended.
Final Verdict : Pass

Thanks.

Regards,
Gowtham Anandha Babu



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

* Re: [PATCH BlueZ 8/8] obexd/client: Add supported_features support
  2014-12-02  6:37                 ` Gowtham Anandha Babu
@ 2014-12-02  9:32                   ` Luiz Augusto von Dentz
  0 siblings, 0 replies; 17+ messages in thread
From: Luiz Augusto von Dentz @ 2014-12-02  9:32 UTC (permalink / raw)
  To: Gowtham Anandha Babu; +Cc: linux-bluetooth

Hi Gowtham,

On Tue, Dec 2, 2014 at 8:37 AM, Gowtham Anandha Babu
<gowtham.ab@samsung.com> wrote:
> Hi Luiz,
>
>> -----Original Message-----
>> From: linux-bluetooth-owner@vger.kernel.org [mailto:linux-bluetooth-
>> owner@vger.kernel.org] On Behalf Of Luiz Augusto von Dentz
>> Sent: Monday, December 01, 2014 8:12 PM
>> To: Gowtham Anandha Babu
>> Cc: linux-bluetooth@vger.kernel.org
>> Subject: Re: [PATCH BlueZ 8/8] obexd/client: Add supported_features
>> support
>>
>> Hi Gowtham,
>>
>> On Mon, Dec 1, 2014 at 4:19 PM, Gowtham Anandha Babu
>> <gowtham.ab@samsung.com> wrote:
>> > Hi Luiz,
>> >
>> >> -----Original Message-----
>> >> From: linux-bluetooth-owner@vger.kernel.org [mailto:linux-bluetooth-
>> >> owner@vger.kernel.org] On Behalf Of Luiz Augusto von Dentz
>> >> Sent: Monday, December 01, 2014 7:30 PM
>> >> To: Gowtham Anandha Babu
>> >> Cc: linux-bluetooth@vger.kernel.org
>> >> Subject: Re: [PATCH BlueZ 8/8] obexd/client: Add supported_features
>> >> support
>> >>
>> >> Hi Gowtham,
>> >>
>> >> On Mon, Dec 1, 2014 at 3:34 PM, Luiz Augusto von Dentz
>> >> <luiz.dentz@gmail.com> wrote:
>> >> > Hi Gowtham,
>> >> >
>> >> > On Mon, Dec 1, 2014 at 3:31 PM, Gowtham Anandha Babu
>> >> > <gowtham.ab@samsung.com> wrote:
>> >> >> Hi Luiz,
>> >> >>
>> >> >>> -----Original Message-----
>> >> >>> From: linux-bluetooth-owner@vger.kernel.org
>> >> >>> [mailto:linux-bluetooth- owner@vger.kernel.org] On Behalf Of Luiz
>> >> >>> Augusto von Dentz
>> >> >>> Sent: Monday, December 01, 2014 6:22 PM
>> >> >>> To: Gowtham Anandha Babu
>> >> >>> Cc: linux-bluetooth@vger.kernel.org
>> >> >>> Subject: Re: [PATCH BlueZ 8/8] obexd/client: Add
>> >> >>> supported_features support
>> >> >>>
>> >> >>> Hi Gowtham,
>> >> >>>
>> >> >>> On Mon, Dec 1, 2014 at 2:17 PM, Gowtham Anandha Babu
>> >> >>> <gowtham.ab@samsung.com> wrote:
>> >> >>> > Hi Luiz,
>> >> >>> >
>> >> >>> >> -----Original Message-----
>> >> >>> >> From: linux-bluetooth-owner@vger.kernel.org
>> >> >>> >> [mailto:linux-bluetooth- owner@vger.kernel.org] On Behalf Of
>> >> >>> >> Luiz Augusto von Dentz
>> >> >>> >> Sent: Monday, December 01, 2014 2:17 PM
>> >> >>> >> To: linux-bluetooth@vger.kernel.org
>> >> >>> >> Subject: [PATCH BlueZ 8/8] obexd/client: Add
>> >> >>> >> supported_features support
>> >> >>> >>
>> >> >>> >> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
>> >> >>> >>
>> >> >>> >> This adds supported_features support to obc_driver so driver
>> >> >>> >> can provide this information when connecting.
>> >> >>> >>
>> >> >>> >> This is required by PBAP 1.2 (page 48):
>> >> >>> >>
>> >> >>> >>   'Mandatory if the PSE advertises a PbapSupportedFeatures
>> >> >>> >> attribute
>> >> in
>> >> >>> >>    its SDP record, else excluded.'
>> >> >>> >> ---
>> >> >>> >>  obexd/client/driver.h  |  1 +
>> >> >>> >>  obexd/client/pbap.c    | 36
>> >> >>> ++++++++++++++++++++++++++++++++++++
>> >> >>> >>  obexd/client/session.c | 25 ++++++++++++++++++++++++-
>> >> >>> >>  3 files changed, 61 insertions(+), 1 deletion(-)
>> >> >>> >>
>> >> >>> >> diff --git a/obexd/client/driver.h b/obexd/client/driver.h
>> >> >>> >> index
>> >> >>> >> f1c0646..0112219 100644
>> >> >>> >> --- a/obexd/client/driver.h
>> >> >>> >> +++ b/obexd/client/driver.h
>> >> >>> >> @@ -26,6 +26,7 @@ struct obc_driver {
>> >> >>> >>       const char *uuid;
>> >> >>> >>       void *target;
>> >> >>> >>       gsize target_len;
>> >> >>> >> +     void *(*supported_features) (struct obc_session
>> >> >>> >> + *session);
>> >> >>> >>       int (*probe) (struct obc_session *session);
>> >> >>> >>       void (*remove) (struct obc_session *session);  }; diff
>> >> >>> >> --git a/obexd/client/pbap.c b/obexd/client/pbap.c index
>> >> >>> >> 812a7fb..57632b4
>> >> >>> >> 100644
>> >> >>> >> --- a/obexd/client/pbap.c
>> >> >>> >> +++ b/obexd/client/pbap.c
>> >> >>> >> @@ -76,6 +76,7 @@
>> >> >>> >>  #define PRIMARY_COUNTER_TAG  0X0A
>> >> >>> >>  #define SECONDARY_COUNTER_TAG        0X0B
>> >> >>> >>  #define DATABASEID_TAG               0X0D
>> >> >>> >> +#define SUPPORTED_FEATURES_TAG  0x10
>> >> >>> >>
>> >> >>> >>  #define DOWNLOAD_FEATURE     0x00000001
>> >> >>> >>  #define BROWSE_FEATURE               0x00000002
>> >> >>> >> @@ -1230,6 +1231,40 @@ static void parse_service_record(struct
>> >> >>> >> pbap_data
>> >> >>> >> *pbap)
>> >> >>> >>
>> >> >>> >>  }
>> >> >>> >>
>> >> >>> >> +static void *pbap_supported_features(struct obc_session
>> >> >>> >> +*session)
>> >> {
>> >> >>> >> +     const void *data;
>> >> >>> >> +     uint16_t version;
>> >> >>> >> +
>> >> >>> >> +     /* Version */
>> >> >>> >> +     data = obc_session_get_attribute(session,
>> >> >>> >> SDP_ATTR_PFILE_DESC_LIST);
>> >> >>> >> +     if (!data)
>> >> >>> >> +             return NULL;
>> >> >>> >> +
>> >> >>> >> +     version = GPOINTER_TO_UINT(data);
>> >> >>> >> +
>> >> >>> >> +     if (version < 0x0102)
>> >> >>> >> +             return NULL;
>> >> >>> >> +
>> >> >>> >> +     /* Supported Feature Bits */
>> >> >>> >> +     data = obc_session_get_attribute(session,
>> >> >>> >> +
>> >> >>> >>       SDP_ATTR_PBAP_SUPPORTED_FEATURES);
>> >> >>> >> +     if (!data)
>> >> >>> >> +             return NULL;
>> >> >>> >> +
>> >> >>> >> +     return g_obex_apparam_set_uint32(NULL,
>> >> >>> >> SUPPORTED_FEATURES_TAG,
>> >> >>> >> +                                             DOWNLOAD_FEATURE |
>> >> >>> >> +                                             BROWSE_FEATURE |
>> >> >>> >> +
>> >> >>> >> + DATABASEID_FEATURE |
>> >> >>> >> +
>> >> >>> >> + FOLDER_VERSION_FEATURE
>> >> >>> >> |
>> >> >>> >> +
>> >> >>> >> + VCARD_SELECTING_FEATURE
>> >> >>> >> |
>> >> >>> >> +
>> >> >>> >> + ENHANCED_CALLS_FEATURE
>> >> >>> >> |
>> >> >>> >> +                                             UCI_FEATURE |
>> >> >>> >> +                                             UID_FEATURE |
>> >> >>> >> +
>> >> >>> >> + REFERENCING_FEATURE |
>> >> >>> >> +
>> >> >>> >> +DEFAULT_IMAGE_FEATURE); }
>> >> >>> >> +
>> >> >>> >>  static int pbap_probe(struct obc_session *session)  {
>> >> >>> >>       struct pbap_data *pbap;
>> >> >>> >> @@ -1274,6 +1309,7 @@ static struct obc_driver pbap = {
>> >> >>> >>       .uuid = PBAP_UUID,
>> >> >>> >>       .target = OBEX_PBAP_UUID,
>> >> >>> >>       .target_len = OBEX_PBAP_UUID_LEN,
>> >> >>> >> +     .supported_features = pbap_supported_features,
>> >> >>> >>       .probe = pbap_probe,
>> >> >>> >>       .remove = pbap_remove
>> >> >>> >>  };
>> >> >>> >> diff --git a/obexd/client/session.c b/obexd/client/session.c
>> >> >>> >> index 9bba6c6..d2ae4fd 100644
>> >> >>> >> --- a/obexd/client/session.c
>> >> >>> >> +++ b/obexd/client/session.c
>> >> >>> >> @@ -345,6 +345,7 @@ static void transport_func(GIOChannel *io,
>> >> >>> >> GError *err, gpointer user_data)
>> >> >>> >>       struct obc_driver *driver = session->driver;
>> >> >>> >>       struct obc_transport *transport = session->transport;
>> >> >>> >>       GObex *obex;
>> >> >>> >> +     GObexApparam *apparam;
>> >> >>> >>       GObexTransportType type;
>> >> >>> >>       int tx_mtu = -1;
>> >> >>> >>       int rx_mtu = -1;
>> >> >>> >> @@ -370,7 +371,29 @@ static void transport_func(GIOChannel
>> >> >>> >> *io, GError *err, gpointer user_data)
>> >> >>> >>
>> >> >>> >>       g_io_channel_set_close_on_unref(io, TRUE);
>> >> >>> >>
>> >> >>> >> -     if (driver->target != NULL)
>> >> >>> >> +     apparam = NULL;
>> >> >>> >> +
>> >> >>> >> +     if (driver->supported_features)
>> >> >>> >> +             apparam = driver->supported_features(session);
>> >> >>> >> +
>> >> >>> >> +     if (apparam) {
>> >> >>> >> +             uint8_t buf[1024];
>> >> >>> >> +             ssize_t len;
>> >> >>> >> +
>> >> >>> >> +             len = g_obex_apparam_encode(apparam, buf,
>> sizeof(buf));
>> >> >>> >> +             if (driver->target)
>> >> >>> >> +                     g_obex_connect(obex, connect_cb, callback, &err,
>> >> >>> >> +                                     G_OBEX_HDR_TARGET,
>> >> >>> >> +                                     driver->target, driver->target_len,
>> >> >>> >> +                                     G_OBEX_HDR_APPARAM,
>> >> >>> >> +                                     buf, len,
>> >> >>> >> +                                     G_OBEX_HDR_INVALID);
>> >> >>> >> +             else
>> >> >>> >> +                     g_obex_connect(obex, connect_cb, callback, &err,
>> >> >>> >> +                                     G_OBEX_HDR_APPARAM, buf, len,
>> >> >>> >> +                                     G_OBEX_HDR_INVALID);
>> >> >>> >> +             g_obex_apparam_free(apparam);
>> >> >>> >> +     } else if (driver->target)
>> >> >>> >>               g_obex_connect(obex, connect_cb, callback, &err,
>> >> >>> >>                       G_OBEX_HDR_TARGET, driver->target,
>> >> >>> >> driver-
>> >> >>> >> >target_len,
>> >> >>> >>                       G_OBEX_HDR_INVALID);
>> >> >>> >> --
>> >> >>> >> 1.9.3
>> >> >>> >>
>> >> >>> >> --
>> >> >>> >> To unsubscribe from this list: send the line "unsubscribe
>> >> >>> >> linux-
>> >> bluetooth"
>> >> >>> > in
>> >> >>> >> the body of a message to majordomo@vger.kernel.org More
>> >> majordomo
>> >> >>> >> info at  http://vger.kernel.org/majordomo-info.html
>> >> >>> >
>> >> >>> >
>> >> >>> >
>> >> >>> > I applied this patch locally and tested with PTS.
>> >> >>> > The PTS test case: TP/SSM/BV-09-C [PCE Shares
>> >> PbapSupportedFeature
>> >> >>> > bits] is failing.
>> >> >>> > According to PBAP V1.2 Spec - Section 6.4 - OBEX Connect
>> >> >>> > request format, the PbapSupportedFeatures are shared during
>> >> >>> > obex connect(after applying the this patch).
>> >> >>> > Still the above test case is failing.
>> >> >>> > Am I mapping anything wrong?
>> >> >>>
>> >> >>> Have you applied the full set? Maybe the PCE record needs
>> >> >>> updating as well, but normally it is not mandatory.
>> >> >>>
>> >> >>>
>> >> >>> --
>> >> >>> Luiz Augusto von Dentz
>> >> >>> --
>> >> >>> To unsubscribe from this list: send the line "unsubscribe
>> >> >>> linux-bluetooth" in the body of a message to
>> >> >>> majordomo@vger.kernel.org More majordomo info at
>> >> >>> http://vger.kernel.org/majordomo-info.html
>> >> >>
>> >> >>
>> >> >> Yes, I applied the complete set and tested it. Still that TC is failing.
>> >> >> Just want to know how it is failing, because I tried
>> >> >> 1) Applying this patch set - not passing
>> >> >> 2) Added below attribute in the src/profile PCE record at the end
>> >> >> as below
>> >> - not passing
>> >> >>                <attribute id=\"0x0317\">
>> >> >>                         <uint32 value=\"0x00000003\"/>
>> >> >>                 </attribute>
>> >> >>
>> >> >> May be it’s a PTS Issue. Anyway it's not mandatory.
>> >> >
>> >> > I will try it as well, btw does the logs indicate anything useful?
>> >>
>> >> Btw, what TC is failing?
>> >>
>> >
>> > The PTS test case: TP/SSM/BV-09-C [PCE Shares PbapSupportedFeature
>> bits] is failing.
>> > Test objective is to verify that the PCE can share its
>> PbapSupportedFeatures bits with a server.
>> >
>> > Steps I followed:
>> > 1) Ran Bluetoothd
>> > 2) Ran obexd
>> > 3) Initiated the above mentioned TC in PTS tool.
>> > 4) ./pbap-client 00:1B:DC:07:33:4E >> err.txt
>> >
>> > Bluetoothd logs:
>> >
>> > bluetoothd[2740]: src/adapter.c:connected_callback() hci0 device
>> > 00:1B:DC:07:33:4E connected eir_len 21
>> > bluetoothd[2740]: src/adapter.c:dev_disconnected() Device
>> > 00:1B:DC:07:33:4E disconnected, reason 2
>> > bluetoothd[2740]: src/adapter.c:adapter_remove_connection()
>> > bluetoothd[2740]: plugins/policy.c:disconnect_cb() reason 2
>> > bluetoothd[2740]: src/adapter.c:bonding_attempt_complete() hci0 bdaddr
>> > 00:1B:DC:07:33:4E type 0 status 0xe
>> > bluetoothd[2740]: src/device.c:device_bonding_complete() bonding (nil)
>> > status 0x0e
>> > bluetoothd[2740]: src/device.c:device_bonding_failed() status 14
>> > bluetoothd[2740]: src/adapter.c:resume_discovery()
>> >
>> > Obexd logs: Nothing while executing the TC
>>
>> It is probably better if you can use obexctl> connect <address> pbap, also it
>> would be good to have the HCI traces to be able to detect if PTS is really
>> setting the record properly, for example if it is not advertising 0x0102 in the
>> record we will not attempt to send the parameters.
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
>> the body of a message to majordomo@vger.kernel.org More majordomo
>> info at  http://vger.kernel.org/majordomo-info.html
>
> After changing the "PBAP Role:  as 1.2 " in PICS, it is passing.
>
> HCI trace:
>
> HCI sniffer - Bluetooth packet analyzer ver 5.25
> device: hci0 snap_len: 1500 filter: 0xffffffffffffffff
> < HCI Command: Create Connection (0x01|0x0005) plen 13
>     bdaddr 00:1B:DC:07:33:4E ptype 0xcc18 rswitch 0x01 clkoffset 0x0000
>     Packet type: DM1 DM3 DM5 DH1 DH3 DH5
>> HCI Event: Command Status (0x0f) plen 4
>     Create Connection (0x01|0x0005) status 0x00 ncmd 1
>> HCI Event: Connect Complete (0x03) plen 11
>     status 0x00 handle 76 bdaddr 00:1B:DC:07:33:4E type ACL encrypt 0x00
> < HCI Command: Read Remote Supported Features (0x01|0x001b) plen 2
>     handle 76
>> HCI Event: Command Status (0x0f) plen 4
>     Read Remote Supported Features (0x01|0x001b) status 0x00 ncmd 0
>> HCI Event: Page Scan Repetition Mode Change (0x20) plen 7
>     bdaddr 00:1B:DC:07:33:4E mode 1
>> HCI Event: Max Slots Change (0x1b) plen 3
>     handle 76 slots 5
>> HCI Event: Command Status (0x0f) plen 4
>     Unknown (0x00|0x0000) status 0x00 ncmd 1
>> HCI Event: Read Remote Supported Features (0x0b) plen 11
>     status 0x00 handle 76
>     Features: 0xff 0xff 0x8f 0x7e 0xd8 0x1f 0x5b 0x87
> < HCI Command: Read Remote Extended Features (0x01|0x001c) plen 3
>     handle 76 page 1
>> HCI Event: Command Status (0x0f) plen 4
>     Read Remote Extended Features (0x01|0x001c) status 0x00 ncmd 1
>> HCI Event: Read Remote Extended Features (0x23) plen 13
>     status 0x00 handle 76 page 1 max 1
>     Features: 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00
> < HCI Command: Remote Name Request (0x01|0x0019) plen 10
>     bdaddr 00:1B:DC:07:33:4E mode 2 clkoffset 0x0000
> < ACL data: handle 76 flags 0x00 dlen 10
>     L2CAP(s): Info req: type 2
>> HCI Event: Command Status (0x0f) plen 4
>     Remote Name Request (0x01|0x0019) status 0x00 ncmd 1
>> HCI Event: Number of Completed Packets (0x13) plen 5
>     handle 76 packets 1
>> ACL data: handle 76 flags 0x02 dlen 16
>     L2CAP(s): Info rsp: type 2 result 0
>       Extended feature mask 0x0038
>         Enhanced Retransmission mode
>         Streaming mode
>         FCS Option
> < ACL data: handle 76 flags 0x00 dlen 12
>     L2CAP(s): Connect req: psm 1 scid 0x0040
>> HCI Event: Remote Name Req Complete (0x07) plen 255
>     status 0x00 bdaddr 00:1B:DC:07:33:4E name 'PTS-PBAP-GOWTHAM-AB'
>> HCI Event: Number of Completed Packets (0x13) plen 5
>     handle 76 packets 1
>> ACL data: handle 76 flags 0x02 dlen 16
>     L2CAP(s): Connect rsp: dcid 0x0040 scid 0x0040 result 1 status 0
>       Connection pending - No futher information available
>> ACL data: handle 76 flags 0x02 dlen 10
>     L2CAP(s): Info req: type 2
> < ACL data: handle 76 flags 0x00 dlen 16
>     L2CAP(s): Info rsp: type 2 result 0
>       Extended feature mask 0x02b8
>         Enhanced Retransmission mode
>         Streaming mode
>         FCS Option
>         Fixed Channels
>         Unicast Connectless Data Reception
>> HCI Event: Number of Completed Packets (0x13) plen 5
>     handle 76 packets 1
>> ACL data: handle 76 flags 0x02 dlen 16
>     L2CAP(s): Connect rsp: dcid 0x0040 scid 0x0040 result 0 status 0
>       Connection successful
> < ACL data: handle 76 flags 0x00 dlen 23
>     L2CAP(s): Config req: dcid 0x0040 flags 0x00 clen 11
>       RFC 0x00 (Basic)
>> ACL data: handle 76 flags 0x02 dlen 16
>     L2CAP(s): Config req: dcid 0x0040 flags 0x00 clen 4
>       MTU 1024
> < ACL data: handle 76 flags 0x00 dlen 18
>     L2CAP(s): Config rsp: scid 0x0040 flags 0x00 result 0 clen 4
>       MTU 1024
>> HCI Event: Number of Completed Packets (0x13) plen 5
>     handle 76 packets 1
>> HCI Event: Number of Completed Packets (0x13) plen 5
>     handle 76 packets 1
>> ACL data: handle 76 flags 0x02 dlen 18
>     L2CAP(s): Config rsp: scid 0x0040 flags 0x00 result 0 clen 4
>       MTU 672
> < ACL data: handle 76 flags 0x00 dlen 38
>     L2CAP(d): cid 0x0040 len 34 [psm 1]
>         SDP SSA Req: tid 0x0 len 0x1d
>           pat uuid-128 0000112f-0000-1000-8000-00805f9b34fb
>           max 65535
>           aid(s) 0x0000 - 0xffff
>           cont 00
>> HCI Event: Number of Completed Packets (0x13) plen 5
>     handle 76 packets 1
>> ACL data: handle 76 flags 0x02 dlen 115
>     L2CAP(d): cid 0x0040 len 111 [psm 1]
>         SDP SSA Rsp: tid 0x0 len 0x6a
>           count 103
>           record #0
>               aid 0x0000 (SrvRecHndl)
>                  uint 0x1000b
>               aid 0x0001 (SrvClassIDList)
>                  < uuid-16 0x112f (PBAP PSE) >
>               aid 0x0004 (ProtocolDescList)
>                  < < uuid-16 0x0100 (L2CAP) > <
>                  uuid-16 0x0003 (RFCOMM) uint 0x2 > <
>                  uuid-16 0x0008 (OBEX) > >
>               aid 0x0009 (BTProfileDescList)
>                  < < uuid-16 0x1130 (PBAP) uint 0x102 > >
>               aid 0x0100 (SrvName)
>                  str 50 68 6f 6e 65 62 6f 6f 6b 0a 41 63 63 65 73 73 20 50 53 45 20 50 54 53
>               aid 0x0200 (VersionNumList)
>                  uint 0x1005
>               aid 0x0314 (SuppRepositories)
>                  uint 0xf
>               aid 0x0317 (unknown)
>                  uint 0x3ff
>           cont 00
> < HCI Command: Authentication Requested (0x01|0x0011) plen 2
>     handle 76
> < ACL data: handle 76 flags 0x00 dlen 12
>     L2CAP(s): Disconn req: dcid 0x0040 scid 0x0040
>> HCI Event: Command Status (0x0f) plen 4
>     Authentication Requested (0x01|0x0011) status 0x00 ncmd 1
>> HCI Event: Link Key Request (0x17) plen 6
>     bdaddr 00:1B:DC:07:33:4E
> < HCI Command: Link Key Request Reply (0x01|0x000b) plen 22
>     bdaddr 00:1B:DC:07:33:4E key E07D49C59D7D98B121A2CFCD41E05458
>> HCI Event: Number of Completed Packets (0x13) plen 5
>     handle 76 packets 1
>> HCI Event: Command Complete (0x0e) plen 10
>     Link Key Request Reply (0x01|0x000b) ncmd 1
>     status 0x00 bdaddr 00:1B:DC:07:33:4E
>> ACL data: handle 76 flags 0x02 dlen 12
>     L2CAP(s): Disconn rsp: dcid 0x0040 scid 0x0040
>> HCI Event: Auth Complete (0x06) plen 3
>     status 0x00 handle 76
> < HCI Command: Set Connection Encryption (0x01|0x0013) plen 3
>     handle 76 encrypt 0x01
>> HCI Event: Command Status (0x0f) plen 4
>     Set Connection Encryption (0x01|0x0013) status 0x00 ncmd 1
>> HCI Event: Encrypt Change (0x08) plen 4
>     status 0x00 handle 76 encrypt 0x01
> < ACL data: handle 76 flags 0x00 dlen 12
>     L2CAP(s): Connect req: psm 4101 scid 0x0041
>> HCI Event: Number of Completed Packets (0x13) plen 5
>     handle 76 packets 1
>> ACL data: handle 76 flags 0x02 dlen 16
>     L2CAP(s): Connect rsp: dcid 0x0040 scid 0x0041 result 1 status 0
>       Connection pending - No futher information available
>> ACL data: handle 76 flags 0x02 dlen 16
>     L2CAP(s): Connect rsp: dcid 0x0040 scid 0x0041 result 0 status 0
>       Connection successful
> < ACL data: handle 76 flags 0x00 dlen 27
>     L2CAP(s): Config req: dcid 0x0040 flags 0x00 clen 15
>       MTU 32767
>       RFC 0x03 (Enhanced Retransmission, TxWin 63, MaxTx 3, RTo 2000, MTo 12000, MPS 298)
>> ACL data: handle 76 flags 0x02 dlen 27
>     L2CAP(s): Config req: dcid 0x0041 flags 0x00 clen 15
>       MTU 4096
>       RFC 0x03 (Enhanced Retransmission, TxWin 8, MaxTx 16, RTo 0, MTo 0, MPS 1691)
> < ACL data: handle 76 flags 0x00 dlen 29
>     L2CAP(s): Config rsp: scid 0x0040 flags 0x00 result 0 clen 15
>       MTU 4096
>       RFC 0x03 (Enhanced Retransmission, TxWin 8, MaxTx 16, RTo 2000, MTo 12000, MPS 298)
>> HCI Event: Number of Completed Packets (0x13) plen 5
>     handle 76 packets 1
>> HCI Event: Number of Completed Packets (0x13) plen 5
>     handle 76 packets 1
>> ACL data: handle 76 flags 0x02 dlen 29
>     L2CAP(s): Config rsp: scid 0x0041 flags 0x00 result 0 clen 15
>       MTU 4096
>       RFC 0x03 (Enhanced Retransmission, TxWin 24, MaxTx 0, RTo 256, MTo 256, MPS 298)
> < ACL data: handle 76 flags 0x00 dlen 43
>     L2CAP(d): cid 0x0040 len 39 ctrl 0x0000 fcs 0x1dc9 [psm 4101]
>       I-frame: Unsegmented TxSeq 0 ReqSeq 0
>> HCI Event: Number of Completed Packets (0x13) plen 5
>     handle 76 packets 1
>> ACL data: handle 76 flags 0x02 dlen 8
>     L2CAP(d): cid 0x0041 len 4 ctrl 0x0101 fcs 0xe8d5 [psm 4101]
>       S-frame: Receiver Ready (RR) ReqSeq 1
>> ACL data: handle 76 flags 0x02 dlen 39
>     L2CAP(d): cid 0x0041 len 35 ctrl 0x0100 fcs 0x1c79 [psm 4101]
>       I-frame: Unsegmented TxSeq 0 ReqSeq 1
> < ACL data: handle 76 flags 0x00 dlen 8
>     L2CAP(d): cid 0x0040 len 4 ctrl 0x0101 fcs 0x14d4 [psm 4101]
>       S-frame: Receiver Ready (RR) ReqSeq 1
>> HCI Event: Number of Completed Packets (0x13) plen 5
>     handle 76 packets 1
>> ACL data: handle 76 flags 0x02 dlen 12
>     L2CAP(s): Disconn req: dcid 0x0041 scid 0x0040
> < ACL data: handle 76 flags 0x00 dlen 12
>     L2CAP(s): Disconn rsp: dcid 0x0041 scid 0x0040
>> HCI Event: Number of Completed Packets (0x13) plen 5
>     handle 76 packets 1
>> HCI Event: Disconn Complete (0x05) plen 4
>     status 0x00 handle 76 reason 0x13
>     Reason: Remote User Terminated Connection
>
> PTS Output:
>
> Test case : TC_PCE_SSM_BV_09_C started
>         - SPP Service successfully registered
>         - SDP Service record: 'HFP-AG Service Record' successfully registered
>         - SDP Service record successfully registered
>         - PBAP successfully initialized
>         - MTC: IUT successfully sent OBEX CONNECT request.
>         - MTC: Extract Support Feature Successful
>         - MTC: SDP Record contained Supported Feature
>         - MTC: No more incoming message.
>         - CM_PTC_EXIT
>         - PBAP : Test case ended.
> Final Verdict : Pass

Thanks a lot for testing, I will push this in a moment.

-- 
Luiz Augusto von Dentz

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

* Re: [PATCH BlueZ 1/8] obexd/client: Add support for reading version
  2014-12-01  8:47 [PATCH BlueZ 1/8] obexd/client: Add support for reading version Luiz Augusto von Dentz
                   ` (6 preceding siblings ...)
  2014-12-01  8:47 ` [PATCH BlueZ 8/8] obexd/client: Add supported_features support Luiz Augusto von Dentz
@ 2014-12-02  9:39 ` Luiz Augusto von Dentz
  7 siblings, 0 replies; 17+ messages in thread
From: Luiz Augusto von Dentz @ 2014-12-02  9:39 UTC (permalink / raw)
  To: linux-bluetooth

Hi,

On Mon, Dec 1, 2014 at 10:47 AM, Luiz Augusto von Dentz
<luiz.dentz@gmail.com> wrote:
> 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

Pushed.


-- 
Luiz Augusto von Dentz

^ permalink raw reply	[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 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.