From: Fabien Chevalier <fabchevalier@free.fr>
To: BlueZ development <bluez-devel@lists.sourceforge.net>
Subject: Re: [Bluez-devel] Some Audio error handling fixes.
Date: Sat, 13 Sep 2008 22:50:17 +0200 [thread overview]
Message-ID: <48CC2789.6010203@free.fr> (raw)
In-Reply-To: <48CBE24E.6080507@free.fr>
[-- Attachment #1: Type: text/plain, Size: 174 bytes --]
Hi all,
Updated patchset attached !
Luiz: I tried to find some doc to get started on gitorious but didn't
found any... how to i create my remote clone ?
Regards,
Fabien
[-- Attachment #2: 0001-Error-code-fixes.patch --]
[-- Type: text/x-patch, Size: 2522 bytes --]
>>From 66048184e4d7c88afae449236a2e62ef352c4438 Mon Sep 17 00:00:00 2001
From: Fabien Chevalier <fabchevalier@free.fr>
Date: Sat, 13 Sep 2008 17:11:08 +0200
Subject: [PATCH] Error code fixes
In case of socket errors, we used to return a positive value
where the convention is to return negative values only : fix that
---
audio/avdtp.c | 18 +++++++++---------
1 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/audio/avdtp.c b/audio/avdtp.c
index 592322f..bf5c0d3 100644
--- a/audio/avdtp.c
+++ b/audio/avdtp.c
@@ -489,7 +489,7 @@ static gboolean disconnect_timeout(gpointer user_data)
session->dc_timer = 0;
- connection_lost(session, -ETIMEDOUT);
+ connection_lost(session, ETIMEDOUT);
return FALSE;
}
@@ -728,7 +728,7 @@ static void finalize_discovery(struct avdtp *session, int err)
{
struct avdtp_error avdtp_err;
- avdtp_error_init(&avdtp_err, AVDTP_ERROR_ERRNO, -err);
+ avdtp_error_init(&avdtp_err, AVDTP_ERROR_ERRNO, err);
if (!session->discov_cb)
return;
@@ -1380,7 +1380,7 @@ static gboolean avdtp_parse_cmd(struct avdtp *session,
debug("Received DISCOVER_CMD");
return avdtp_discover_cmd(session, (void *) header, size);
case AVDTP_GET_CAPABILITIES:
- debug("Received GET_CAPABILITIES_CMD");
+ debug("Received GET_CAPABILITIES_CMD");
return avdtp_getcap_cmd(session, (void *) header, size);
case AVDTP_SET_CONFIGURATION:
debug("Received SET_CONFIGURATION_CMD");
@@ -1519,7 +1519,7 @@ static gboolean session_cb(GIOChannel *chan, GIOCondition cond,
return TRUE;
failed:
- connection_lost(session, -EIO);
+ connection_lost(session, EIO);
return FALSE;
}
@@ -1559,9 +1559,9 @@ static void l2cap_connect_cb(GIOChannel *chan, int err, const bdaddr_t *src,
len = sizeof(l2o);
if (getsockopt(sk, SOL_L2CAP, L2CAP_OPTIONS, &l2o,
&len) < 0) {
- err = errno;
- error("getsockopt(L2CAP_OPTIONS): %s (%d)", strerror(err),
- err);
+ err = -errno;
+ error("getsockopt(L2CAP_OPTIONS): %s (%d)", strerror(-err),
+ -err);
goto failed;
}
@@ -1710,7 +1710,7 @@ static gboolean request_timeout(gpointer user_data)
goto done;
failed:
- connection_lost(session, -ETIMEDOUT);
+ connection_lost(session, ETIMEDOUT);
done:
pending_req_free(req);
return FALSE;
@@ -2716,7 +2716,7 @@ static void auth_cb(DBusError *derr, void *user_data)
if (derr && dbus_error_is_set(derr)) {
error("Access denied: %s", derr->message);
- connection_lost(session, -EACCES);
+ connection_lost(session, EACCES);
return;
}
--
1.5.6.5
[-- Attachment #3: 0002-Connect-fix.patch --]
[-- Type: text/x-patch, Size: 959 bytes --]
>>From 8da5a48ab9667f13066d6e048100da9269d8a205 Mon Sep 17 00:00:00 2001
From: Fabien Chevalier <fabchevalier@free.fr>
Date: Sat, 13 Sep 2008 17:13:27 +0200
Subject: [PATCH] Connect() fix.
In case we are unable to connect the sink, we forget to send DBUS reply.
Caller is stuck forever...
---
audio/sink.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/audio/sink.c b/audio/sink.c
index c6d2dc4..e79b9f1 100644
--- a/audio/sink.c
+++ b/audio/sink.c
@@ -381,11 +381,11 @@ static void discovery_complete(struct avdtp *session, GSList *seps, struct avdtp
return;
failed:
- pending_request_free(pending);
+ error_failed(pending->conn, pending->msg, "Stream setup failed");
+ pending_request_free(pending);
sink->connect = NULL;
avdtp_unref(sink->session);
sink->session = NULL;
- error_failed(pending->conn, pending->msg, "Stream setup failed");
}
static DBusMessage *sink_connect(DBusConnection *conn,
--
1.5.6.5
[-- Attachment #4: 0003-Error-value-fixes.patch --]
[-- Type: text/x-patch, Size: 1232 bytes --]
>>From d79457b70e1480f0c590d043208dbe61ceca4026 Mon Sep 17 00:00:00 2001
From: Fabien Chevalier <fabchevalier@free.fr>
Date: Sat, 13 Sep 2008 17:14:34 +0200
Subject: [PATCH] Error value fixes.
In case the HSP/HFP headset is down, we return "not supported" : this is non-sense :
change that to connection attempt failed
---
audio/headset.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/audio/headset.c b/audio/headset.c
index 102d0bc..45bcf34 100644
--- a/audio/headset.c
+++ b/audio/headset.c
@@ -1074,7 +1074,9 @@ static void get_record_cb(sdp_list_t *recs, int err, gpointer user_data)
if (err < 0) {
error("Unable to get service record: %s (%d)", strerror(-err),
-err);
- goto failed_not_supported;
+ error_connection_attempt_failed(dev->conn, p->msg, p->err);
+
+ goto failed;
}
if (!recs || !recs->data) {
@@ -1140,10 +1142,13 @@ static void get_record_cb(sdp_list_t *recs, int err, gpointer user_data)
failed_not_supported:
if (p->msg) {
error_not_supported(dev->conn, p->msg);
+ }
+failed:
+ if (p->msg) {
dbus_message_unref(p->msg);
p->msg = NULL;
}
-failed:
+
if (classes)
sdp_list_free(classes, free);
pending_connect_finalize(dev);
--
1.5.6.5
[-- Attachment #5: Type: text/plain, Size: 363 bytes --]
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
[-- Attachment #6: Type: text/plain, Size: 164 bytes --]
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
next prev parent reply other threads:[~2008-09-13 20:50 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-13 15:54 [Bluez-devel] Some Audio error handling fixes Fabien Chevalier
2008-09-13 16:12 ` Luiz Augusto von Dentz
2008-09-13 19:08 ` Fabien Chevalier
2008-09-13 17:03 ` Marcel Holtmann
2008-09-13 19:49 ` Fabien Chevalier
2008-09-13 20:50 ` Fabien Chevalier [this message]
2008-09-13 20:57 ` Marcel Holtmann
2008-09-14 8:14 ` Fabien Chevalier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=48CC2789.6010203@free.fr \
--to=fabchevalier@free.fr \
--cc=bluez-devel@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox