All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Frédéric Danis" <frederic.danis@linux.intel.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH obexd] client: Add parameters to get message in map module
Date: Wed, 29 Aug 2012 11:39:50 +0200	[thread overview]
Message-ID: <1346233190-6238-1-git-send-email-frederic.danis@linux.intel.com> (raw)

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


             reply	other threads:[~2012-08-29  9:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-29  9:39 Frédéric Danis [this message]
2012-08-30 15:21 ` [PATCH obexd] client: Add parameters to get message in map module Luiz Augusto von Dentz
2012-08-31  7:23   ` Frederic Danis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1346233190-6238-1-git-send-email-frederic.danis@linux.intel.com \
    --to=frederic.danis@linux.intel.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.