From 05ba90324ddfd1de724c39f2f9f28ec10930996f Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Mon, 26 Nov 2007 13:40:09 +0000 Subject: Add common error helper functions --- common/error.h | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 common/error.h (limited to 'common/error.h') diff --git a/common/error.h b/common/error.h new file mode 100644 index 00000000..d6f17f06 --- /dev/null +++ b/common/error.h @@ -0,0 +1,80 @@ +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2006-2007 Nokia Corporation + * Copyright (C) 2004-2007 Marcel Holtmann + * Copyright (C) 2007 Fabien Chevalier + * + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +/* + Please update dbus-api.txt in hcid folder when changes are made to this file. + */ + +#include + +#define ERROR_INTERFACE "org.bluez.Error" + +DBusHandlerResult error_device_unreachable(DBusConnection *conn, + DBusMessage *msg); + +DBusHandlerResult error_connection_attempt_failed(DBusConnection *conn, + DBusMessage *msg, + int err); + +DBusHandlerResult error_already_connected(DBusConnection *conn, + DBusMessage *msg); + +DBusHandlerResult error_not_connected(DBusConnection *conn, DBusMessage *msg); + +DBusHandlerResult error_in_progress(DBusConnection *conn, DBusMessage *msg, + const char *str); + +DBusHandlerResult error_invalid_arguments(DBusConnection *conn, + DBusMessage *msg, + const char *str); + +DBusHandlerResult error_out_of_memory(DBusConnection *conn, DBusMessage *msg); + +DBusHandlerResult error_not_available(DBusConnection *conn, DBusMessage *msg); + +DBusHandlerResult error_not_supported(DBusConnection *conn, + DBusMessage *msg); + +DBusHandlerResult error_already_exists(DBusConnection *conn, DBusMessage *msg, + const char *str); + +DBusHandlerResult error_does_not_exist(DBusConnection *conn, DBusMessage *msg, + const char *str); + +DBusHandlerResult error_device_does_not_exist(DBusConnection *conn, + DBusMessage *msg); + +DBusHandlerResult error_canceled(DBusConnection *conn, DBusMessage *msg, + const char *str); + +DBusHandlerResult error_failed(DBusConnection *conn, DBusMessage *msg, + const char *desc); + +DBusHandlerResult error_failed_errno(DBusConnection *conn, DBusMessage *msg, + int err); + +DBusHandlerResult error_common_reply(DBusConnection *conn, DBusMessage *msg, + const char *name, const char *descr); + -- cgit From e823c15e43a6f924779e466d434c51157002d9ee Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 2 Feb 2008 03:37:05 +0000 Subject: Update copyright information --- common/error.h | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'common/error.h') diff --git a/common/error.h b/common/error.h index d6f17f06..03d0c182 100644 --- a/common/error.h +++ b/common/error.h @@ -3,8 +3,8 @@ * BlueZ - Bluetooth protocol stack for Linux * * Copyright (C) 2006-2007 Nokia Corporation - * Copyright (C) 2004-2007 Marcel Holtmann - * Copyright (C) 2007 Fabien Chevalier + * Copyright (C) 2004-2008 Marcel Holtmann + * Copyright (C) 2007-2008 Fabien Chevalier * * * This program is free software; you can redistribute it and/or modify @@ -23,10 +23,6 @@ * */ -/* - Please update dbus-api.txt in hcid folder when changes are made to this file. - */ - #include #define ERROR_INTERFACE "org.bluez.Error" -- cgit From dfad08e334136022c3918d6247823e7a79ca899f Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Thu, 13 Mar 2008 16:57:12 +0000 Subject: Move error_unknown_method to libhelper. --- common/error.h | 1 + 1 file changed, 1 insertion(+) (limited to 'common/error.h') diff --git a/common/error.h b/common/error.h index 03d0c182..44b6f417 100644 --- a/common/error.h +++ b/common/error.h @@ -74,3 +74,4 @@ DBusHandlerResult error_failed_errno(DBusConnection *conn, DBusMessage *msg, DBusHandlerResult error_common_reply(DBusConnection *conn, DBusMessage *msg, const char *name, const char *descr); +DBusHandlerResult error_unknown_method(DBusConnection *conn, DBusMessage *msg); -- cgit From 40b5cf346c985b629c927c5b2a6d188ccd0966dd Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 27 May 2008 11:43:25 +0000 Subject: Restore error handling for the new manager interface --- common/error.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'common/error.h') diff --git a/common/error.h b/common/error.h index 44b6f417..a2492601 100644 --- a/common/error.h +++ b/common/error.h @@ -27,6 +27,8 @@ #define ERROR_INTERFACE "org.bluez.Error" +DBusMessage *create_errno_message(DBusMessage *msg, int err); + DBusHandlerResult error_device_unreachable(DBusConnection *conn, DBusMessage *msg); -- cgit From 92faff9a094d5cbdfaa3c83f3fe17074a483ce55 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 7 Jun 2008 08:49:19 +0000 Subject: Cleanup errors and remove unused functions --- common/error.h | 30 ------------------------------ 1 file changed, 30 deletions(-) (limited to 'common/error.h') diff --git a/common/error.h b/common/error.h index a2492601..68ce105a 100644 --- a/common/error.h +++ b/common/error.h @@ -29,41 +29,13 @@ DBusMessage *create_errno_message(DBusMessage *msg, int err); -DBusHandlerResult error_device_unreachable(DBusConnection *conn, - DBusMessage *msg); - DBusHandlerResult error_connection_attempt_failed(DBusConnection *conn, DBusMessage *msg, int err); -DBusHandlerResult error_already_connected(DBusConnection *conn, - DBusMessage *msg); - -DBusHandlerResult error_not_connected(DBusConnection *conn, DBusMessage *msg); - -DBusHandlerResult error_in_progress(DBusConnection *conn, DBusMessage *msg, - const char *str); - -DBusHandlerResult error_invalid_arguments(DBusConnection *conn, - DBusMessage *msg, - const char *str); - -DBusHandlerResult error_out_of_memory(DBusConnection *conn, DBusMessage *msg); - -DBusHandlerResult error_not_available(DBusConnection *conn, DBusMessage *msg); - DBusHandlerResult error_not_supported(DBusConnection *conn, DBusMessage *msg); -DBusHandlerResult error_already_exists(DBusConnection *conn, DBusMessage *msg, - const char *str); - -DBusHandlerResult error_does_not_exist(DBusConnection *conn, DBusMessage *msg, - const char *str); - -DBusHandlerResult error_device_does_not_exist(DBusConnection *conn, - DBusMessage *msg); - DBusHandlerResult error_canceled(DBusConnection *conn, DBusMessage *msg, const char *str); @@ -75,5 +47,3 @@ DBusHandlerResult error_failed_errno(DBusConnection *conn, DBusMessage *msg, DBusHandlerResult error_common_reply(DBusConnection *conn, DBusMessage *msg, const char *name, const char *descr); - -DBusHandlerResult error_unknown_method(DBusConnection *conn, DBusMessage *msg); -- cgit