Commit Graph

15166 Commits

Author SHA1 Message Date
Marcel Holtmann
5f901fdb0f monitor: Remove pointless empty lines 2013-08-12 20:39:01 -07:00
Marcel Holtmann
fa7c3f5f6e monitor: Fix function names for some LE security commands 2013-08-12 20:34:18 -07:00
Marcel Holtmann
2e137ec032 monitor: Fix structures for LE long term key request commands 2013-08-12 20:30:19 -07:00
Marcel Holtmann
e2cb57ecf7 monitor: Add definitions for LE test commands 2013-08-12 20:26:47 -07:00
Luiz Augusto von Dentz
feb46c1d38 client/transfer: Add proper message to errors
This improve the error message when a transfer fails by using
g_obex_strerror to decode the response code to a human readable string.
2013-08-12 13:48:09 +03:00
Luiz Augusto von Dentz
0c6df3bb9b gobex: Add proper message to transfer errors
This improve the error message when a transfer fails by using
g_obex_strerror to decode the response code to a human readable string.
2013-08-12 11:13:51 +03:00
Marcel Holtmann
17a59808a1 monitor: Fix fields for LE Set Advertising Parameters command 2013-08-11 21:29:08 -07:00
Marcel Holtmann
eeeb058432 monitor: Add support for LE Set Advertising Parameters command 2013-08-11 21:28:03 -07:00
Marcel Holtmann
16613cf37d monitor: Fix whitespace issue 2013-08-11 21:09:52 -07:00
Marcel Holtmann
11aea49884 monitor: Print proper LE address labels 2013-08-11 21:07:53 -07:00
Johan Hedberg
d01c257665 tools/scotest: Fix supporting hex voice setting values 2013-08-08 14:05:57 +03:00
Johan Hedberg
0ede25eddc tools/scotest: Don't try BT_VOICE unless a non-zero voice setting was given 2013-08-08 14:01:48 +03:00
Johan Hedberg
7ddeb00c1a tools/btiotest: Fix applying voice setting for incoming connections 2013-08-08 12:48:37 +03:00
Marcel Holtmann
c4db4db6bf Release 5.8 2013-08-07 22:32:56 -07:00
Marcel Holtmann
8b11a12173 build: Update library version 2013-08-07 12:35:24 -07:00
Marcel Holtmann
a24e0a151f lib: Update company identifiers 2013-08-07 12:21:46 -07:00
Marcel Holtmann
4823139c23 tools: Fix path for bluetooth.org assigned numbers table 2013-08-07 12:20:35 -07:00
Frederic Danis
bb8d0b6fde core: Fix error message in profile ext_auth function 2013-08-01 18:52:36 +03:00
Johan Hedberg
d009995121 tools/btiotest: Print voice setting 2013-08-01 15:43:38 +03:00
Frédéric Dalleau
ae673b27c6 tools/sco-tester: Add more connection test cases 2013-08-01 12:54:32 +03:00
Frédéric Dalleau
5c3dd66b61 shared/hciemu: Add hciemu_get_features API (needed for SCO tests) 2013-08-01 12:54:32 +03:00
Frédéric Dalleau
7d0783b711 emulator: Add btdev_get_features API (needed for SCO tests) 2013-08-01 12:54:32 +03:00
Frédéric Dalleau
5ae69263b7 tools/sco-tester: Add new SCO test tool 2013-08-01 12:54:32 +03:00
Frédéric Dalleau
287304526a emulator: Add SCO connection creation support 2013-08-01 12:54:32 +03:00
Frédéric Dalleau
89c0d1a490 scotest: Add option for SCO voice setting 2013-08-01 12:38:34 +03:00
Frédéric Dalleau
36e6ebec91 btiotest: Add option for SCO voice setting 2013-08-01 12:37:38 +03:00
Frédéric Dalleau
cf721a5364 btio: Add option for SCO voice setting 2013-08-01 12:36:25 +03:00
Frédéric Dalleau
c594291320 lib: SCO voice setting support header
Modify headers to enable support for changing SCO voice setting.
Corresponding commit implements functionality on kernel side.
2013-08-01 12:32:11 +03:00
Szymon Janc
a79f22a45a monitor: Opencode strndupa in print_string
Strndupa is GNU extension. print_string is simple and opencoding
strndupa is not a big loss.

This fix linkage error with bionic library which doesn't provide
strndupa.

target Executable: btmon (out/target/product/grouper/obj/EXECUTABLES/
    btmon_intermediates/LINKED/btmon)
prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.6/bin/../lib/gcc/
    arm-linux-androideabi/4.6.x-google/../../../../
    arm-linux-androideabi/bin/ld: out/target/product/grouper/obj/
    EXECUTABLES/btmon_intermediates/monitor/sdp.o: in function
    print_string:external/bluetooth/bluez/monitor/sdp.c:146: error:
    undefined reference to 'strndupa'
collect2: ld returned 1 exit status
make: *** [out/target/product/grouper/obj/EXECUTABLES/
    btmon_intermediates/LINKED/btmon] Error
2013-08-01 10:53:16 +03:00
Luiz Augusto von Dentz
fd9dddbfe6 audio/player: Fix overflowing position
The position should stop at UINT32_MAX after that the progress can no
longer be calculated, this should also prevent the position to change
when the remote stack doesn't support it which is also indicated with
UINT32_MAX which apparently is the case of Spotify on Android 4.3:

[CHG] Player /org/bluez/hci0/dev_XX_XX_XX_XX_XX_XX/player0 Position: 0xffffffff
[CHG] Player /org/bluez/hci0/dev_XX_XX_XX_XX_XX_XX/player0 Status: playing
[CHG] Player /org/bluez/hci0/dev_XX_XX_XX_XX_XX_XX/player0 Position: 0x000000
2013-07-31 14:35:41 +03:00
Dirk-Jan C. Binnema
fabd565565 attrib: Add support for 128-bit characteristic UUIDs in gatt_service_add
Custom GATT services typically use 128-bits UUIDs; this patch allows for
using gatt_service_add to define such services by adding a new option
GATT_OPT_CHR_UUID, which allows for passing bt_uuid_t* values. Note, a
previous patch renamed the old GATT_OPT_CHR_UUID into
GATT_OPT_CHR_UUID16.
2013-07-30 12:59:15 +03:00
Dirk-Jan C. Binnema
1208266dcc attrib: Rename GATT_OPT_CHR_UUID into GATT_OPT_CHR_UUID16
Rename the option for all in-tree users. This frees up GATT_OPT_CHR_UUID to be used
for UUIDs of type bt_uuid_t* (in a next patch).
2013-07-30 12:59:12 +03:00
Dirk-Jan C. Binnema
f3e175bd78 attrib: Update gatt_service_add size assert for dealing with 128-bit UUIDs
To paraphrase Anderson Lizardo: "h" was overflowing for 128-bit services
because the handle is incremented after each attribute is added so at
the end we had: 0xffff + 1 == 0 (h is uint16_t).

As it seems more complex to try to remove the overflow without affecting
the logic too much, we update the assertion.
2013-07-30 12:59:12 +03:00
Luiz Augusto von Dentz
af6855c6c2 audio/AVCTP: Do not process browsing queue until connection completes
Any request processed before the connection completes will likely fail
in avctp_browsing_send so instead delay the processing.
2013-07-30 12:53:23 +03:00
Luiz Augusto von Dentz
0eef17b39a audio/AVCTP: Fix connecting browsing channel multiple times
While accepting the connection via DEFER_SETUP a second connection can
be created by using avctp_connect_browsing which will not detect one is
in course as the state has not yet changed, this can cause memory leaks
or crashes as the following:

profiles/audio/avctp.c:avctp_confirm_cb() AVCTP: incoming connect from XX:XX:XX:XX:XX:XX
profiles/audio/avctp.c:avctp_set_state() AVCTP Browsing Connecting
profiles/audio/avctp.c:avctp_connect_browsing_cb() AVCTP Browsing: connected to XX:XX:XX:XX:XX:XX
profiles/audio/avctp.c:avctp_set_state() AVCTP Browsing Connected
profiles/audio/avctp.c:avctp_connect_browsing_cb() AVCTP Browsing: connected to XX:XX:XX:XX:XX:XX
profiles/audio/avctp.c:avctp_set_state() AVCTP Browsing Connected
profiles/audio/avctp.c:session_browsing_cb() AVCTP Browsing: disconnected
profiles/audio/avctp.c:avctp_set_state() AVCTP Connected
Invalid read of size 8
   at 0x41EB28: session_browsing_cb (avctp.c:842)
   by 0x32F5447E05: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.3600.3)
   by 0x32F5448157: ??? (in /usr/lib64/libglib-2.0.so.0.3600.3)
   by 0x32F5448559: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.3600.3)
   by 0x40A28F: main (main.c:583)
 Address 0x20 is not stack'd, malloc'd or (recently) free'd
2013-07-30 12:53:16 +03:00
Luiz Augusto von Dentz
153a607801 audio/AVRCP: Connect browsing channel in case of GetCapabilities response
If the remote stack respond to GetCapabilities before connecting to
browsing channel connect it immediatelly as some events might depend on
it to work properly.

The spec actually recommends the browsing channel to be connected
immediatelly after the control channel:

AVRCP 1.5 - Page 23

"4.1.1 Connection establishment
...
If a browsing channel is supported by both devices it shall be
established after control channel establishment. It is recommended that
the browsing channel is established immediately after the control
channel is established and released immediately before the control
channel is released to avoid unsatisfactory latency when a browsing
command is sent."
2013-07-30 12:52:42 +03:00
Luiz Augusto von Dentz
bd56b05de4 audio/AVRCP: Connect browsing channel when accepting the connection
If remote stack for some reason don't connect the browsing channel
connect it after a timeout (1 sec.)
2013-07-30 12:52:29 +03:00
Luiz Augusto von Dentz
78ec5c13c9 audio/AVRCP: Fix not setting browsing feature in CT record
The record already contain the additional protocol containing the
browsing channel but the feature is not set as it is supposed to.
2013-07-30 12:52:21 +03:00
Luiz Augusto von Dentz
01f7adca85 audio/AVRCP: Fix not connecting Browsing channel when supported
Both controller and target services can initiate the connection but
probably only one of the services will be in CONNECTING state which may
happen to not have browsing feature set.

Currently this happens when connecting BlueZ vs BlueZ where the CT record
does not have browsing feature set so if the corresponding service start
connecting it wont connect the browsing channel due to lack of feature.
2013-07-30 12:52:11 +03:00
Luiz Augusto von Dentz
193a71190b audio/AVRCP: Fix memory leaks
When the remote stack support both AVAILABLE_PLAYER_CHANGED and
ADDRESSED_PLAYER_CHANGED the player twice are inited twice leaking
the memory allocated in the first time:

16 bytes in 1 blocks are definitely lost in loss record 45 of 236
   at 0x4A06409: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x32F544D89E: g_malloc (in /usr/lib64/libglib-2.0.so.0.3600.3)
   by 0x32F5464BF7: g_memdup (in /usr/lib64/libglib-2.0.so.0.3600.3)
   by 0x4247CC: avrcp_get_media_player_list_rsp (avrcp.c:2432)
   by 0x41ECAB: session_browsing_cb (avctp.c:826)
   by 0x32F5447E05: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.3600.3)
   by 0x32F5448157: ??? (in /usr/lib64/libglib-2.0.so.0.3600.3)
   by 0x32F5448559: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.3600.3)
   by 0x40A28F: main (main.c:583)

16 bytes in 1 blocks are definitely lost in loss record 46 of 236
   at 0x4A082F7: realloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x32F544D946: g_realloc (in /usr/lib64/libglib-2.0.so.0.3600.3)
   by 0x32F5466D43: ??? (in /usr/lib64/libglib-2.0.so.0.3600.3)
   by 0x32F5467032: g_string_insert_len (in /usr/lib64/libglib-2.0.so.0.3600.3)
   by 0x32F5435287: ??? (in /usr/lib64/libglib-2.0.so.0.3600.3)
   by 0x421E62: avrcp_set_browsed_player_rsp (avrcp.c:2349)
   by 0x41ECAB: session_browsing_cb (avctp.c:826)
   by 0x32F5447E05: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.3600.3)
   by 0x32F5448157: ??? (in /usr/lib64/libglib-2.0.so.0.3600.3)
   by 0x32F5448559: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.3600.3)
   by 0x40A28F: main (main.c:583)
2013-07-30 12:52:04 +03:00
Claudio Takahasi
d27d5eadd5 scanparam: Remove unneeded header include 2013-07-30 12:51:24 +03:00
Anderson Lizardo
04c1af8209 scanparam: Apply convention for "GSource id" like variable
By convention, BlueZ code checks for "Gsource id" like variables using:

if (source_id > 0)
...

Also fix the variable type to match that returned by
g_attrib_unregister().
2013-07-30 12:50:57 +03:00
Anderson Lizardo
8de51036c1 scanparam: Fix missing check for valid GAttrib when removing device
If device is removed while there is no connection, scan->attrib will be
NULL, because its reference is managed by attio connect/disconnect
callbacks. This means that on disconnect any resources owned by GAttrib
will be properly destroyed.
2013-07-30 12:50:49 +03:00
Anderson Lizardo
63eb0e9084 scanparam: Remove unnecessary assignment
"scan" will be g_free()'d on this same function, so no need to assign 0
to refresh_cb_id.
2013-07-30 12:50:43 +03:00
Anderson Lizardo
9a3b7a8dd8 scanparam: Fix handle range check on descriptor discovery
When discovering descriptors, if there is only a single descriptor, the
start handle will be equal to the end handle. It is valid to issue the
Find Information Request on this case.

Before this fix, notification for Scan Refresh characteristic was never
enabled.
2013-07-30 12:50:26 +03:00
Luiz Augusto von Dentz
e7d8275676 audio/player: Fix not setting playlist items as playable
All items in the playlist should have playable flag set otherwise they
cannot be part of the playlist.
2013-07-26 09:24:13 -07:00
Anderson Lizardo
32f40223cd test: Fix ProximityMonitor1 interface name typo in test-proximity 2013-07-26 09:23:37 -07:00
Luiz Augusto von Dentz
7a17b557ab doc/media-api: Add Metadata property to MediaItem
The implementation uses a single property to expose the item metadata
not multiple for every single metadata entry.
2013-07-26 11:27:27 +03:00
Anderson Lizardo
188d211c74 build: Fix make distcheck
Fix this error:

make[1]: *** No rule to make target `profiles/audio/audio.conf', needed
by `distdir'.  Stop.
make: *** [test_build] Error 2
2013-07-25 11:51:26 -07:00
Luiz Augusto von Dentz
d76b4b05b1 tools/mpris-player: Fix leaking memory when unregistering a player
Any memory allocated for user_data passed to
dbus_connection_register_object_path should be freed once unregistered.
2013-07-25 16:12:45 +03:00