All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] bluez5: Add bt_register_profile_with_role
@ 2013-03-01 21:58 Paulo Borges
  2013-03-04 18:05 ` Denis Kenzior
  0 siblings, 1 reply; 2+ messages in thread
From: Paulo Borges @ 2013-03-01 21:58 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 2218 bytes --]

This function allows to specify which role is registering when the
profile does not have specific UUIDs for each role.
---
 plugins/bluez5.c |   15 +++++++++++++--
 plugins/bluez5.h |    4 ++++
 2 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/plugins/bluez5.c b/plugins/bluez5.c
index 9233a2b..7cc11fd 100644
--- a/plugins/bluez5.c
+++ b/plugins/bluez5.c
@@ -107,9 +107,9 @@ done:
 	dbus_message_unref(reply);
 }
 
-int bt_register_profile(DBusConnection *conn, const char *uuid,
+int bt_register_profile_with_role(DBusConnection *conn, const char *uuid,
 					uint16_t version, const char *name,
-					const char *object)
+					const char *object, const char *role)
 {
 	DBusMessageIter iter, dict;
 	DBusPendingCall *c;
@@ -128,6 +128,9 @@ int bt_register_profile(DBusConnection *conn, const char *uuid,
 	ofono_dbus_dict_append(&dict, "Name", DBUS_TYPE_STRING, &name);
 	ofono_dbus_dict_append(&dict, "Version", DBUS_TYPE_UINT16, &version);
 
+	if (role)
+		ofono_dbus_dict_append(&dict, "Role", DBUS_TYPE_STRING, &role);
+
 	dbus_message_iter_close_container(&iter, &dict);
 
 	if (!dbus_connection_send_with_reply(conn, msg, &c, -1)) {
@@ -144,6 +147,14 @@ int bt_register_profile(DBusConnection *conn, const char *uuid,
 	return 0;
 }
 
+int bt_register_profile(DBusConnection *conn, const char *uuid,
+					uint16_t version, const char *name,
+							const char *object)
+{
+	return bt_register_profile_with_role(conn, uuid, version, name, object,
+									NULL);
+}
+
 void bt_unregister_profile(DBusConnection *conn, const char *object)
 {
 	DBusMessageIter iter;
diff --git a/plugins/bluez5.h b/plugins/bluez5.h
index 1432068..f7f3d7e 100644
--- a/plugins/bluez5.h
+++ b/plugins/bluez5.h
@@ -69,6 +69,10 @@ int bt_ba2str(const bdaddr_t *ba, char *str);
 
 int bt_bacmp(const bdaddr_t *ba1, const bdaddr_t *ba2);
 
+int bt_register_profile_with_role(DBusConnection *conn, const char *uuid,
+					uint16_t version, const char *name,
+					const char *object, const char *role);
+
 int bt_register_profile(DBusConnection *conn, const char *uuid,
 					uint16_t version, const char *name,
 					const char *object);
-- 
1.7.9.5


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

* Re: [PATCH] bluez5: Add bt_register_profile_with_role
  2013-03-01 21:58 [PATCH] bluez5: Add bt_register_profile_with_role Paulo Borges
@ 2013-03-04 18:05 ` Denis Kenzior
  0 siblings, 0 replies; 2+ messages in thread
From: Denis Kenzior @ 2013-03-04 18:05 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 384 bytes --]

Hi Paulo,

On 03/01/2013 03:58 PM, Paulo Borges wrote:
> This function allows to specify which role is registering when the
> profile does not have specific UUIDs for each role.
> ---
>   plugins/bluez5.c |   15 +++++++++++++--
>   plugins/bluez5.h |    4 ++++
>   2 files changed, 17 insertions(+), 2 deletions(-)
>

Patch has been applied, thanks.

Regards,
-Denis


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

end of thread, other threads:[~2013-03-04 18:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-01 21:58 [PATCH] bluez5: Add bt_register_profile_with_role Paulo Borges
2013-03-04 18:05 ` Denis Kenzior

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.