public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] add btd_error_agent_not_available()
@ 2010-12-16 17:58 Gustavo F. Padovan
  2010-12-16 17:58 ` [PATCH 2/3] add btd_error_not_ready() Gustavo F. Padovan
  2010-12-16 19:45 ` [PATCH 1/3] add btd_error_agent_not_available() Johan Hedberg
  0 siblings, 2 replies; 4+ messages in thread
From: Gustavo F. Padovan @ 2010-12-16 17:58 UTC (permalink / raw)
  To: linux-bluetooth

---
 audio/gateway.c |    3 +--
 src/adapter.c   |    3 +--
 src/error.c     |    6 ++++++
 src/error.h     |    1 +
 4 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/audio/gateway.c b/audio/gateway.c
index 655047d..43a4b02 100644
--- a/audio/gateway.c
+++ b/audio/gateway.c
@@ -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)
diff --git a/src/adapter.c b/src/adapter.c
index 2ff59a0..a36d2b1 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -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;
diff --git a/src/error.c b/src/error.c
index 1ee98c8..ebfc614 100644
--- a/src/error.c
+++ b/src/error.c
@@ -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
diff --git a/src/error.h b/src/error.h
index f346c07..ffd4332 100644
--- a/src/error.h
+++ b/src/error.h
@@ -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);
-- 
1.7.3.2


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

end of thread, other threads:[~2010-12-16 19:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-16 17:58 [PATCH 1/3] add btd_error_agent_not_available() Gustavo F. Padovan
2010-12-16 17:58 ` [PATCH 2/3] add btd_error_not_ready() Gustavo F. Padovan
2010-12-16 17:58   ` [PATCH 3/3] covert more dbus errors to btd_error_* Gustavo F. Padovan
2010-12-16 19:45 ` [PATCH 1/3] add btd_error_agent_not_available() Johan Hedberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox