Add btd_error_agent_not_available()

This commit is contained in:
Gustavo F. Padovan 2010-12-16 15:58:07 -02:00 committed by Johan Hedberg
parent ea30b84b23
commit 33249f80e6
4 changed files with 9 additions and 4 deletions

View File

@ -369,8 +369,7 @@ static DBusMessage *ag_connect(DBusConnection *conn, DBusMessage *msg,
int err;
if (!gw->agent)
return g_dbus_create_error(msg, ERROR_INTERFACE
".Failed", "Agent not assigned");
return btd_error_agent_not_available(msg);
err = get_records(au_dev);
if (err < 0)

View File

@ -1412,8 +1412,7 @@ static DBusMessage *request_session(DBusConnection *conn,
int err;
if (!adapter->agent)
return g_dbus_create_error(msg, ERROR_INTERFACE ".Failed",
"No agent registered");
return btd_error_agent_not_available(msg);
if (!adapter->mode_sessions)
adapter->global_mode = adapter->mode;

View File

@ -97,6 +97,12 @@ DBusMessage *btd_error_no_such_adapter(DBusMessage *msg)
"No such adapter");
}
DBusMessage *btd_error_agent_not_available(DBusMessage *msg)
{
return g_dbus_create_error(msg, ERROR_INTERFACE ".AgentNotAvailable",
"Agent Not Available");
}
DBusMessage *btd_error_failed(DBusMessage *msg, const char *str)
{
return g_dbus_create_error(msg, ERROR_INTERFACE

View File

@ -38,4 +38,5 @@ DBusMessage *btd_error_in_progress(DBusMessage *msg);
DBusMessage *btd_error_does_not_exist(DBusMessage *msg);
DBusMessage *btd_error_not_authorized(DBusMessage *msg);
DBusMessage *btd_error_no_such_adapter(DBusMessage *msg);
DBusMessage *btd_error_agent_not_available(DBusMessage *msg);
DBusMessage *btd_error_failed(DBusMessage *msg, const char *str);