| 66c74b1a |
adapter: Simplify DBusConnection object handling
This patch removes redundant references and function parameters for
DBusConnection object and uses btd_get_dbus_connection() call wherever
such object is needed instead.
Pointer returned by this call is guaranteed to be valid for entire
bluetoothd lifetime and thus do not need to be refcounted. |
Andrzej Kaczmarek |
13 years ago |
6 files, +68, -88 |
| ae92ea28 |
device: Simplify DBusConnection object handling
This patch removes redundant references and function parameters for
DBusConnection object and uses btd_get_dbus_connection() call wherever
such object is needed instead.
Pointer returned by this call is guaranteed to be valid for entire
bluetoothd lifetime and thus do not need to be refcounted. |
Andrzej Kaczmarek |
13 years ago |
4 files, +93, -119 |
| 2f3db983 |
agent: Simplify DBusConnection object handling
This patch removes local reference to DBusConnection object and uses
btd_get_dbus_connection() call wherever such object is needed instead.
Pointer returned by this call is guaranteed to be valid for entire
bluetoothd lifetime and thus do not need to be refcounted. |
Andrzej Kaczmarek |
13 years ago |
3 files, +17, -34 |
| 0c6bdf60 |
manager: Simplify DBusConnection object handling
This patch removes local reference to DBusConnection object and uses
btd_get_dbus_connection() call wherever such object is needed instead. |
Andrzej Kaczmarek |
13 years ago |
3 files, +22, -24 |
| f6bff404 |
dbus-common: Remove conn parameter from emit_array_property_changed
DBusConnection pointer is already stored in connection static variable
so it's redundant to pass it as function parameter. |
Andrzej Kaczmarek |
13 years ago |
5 files, +11, -13 |
| b9953680 |
dbus-common: Remove conn parameter from emit_property_changed
Valid DBusConnection pointer is available static variable 'connection'
so it's it's redundant to pass it as function parameter. |
Andrzej Kaczmarek |
13 years ago |
19 files, +118, -125 |
| be9a40bf |
core: Make D-Bus connection valid for entire bluetoothd lifetime
D-Bus is connected before any subsystem needs to use it and disconnected
only after nothing uses it (i.e. plugins). This is to guarantee that
every call to btd_get_dbus_connection() will return valid DBusConnection
object so various components and plugins do not need to store it
somewhere and care about ref counting. |
Andrzej Kaczmarek |
13 years ago |
1 file, +8, -6 |
| 000014ae |
Rename get_dbus_connection to btd_get_dbus_connection
get_dbus_connection is exported function which can be used by plugins thus
should be prefixed with "btd_" |
Andrzej Kaczmarek |
13 years ago |
10 files, +36, -33 |
| 4fc0f070 |
mgmt: Add wrapper for Set LE
Wrap mgmt_set_mode for Set LE into separate function to be consistent
with other calls and have debug printout. |
Andrzej Kaczmarek |
13 years ago |
1 file, +7, -1 |
| c51ede31 |
mgmt: Add wrapper for Set SSP
Wrap mgmt_set_mode for Set SSP into separate function to be consistent
with other calls and have debug printout. |
Andrzej Kaczmarek |
13 years ago |
1 file, +7, -1 |
| 318c126e |
core: Use adapter connect list for LE connections
When a connection is needed for a LE device it is added to the adapter
connect list instead of directly connecting the ATT io channel. |
João Paulo Rechi Vita |
13 years ago |
3 files, +13, -35 |
| 0fd44000 |
core: Control connections based on adapter state
This patch disable automatic ATTIO connections when the adapter is
powered down and enable automatic connection when the adapter is powered
on. |
Claudio Takahasi |
13 years ago |
1 file, +14, -9 |
| e8826d0b |
hog: Fix segfault when discovering descriptors
Invalid memory was being accessed when discovering the External Report
Reference descriptor. |
João Paulo Rechi Vita |
13 years ago |
1 file, +1, -1 |
| ea4ff510 |
gatttool: Fix Characteristic descriptor discovery
This patch fixes end condition for Characteristic Descriptor Discovery.
This sub-procedure is complete when the Error Response is received and
the Error Code is set to Attribute Not Found or the Find Information
Response has an Attribute Handle that is equal to the Ending Handle of
the request. |
Claudio Takahasi |
13 years ago |
1 file, +13, -9 |
| 7cc3243d |
cups: Free D-Bus error
If D-Bus error is set we should free it. |
Syam Sidhardhan |
13 years ago |
1 file, +7, -2 |
| 7730ff4a |
gstavdtpsink: Free the D-Bus error on reply failure
If D-Bus error is set we should free it. |
Syam Sidhardhan |
13 years ago |
1 file, +10, -5 |
| fea4c579 |
adapter: Remove dead code from adapter_emit_device_found() |
Syam Sidhardhan |
13 years ago |
1 file, +1, -2 |
| 03604d12 |
device: Remove dead code from get_properties() |
Syam Sidhardhan |
13 years ago |
1 file, +1, -2 |
| 134933c2 |
media: Fix infinite loop due to release_endpoint()
release_endpoint() cannot succeed unless all transports are released
first. For example a2dp_remove_sep() will ignore the call if the SEP is
locked, leading to an infinite loop in path_free(), which expects to
successfully release and remove the endpoint in each call to
release_endpoint().
This issue can easily be reproduced by shutting bluetoothd daemon
during A2DP streaming (tested in sink role). |
Mikel Astiz |
13 years ago |
1 file, +2, -2 |
| 7b69385b |
media: Extend media API with optional acquire
Acquiring a transport is needed in two different situations: either
we are initiating the audio stream locally, or the remote side initiated
it and thus we are just reacting. In the second case, we would expect
the stream is already available, and otherwise the operation should
fail. This means the media API needs to be extended in order to make
this difference.
This issue is specially relevant in the case of SCO, because the current
approach is racy. With HFP, for example (say BlueZ has the HS role), the
following race condition could be met:
1. Phone has an incoming call and thus starts in-band ringing.
2. SCO connection is accepted and stablished by BlueZ.
3. Gateway interface state is changed to Playing.
4. Exactly afterwards, the user routes the audio to the phone, to have
a private conversation. So the SCO link is closed.
5. In parallel, PulseAudio sees the transition to Playing, and acquires
the transport.
6. BlueZ receives an Acquire() request, but SCO is down. So it tries to
reconnect the SCO link.
The last step is an undesired behavior (the audio is routed back to the
car). BlueZ should be smart enough to know that the SCO connection
shouldn't be reestablished, but this is only possible if the endpoint
provides additional information in the media API.
Note that the API change introduced by this patch is backward
compatible, meaning that older versions of BlueZ will just ignore the
flag. So clients are encouraged to use it without necessarily adding a
dependency to newer versions of BlueZ. |
Mikel Astiz |
13 years ago |
2 files, +15, -0 |
| 75b10ebb |
media: Automatically release transport when HUP
When the remote end suspends the audio stream, release the transport
automatically without waiting until the clients call Release().
This affects the D-Bus API since clients will get an error when trying
to release the transport afterwards.
However, this should have no real impact, since most clients (i.e.
PulseAudio) would just log some error trace but otherwise ignore the
issue. |
Mikel Astiz |
13 years ago |
1 file, +10, -1 |
| 3edd39f0 |
media: Expose transport state in D-Bus
Extend the Media API to expose the transport state in D-Bus, as a
property of the transport. This way the clients do not have to find
out which is the corresponding profile-specific interface for the
transport.
Additionally, this state along with the automatic release of transports
will allow clients to avoid the "optional release" or "accept remote
release" race condition. For example, with HSP/HFP profiles, the problem
is the following:
1. User suspends SCO in the remote end.
2. BlueZ signals the Playing->Connected state change in D-Bus.
3. Exactly afterwards, the user resumes SCO in the remote end.
4. In parallel, PulseAudio sees the aforementioned transition to
Connected, and thus releases the transport.
5. BlueZ receives a Release() request while SCO is up. So the audio
stream will be suspended.
The last step is an undesired behavior since the user explicitly wanted
to route the audio stream through Bluetooth.
The issue is difficult to reproduce but it can easily be solved by
exposing the transport state in D-Bus. |
Mikel Astiz |
13 years ago |
2 files, +37, -0 |
| 4138972b |
media: Split transport state based on playing flag
Split the transport states (formerly in_use) into more specific states
where the stream state (playing or suspended) is explicitly represented,
along with the transitional states (locally initiated suspend and
resume).
TRANSPORT_STATE_ACTIVE is an exception since it also includes the state
where the transport is acquired, but the audio was later suspended (not
released yet though). |
Mikel Astiz |
13 years ago |
1 file, +57, -11 |
| 3aa61570 |
media: Watch interface state changes in transport
Install watches to keep track whether the audio is streaming or not.
This should be relevant if the transport needs to reflect this state. |
Mikel Astiz |
13 years ago |
1 file, +103, -0 |
| 209500b9 |
media: Replace transport->in_use flag with state
Refactor the code to use a enum type to represent the transport state.
This should scale better when additional states need to be represented.
A helper function has been added to help track the mapping between the
enum type and the old in_use flag. |
Mikel Astiz |
13 years ago |
1 file, +58, -19 |
| 869c3c51 |
media: Add gateway_get_state() to internal API
Expose the state of the gateway interface in the internal API. |
Mikel Astiz |
13 years ago |
2 files, +8, -0 |
| 6e62d4a0 |
media: Fix accesstype comparison
Replace the string representation of the accesstype with a conventional
binary representation. This makes the code simpler and more efficient.
This also fixes a minor bug in the Release() D-Bus method, where the
string comparison was used to see whether the owner should be removed. A
client acquiring with "rw" and releasing with "wr" would lead to the
inconsistent state of having a released transport with an owner with no
accesstype. Partial releases can also get affected by this bug since the
released character (partial accesstype) got replaced by a whitespace.
Additionally, this approach is more robust in case new flags are added
in the future. |
Mikel Astiz |
13 years ago |
1 file, +68, -51 |
| 7c14b823 |
media: Add a2dp_sep_is_playing() to internal API
Add this function to expose whether the local SEP is streaming or not. |
Mikel Astiz |
13 years ago |
2 files, +9, -0 |
| 7b1bda3a |
input: Remove unnecessary struct input_conn
There's no need to maintain the capability of multiple connections per
device, so just merge the connections list into the main input_device
struct. |
Johan Hedberg |
13 years ago |
1 file, +139, -227 |
| 2e16cbf3 |
input: Remove fakhid functionality
The HSP code conflicts with a real HSP implementation and the PS3
support should be done through the kernel. |
Johan Hedberg |
13 years ago |
6 files, +13, -901 |
| 96f60e14 |
profile: Add asynchronous completion functions for connect/disconnect |
Johan Hedberg |
13 years ago |
1 file, +8, -2 |
| b1cde69a |
core: Move profile code into profile.{c,h} |
Johan Hedberg |
13 years ago |
17 files, +133, -71 |
| 06a7852b |
avctp: Fix reply for message with invalid PID
Reply for control message with invalid (not registered for reception
of messages) PID should not have message information field present.
This was affecting AVCTP qualification test case TP/NFR/BI-01-C. |
Par-Gunnar Hjalmdahl |
13 years ago |
1 file, +1, -1 |
| 069cef5d |
network: Fix minor whitespace issue |
Johan Hedberg |
13 years ago |
1 file, +1, -1 |
| ff1ef931 |
core: Remove pattern matching when probing services
This code was only needed for the Serial interface for matching all
RFCOMM-based records, and now that this interface is gone the code is
also no-longer needed. |
Johan Hedberg |
13 years ago |
1 file, +1, -28 |
| c67bd8fa |
fakehid: Add support for Logitech Harmony Adapter for PS3
This emulates a Sony BD Remote for the Logitech Harmony series of
universal remotes. |
David Dillow |
13 years ago |
1 file, +10, -0 |
| 7bd80379 |
fakehid: Disconnect from PS3 remote after 10 mins
After 10 minutes, disconnect the PS3 BD Remote to avoid draining its
battery. This is consistent with its behaviour on the PS3.
Original patch by Ruslan N. Marchenko <rufferson@gmail.com> |
Bastien Nocera |
13 years ago |
2 files, +34, -0 |
| 7e5c32ae |
input: Add helper function to request disconnect |
Bastien Nocera |
13 years ago |
2 files, +9, -0 |
| 51a51b89 |
fakehid: Use the same constant as declared
ps3remote_keymap[] uses 0xff as the max value, so should we. |
Bastien Nocera |
13 years ago |
1 file, +1, -1 |
| d3634b4b |
test: Add compact mode to test-discovery |
Johan Hedberg |
13 years ago |
1 file, +29, -0 |
| b761c2e6 |
core: Add a list of LE devices to connect
This commit creates a per-adapter list of LE devices to connect when a
advertising from them is seen during a scan. |
João Paulo Rechi Vita |
13 years ago |
2 files, +63, -1 |
| 35c2fd92 |
core: Add compare function for bdaddr in a struct btd_device
This is a utility function similar to device_address_cmp but comparing
bdaddr instead of the string representing the address. This way is
possible to avoid allocating two buffers to temporarily hold the
strings, two sprintf() calls to generate the strings from the bdaddr
arrays, and a string comparison, substituting all of it for one memcmp()
call. |
João Paulo Rechi Vita |
13 years ago |
2 files, +6, -0 |
| fcd0c0c4 |
mgmt: Print error message when start_discovery fails
If we fail to communicate with the MGMT socket is better to print the
error message on the mgmtops plugin, where it really happened, instead
of leaving this job to its users. |
João Paulo Rechi Vita |
13 years ago |
2 files, +6, -7 |
| 30529a58 |
hcitool: Add LE scan based on White List
This patch extends the LE scanning command allowing the user to inform
an option to enable LE scanning detecting advertises sent from devices
in the White List Only. This option can be used combined with others. |
Claudio Takahasi |
13 years ago |
1 file, +7, -1 |
| 0940a92c |
gatt: Fix reading Service Changed CCC
Find Information Request is only sent when there are no more attributes
following Service Changed Value (incorrect) and thus will never find CCC. |
Andrzej Kaczmarek |
13 years ago |
1 file, +1, -1 |
| 229f63c3 |
mgmt: Use bt_get_* helper functions to access unaligned memory |
Szymon Janc |
13 years ago |
1 file, +9, -9 |
| 885b72f1 |
eir: Use bt_get_* helper functions to access unaligned memory |
Szymon Janc |
13 years ago |
1 file, +4, -2 |
| 14939676 |
avrcp: Fix compilation errors due to unaligned memory access
This fix following build errors on ARM.
CC audio/bluetoothd-avrcp.o
audio/avrcp.c: In function avrcp_handle_get_element_attributes:
audio/avrcp.c:667:25: error: cast increases required alignment of
target type [-Werror=cast-align]
audio/avrcp.c:690:20: error: cast increases required alignment of
target type [-Werror=cast-align]
cc1: all warnings being treated as errors
make[1]: *** [audio/bluetoothd-avrcp.o] Error 1
make: *** [all] Error 2 |
Szymon Janc |
13 years ago |
1 file, +5, -5 |
| b3fa97f8 |
hciemu: Fix build errors due to unaligned memory access
This fix following build errors on ARM.
CC test/hciemu.o
test/hciemu.c: In function num_completed_pkts:
test/hciemu.c:429:4: error: cast increases required alignment of target
type [-Werror=cast-align]
test/hciemu.c:430:4: error: cast increases required alignment of target
type [-Werror=cast-align]
cc1: all warnings being treated as errors
make[1]: *** [test/hciemu.o] Error 1
make: *** [all] Error 2 |
Szymon Janc |
13 years ago |
1 file, +4, -2 |
| 809b7c31 |
sdpd-service: Fix build errors due to unaligned memory access
This fix number of build errors on ARM similar to one below.
CC src/bluetooth-sdpd-service.o
src/sdpd-service.c: In function service_remove_req:
src/sdpd-service.c:517:20: error: cast increases required alignment of
target type [-Werror=cast-align]
src/sdpd-service.c:517:20: error: cast increases required alignment of
target type [-Werror=cast-align]
src/sdpd-service.c:536:2: error: cast increases required alignment of
target type [-Werror=cast-align]
src/sdpd-service.c:536:2: error: cast increases required alignment of
target type [-Werror=cast-align]
cc1: all warnings being treated as errors |
Szymon Janc |
13 years ago |
1 file, +10, -11 |