mirror of git://git.sysmocom.de/ofono
bluez5: Add bt_register_profile_with_role
This function allows to specify which role is registering when the profile does not have specific UUIDs for each role.
This commit is contained in:
parent
4fcd084859
commit
08eea76ea8
|
@ -107,9 +107,9 @@ done:
|
||||||
dbus_message_unref(reply);
|
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,
|
uint16_t version, const char *name,
|
||||||
const char *object)
|
const char *object, const char *role)
|
||||||
{
|
{
|
||||||
DBusMessageIter iter, dict;
|
DBusMessageIter iter, dict;
|
||||||
DBusPendingCall *c;
|
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, "Name", DBUS_TYPE_STRING, &name);
|
||||||
ofono_dbus_dict_append(&dict, "Version", DBUS_TYPE_UINT16, &version);
|
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);
|
dbus_message_iter_close_container(&iter, &dict);
|
||||||
|
|
||||||
if (!dbus_connection_send_with_reply(conn, msg, &c, -1)) {
|
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;
|
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)
|
void bt_unregister_profile(DBusConnection *conn, const char *object)
|
||||||
{
|
{
|
||||||
DBusMessageIter iter;
|
DBusMessageIter iter;
|
||||||
|
|
|
@ -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_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,
|
int bt_register_profile(DBusConnection *conn, const char *uuid,
|
||||||
uint16_t version, const char *name,
|
uint16_t version, const char *name,
|
||||||
const char *object);
|
const char *object);
|
||||||
|
|
Loading…
Reference in New Issue