diff options
author | Claudio Takahasi <claudio.takahasi@openbossa.org> | 2006-08-29 17:16:12 +0000 |
---|---|---|
committer | Claudio Takahasi <claudio.takahasi@openbossa.org> | 2006-08-29 17:16:12 +0000 |
commit | a68204dbb9f7cfee00d44315282124628ef4cded (patch) | |
tree | 8feb20792cba87865fc59b415674f817a1b3edea /hcid/dbus-error.c | |
parent | 250ed56dd4ec7aa5175b53304edc7db4524a5e72 (diff) |
changed sdp error handling
Diffstat (limited to 'hcid/dbus-error.c')
-rw-r--r-- | hcid/dbus-error.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/hcid/dbus-error.c b/hcid/dbus-error.c index ef59272d..da8d166a 100644 --- a/hcid/dbus-error.c +++ b/hcid/dbus-error.c @@ -236,3 +236,29 @@ DBusHandlerResult error_service_search_in_progress(DBusConnection *conn, DBusMes return error_in_progress(conn, msg, "Service search in progress"); } +static const char *strsdperror(int err) +{ + switch (err) { + case SDP_INVALID_VERSION: + return "Invalid/unsupported SDP version"; + case SDP_INVALID_RECORD_HANDLE: + return "Invalid Service Record Handle"; + case SDP_INVALID_SYNTAX: + return "Invalid request syntax"; + case SDP_INVALID_PDU_SIZE: + return "Invalid PDU size"; + case SDP_INVALID_CSTATE: + return "Invalid Continuation State"; + default: + return "Undefined error"; + } +} + +DBusHandlerResult error_sdp_failed(DBusConnection *conn, DBusMessage *msg, int err) +{ + const char *str = strsdperror(err); + + return send_reply_and_unref(conn, + dbus_message_new_error(msg, ERROR_INTERFACE ".Failed", str)); +} + |