linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH BlueZ 06/11] obexd: Add support for custom records
Date: Wed, 12 Dec 2012 13:52:11 +0200	[thread overview]
Message-ID: <1355313136-7891-6-git-send-email-luiz.dentz@gmail.com> (raw)
In-Reply-To: <1355313136-7891-1-git-send-email-luiz.dentz@gmail.com>

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

Services such as pcsuite and syncml use custom records not defined by
Bluetooth SIG so they have to be registered using ServiceRecord entry.
---
 obexd/plugins/bluetooth.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/obexd/plugins/bluetooth.c b/obexd/plugins/bluetooth.c
index 8a9e190..cbc42f3 100644
--- a/obexd/plugins/bluetooth.c
+++ b/obexd/plugins/bluetooth.c
@@ -253,6 +253,7 @@ static int register_profile(struct bluetooth_profile *profile)
 	DBusMessageIter iter, opt;
 	DBusPendingCall *call;
 	dbus_bool_t auto_connect = FALSE;
+	char *xml;
 	int ret = 0;
 
 	profile->path = g_strconcat("/org/bluez/obex/", profile->uuid, NULL);
@@ -286,6 +287,20 @@ static int register_profile(struct bluetooth_profile *profile)
 					&opt);
 	dict_append_entry(&opt, "AutoConnect", DBUS_TYPE_BOOLEAN,
 								&auto_connect);
+	if (profile->driver->record) {
+		if (profile->driver->port != 0)
+			xml = g_markup_printf_escaped(profile->driver->record,
+						profile->driver->channel,
+						profile->driver->name,
+						profile->driver->port);
+		else
+			xml = g_markup_printf_escaped(profile->driver->record,
+						profile->driver->channel,
+						profile->driver->name);
+		dict_append_entry(&opt, "ServiceRecord", DBUS_TYPE_STRING,
+								&xml);
+		g_free(xml);
+	}
 	dbus_message_iter_close_container(&iter, &opt);
 
 	if (!dbus_connection_send_with_reply(connection, msg, &call, -1)) {
@@ -314,6 +329,10 @@ static const char *service2uuid(uint16_t service)
 		return OBEX_PSE_UUID;
 	case OBEX_IRMC:
 		return OBEX_SYNC_UUID;
+	case OBEX_PCSUITE:
+		return "00005005-0000-1000-8000-0002ee000001";
+	case OBEX_SYNCEVOLUTION:
+		return "00000002-0000-1000-8000-0002ee000002";
 	case OBEX_MAS:
 		return OBEX_MAS_UUID;
 	}
-- 
1.7.11.7


  parent reply	other threads:[~2012-12-12 11:52 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-12 11:52 [PATCH BlueZ 01/11] obexd: Port bluetooth plugin to use external profile support Luiz Augusto von Dentz
2012-12-12 11:52 ` [PATCH BlueZ 02/11] core: Add MAS record Luiz Augusto von Dentz
2012-12-12 11:52 ` [PATCH BlueZ 03/11] core: Add SYNC record Luiz Augusto von Dentz
2012-12-12 11:52 ` [PATCH BlueZ 04/11] obexd: Enable support for MAS profile Luiz Augusto von Dentz
2012-12-12 11:52 ` [PATCH BlueZ 05/11] obexd: Enable support SYNC profile Luiz Augusto von Dentz
2012-12-12 11:52 ` Luiz Augusto von Dentz [this message]
2012-12-12 11:52 ` [PATCH BlueZ 07/11] opp: Remove record details Luiz Augusto von Dentz
2012-12-12 11:52 ` [PATCH BlueZ 08/11] ftp: " Luiz Augusto von Dentz
2012-12-12 11:52 ` [PATCH BlueZ 09/11] pbap: " Luiz Augusto von Dentz
2012-12-12 11:52 ` [PATCH BlueZ 10/11] mas: " Luiz Augusto von Dentz
2012-12-12 11:52 ` [PATCH BlueZ 11/11] irmc: " Luiz Augusto von Dentz
2012-12-12 12:02 ` [PATCH BlueZ 01/11] obexd: Port bluetooth plugin to use external profile support Johan Hedberg
2012-12-12 16:38   ` Mikel Astiz
2012-12-12 18:55     ` Johan Hedberg

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=1355313136-7891-6-git-send-email-luiz.dentz@gmail.com \
    --to=luiz.dentz@gmail.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 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).