Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH 8/8] obexd: Remove transferred file only if the GET operation failed
From: Christian Fetzer @ 2013-01-11 15:55 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Christian Fetzer
In-Reply-To: <1357919757-10334-1-git-send-email-christian.fetzer@oss.bmw-carit.de>

From: Christian Fetzer <christian.fetzer@bmw-carit.de>

Since 9606375649e12f1b9f302bbb5bb8f87957387ddd xfer_complete() sets the
transfer status rather than the size. Adapt obc_transfer_free to check
for the completed status to avoid deletion of completed transfers.
---
 obexd/client/transfer.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/obexd/client/transfer.c b/obexd/client/transfer.c
index 541f405..427eab7 100644
--- a/obexd/client/transfer.c
+++ b/obexd/client/transfer.c
@@ -327,7 +327,8 @@ static void obc_transfer_free(struct obc_transfer *transfer)
 	}
 
 	if (transfer->op == G_OBEX_OP_GET &&
-					transfer->transferred != transfer->size)
+				transfer->status != TRANSFER_STATUS_COMPLETE &&
+				transfer->filename)
 		remove(transfer->filename);
 
 	if (transfer->fd > 0)
-- 
1.8.1


^ permalink raw reply related

* [PATCH 7/8] obexd: Change behavior of parse_filter_read
From: Christian Fetzer @ 2013-01-11 15:55 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Christian Fetzer
In-Reply-To: <1357919757-10334-1-git-send-email-christian.fetzer@oss.bmw-carit.de>

From: Christian Fetzer <christian.fetzer@bmw-carit.de>

Calls to ListMessages with filter 'Read' set to true should
request the MSE to send read messages only.

The old code requests the MSE to send unread messages only.
This behavior is not matching the other filters.
---
 obexd/client/map.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/obexd/client/map.c b/obexd/client/map.c
index 3e4cde9..99982c0 100644
--- a/obexd/client/map.c
+++ b/obexd/client/map.c
@@ -1179,9 +1179,9 @@ static GObexApparam *parse_filter_read(GObexApparam *apparam,
 	dbus_message_iter_get_basic(iter, &dbus_status);
 
 	if (dbus_status)
-		status = FILTER_READ_STATUS_ONLY_UNREAD;
-	else
 		status = FILTER_READ_STATUS_ONLY_READ;
+	else
+		status = FILTER_READ_STATUS_ONLY_UNREAD;
 
 	return g_obex_apparam_set_uint8(apparam, MAP_AP_FILTERREADSTATUS,
 								status);
-- 
1.8.1


^ permalink raw reply related

* [PATCH 6/8] obexd: Use defines for values in parse_filter_read parse_filter_priority
From: Christian Fetzer @ 2013-01-11 15:55 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Christian Fetzer
In-Reply-To: <1357919757-10334-1-git-send-email-christian.fetzer@oss.bmw-carit.de>

From: Christian Fetzer <christian.fetzer@bmw-carit.de>

---
 obexd/client/map.c | 22 ++++++++++++++++++----
 1 file changed, 18 insertions(+), 4 deletions(-)

diff --git a/obexd/client/map.c b/obexd/client/map.c
index 57ce1e6..3e4cde9 100644
--- a/obexd/client/map.c
+++ b/obexd/client/map.c
@@ -77,6 +77,14 @@ static const char * const filter_list[] = {
 #define FILTER_BIT_MAX	15
 #define FILTER_ALL	0x0000FFFF
 
+#define FILTER_READ_STATUS_NONE		0
+#define FILTER_READ_STATUS_ONLY_UNREAD	1
+#define FILTER_READ_STATUS_ONLY_READ	2
+
+#define FILTER_PRIORITY_NONE		0
+#define FILTER_PRIORITY_ONLY_HIGH	1
+#define FILTER_PRIORITY_ONLY_NONHIGH	2
+
 #define STATUS_READ 0
 #define STATUS_DELETE 1
 #define FILLER_BYTE 0x30
@@ -1162,7 +1170,7 @@ static GObexApparam *parse_period_end(GObexApparam *apparam,
 static GObexApparam *parse_filter_read(GObexApparam *apparam,
 							DBusMessageIter *iter)
 {
-	guint8 status = 0;
+	guint8 status = FILTER_READ_STATUS_NONE;
 	dbus_bool_t dbus_status = FALSE;
 
 	if (dbus_message_iter_get_arg_type(iter) != DBUS_TYPE_BOOLEAN)
@@ -1170,7 +1178,10 @@ static GObexApparam *parse_filter_read(GObexApparam *apparam,
 
 	dbus_message_iter_get_basic(iter, &dbus_status);
 
-	status = (dbus_status) ? 0x01 : 0x02;
+	if (dbus_status)
+		status = FILTER_READ_STATUS_ONLY_UNREAD;
+	else
+		status = FILTER_READ_STATUS_ONLY_READ;
 
 	return g_obex_apparam_set_uint8(apparam, MAP_AP_FILTERREADSTATUS,
 								status);
@@ -1207,7 +1218,7 @@ static GObexApparam *parse_filter_sender(GObexApparam *apparam,
 static GObexApparam *parse_filter_priority(GObexApparam *apparam,
 							DBusMessageIter *iter)
 {
-	guint8 priority;
+	guint8 priority = FILTER_PRIORITY_NONE;
 	dbus_bool_t dbus_priority = FALSE;
 
 	if (dbus_message_iter_get_arg_type(iter) != DBUS_TYPE_BOOLEAN)
@@ -1215,7 +1226,10 @@ static GObexApparam *parse_filter_priority(GObexApparam *apparam,
 
 	dbus_message_iter_get_basic(iter, &dbus_priority);
 
-	priority = (dbus_priority) ? 0x01 : 0x02;
+	if (dbus_priority)
+		priority = FILTER_PRIORITY_ONLY_HIGH;
+	else
+		priority = FILTER_PRIORITY_ONLY_NONHIGH;
 
 	return g_obex_apparam_set_uint8(apparam, MAP_AP_FILTERPRIORITY,
 								priority);
-- 
1.8.1


^ permalink raw reply related

* [PATCH 5/8] obexd: Fix segfault in parse_filter_read and parse_filter_priority
From: Christian Fetzer @ 2013-01-11 15:55 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Christian Fetzer
In-Reply-To: <1357919757-10334-1-git-send-email-christian.fetzer@oss.bmw-carit.de>

From: Christian Fetzer <christian.fetzer@bmw-carit.de>

Calls to ListMessages with filter 'Read' or 'Priority' caused a segfault
in parse_filter_read / parse_filter_priority. The functions read
D-Bus boolean values (uint32) into uint8.

0  0x00007ffff730332d in ?? () from /usr/lib/libdbus-1.so.3
1  0x00007ffff7304219 in dbus_message_iter_next () from /usr/lib/libdbus-1.so.3
2  0x000000000043ef0f in parse_message_filters (
    apparam=<error reading variable: Cannot access memory at address 0x7ffffeffff08>,
    iter=<error reading variable: Cannot access memory at address 0x7ffffeffff00>)
    at obexd/client/map.c:1246
---
 obexd/client/map.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/obexd/client/map.c b/obexd/client/map.c
index cea9369..57ce1e6 100644
--- a/obexd/client/map.c
+++ b/obexd/client/map.c
@@ -1163,13 +1163,14 @@ static GObexApparam *parse_filter_read(GObexApparam *apparam,
 							DBusMessageIter *iter)
 {
 	guint8 status = 0;
+	dbus_bool_t dbus_status = FALSE;
 
 	if (dbus_message_iter_get_arg_type(iter) != DBUS_TYPE_BOOLEAN)
 		return NULL;
 
-	dbus_message_iter_get_basic(iter, &status);
+	dbus_message_iter_get_basic(iter, &dbus_status);
 
-	status = (status) ? 0x01 : 0x02;
+	status = (dbus_status) ? 0x01 : 0x02;
 
 	return g_obex_apparam_set_uint8(apparam, MAP_AP_FILTERREADSTATUS,
 								status);
@@ -1207,13 +1208,14 @@ static GObexApparam *parse_filter_priority(GObexApparam *apparam,
 							DBusMessageIter *iter)
 {
 	guint8 priority;
+	dbus_bool_t dbus_priority = FALSE;
 
 	if (dbus_message_iter_get_arg_type(iter) != DBUS_TYPE_BOOLEAN)
 		return NULL;
 
-	dbus_message_iter_get_basic(iter, &priority);
+	dbus_message_iter_get_basic(iter, &dbus_priority);
 
-	priority = (priority) ? 0x01 : 0x02;
+	priority = (dbus_priority) ? 0x01 : 0x02;
 
 	return g_obex_apparam_set_uint8(apparam, MAP_AP_FILTERPRIORITY,
 								priority);
-- 
1.8.1


^ permalink raw reply related

* [PATCH 4/8] obexd: Fix FILTER_ALL in MAP client to set 16 bit
From: Christian Fetzer @ 2013-01-11 15:55 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Christian Fetzer
In-Reply-To: <1357919757-10334-1-git-send-email-christian.fetzer@oss.bmw-carit.de>

From: Christian Fetzer <christian.fetzer@bmw-carit.de>

The MAP specification defines ParameterMask as a bitmask of 32 bit / 4 bytes.
For the lower 16 bit the specification defines parameters, the higher 16 bit
remain reserved for future use. Therefore FILTER_ALL is set to 0x0000FFFF.
(Reserved bits have to be set to 0)

In addition this fixes the issue that ListFilterFields didn't show all fields.
---
 obexd/client/map.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/obexd/client/map.c b/obexd/client/map.c
index afb5f9a..cea9369 100644
--- a/obexd/client/map.c
+++ b/obexd/client/map.c
@@ -75,7 +75,7 @@ static const char * const filter_list[] = {
 };
 
 #define FILTER_BIT_MAX	15
-#define FILTER_ALL	0xFF
+#define FILTER_ALL	0x0000FFFF
 
 #define STATUS_READ 0
 #define STATUS_DELETE 1
-- 
1.8.1


^ permalink raw reply related

* [PATCH 3/8] obexd: Fix infinite loop in ListMessages with filter "Types"
From: Christian Fetzer @ 2013-01-11 15:55 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Christian Fetzer
In-Reply-To: <1357919757-10334-1-git-send-email-christian.fetzer@oss.bmw-carit.de>

From: Christian Fetzer <christian.fetzer@bmw-carit.de>

Calls to ListMessages with filter 'Types' make obexd hang in an infinite loop.
This is caused by a missing dbus_message_iter_next in parse_filter_type.

0  0x00007ffff7304ca7 in dbus_message_iter_get_basic ()
   from /usr/lib/libdbus-1.so.3
1  0x0000000000434fba in parse_filter_type (iter=0x7fffffffd7d0, apparam=
    0x6987f0) at obexd/client/map.c:1086
2  parse_message_filters (iter=0x7fffffffd730, apparam=0x6987f0)
    at obexd/client/map.c:1222
3  map_list_messages (connection=<optimized out>, message=0x669ae0, user_data=
    0x698a60) at obexd/client/map.c:1273
4  0x00000000004109a1 in process_message (connection=0x662b20,
    message=<optimized out>, iface_user_data=<optimized out>,
    method=<optimized out>, method=<optimized out>) at gdbus/object.c:285
5  0x00007ffff7308e15 in ?? () from /usr/lib/libdbus-1.so.3
6  0x00007ffff72fb070 in dbus_connection_dispatch ()
   from /usr/lib/libdbus-1.so.3
7  0x000000000040e3d8 in message_dispatch (data=0x662b20)
    at gdbus/mainloop.c:76
8  0x00007ffff703d3cb in ?? () from /usr/lib/libglib-2.0.so.0
9  0x00007ffff703c845 in g_main_context_dispatch ()
   from /usr/lib/libglib-2.0.so.0
10 0x00007ffff703cb78 in ?? () from /usr/lib/libglib-2.0.so.0
11 0x00007ffff703cf72 in g_main_loop_run () from /usr/lib/libglib-2.0.so.0
12 0x000000000040df82 in main (argc=1, argv=0x7fffffffdd88)
    at obexd/src/main.c:323
---
 obexd/client/map.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/obexd/client/map.c b/obexd/client/map.c
index 635d951..afb5f9a 100644
--- a/obexd/client/map.c
+++ b/obexd/client/map.c
@@ -1123,6 +1123,8 @@ static GObexApparam *parse_filter_type(GObexApparam *apparam,
 			types |= 0x08; /* mms */
 		else
 			return NULL;
+
+		dbus_message_iter_next(&array);
 	}
 
 	return g_obex_apparam_set_uint8(apparam, MAP_AP_FILTERMESSAGETYPE,
-- 
1.8.1


^ permalink raw reply related

* [PATCH 2/8] obexd: Add property exist functions to map client
From: Christian Fetzer @ 2013-01-11 15:55 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Christian Fetzer
In-Reply-To: <1357919757-10334-1-git-send-email-christian.fetzer@oss.bmw-carit.de>

From: Christian Fetzer <christian.fetzer@bmw-carit.de>

This fixes crashes in MAP client when the server does not send optional properties.

0  0x00007ffff6a792c5 in raise () from /usr/lib/libc.so.6
1  0x00007ffff6a7a748 in abort () from /usr/lib/libc.so.6
2  0x00007ffff731c145 in ?? () from /usr/lib/libdbus-1.so.3
3  0x00007ffff7312a25 in ?? () from /usr/lib/libdbus-1.so.3
4  0x00007ffff73050d6 in dbus_message_iter_append_basic () from /usr/lib/libdbus-1.so.3
5  0x0000000000433cc5 in get_replyto (property=<optimized out>, iter=<optimized out>,
    data=<optimized out>) at obexd/client/map.c:484
6  0x00000000004103b6 in append_property (p=p@entry=0x6594c0 <map_msg_properties+192>,
    dict=dict@entry=0x7fffffffd8e0, iface=0x6a3720) at gdbus/object.c:547
7  0x0000000000410472 in append_properties (data=data@entry=0x6a3720, iter=iter@entry=
    0x7fffffffd960) at gdbus/object.c:576
8  0x00000000004104d1 in append_interface (data=0x6a3720, user_data=0x7fffffffda40)
    at gdbus/object.c:591
9  0x00007ffff7058a4d in g_slist_foreach () from /usr/lib/libglib-2.0.so.0
10 0x0000000000411d05 in emit_interfaces_added (data=0x6a2ff0) at gdbus/object.c:623
11 process_changes (user_data=0x6a2ff0) at gdbus/object.c:1006
12 0x00007ffff703c845 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
13 0x00007ffff703cb78 in ?? () from /usr/lib/libglib-2.0.so.0
14 0x00007ffff703cf72 in g_main_loop_run () from /usr/lib/libglib-2.0.so.0
15 0x000000000040df82 in main (argc=1, argv=0x7fffffffdd88) at obexd/src/main.c:323
---
 obexd/client/map.c | 76 ++++++++++++++++++++++++++++++++++++++++++++++++------
 1 file changed, 68 insertions(+), 8 deletions(-)

diff --git a/obexd/client/map.c b/obexd/client/map.c
index 08914a6..635d951 100644
--- a/obexd/client/map.c
+++ b/obexd/client/map.c
@@ -435,6 +435,13 @@ done:
 	msg->pending = 0;
 }
 
+static gboolean subject_exists(const GDBusPropertyTable *property, void *data)
+{
+	struct map_msg *msg = data;
+
+	return msg->subject != NULL;
+}
+
 static gboolean get_subject(const GDBusPropertyTable *property,
 					DBusMessageIter *iter, void *data)
 {
@@ -445,6 +452,13 @@ static gboolean get_subject(const GDBusPropertyTable *property,
 	return TRUE;
 }
 
+static gboolean timestamp_exists(const GDBusPropertyTable *property, void *data)
+{
+	struct map_msg *msg = data;
+
+	return msg->timestamp != NULL;
+}
+
 static gboolean get_timestamp(const GDBusPropertyTable *property,
 					DBusMessageIter *iter, void *data)
 {
@@ -455,6 +469,13 @@ static gboolean get_timestamp(const GDBusPropertyTable *property,
 	return TRUE;
 }
 
+static gboolean sender_exists(const GDBusPropertyTable *property, void *data)
+{
+	struct map_msg *msg = data;
+
+	return msg->sender != NULL;
+}
+
 static gboolean get_sender(const GDBusPropertyTable *property,
 					DBusMessageIter *iter, void *data)
 {
@@ -465,6 +486,14 @@ static gboolean get_sender(const GDBusPropertyTable *property,
 	return TRUE;
 }
 
+static gboolean sender_address_exists(const GDBusPropertyTable *property,
+								void *data)
+{
+	struct map_msg *msg = data;
+
+	return msg->sender_address != NULL;
+}
+
 static gboolean get_sender_address(const GDBusPropertyTable *property,
 					DBusMessageIter *iter, void *data)
 {
@@ -476,6 +505,13 @@ static gboolean get_sender_address(const GDBusPropertyTable *property,
 	return TRUE;
 }
 
+static gboolean replyto_exists(const GDBusPropertyTable *property, void *data)
+{
+	struct map_msg *msg = data;
+
+	return msg->replyto != NULL;
+}
+
 static gboolean get_replyto(const GDBusPropertyTable *property,
 					DBusMessageIter *iter, void *data)
 {
@@ -486,6 +522,13 @@ static gboolean get_replyto(const GDBusPropertyTable *property,
 	return TRUE;
 }
 
+static gboolean recipient_exists(const GDBusPropertyTable *property, void *data)
+{
+	struct map_msg *msg = data;
+
+	return msg->recipient != NULL;
+}
+
 static gboolean get_recipient(const GDBusPropertyTable *property,
 					DBusMessageIter *iter, void *data)
 {
@@ -496,6 +539,14 @@ static gboolean get_recipient(const GDBusPropertyTable *property,
 	return TRUE;
 }
 
+static gboolean recipient_address_exists(const GDBusPropertyTable *property,
+								void *data)
+{
+	struct map_msg *msg = data;
+
+	return msg->recipient_address != NULL;
+}
+
 static gboolean get_recipient_address(const GDBusPropertyTable *property,
 					DBusMessageIter *iter, void *data)
 {
@@ -507,6 +558,13 @@ static gboolean get_recipient_address(const GDBusPropertyTable *property,
 	return TRUE;
 }
 
+static gboolean type_exists(const GDBusPropertyTable *property, void *data)
+{
+	struct map_msg *msg = data;
+
+	return msg->type != NULL;
+}
+
 static gboolean get_type(const GDBusPropertyTable *property,
 					DBusMessageIter *iter, void *data)
 {
@@ -635,14 +693,16 @@ static const GDBusMethodTable map_msg_methods[] = {
 };
 
 static const GDBusPropertyTable map_msg_properties[] = {
-	{ "Subject", "s", get_subject },
-	{ "Timestamp", "s", get_timestamp },
-	{ "Sender", "s", get_sender },
-	{ "SenderAddress", "s", get_sender_address },
-	{ "ReplyTo", "s", get_replyto },
-	{ "Recipient", "s", get_recipient },
-	{ "RecipientAddress", "s", get_recipient_address },
-	{ "Type", "s", get_type },
+	{ "Subject", "s", get_subject, NULL, subject_exists },
+	{ "Timestamp", "s", get_timestamp, NULL, timestamp_exists },
+	{ "Sender", "s", get_sender, NULL, sender_exists },
+	{ "SenderAddress", "s", get_sender_address, NULL,
+						sender_address_exists },
+	{ "ReplyTo", "s", get_replyto, NULL, replyto_exists },
+	{ "Recipient", "s", get_recipient, NULL, recipient_exists },
+	{ "RecipientAddress", "s", get_recipient_address, NULL,
+						recipient_address_exists },
+	{ "Type", "s", get_type, NULL, type_exists },
 	{ "Size", "t", get_size },
 	{ "Priority", "b", get_priority },
 	{ "Read", "b", get_read, set_read },
-- 
1.8.1


^ permalink raw reply related

* [PATCH 1/8] obexd: Handle empty path name in SetPath
From: Christian Fetzer @ 2013-01-11 15:55 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Christian Fetzer
In-Reply-To: <1357919757-10334-1-git-send-email-christian.fetzer@oss.bmw-carit.de>

From: Christian Fetzer <christian.fetzer@bmw-carit.de>

If the empty path is given, an empty name should be sent via OBEX.
Currently the name field is not set at all and later checks which
depend on data->index will access invalid memory regions as g_strsplit
returns NULL when an empty string is given.

0  0x000000000041a181 in g_obex_setpath (obex=obex@entry=0x662eb0, path=
    0x20 <Address 0x20 out of bounds>, func=func@entry=0x42d300 <setpath_cb>,
    user_data=user_data@entry=0x668f10, err=err@entry=0x7fffffffda08)
    at gobex/gobex.c:1397
1  0x000000000042d395 in setpath_cb (obex=0x662eb0, err=0x0, rsp=<optimized out>,
    user_data=0x668f10) at obexd/client/session.c:902
2  0x0000000000418e54 in handle_response (obex=obex@entry=0x662eb0, err=err@entry=0x0,
    rsp=rsp@entry=0x668f40) at gobex/gobex.c:948
3  0x0000000000419d7a in incoming_data (io=<optimized out>, cond=<optimized out>,
    user_data=0x662eb0) at gobex/gobex.c:1191
4  0x00007ffff703c845 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
5  0x00007ffff703cb78 in ?? () from /usr/lib/libglib-2.0.so.0
6  0x00007ffff703cf72 in g_main_loop_run () from /usr/lib/libglib-2.0.so.0
7  0x000000000040def2 in main (argc=1, argv=0x7fffffffdd88) at obexd/src/main.c:323
---
 obexd/client/session.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/obexd/client/session.c b/obexd/client/session.c
index 9cc824e..db37a86 100644
--- a/obexd/client/session.c
+++ b/obexd/client/session.c
@@ -934,7 +934,7 @@ guint obc_session_setpath(struct obc_session *session, const char *path,
 	p = pending_request_new(session, NULL, setpath_complete, data);
 
 	/* Relative path */
-	if (path[0] != '/') {
+	if (path[0] != '/' && path[0] != 0) {
 		first = data->remaining[data->index];
 		data->index++;
 	}
-- 
1.8.1


^ permalink raw reply related

* [PATCH 0/8] Obexd / MAP-client bug fixes
From: Christian Fetzer @ 2013-01-11 15:55 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Christian Fetzer

From: Christian Fetzer <christian.fetzer@bmw-carit.de>

This patch set fixes a couple of small issues in the MAP-client implementation
and in the generic obexd client code.

Christian Fetzer (8):
  obexd: Handle empty path name in SetPath
  obexd: Add property exist functions to map client
  obexd: Fix infinite loop in ListMessages with filter "Types"
  obexd: Fix FILTER_ALL in MAP client to set 16 bit
  obexd: Fix segfault in parse_filter_read and parse_filter_priority
  obexd: Use defines for values in parse_filter_read parse_filter_priority
  obexd: Change behavior of parse_filter_read
  obexd: Remove transferred file only if the GET operation failed

 obexd/client/map.c      | 108 +++++++++++++++++++++++++++++++++++++++++-------
 obexd/client/session.c  |   2 +-
 obexd/client/transfer.c |   3 +-
 3 files changed, 96 insertions(+), 17 deletions(-)

-- 
1.8.1


^ permalink raw reply

* Re: [PATCH BlueZ] AVRCP: Fix crash when MediaPlayer1 is disabled
From: Johan Hedberg @ 2013-01-11 14:28 UTC (permalink / raw)
  To: Luiz Augusto von Dentz; +Cc: linux-bluetooth
In-Reply-To: <1357913949-27785-1-git-send-email-luiz.dentz@gmail.com>

Hi Luiz,

On Fri, Jan 11, 2013, Luiz Augusto von Dentz wrote:
> When MediaPlayer1 is disabled we should not proceed with getting
> remote capabilities but switch back to 1.0 mode.
> ---
>  profiles/audio/avrcp.c | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)

Applied. Thanks.

Johan

^ permalink raw reply

* [PATCH BlueZ] AVRCP: Fix crash when MediaPlayer1 is disabled
From: Luiz Augusto von Dentz @ 2013-01-11 14:19 UTC (permalink / raw)
  To: linux-bluetooth

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

When MediaPlayer1 is disabled we should not proceed with getting
remote capabilities but switch back to 1.0 mode.
---
 profiles/audio/avrcp.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/profiles/audio/avrcp.c b/profiles/audio/avrcp.c
index d0cc346..ef324b0 100644
--- a/profiles/audio/avrcp.c
+++ b/profiles/audio/avrcp.c
@@ -2178,11 +2178,12 @@ static void session_ct_init(struct avrcp *session)
 	path = device_get_path(session->dev->btd_dev);
 
 	mp = media_player_controller_create(path);
-	if (mp != NULL) {
-		media_player_set_callbacks(mp, &ct_cbs, player);
-		player->user_data = mp;
-		player->destroy = (GDestroyNotify) media_player_destroy;
-	}
+	if (mp == NULL)
+		return;
+
+	media_player_set_callbacks(mp, &ct_cbs, player);
+	player->user_data = mp;
+	player->destroy = (GDestroyNotify) media_player_destroy;
 
 	if (session->version < 0x0103)
 		return;
-- 
1.8.0.1


^ permalink raw reply related

* [PATCH BlueZ 7/7] unit: Add gdbus/client_get_uint64_property
From: Luiz Augusto von Dentz @ 2013-01-11 11:50 UTC (permalink / raw)
  To: linux-bluetooth
In-Reply-To: <1357905018-23237-1-git-send-email-luiz.dentz@gmail.com>

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

---
 unit/test-gdbus-client.c | 66 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 66 insertions(+)

diff --git a/unit/test-gdbus-client.c b/unit/test-gdbus-client.c
index c3ae4b9..a777fe3 100644
--- a/unit/test-gdbus-client.c
+++ b/unit/test-gdbus-client.c
@@ -530,6 +530,69 @@ static void client_get_array_property(void)
 	destroy_context(context);
 }
 
+static void proxy_get_uint64(GDBusProxy *proxy, void *user_data)
+{
+	struct context *context = user_data;
+	DBusMessageIter iter;
+	guint64 value;
+
+	if (g_test_verbose())
+		g_print("proxy %s found\n",
+					g_dbus_proxy_get_interface(proxy));
+
+	g_assert(g_dbus_proxy_get_property(proxy, "Number", &iter));
+	g_assert(dbus_message_iter_get_arg_type(&iter) == DBUS_TYPE_UINT64);
+
+	dbus_message_iter_get_basic(&iter, &value);
+	g_assert(value == G_MAXUINT64);
+
+	g_dbus_client_unref(context->dbus_client);
+
+	g_main_loop_quit(context->main_loop);
+}
+
+static gboolean get_uint64(const GDBusPropertyTable *property,
+					DBusMessageIter *iter, void *data)
+{
+	guint64 value = G_MAXUINT64;
+
+	dbus_message_iter_append_basic(iter, DBUS_TYPE_UINT64, &value);
+
+	return TRUE;
+}
+
+static void client_get_uint64_property(void)
+{
+	struct context *context = create_context();
+	static const GDBusPropertyTable uint64_properties[] = {
+		{ "Number", "t", get_uint64 },
+		{ },
+	};
+
+	if (context == NULL)
+		return;
+
+	g_dbus_register_interface(context->dbus_conn,
+				SERVICE_PATH, SERVICE_NAME,
+				methods, signals, uint64_properties,
+				NULL, NULL);
+
+	context->dbus_client = g_dbus_client_new(context->dbus_conn,
+						SERVICE_NAME, SERVICE_PATH);
+
+	g_dbus_client_set_proxy_handlers(context->dbus_client,
+						proxy_get_uint64,
+						NULL, NULL,
+						context);
+
+	g_main_loop_run(context->main_loop);
+
+	g_dbus_unregister_interface(context->dbus_conn,
+					SERVICE_PATH, SERVICE_NAME);
+
+	destroy_context(context);
+}
+
 int main(int argc, char *argv[])
 {
 	g_test_init(&argc, &argv, NULL);
@@ -545,6 +608,9 @@ int main(int argc, char *argv[])
 	g_test_add_func("/gdbus/client_get_boolean_property",
 						client_get_boolean_property);
 
+	g_test_add_func("/gdbus/client_get_uint64_property",
+						client_get_uint64_property);
+
 	g_test_add_func("/gdbus/client_get_array_property",
 						client_get_array_property);
 
-- 
1.8.0.1


^ permalink raw reply related

* [PATCH BlueZ 6/7] unit: Add gdbus/client_get_array_property
From: Luiz Augusto von Dentz @ 2013-01-11 11:50 UTC (permalink / raw)
  To: linux-bluetooth
In-Reply-To: <1357905018-23237-1-git-send-email-luiz.dentz@gmail.com>

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

---
 unit/test-gdbus-client.c | 80 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 80 insertions(+)

diff --git a/unit/test-gdbus-client.c b/unit/test-gdbus-client.c
index e26dd0c..c3ae4b9 100644
--- a/unit/test-gdbus-client.c
+++ b/unit/test-gdbus-client.c
@@ -453,6 +453,83 @@ static void client_get_boolean_property(void)
 	destroy_context(context);
 }
 
+static void proxy_get_array(GDBusProxy *proxy, void *user_data)
+{
+	struct context *context = user_data;
+	DBusMessageIter iter, entry;
+	const char *value1, *value2;
+
+	if (g_test_verbose())
+		g_print("proxy %s found\n",
+					g_dbus_proxy_get_interface(proxy));
+
+	g_assert(g_dbus_proxy_get_property(proxy, "Array", &iter));
+	g_assert(dbus_message_iter_get_arg_type(&iter) == DBUS_TYPE_ARRAY);
+
+	dbus_message_iter_recurse(&iter, &entry);
+	g_assert(dbus_message_iter_get_arg_type(&entry) == DBUS_TYPE_STRING);
+
+	dbus_message_iter_get_basic(&entry, &value1);
+	g_assert(g_strcmp0(value1, "value1") == 0);
+
+	dbus_message_iter_next(&entry);
+	g_assert(dbus_message_iter_get_arg_type(&entry) == DBUS_TYPE_STRING);
+
+	dbus_message_iter_get_basic(&entry, &value2);
+	g_assert(g_strcmp0(value2, "value2") == 0);
+
+	g_dbus_client_unref(context->dbus_client);
+
+	g_main_loop_quit(context->main_loop);
+}
+
+static gboolean get_array(const GDBusPropertyTable *property,
+					DBusMessageIter *iter, void *data)
+{
+	const char *value[2] = { "value1", "value2" };
+	DBusMessageIter array;
+
+	dbus_message_iter_open_container(iter, DBUS_TYPE_ARRAY, "s", &array);
+
+	dbus_message_iter_append_basic(&array, DBUS_TYPE_STRING, &value[0]);
+	dbus_message_iter_append_basic(&array, DBUS_TYPE_STRING, &value[1]);
+
+	dbus_message_iter_close_container(iter, &array);
+
+	return TRUE;
+}
+
+static void client_get_array_property(void)
+{
+	struct context *context = create_context();
+	static const GDBusPropertyTable array_properties[] = {
+		{ "Array", "as", get_array },
+		{ },
+	};
+
+	if (context == NULL)
+		return;
+
+	g_dbus_register_interface(context->dbus_conn,
+				SERVICE_PATH, SERVICE_NAME,
+				methods, signals, array_properties,
+				NULL, NULL);
+
+	context->dbus_client = g_dbus_client_new(context->dbus_conn,
+						SERVICE_NAME, SERVICE_PATH);
+
+	g_dbus_client_set_proxy_handlers(context->dbus_client, proxy_get_array,
+						NULL, NULL,
+						context);
+
+	g_main_loop_run(context->main_loop);
+
+	g_dbus_unregister_interface(context->dbus_conn,
+					SERVICE_PATH, SERVICE_NAME);
+
+	destroy_context(context);
+}
+
 int main(int argc, char *argv[])
 {
 	g_test_init(&argc, &argv, NULL);
@@ -468,6 +545,9 @@ int main(int argc, char *argv[])
 	g_test_add_func("/gdbus/client_get_boolean_property",
 						client_get_boolean_property);
 
+	g_test_add_func("/gdbus/client_get_array_property",
+						client_get_array_property);
+
 	g_test_add_func("/gdbus/client_get_dict_property",
 						client_get_dict_property);
 
-- 
1.8.0.1


^ permalink raw reply related

* [PATCH BlueZ 5/7] unit: Add gdbus/client_get_boolean_property
From: Luiz Augusto von Dentz @ 2013-01-11 11:50 UTC (permalink / raw)
  To: linux-bluetooth
In-Reply-To: <1357905018-23237-1-git-send-email-luiz.dentz@gmail.com>

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

---
 unit/test-gdbus-client.c | 66 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 66 insertions(+)

diff --git a/unit/test-gdbus-client.c b/unit/test-gdbus-client.c
index bcdd811..e26dd0c 100644
--- a/unit/test-gdbus-client.c
+++ b/unit/test-gdbus-client.c
@@ -390,6 +390,69 @@ static void client_get_string_property(void)
 	destroy_context(context);
 }
 
+static void proxy_get_boolean(GDBusProxy *proxy, void *user_data)
+{
+	struct context *context = user_data;
+	DBusMessageIter iter;
+	dbus_bool_t value;
+
+	if (g_test_verbose())
+		g_print("proxy %s found\n",
+					g_dbus_proxy_get_interface(proxy));
+
+	g_assert(g_dbus_proxy_get_property(proxy, "Boolean", &iter));
+	g_assert(dbus_message_iter_get_arg_type(&iter) == DBUS_TYPE_BOOLEAN);
+
+	dbus_message_iter_get_basic(&iter, &value);
+	g_assert(value == TRUE);
+
+	g_dbus_client_unref(context->dbus_client);
+
+	g_main_loop_quit(context->main_loop);
+}
+
+static gboolean get_boolean(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 void client_get_boolean_property(void)
+{
+	struct context *context = create_context();
+	static const GDBusPropertyTable boolean_properties[] = {
+		{ "Boolean", "b", get_boolean },
+		{ },
+	};
+
+	if (context == NULL)
+		return;
+
+	g_dbus_register_interface(context->dbus_conn,
+				SERVICE_PATH, SERVICE_NAME,
+				methods, signals, boolean_properties,
+				NULL, NULL);
+
+	context->dbus_client = g_dbus_client_new(context->dbus_conn,
+						SERVICE_NAME, SERVICE_PATH);
+
+	g_dbus_client_set_proxy_handlers(context->dbus_client,
+						proxy_get_boolean,
+						NULL, NULL,
+						context);
+
+	g_main_loop_run(context->main_loop);
+
+	g_dbus_unregister_interface(context->dbus_conn,
+					SERVICE_PATH, SERVICE_NAME);
+
+	destroy_context(context);
+}
+
 int main(int argc, char *argv[])
 {
 	g_test_init(&argc, &argv, NULL);
@@ -402,6 +465,9 @@ int main(int argc, char *argv[])
 	g_test_add_func("/gdbus/client_get_string_property",
 						client_get_string_property);
 
+	g_test_add_func("/gdbus/client_get_boolean_property",
+						client_get_boolean_property);
+
 	g_test_add_func("/gdbus/client_get_dict_property",
 						client_get_dict_property);
 
-- 
1.8.0.1


^ permalink raw reply related

* [PATCH BlueZ 4/7] unit: Add gdbus/client_get_string_property
From: Luiz Augusto von Dentz @ 2013-01-11 11:50 UTC (permalink / raw)
  To: linux-bluetooth
In-Reply-To: <1357905018-23237-1-git-send-email-luiz.dentz@gmail.com>

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

---
 unit/test-gdbus-client.c | 65 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 65 insertions(+)

diff --git a/unit/test-gdbus-client.c b/unit/test-gdbus-client.c
index dac0cb5..bcdd811 100644
--- a/unit/test-gdbus-client.c
+++ b/unit/test-gdbus-client.c
@@ -328,6 +328,68 @@ static void client_get_dict_property(void)
 	destroy_context(context);
 }
 
+static void proxy_get_string(GDBusProxy *proxy, void *user_data)
+{
+	struct context *context = user_data;
+	DBusMessageIter iter;
+	const char *string;
+
+	if (g_test_verbose())
+		g_print("proxy %s found\n",
+					g_dbus_proxy_get_interface(proxy));
+
+	g_assert(g_dbus_proxy_get_property(proxy, "String", &iter));
+	g_assert(dbus_message_iter_get_arg_type(&iter) == DBUS_TYPE_STRING);
+
+	dbus_message_iter_get_basic(&iter, &string);
+	g_assert(g_strcmp0(string, "value") == 0);
+
+	g_dbus_client_unref(context->dbus_client);
+
+	g_main_loop_quit(context->main_loop);
+}
+
+static gboolean get_string(const GDBusPropertyTable *property,
+					DBusMessageIter *iter, void *data)
+{
+	const char *string = "value";
+
+	dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING, &string);
+
+	return TRUE;
+}
+
+static void client_get_string_property(void)
+{
+	struct context *context = create_context();
+	static const GDBusPropertyTable string_properties[] = {
+		{ "String", "s", get_string },
+		{ },
+	};
+
+	if (context == NULL)
+		return;
+
+	g_dbus_register_interface(context->dbus_conn,
+				SERVICE_PATH, SERVICE_NAME,
+				methods, signals, string_properties,
+				NULL, NULL);
+
+	context->dbus_client = g_dbus_client_new(context->dbus_conn,
+						SERVICE_NAME, SERVICE_PATH);
+
+	g_dbus_client_set_proxy_handlers(context->dbus_client, proxy_get_string,
+						NULL, NULL,
+						context);
+
+	g_main_loop_run(context->main_loop);
+
+	g_dbus_unregister_interface(context->dbus_conn,
+					SERVICE_PATH, SERVICE_NAME);
+
+	destroy_context(context);
+}
+
 int main(int argc, char *argv[])
 {
 	g_test_init(&argc, &argv, NULL);
@@ -337,6 +399,9 @@ int main(int argc, char *argv[])
 	g_test_add_func("/gdbus/client_connect_disconnect",
 						client_connect_disconnect);
 
+	g_test_add_func("/gdbus/client_get_string_property",
+						client_get_string_property);
+
 	g_test_add_func("/gdbus/client_get_dict_property",
 						client_get_dict_property);
 
-- 
1.8.0.1


^ permalink raw reply related

* [PATCH BlueZ 3/7] unit: Add gdbus/client_get_dict_property
From: Luiz Augusto von Dentz @ 2013-01-11 11:50 UTC (permalink / raw)
  To: linux-bluetooth
In-Reply-To: <1357905018-23237-1-git-send-email-luiz.dentz@gmail.com>

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

---
 unit/test-gdbus-client.c | 147 +++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 147 insertions(+)

diff --git a/unit/test-gdbus-client.c b/unit/test-gdbus-client.c
index 34c714e..dac0cb5 100644
--- a/unit/test-gdbus-client.c
+++ b/unit/test-gdbus-client.c
@@ -81,6 +81,8 @@ static struct context *create_context(void)
 	/* Avoid D-Bus library calling _exit() before next test finishes. */
 	dbus_connection_set_exit_on_disconnect(context->dbus_conn, FALSE);
 
+	g_dbus_attach_object_manager(context->dbus_conn);
+
 	return context;
 }
 
@@ -184,6 +186,148 @@ static void client_connect_disconnect(void)
 	destroy_context(context);
 }
 
+static void append_variant(DBusMessageIter *iter, int type, void *val)
+{
+	DBusMessageIter value;
+	char sig[2] = { type, '\0' };
+
+	dbus_message_iter_open_container(iter, DBUS_TYPE_VARIANT, sig, &value);
+
+	dbus_message_iter_append_basic(&value, type, val);
+
+	dbus_message_iter_close_container(iter, &value);
+}
+
+static void dict_append_entry(DBusMessageIter *dict, const char *key, int type,
+								void *val)
+{
+	DBusMessageIter entry;
+
+	if (type == DBUS_TYPE_STRING) {
+		const char *str = *((const char **) val);
+		if (str == NULL)
+			return;
+	}
+
+	dbus_message_iter_open_container(dict, DBUS_TYPE_DICT_ENTRY,
+							NULL, &entry);
+
+	dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &key);
+
+	append_variant(&entry, type, val);
+
+	dbus_message_iter_close_container(dict, &entry);
+}
+
+static gboolean get_dict(const GDBusPropertyTable *property,
+					DBusMessageIter *iter, void *data)
+{
+	DBusMessageIter dict;
+	const char *string = "value";
+	dbus_bool_t boolean = TRUE;
+
+	dbus_message_iter_open_container(iter, DBUS_TYPE_ARRAY,
+			DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING
+			DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_VARIANT_AS_STRING
+			DBUS_DICT_ENTRY_END_CHAR_AS_STRING, &dict);
+
+	dict_append_entry(&dict, "String", DBUS_TYPE_STRING, &string);
+	dict_append_entry(&dict, "Boolean", DBUS_TYPE_BOOLEAN, &boolean);
+
+	dbus_message_iter_close_container(iter, &dict);
+
+	return TRUE;
+}
+
+static void proxy_get_dict(GDBusProxy *proxy, void *user_data)
+{
+	struct context *context = user_data;
+	DBusMessageIter iter, dict, var1, var2, entry1, entry2;
+	const char *string;
+	dbus_bool_t boolean;
+
+	if (g_test_verbose())
+		g_print("proxy %s found\n",
+					g_dbus_proxy_get_interface(proxy));
+
+	g_assert(g_dbus_proxy_get_property(proxy, "Dict", &iter));
+	g_assert(dbus_message_iter_get_arg_type(&iter) == DBUS_TYPE_ARRAY);
+
+	dbus_message_iter_recurse(&iter, &dict);
+	g_assert(dbus_message_iter_get_arg_type(&dict) ==
+							DBUS_TYPE_DICT_ENTRY);
+
+	dbus_message_iter_recurse(&dict, &entry1);
+	g_assert(dbus_message_iter_get_arg_type(&entry1) == DBUS_TYPE_STRING);
+
+	dbus_message_iter_get_basic(&entry1, &string);
+	g_assert(g_strcmp0(string, "String") == 0);
+
+	dbus_message_iter_next(&entry1);
+	g_assert(dbus_message_iter_get_arg_type(&entry1) == DBUS_TYPE_VARIANT);
+
+	dbus_message_iter_recurse(&entry1, &var1);
+	g_assert(dbus_message_iter_get_arg_type(&var1) == DBUS_TYPE_STRING);
+
+	dbus_message_iter_get_basic(&var1, &string);
+	g_assert(g_strcmp0(string, "value") == 0);
+
+	dbus_message_iter_next(&dict);
+	g_assert(dbus_message_iter_get_arg_type(&dict) ==
+							DBUS_TYPE_DICT_ENTRY);
+
+	dbus_message_iter_recurse(&dict, &entry2);
+	g_assert(dbus_message_iter_get_arg_type(&entry2) == DBUS_TYPE_STRING);
+
+	dbus_message_iter_get_basic(&entry2, &string);
+	g_assert(g_strcmp0(string, "Boolean") == 0);
+
+	dbus_message_iter_next(&entry2);
+	g_assert(dbus_message_iter_get_arg_type(&entry2) == DBUS_TYPE_VARIANT);
+
+	dbus_message_iter_recurse(&entry2, &var2);
+	g_assert(dbus_message_iter_get_arg_type(&var2) == DBUS_TYPE_BOOLEAN);
+
+	dbus_message_iter_get_basic(&var2, &boolean);
+	g_assert(boolean == TRUE);
+
+	dbus_message_iter_next(&dict);
+	g_assert(dbus_message_iter_get_arg_type(&dict) == DBUS_TYPE_INVALID);
+
+	g_main_loop_quit(context->main_loop);
+}
+
+static void client_get_dict_property(void)
+{
+	struct context *context = create_context();
+	static const GDBusPropertyTable dict_properties[] = {
+		{ "Dict", "a{sv}", get_dict },
+		{ },
+	};
+
+	if (context == NULL)
+		return;
+
+	g_dbus_register_interface(context->dbus_conn,
+				SERVICE_PATH, SERVICE_NAME,
+				methods, signals, dict_properties,
+				NULL, NULL);
+
+	context->dbus_client = g_dbus_client_new(context->dbus_conn,
+						SERVICE_NAME, SERVICE_PATH);
+
+	g_dbus_client_set_proxy_handlers(context->dbus_client, proxy_get_dict,
+						NULL, NULL,
+						context);
+
+	g_main_loop_run(context->main_loop);
+
+	g_dbus_unregister_interface(context->dbus_conn,
+					SERVICE_PATH, SERVICE_NAME);
+
+	destroy_context(context);
+}
+
 int main(int argc, char *argv[])
 {
 	g_test_init(&argc, &argv, NULL);
@@ -193,5 +337,8 @@ int main(int argc, char *argv[])
 	g_test_add_func("/gdbus/client_connect_disconnect",
 						client_connect_disconnect);
 
+	g_test_add_func("/gdbus/client_get_dict_property",
+						client_get_dict_property);
+
 	return g_test_run();
 }
-- 
1.8.0.1


^ permalink raw reply related

* [PATCH BlueZ 2/7] gdbus: Add g_dbus_proxy_get_client function
From: Luiz Augusto von Dentz @ 2013-01-11 11:50 UTC (permalink / raw)
  To: linux-bluetooth
In-Reply-To: <1357905018-23237-1-git-send-email-luiz.dentz@gmail.com>

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

This is convenient as some callbacks don't provide the client which
the proxy belongs.
---
 gdbus/client.c | 8 ++++++++
 gdbus/gdbus.h  | 1 +
 2 files changed, 9 insertions(+)

diff --git a/gdbus/client.c b/gdbus/client.c
index ea56023..3c5784b 100644
--- a/gdbus/client.c
+++ b/gdbus/client.c
@@ -478,6 +478,14 @@ const char *g_dbus_proxy_get_interface(GDBusProxy *proxy)
 	return proxy->interface;
 }
 
+GDBusClient *g_dbus_proxy_get_client(GDBusProxy *proxy)
+{
+	if (proxy == NULL)
+		return NULL;
+
+	return proxy->client;
+}
+
 gboolean g_dbus_proxy_get_property(GDBusProxy *proxy, const char *name,
                                                         DBusMessageIter *iter)
 {
diff --git a/gdbus/gdbus.h b/gdbus/gdbus.h
index 77bd069..83e41c7 100644
--- a/gdbus/gdbus.h
+++ b/gdbus/gdbus.h
@@ -313,6 +313,7 @@ void g_dbus_proxy_unref(GDBusProxy *proxy);
 
 const char *g_dbus_proxy_get_path(GDBusProxy *proxy);
 const char *g_dbus_proxy_get_interface(GDBusProxy *proxy);
+GDBusClient *g_dbus_proxy_get_client(GDBusProxy *proxy);
 
 gboolean g_dbus_proxy_get_property(GDBusProxy *proxy, const char *name,
 							DBusMessageIter *iter);
-- 
1.8.0.1


^ permalink raw reply related

* [PATCH BlueZ 1/7] gdbus: Add g_dbus_client_get_proxy
From: Luiz Augusto von Dentz @ 2013-01-11 11:50 UTC (permalink / raw)
  To: linux-bluetooth

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

g_dbus_client_get_proxy gives the possibilitity to just check if a
proxy exist for the given path and interface pair instead of using
g_dbus_proxy_new which end up creating a proxy if it doesn't exists
which is not always necessary.
---
 gdbus/client.c | 8 ++++----
 gdbus/gdbus.h  | 3 +++
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/gdbus/client.c b/gdbus/client.c
index c03e3a4..ea56023 100644
--- a/gdbus/client.c
+++ b/gdbus/client.c
@@ -328,8 +328,8 @@ static void get_all_properties(GDBusProxy *proxy)
 	dbus_message_unref(msg);
 }
 
-static GDBusProxy *proxy_lookup(GDBusClient *client, const char *path,
-						const char *interface)
+GDBusProxy *g_dbus_client_get_proxy(GDBusClient *client, const char *path,
+							const char *interface)
 {
 	GList *list;
 
@@ -423,7 +423,7 @@ GDBusProxy *g_dbus_proxy_new(GDBusClient *client, const char *path,
 	if (client == NULL)
 		return NULL;
 
-	proxy = proxy_lookup(client, path, interface);
+	proxy = g_dbus_client_get_proxy(client, path, interface);
 	if (proxy)
 		return g_dbus_proxy_ref(proxy);
 
@@ -841,7 +841,7 @@ static void parse_properties(GDBusClient *client, const char *path,
 	if (g_str_equal(interface, DBUS_INTERFACE_PROPERTIES) == TRUE)
 		return;
 
-	proxy = proxy_lookup(client, path, interface);
+	proxy = g_dbus_client_get_proxy(client, path, interface);
 	if (proxy) {
 		update_properties(proxy, iter);
 		return;
diff --git a/gdbus/gdbus.h b/gdbus/gdbus.h
index 6f5a012..77bd069 100644
--- a/gdbus/gdbus.h
+++ b/gdbus/gdbus.h
@@ -360,6 +360,9 @@ gboolean g_dbus_client_set_proxy_handlers(GDBusClient *client,
 					GDBusPropertyFunction property_changed,
 					void *user_data);
 
+GDBusProxy *g_dbus_client_get_proxy(GDBusClient *client, const char *path,
+							const char *interface);
+
 #ifdef __cplusplus
 }
 #endif
-- 
1.8.0.1


^ permalink raw reply related

* Obexd OPP filesend fails with Windows7 stack
From: Syam Sidhardhan @ 2013-01-11  8:32 UTC (permalink / raw)
  To: linux-bluetooth
In-Reply-To: <alpine.DEB.2.02.1204250827200.20357@mathewm-linux>

Hi,

We are using the obexd 0.48 version and testing the obexd.
During testing OPP file send, we found one interoperability
issue with the Windows7 PC stack and some commercialized devices
available in the market.

The issue is: OBEXD file transfer is getting failed
once after the complete file content got transfferd. This is
because of, we do a direct RFCOMM disconection rather than
doing a proper OBEX disconection before.

Does someone can help me a with a fix for this?

hcidump logs:
< ACL data: handle 11 flags 0x00 dlen 15
    L2CAP(d): cid 0x0041 len 11 [psm 3]
      RFCOMM(d): UIH: cr 1 dlci 2 pf 0 ilen 7 fcs 0x9a
        OBEX: Connect cmd(f): len 7 version 1.0 flags 0 mtu 4096
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 11 packets 2
> ACL data: handle 11 flags 0x02 dlen 9
    L2CAP(d): cid 0x0041 len 5 [psm 3]
      RFCOMM(d): UIH: cr 0 dlci 2 pf 1 ilen 0 fcs 0x5c credits 26
> ACL data: handle 11 flags 0x02 dlen 16
    L2CAP(d): cid 0x0041 len 12 [psm 3]
      RFCOMM(d): UIH: cr 0 dlci 2 pf 1 ilen 7 fcs 0x5c credits 0
        OBEX: Connect rsp(f): status 200 len 7 version 1.0 flags 0 mtu 4096
        Status 200 = Success
< ACL data: handle 11 flags 0x00 dlen 65
    L2CAP(d): cid 0x0041 len 61 [psm 3]
      RFCOMM(d): UIH: cr 1 dlci 2 pf 0 ilen 57 fcs 0x9a
        OBEX: Put cmd(c): len 57
        Name (0x01) = Unicode length 28
        0000: 00 74 00 65 00 73 00 74  00 2d 00 74 00 65 00 78 
.t.e.s.t.-.t.e.x
        0010: 00 74 00 2e 00 74 00 78  00 74 00 00              .t...t.x.t..
        Length (0xc3) = 15
        Body (0x48) = Sequence length 15
        0000: 54 65 73 74 20 44 6f 63  75 6d 65 6e 74 0d 0a     Test 
Document..
> ACL data: handle 11 flags 0x02 dlen 12
    L2CAP(d): cid 0x0041 len 8 [psm 3]
      RFCOMM(d): UIH: cr 0 dlci 2 pf 1 ilen 3 fcs 0x5c credits 1
        OBEX: Put rsp(f): status 100 len 3
< ACL data: handle 11 flags 0x00 dlen 14
    L2CAP(d): cid 0x0041 len 10 [psm 3]
      RFCOMM(d): UIH: cr 1 dlci 2 pf 0 ilen 6 fcs 0x9a
        OBEX: Put cmd(f): len 6 (continue)
        End of Body (0x49) = Sequence length 0
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 11 packets 2
> ACL data: handle 11 flags 0x02 dlen 12
    L2CAP(d): cid 0x0041 len 8 [psm 3]
      RFCOMM(d): UIH: cr 0 dlci 2 pf 1 ilen 3 fcs 0x5c credits 1
        OBEX: Put rsp(f): status 200 len 3
< ACL data: handle 11 flags 0x00 dlen 8
    L2CAP(d): cid 0x0041 len 4 [psm 3]
      RFCOMM(s): DISC: cr 1 dlci 2 pf 1 ilen 0 fcs 0xb8
> ACL data: handle 11 flags 0x02 dlen 8
    L2CAP(d): cid 0x0041 len 4 [psm 3]
      RFCOMM(s): UA: cr 1 dlci 2 pf 1 ilen 0 fcs 0x92
< ACL data: handle 11 flags 0x00 dlen 8
    L2CAP(d): cid 0x0041 len 4 [psm 3]
      RFCOMM(s): DISC: cr 1 dlci 0 pf 1 ilen 0 fcs 0xfd
< ACL data: handle 11 flags 0x00 dlen 12
    L2CAP(s): Disconn req: dcid 0x0041 scid 0x0041
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 11 packets 2
> ACL data: handle 11 flags 0x02 dlen 8
    L2CAP(d): cid 0x0041 len 4 [psm 3]
      RFCOMM(s): UA: cr 1 dlci 0 pf 1 ilen 0 fcs 0xd7

Thanks,
Syam. 


^ permalink raw reply

* 57 Bluez-users moderator request(s) waiting
From: bluez-users-bounces @ 2013-01-11  8:30 UTC (permalink / raw)
  To: bluez-users-owner

The Bluez-users@lists.sourceforge.net mailing list has 57 request(s)
waiting for your consideration at:

	https://lists.sourceforge.net/lists/admindb/bluez-users
	
Please attend to this at your earliest convenience.  This notice of
pending requests, if any, will be sent out daily.

Pending subscriptions:
    jiahu@atheros.com (jiahu) Tue Nov  9 05:10:57 2010
    grafologi@tiscali.it (claudiosarda) Wed Nov 17 14:56:49 2010
    ycyan.china@gmail.com (terry_55) Mon Nov 22 05:13:40 2010
    tausif.kts766@gmail.com (Tausif Khan) Sun Dec 26 19:08:37 2010
    ajayembedded@gmail.com (ajaykumar) Mon Jan  3 16:25:20 2011
    tejaswini.purandare@wipro.com Thu Jan  6 11:10:27 2011
    sourabh.gre.ma@gmail.com (SAM) Sun Jan  9 13:08:39 2011
    doina.cristina@gmail.com Fri Feb 25 09:57:30 2011
    xuan_fx@hotmail.com (loafer) Wed Mar  2 02:52:59 2011
    debiswas@cisco.com (Debanjan Biswas) Wed Mar  9 09:29:24 2011
    alex@anwsoft.com.tw (Alex Hsu) Sun Mar 27 01:30:38 2011
    alex@anwsoft.com.tw (Alex Hsu) Sun Mar 27 01:52:01 2011
    loafer_k@sina.com (loafer_k) Thu Mar 31 01:22:00 2011
    rtresidd@tresar-electronics.com.au (Richard) Mon Apr 11 11:40:20 2011
    ylemliu@gmail.com Tue Apr 26 09:17:29 2011
    345017062@qq.com (bluebaby) Tue May 31 11:18:58 2011
    ng@gleike.net (Zanifu) Tue Jun 14 14:29:03 2011
    htcleo@bettercommute.org (Roy) Sat Jun 18 02:51:24 2011
    jcteng@tokenwireless.com Tue Jul  5 07:20:28 2011
    luckysolar@gmail.com (Kyle Lin) Tue Jul  5 09:04:28 2011
    bezui01@live.com (Sarel) Sun Aug  7 04:04:54 2011
    sealeafsun@126.com (KalvinYe) Thu Aug 11 03:22:55 2011
    sunil.kumar5@wipro.com (Sunil) Thu Aug 11 05:52:38 2011
    gmo@passifsemi.com (Gmo) Fri Aug 12 19:36:47 2011
    mjanke@deviceworx.com (Mark) Wed Aug 24 17:18:01 2011
    rhbotha@gmail.com (Rynardt) Fri Sep  2 13:21:09 2011
    liaochaoyun66@gmail.com (T.Liao) Sun Sep  4 10:30:22 2011
    costamagna.valerio@gmail.com Fri Sep 16 13:16:58 2011
    lyj_xp@hotmail.com (Walter Liu ) Sat Oct  1 16:45:28 2011
    wshn13@gmail.com (Wang Shaonan) Tue Nov  8 07:22:46 2011
    pandygui@163.com (pandygui) Sat Nov 12 01:29:22 2011
    wshn13@gmail.com (Wang Shaonan) Thu Dec  8 05:14:21 2011
    delentef@gmail.com (F. Delente) Thu Feb  9 10:44:47 2012
    wofanli@gmail.com (nathan) Tue Mar 13 16:07:26 2012
    mahalakshmi.m@jasmin-infotech.com (dollymaha) Wed Mar 21 07:21:31 2012
    jon1979@sbcglobal.net Thu Mar 22 00:45:57 2012
    marter0574@gmail.com (marter) Thu Apr 12 01:09:49 2012
    yzh2195@arcsoft.com (yu zhihu) Mon Apr 16 02:49:00 2012
    bluez@saltyshells.com (Harry Bennett) Sat Apr 21 12:53:25 2012
    jrs@vt.edu (John S) Wed May  2 00:56:05 2012
    woodsboy.cn@163.com (wanlin) Wed May  2 08:36:47 2012
    ybzhao1989@gmail.com (z7z8th) Mon May 14 06:29:16 2012
    easebone@gmail.com (Luke Huang) Thu May 31 05:40:05 2012
    hikohong@gmail.com (Hiko) Mon Jul  2 01:29:05 2012
    francisco.missael@gmail.com Wed Jul 11 21:50:48 2012
    francisco.missael@gmail.com (Francisco) Wed Jul 25 16:55:36 2012
    nshutchinson@gmail.com (Nick Hutchinson) Tue Jul 31 11:06:12 2012
    karl.wang@mstarsemi.com (karl) Mon Aug  6 06:46:42 2012
    karl.wang@mstarsemi.com (karl.wang) Tue Aug 21 08:47:01 2012
    lcheng@grandstream.com (chenglei) Thu Sep 27 01:09:09 2012
    dshwatrz@gmail.com Wed Oct 17 12:20:35 2012
    zhaojidong6020@163.com (zhaojidong) Thu Oct 25 12:53:31 2012
    yzzq@hotmail.com (yang) Wed Nov  7 09:13:07 2012
    qdtuxt@163.com (xiaotao tu) Wed Dec 12 10:46:14 2012
    embeddedboy@gmail.com (embeddedboy) Wed Dec 19 06:51:20 2012
    bhavesh.soni@indieontech.com (bhavesh) Wed Dec 26 06:36:42 2012
    bhavesh.soni@indieontech.com (bhavesh) Fri Dec 28 09:34:13 2012

^ permalink raw reply

* [PATCH BlueZ 2/2] unit: Add tests for SDP integer Data Elements
From: Anderson Lizardo @ 2013-01-11  1:22 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Anderson Lizardo
In-Reply-To: <1357867322-31384-1-git-send-email-anderson.lizardo@openbossa.org>

SDP_DATA_NIL does not have a value, but its sdp_data_t val field is
zeroed by memset(), so just treat it as UINT8 with zero value to
simplify checking (and not require a separate macro.)

SDP_BOOL is handled by SDP library as a INT8.

SDP_UINT128/SDP_INT128 are just byte arrays converted to host order, so
use memcmp() to compare them (converting from host to network order
first.)
---
 unit/test-sdp.c |   84 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 84 insertions(+)

diff --git a/unit/test-sdp.c b/unit/test-sdp.c
index 7879e58..8c0ce98 100644
--- a/unit/test-sdp.c
+++ b/unit/test-sdp.c
@@ -52,6 +52,7 @@ struct test_data {
 };
 
 #define raw_data(args...) ((const unsigned char[]) { args })
+#define build_u128(args...) ((const uint128_t) { .data = { args } })
 
 #define raw_pdu(args...) \
 	{							\
@@ -768,6 +769,7 @@ static void test_sdp(gconstpointer data)
 static void test_sdp_de_attr(gconstpointer data)
 {
 	const struct test_data_de *test = data;
+	uint128_t u128;
 	sdp_data_t *d;
 	int size = 0;
 
@@ -786,6 +788,39 @@ static void test_sdp_de_attr(gconstpointer data)
 	case SDP_URL_STR16:
 		g_assert_cmpstr(test->expected.val.str, ==, d->val.str);
 		break;
+	case SDP_DATA_NIL:
+	case SDP_UINT8:
+		g_assert_cmpuint(test->expected.val.uint8, ==, d->val.uint8);
+		break;
+	case SDP_UINT16:
+		g_assert_cmpuint(test->expected.val.uint16, ==, d->val.uint16);
+		break;
+	case SDP_UINT32:
+		g_assert_cmpuint(test->expected.val.uint32, ==, d->val.uint32);
+		break;
+	case SDP_UINT64:
+		g_assert_cmpuint(test->expected.val.uint64, ==, d->val.uint64);
+		break;
+	case SDP_BOOL:
+	case SDP_INT8:
+		g_assert_cmpuint(test->expected.val.int8, ==, d->val.int8);
+		break;
+	case SDP_INT16:
+		g_assert_cmpuint(test->expected.val.int16, ==, d->val.int16);
+		break;
+	case SDP_INT32:
+		g_assert_cmpuint(test->expected.val.int32, ==, d->val.int32);
+		break;
+	case SDP_INT64:
+		g_assert_cmpuint(test->expected.val.int64, ==, d->val.int64);
+		break;
+	case SDP_UINT128:
+	case SDP_INT128:
+		/* Expected bytes are in network order */
+		hton128(&d->val.uint128, &u128);
+		g_assert(memcmp(&test->expected.val.uint128, &u128,
+						sizeof(uint128_t)) == 0);
+		break;
 	default:
 		g_assert_not_reached();
 	}
@@ -2774,6 +2809,55 @@ int main(int argc, char *argv[])
 				0x6c, 0x75, 0x65, 0x7a, 0x2e, 0x6f, 0x72, 0x67,
 				0x2f),
 			exp_data(SDP_URL_STR16, str, "http://www.bluez.org/"));
+	define_test_de_attr("NIL",
+			raw_data(0x00),
+			exp_data(SDP_DATA_NIL, uint8, 0));
+	define_test_de_attr("UINT8",
+			raw_data(0x08, 0xff),
+			exp_data(SDP_UINT8, uint8, UINT8_MAX));
+	define_test_de_attr("INT8",
+			raw_data(0x10, 0x80),
+			exp_data(SDP_INT8, int8, INT8_MIN));
+	define_test_de_attr("BOOL",
+			raw_data(0x28, 0x01),
+			exp_data(SDP_BOOL, int8, 1));
+	define_test_de_attr("UINT16",
+			raw_data(0x09, 0xff, 0xff),
+			exp_data(SDP_UINT16, uint16, UINT16_MAX));
+	define_test_de_attr("INT16",
+			raw_data(0x11, 0x80, 0x00),
+			exp_data(SDP_INT16, int16, INT16_MIN));
+	define_test_de_attr("UINT32",
+			raw_data(0x0A, 0xff, 0xff, 0xff, 0xff),
+			exp_data(SDP_UINT32, uint32, UINT32_MAX));
+	define_test_de_attr("INT32",
+			raw_data(0x12, 0x80, 0x00, 0x00, 0x00),
+			exp_data(SDP_INT32, int32, INT32_MIN));
+	define_test_de_attr("UINT64",
+			raw_data(0x0B, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+									0xff),
+			exp_data(SDP_UINT64, uint64, UINT64_MAX));
+	define_test_de_attr("INT64",
+			raw_data(0x13, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+									0x00),
+			exp_data(SDP_INT64, int64, INT64_MIN));
+	/* UINT128/INT128 are just byte arrays parsed as uint128_t */
+	define_test_de_attr("UINT128",
+			raw_data(0x0C, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+					0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+					0xff, 0xff, 0xff),
+			exp_data(SDP_UINT128, uint128,
+				build_u128(0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+						0xff, 0xff, 0xff, 0xff, 0xff,
+						0xff, 0xff, 0xff, 0xff, 0xff)));
+	define_test_de_attr("INT128",
+			raw_data(0x14, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+					0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+					0x00, 0x00, 0x00),
+			exp_data(SDP_INT128, uint128,
+				build_u128(0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
+						0x00, 0x00, 0x00, 0x00, 0x00,
+						0x00, 0x00, 0x00, 0x00, 0x00)));
 
 	return g_test_run();
 }
-- 
1.7.9.5


^ permalink raw reply related

* [PATCH BlueZ 1/2] unit: Add {TEXT,URL}_STR{8,16} tests for sdp_extract_attr()
From: Anderson Lizardo @ 2013-01-11  1:22 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Anderson Lizardo

These tests are for valid data. Other tests might be added later to
check for error paths, but will require separate macros.

{TEXT,URL}_STR32 cannot be tested with the same macros because
sdp_extract_attr() does not support them. They will be tested
separately with other SDP library functions.

As example of failure output, if commit
504a0cf46ad89cab8005ce9cffb22e41048f6a30 is reverted for testing, the
STR16 test will fail with:

ERROR:unit/test-sdp.c:776:test_sdp_de_attr: assertion failed
(test->input_size == size): (7 == 11)
---
 unit/test-sdp.c |   78 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 78 insertions(+)

diff --git a/unit/test-sdp.c b/unit/test-sdp.c
index 77a4c6c..7879e58 100644
--- a/unit/test-sdp.c
+++ b/unit/test-sdp.c
@@ -85,6 +85,29 @@ struct test_data {
 #define define_ssa(name, args...) define_test("/TP/SERVER/SSA/" name, 48, args)
 #define define_brw(name, args...) define_test("/TP/SERVER/BRW/" name, 672, args)
 
+/* SDP Data Element (DE) tests */
+struct test_data_de {
+	const void *input_data;
+	size_t input_size;
+	sdp_data_t expected;
+};
+
+#define exp_data(_dtd, val_type, val_data) \
+	((const sdp_data_t) {			\
+		.dtd = _dtd,			\
+		.val.val_type = val_data,	\
+	})
+
+#define define_test_de_attr(name, input, exp) \
+	do {								\
+		static struct test_data_de data;			\
+		data.input_data = input;				\
+		data.input_size = sizeof(input);			\
+		data.expected = exp;					\
+		g_test_add_data_func("/sdp/DE/ATTR/" name, &data,	\
+						test_sdp_de_attr);	\
+	} while (0)
+
 struct context {
 	GMainLoop *main_loop;
 	guint server_source;
@@ -742,6 +765,34 @@ static void test_sdp(gconstpointer data)
 	g_free(test->pdu_list);
 }
 
+static void test_sdp_de_attr(gconstpointer data)
+{
+	const struct test_data_de *test = data;
+	sdp_data_t *d;
+	int size = 0;
+
+	d = sdp_extract_attr(test->input_data, test->input_size, &size, NULL);
+	g_assert(d != NULL);
+	g_assert_cmpuint(test->input_size, ==, size);
+	g_assert_cmpuint(test->expected.dtd, ==, d->dtd);
+
+	if (g_test_verbose() == TRUE)
+		g_print("DTD=0x%02x\n", d->dtd);
+
+	switch (d->dtd) {
+	case SDP_TEXT_STR8:
+	case SDP_TEXT_STR16:
+	case SDP_URL_STR8:
+	case SDP_URL_STR16:
+		g_assert_cmpstr(test->expected.val.str, ==, d->val.str);
+		break;
+	default:
+		g_assert_not_reached();
+	}
+
+	sdp_data_free(d);
+}
+
 int main(int argc, char *argv[])
 {
 	g_test_init(&argc, &argv, NULL);
@@ -2697,5 +2748,32 @@ int main(int argc, char *argv[])
 			0x08, 0x09, 0x00, 0x01, 0x35, 0x03, 0x19, 0x11,
 			0x06, 0x00));
 
+	/*
+	 * SDP Data Element (DE) tests
+	 *
+	 * Test extraction of valid DEs supported by sdp_extract_attr().
+	 */
+	define_test_de_attr("TEXT_STR8/empty",
+			raw_data(0x25, 0x00),
+			exp_data(SDP_TEXT_STR8, str, ""));
+	define_test_de_attr("TEXT_STR8",
+			raw_data(0x25, 0x04, 0x41, 0x42, 0x43, 0x44),
+			exp_data(SDP_TEXT_STR8, str, "ABCD"));
+	define_test_de_attr("TEXT_STR16",
+			raw_data(0x26, 0x00, 0x04, 0x41, 0x42, 0x43, 0x44),
+			exp_data(SDP_TEXT_STR16, str, "ABCD"));
+	define_test_de_attr("URL_STR8",
+			raw_data(0x45, 0x15, 0x68, 0x74, 0x74, 0x70, 0x3a,
+				0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x62, 0x6c,
+				0x75, 0x65, 0x7a, 0x2e, 0x6f, 0x72, 0x67,
+				0x2f),
+			exp_data(SDP_URL_STR8, str, "http://www.bluez.org/"));
+	define_test_de_attr("URL_STR16",
+			raw_data(0x46, 0x00, 0x15, 0x68, 0x74, 0x74, 0x70,
+				0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x62,
+				0x6c, 0x75, 0x65, 0x7a, 0x2e, 0x6f, 0x72, 0x67,
+				0x2f),
+			exp_data(SDP_URL_STR16, str, "http://www.bluez.org/"));
+
 	return g_test_run();
 }
-- 
1.7.9.5


^ permalink raw reply related

* Re: [PATCH BlueZ 1/2] build: Fix --disable-optimization configure option
From: Marcel Holtmann @ 2013-01-11  0:31 UTC (permalink / raw)
  To: Anderson Lizardo; +Cc: linux-bluetooth
In-Reply-To: <1357659987-4219-1-git-send-email-anderson.lizardo@openbossa.org>

Hi Anderson,

> On commit cc9e4e7cae0379864ea06038d92bf7ecc192bba7, this flag was
> mistakenly replaced with the behavior of the old --enable-fortify
> option.
> 
> This patch restores the "-O0" flag when --disable-optimization is used.
> 
> Unfortunately, this is not enough to disable build optimization. By
> default, autoconf adds -O2 to CFLAGS if the compiler is GCC. AM_CFLAGS
> (where -O0 is added with --disable-optimization) is passed as argument
> to GCC before autoconf CFLAGS, so it is not possible to override the
> default -O2. One solution is to use:
> 
> CFLAGS= ./configure --disable-optimization
> 
> i.e. remove -O2 from CFLAGS, and let autoconf add -O0.
> ---
>  acinclude.m4 |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

patch has been applied.

Regards

Marcel



^ permalink raw reply

* Re: [PATCH BlueZ 2/2] attrib: Fix compilation errors when compiled without optimization
From: Marcel Holtmann @ 2013-01-11  0:06 UTC (permalink / raw)
  To: Anderson Lizardo; +Cc: linux-bluetooth
In-Reply-To: <1357659987-4219-2-git-send-email-anderson.lizardo@openbossa.org>

Hi Anderzon,

> Fix these build errors:
> 
> attrib/att.c: In function ‘dec_read_by_grp_req’:
> attrib/att.c:165:10: error: comparison between signed and unsigned
> integer expressions [-Werror=sign-compare]
> attrib/att.c:170:10: error: comparison between signed and unsigned
> integer expressions [-Werror=sign-compare]
> attrib/att.c: In function ‘dec_read_by_type_req’:
> attrib/att.c:393:10: error: comparison between signed and unsigned
> integer expressions [-Werror=sign-compare]
> attrib/att.c:402:10: error: comparison between signed and unsigned
> integer expressions [-Werror=sign-compare]
> ---
>  attrib/att.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

patch has been applied.

Regards

Marcel



^ permalink raw reply

* Re: [PATCH neard 1/2] build: Use AM_CPPFLAGS instead of INCLUDES
From: Marcel Holtmann @ 2013-01-10 23:54 UTC (permalink / raw)
  To: Lucas De Marchi; +Cc: linux-bluetooth, linux-nfc
In-Reply-To: <1357831094-13513-1-git-send-email-lucas.demarchi@profusion.mobi>

Hi Lucas,

> Makefile.am:50: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
> ---
>  Makefile.am | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

patch has been applied.

Regards

Marcel



^ permalink raw reply


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