From 48cb2e5249d56ddb796440cb81ce824adc8ead16 Mon Sep 17 00:00:00 2001 From: Vinicius Costa Gomes Date: Tue, 23 Apr 2013 18:21:50 -0300 Subject: bluez5: Unify bt_register_profile_* into a single function It was a cause of confusion for little gain to have separate functions for registering profiles with extra information, for example "role" and "features". We remove those helper functions in favor of a single one with more parameters, "role" and "feature" when NULL, will be ignored. --- plugins/bluez5.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'plugins/bluez5.c') diff --git a/plugins/bluez5.c b/plugins/bluez5.c index 0f997daf..979076e4 100644 --- a/plugins/bluez5.c +++ b/plugins/bluez5.c @@ -90,9 +90,10 @@ done: dbus_message_unref(reply); } -int bt_register_profile_with_role(DBusConnection *conn, const char *uuid, +int bt_register_profile(DBusConnection *conn, const char *uuid, uint16_t version, const char *name, - const char *object, const char *role) + const char *object, const char *role, + uint16_t features) { DBusMessageIter iter, dict; DBusPendingCall *c; @@ -114,6 +115,10 @@ int bt_register_profile_with_role(DBusConnection *conn, const char *uuid, if (role) ofono_dbus_dict_append(&dict, "Role", DBUS_TYPE_STRING, &role); + if (features) + ofono_dbus_dict_append(&dict, "Features", DBUS_TYPE_UINT16, + &features); + dbus_message_iter_close_container(&iter, &dict); if (!dbus_connection_send_with_reply(conn, msg, &c, -1)) { @@ -130,14 +135,6 @@ int bt_register_profile_with_role(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; -- cgit v1.2.3