linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH obexd] client: Add parameters to get message in map module
@ 2012-08-29  9:39 Frédéric Danis
  2012-08-30 15:21 ` Luiz Augusto von Dentz
  0 siblings, 1 reply; 3+ messages in thread
From: Frédéric Danis @ 2012-08-29  9:39 UTC (permalink / raw)
  To: linux-bluetooth

GetMessage function needs attachment and charset application params
---
 client/map.c |   14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/client/map.c b/client/map.c
index 4f07fcb..fa27c21 100644
--- a/client/map.c
+++ b/client/map.c
@@ -29,6 +29,8 @@
 #include <glib.h>
 #include <gdbus.h>
 
+#include <gobex/gobex-apparam.h>
+
 #include "dbus.h"
 #include "log.h"
 
@@ -36,6 +38,7 @@
 #include "transfer.h"
 #include "session.h"
 #include "driver.h"
+#include "map_ap.h"
 
 #define OBEX_MAS_UUID \
 	"\xBB\x58\x2B\x40\x42\x0C\x11\xDB\xB0\xDE\x08\x00\x20\x0C\x9A\x66"
@@ -258,6 +261,9 @@ static DBusMessage *map_msg_get(DBusConnection *connection,
 	struct map_msg *msg = user_data;
 	struct obc_transfer *transfer;
 	const char *target_file;
+	GObexApparam *apparam;
+	guint8 buf[6];
+	gsize len;
 	GError *err = NULL;
 	DBusMessage *reply;
 
@@ -272,6 +278,14 @@ static DBusMessage *map_msg_get(DBusConnection *connection,
 	if (transfer == NULL)
 		goto fail;
 
+	apparam = g_obex_apparam_set_uint8(NULL, MAP_AP_ATTACHMENT, 0);
+	apparam = g_obex_apparam_set_uint8(apparam, MAP_AP_CHARSET, 1);
+	len = g_obex_apparam_encode(apparam, buf, sizeof(buf));
+
+	obc_transfer_set_params(transfer, buf, len);
+
+	g_obex_apparam_free(apparam);
+
 	if (!obc_session_queue(msg->data->session, transfer, NULL, NULL, &err))
 		goto fail;
 
-- 
1.7.9.5


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

* Re: [PATCH obexd] client: Add parameters to get message in map module
  2012-08-29  9:39 [PATCH obexd] client: Add parameters to get message in map module Frédéric Danis
@ 2012-08-30 15:21 ` Luiz Augusto von Dentz
  2012-08-31  7:23   ` Frederic Danis
  0 siblings, 1 reply; 3+ messages in thread
From: Luiz Augusto von Dentz @ 2012-08-30 15:21 UTC (permalink / raw)
  To: Frédéric Danis; +Cc: linux-bluetooth

Hi Frédéric,

On Wed, Aug 29, 2012 at 12:39 PM, Frédéric Danis
<frederic.danis@linux.intel.com> wrote:
> GetMessage function needs attachment and charset application params
> ---
>  client/map.c |   14 ++++++++++++++
>  1 file changed, 14 insertions(+)
>
> diff --git a/client/map.c b/client/map.c
> index 4f07fcb..fa27c21 100644
> --- a/client/map.c
> +++ b/client/map.c
> @@ -29,6 +29,8 @@
>  #include <glib.h>
>  #include <gdbus.h>
>
> +#include <gobex/gobex-apparam.h>
> +
>  #include "dbus.h"
>  #include "log.h"
>
> @@ -36,6 +38,7 @@
>  #include "transfer.h"
>  #include "session.h"
>  #include "driver.h"
> +#include "map_ap.h"
>
>  #define OBEX_MAS_UUID \
>         "\xBB\x58\x2B\x40\x42\x0C\x11\xDB\xB0\xDE\x08\x00\x20\x0C\x9A\x66"
> @@ -258,6 +261,9 @@ static DBusMessage *map_msg_get(DBusConnection *connection,
>         struct map_msg *msg = user_data;
>         struct obc_transfer *transfer;
>         const char *target_file;
> +       GObexApparam *apparam;
> +       guint8 buf[6];
> +       gsize len;
>         GError *err = NULL;
>         DBusMessage *reply;
>
> @@ -272,6 +278,14 @@ static DBusMessage *map_msg_get(DBusConnection *connection,
>         if (transfer == NULL)
>                 goto fail;
>
> +       apparam = g_obex_apparam_set_uint8(NULL, MAP_AP_ATTACHMENT, 0);
> +       apparam = g_obex_apparam_set_uint8(apparam, MAP_AP_CHARSET, 1);
> +       len = g_obex_apparam_encode(apparam, buf, sizeof(buf));
> +
> +       obc_transfer_set_params(transfer, buf, len);
> +
> +       g_obex_apparam_free(apparam);
> +
>         if (!obc_session_queue(msg->data->session, transfer, NULL, NULL, &err))
>                 goto fail;
>
> --
> 1.7.9.5

I have a pending patchset to address this, basically adding filters
parameters so the application can enable what this parameters should
be. Btw, Im confused why are you setting attachment as type uint8, the
spec says it should assume "On" or "Off", which normally means it is
of string type.


-- 
Luiz Augusto von Dentz

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

* Re: [PATCH obexd] client: Add parameters to get message in map module
  2012-08-30 15:21 ` Luiz Augusto von Dentz
@ 2012-08-31  7:23   ` Frederic Danis
  0 siblings, 0 replies; 3+ messages in thread
From: Frederic Danis @ 2012-08-31  7:23 UTC (permalink / raw)
  To: Luiz Augusto von Dentz; +Cc: linux-bluetooth

Hello Luiz,

On 30/08/2012 17:21, Luiz Augusto von Dentz wrote:
>> +       apparam = g_obex_apparam_set_uint8(NULL, MAP_AP_ATTACHMENT, 0);
>> +       apparam = g_obex_apparam_set_uint8(apparam, MAP_AP_CHARSET, 1);
>> +       len = g_obex_apparam_encode(apparam, buf, sizeof(buf));
>> +
>> +       obc_transfer_set_params(transfer, buf, len);
>> +
>> +       g_obex_apparam_free(apparam);
>> +
>>          if (!obc_session_queue(msg->data->session, transfer, NULL, NULL, &err))
>>                  goto fail;
>>
>> --
>> 1.7.9.5
>
> I have a pending patchset to address this, basically adding filters
> parameters so the application can enable what this parameters should
> be. Btw, Im confused why are you setting attachment as type uint8, the
> spec says it should assume "On" or "Off", which normally means it is
> of string type.
>

I sent this as those parameters are needed to be able to retrieve 
message on Samsung GT-I9300.
Forgot it as you have more complete patchset.

Attachment parameter is defined as a byte in chapter 6.3.1 of the MAP 
spec (page 65, bitmask with 0="OFF" and 1="ON").


-- 
Frederic Danis                            Open Source Technology Center
frederic.danis@intel.com                              Intel Corporation


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

end of thread, other threads:[~2012-08-31  7:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-29  9:39 [PATCH obexd] client: Add parameters to get message in map module Frédéric Danis
2012-08-30 15:21 ` Luiz Augusto von Dentz
2012-08-31  7:23   ` Frederic Danis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).