Commit Graph

6819 Commits

Author SHA1 Message Date
Adam Gołębiowski
5c4cbb4be5 Fix parallel build
Since src/bluetoothd needs libbluetooth, add it to its dependencies.
Parallel build tested with make -j16.
2009-09-22 14:49:57 -07:00
Johan Hedberg
d8fe64e3b9 Fix headset_suspend_stream behavior for invalid states
The headset_suspend_stream function should imediately fail if the headset
isn't connected or playing. This ensures that we return a proper error to
the unix socket client if the headset disconnect just before we receive a
STOP_STREAM request.
2009-09-21 21:32:46 +03:00
Johan Hedberg
21b1a180f4 Fix headset connecting state string representation 2009-09-21 16:18:48 +03:00
Johan Hedberg
9cec7f8d2f Fix AVDTP suspend while closing
We should reject any suspend request if we've already started the close
procedure for a stream.
2009-09-16 14:15:22 +03:00
Johan Hedberg
de310b6121 Downgrade "no matching connection" logs from error to debug
Since we don't track SCO handles the most common reason for this message
is a disconnected SCO link, i.e. it's not an error as such.
2009-09-16 10:33:39 +03:00
Johan Hedberg
d165bb2387 Fix command timeout handling when there's no stream
The media stream could be gone by the time that the AVDTP command timeout
expires (e.g. if the media transport channel gets closed prematurely). In
such a case there's no need to send a separate ABORT command but we can
directly proceed with closing the signalling channel.
2009-09-15 21:12:04 +03:00
Johan Hedberg
4694093ca9 Fix AVDTP ABORTING state transition
The transition to ABORTING state when acting as initiator should happen
when we receive the ABORT reply and not when we send the initial ABORT
command. The reply handling is already correct but since there's a state
change also in the sending part the later state change request would fail.
This patch fixes the issue by removing the state change when sending the
ABORT command.
2009-09-15 17:17:07 +03:00
Johan Hedberg
cadf787439 Fix stream handling when the media transport disconnects prematurely
We might not have a stream anymore when receiving the reply to a AVDTP
command that assumes that there is an existing stream. So ignore the
replies to these commands if we don't have a stream anymore.
2009-09-15 11:26:50 +03:00
RISKÓ Gergely
8f8cb865db Add introspection interface to the output of introspection calls
This provides better compatibility with some D-Bus clients, such as qdbus.
2009-09-14 18:25:13 +03:00
Marcel Holtmann
69f18ff2ad Release 4.53 2009-09-10 21:02:31 +02:00
Peter Hurley
854ac30779 Fixed duplicate attempt from device to connect 'signalling' channel
A device may attempt to initiate a duplicate avdtp channel while
a host-initiated channel connection is still pending. This
situation is referred to as 'XCASE connect:connect' in sink.c and
source.c. This fix rejects the device-initiated connection in this
circumstance.
2009-09-09 20:53:47 +03:00
Johan Hedberg
28b19ec20b Add debug print for closing uinput 2009-09-09 15:07:22 +03:00
Johan Hedberg
30b4f35a55 Fix agent destroy callback handling for errors
The destroy callback should not be called if calling the agent fails and
an error is returned to the caller of the agent.c public function.
2009-09-06 03:18:19 +03:00
Johan Hedberg
f87026b8fa Fix agent_authorize error return 2009-09-06 03:15:42 +03:00
Johan Hedberg
cebec3d1a6 Coding style fixes 2009-09-06 03:00:31 +03:00
Johan Hedberg
82f570754d Fix clearing source id after removing it 2009-09-06 02:58:55 +03:00
Johan Hedberg
0439477145 Fix audio device authorized setting for AVRCP-only connections
AVRCP state isn't hooked up to the generic audio interface and its state
changes so it needs to clear the authorized variable when getting
disconnected if no other profile is active.
2009-09-06 02:56:37 +03:00
Johan Hedberg
74624288fb Use an idle callback for trusted device authorization
The caller of btd_request_authorization could assume that it's
callback will be called in a separate mainloop iteration as opposed to
from within the actual btd_request_authorization function. It's therefore
better to use an idle callback to make the trusted device callback
behavior similar to that of untrusted devices.
2009-09-06 02:44:34 +03:00
Johan Hedberg
86aeac39b2 Fix audio authorization cancelation on the same mainloop iteration
If the device is trusted and the authorization is canceled before the idle
callback takes place the idle callback should be removed. This patch adds
tracking of the idle id and removes it in the case of cancelation.
2009-09-05 23:06:23 +03:00
Johan Hedberg
61d29a1847 Make dev->authorized private to audio/device.c
There's no need to expose the authorized setting outside of device.c.
2009-09-05 22:09:34 +03:00
Johan Hedberg
aa218c796c Fix AVDTP stream leak for invalid media transport config 2009-09-05 18:40:18 +03:00
Johan Hedberg
763c7011e1 Fix race condition in authorizing audio connections
The current check for implicit authorization is if any other audio profile
is already connected. However, a the second profile might try to connect
right after we've gotten a positive authorization reply for the first one
but before the first profile has reached "connected" state. So just by
checking the connected state of other profiles we might get a false
negative for the decision of doing implicit authorization.

This patch adds a variable to the audio_device struct for keeping track of
if we've gotten a positive authorization reply that can be used in
addition to the "any other profiles" connected check. This variable gets
cleared when the (global audio) device state goes back to disconnected.
2009-09-04 19:44:28 +03:00
Johan Hedberg
ad3cdc0bd1 Add debug logs for AVCTP state changes 2009-09-04 19:01:30 +03:00
Johan Hedberg
88d7897d4c Fix audio connection authorization handling with timeouts
When manager.c (HFP/HSP), avdtp.c (A2DP) or control.c wants to cancel an
authorization request it shouldnd't affect the requests of the other
modules. So btd_cancel_authorization cannot be used. This patch adds a new
cancellation function to device.c which will remove the specific callback
from the list and only if the list is empty call btd_cancel_authorization.
2009-09-04 18:50:56 +03:00
Johan Hedberg
966ccc91a4 Fix potential leak of client->interface
The code shouldn't just blindly overwrite the existing client->interface
without freeing it first. This could happen e.g. if we get two consecutive
GET_CAPABILITIES requests over the IPC.
2009-09-04 18:40:30 +03:00
Johan Hedberg
a3cd5c2440 Fix telephony connection state notification for failed connects
telephony_device_disconnected() shouldn't be called when transitioning
from "connecting" to "disconnected" state since
telephony_device_disconnected() requires that at least "connected" state
was reached previously.
2009-09-04 18:15:14 +03:00
Marcel Holtmann
d6e1c083a7 Release 4.52 2009-09-03 16:09:13 -07:00
Johan Hedberg
86a8cb5037 Add support for waiting before exiting to avtest 2009-09-04 00:48:54 +03:00
Johan Hedberg
cf30b82290 Fix a few more ref-leaks with AVDTP failures and unix socket clients
If any of the IPC messages cause us to create a brand new AVDTP session
and then there's failure caused by disconnection, we have to unref the
session since there will not be a unix.c callback to do it when avdtp.c
wants to clean up in the next mainloop iteration.
2009-09-04 00:45:52 +03:00
Johan Hedberg
5c2b1c61ea Fix potential AVDTP reference leak
If the AVDTP connection has just recently disconnected but not yet been
notified to the mainloop then we need to clean the unix.c avdtp session
reference within start_discovery() instead of doing it when the unix
client disconnects. This is because when the AVDTP disconnection finally
gets reported in the next mainloop iteration the unix.c reference wouldn't
get cleared as is intended (since unix.c doesn't have any callbacks at
this point).
2009-09-03 23:30:29 +03:00
Johan Hedberg
8be335ca8f Add more complete AVCTP support to avtest 2009-09-03 22:20:48 +03:00
Johan Hedberg
788ffa0775 Add initial AVCTP support to avtest 2009-09-03 21:46:18 +03:00
Johan Hedberg
45091c9a9a Update help output for avtest 2009-09-03 21:01:17 +03:00
Johan Hedberg
9604e597d7 Fix authorization when the audio profiles are slow to connect
Incoming audio connections should be automatically authorized if either
HFP/HSP or A2DP is already connected for the same device.
2009-09-03 19:58:00 +03:00
Johan Hedberg
9c3f955375 Rename audio_device_is_connected more appropriately 2009-09-03 19:55:23 +03:00
Johan Hedberg
9428fbcf37 Fix AVDTP Abort when transport closes before response 2009-09-03 18:23:51 +03:00
Johan Hedberg
0223594362 Add ABORT support to avtest 2009-09-03 18:23:44 +03:00
Johan Hedberg
5b968a14e1 Fix do_send to wait for a proper reply
The remote side might be simultaneously sending commands to us which we
should just ignore.
2009-09-03 16:22:02 +03:00
Marcel Holtmann
467e28d995 Release 4.51 2009-09-03 01:56:41 -07:00
Marcel Holtmann
dd5d60af94 Update library version 2009-09-03 01:51:48 -07:00
Johan Hedberg
0ed3510c9d Add Nokia copyright to avtest.c 2009-09-03 11:49:11 +03:00
Johan Hedberg
793be3b7b1 Allow avtest to use 48 byte MTU also in SEND mode
This should be helpful for AVDTP tests where the IUT (bluetoothd) is
supposed to send a fragmented message to us.
2009-09-02 22:19:51 +03:00
Johan Hedberg
5a1ad09af8 Add fragmented message sending support to avtest 2009-09-02 20:04:44 +03:00
Johan Hedberg
dd65e5a614 Fix closing media transport after receiving CLOSE 2009-09-02 19:31:08 +03:00
Johan Hedberg
8d839631b3 Add avtest support for responding to AVDTP_SUSPEND 2009-09-02 19:30:02 +03:00
Johan Hedberg
93b269a185 Add avtest support for responding to AVDTP_CLOSE 2009-09-02 19:26:07 +03:00
Johan Hedberg
9ec30f5ec3 Add avtest support for responding to AVDTP_START 2009-09-02 19:23:24 +03:00
Johan Hedberg
9f226395d0 Add avtest support for responding to AVDTP_OPEN 2009-09-02 19:18:28 +03:00
Johan Hedberg
d3eb02475c Add avtest support for responding to AVDTP_GET_CONFIGURATION 2009-09-02 19:03:37 +03:00
Johan Hedberg
386278a53f Add avtest support for responding to AVDTP_SET_CONFIGURATION 2009-09-02 18:59:04 +03:00