Hi Frederic: On Tue, Mar 12, 2013 at 12:26 PM, Frederic Danis <[email protected]> wrote: > Hello Claudio, > > > On 12/03/2013 13:42, Claudio Takahasi wrote: >> >> This patch returns "Operation already in progress" if there is a >> pending Handsfree Audio Card "Connect" method call pending. >> --- >> src/handsfree-audio.c | 3 +++ >> 1 file changed, 3 insertions(+) >> >> diff --git a/src/handsfree-audio.c b/src/handsfree-audio.c >> index 8950347..805f3b6 100644 >> --- a/src/handsfree-audio.c >> +++ b/src/handsfree-audio.c >> @@ -285,6 +285,9 @@ static DBusMessage *card_connect(DBusConnection *conn, >> if (agent == NULL) >> return __ofono_error_not_available(msg); >> >> + if (card->msg) >> + return __ofono_error_busy(msg); >> + >> sk = driver->audio_connect(card->remote, card->local); >> if (sk < 0) >> return __ofono_error_failed(msg); >> > > Shouldn't you also test if there is already a SCO connection (sco_watch) ? > I think that only one SCO link can be connected at a time for a Handsfree > Audio Card. > > Regards > > Fred
It is equivalent to check for card->sco_watch or card->msg. card->sco_watch monitors the SCO connection attempt only. At the moment, oFono is not keeping the SCO socket reference after passing it to the Agent(P.A.). Regards, Claudio _______________________________________________ ofono mailing list [email protected] http://lists.ofono.org/listinfo/ofono
