OSDN Git Service

android-x86/external-bluetooth-bluez.git
11 years agoobexd: Notify registered notification handlers in MNS
Christian Fetzer [Mon, 17 Jun 2013 08:35:30 +0000 (10:35 +0200)]
obexd: Notify registered notification handlers in MNS

11 years agoobexd: Register notification handler in the MAP client
Christian Fetzer [Mon, 17 Jun 2013 08:35:29 +0000 (10:35 +0200)]
obexd: Register notification handler in the MAP client

11 years agobuild: Add support for building MAP notification dispatcher
Christian Fetzer [Mon, 17 Jun 2013 08:35:28 +0000 (10:35 +0200)]
build: Add support for building MAP notification dispatcher

11 years agoobexd: Add MAP notification dispatching
Christian Fetzer [Mon, 17 Jun 2013 08:35:27 +0000 (10:35 +0200)]
obexd: Add MAP notification dispatching

The MAP specification allows to reuse one MNS server instance for all
local MAS client instances. This dispatching of event reports to the
correct MAS client instance is done by the MAS instance id and the
device address.

The dispatcher component allows MAS client instances to register a
notification handler. Events reports are forwarded by the MNS server using
map_dispatch_event.

11 years agoobexd: Add function to get the destination from the obc_session
Christian Fetzer [Mon, 17 Jun 2013 08:35:26 +0000 (10:35 +0200)]
obexd: Add function to get the destination from the obc_session

11 years agocore: Add mode option to external profile default configuration
Luiz Augusto von Dentz [Thu, 20 Jun 2013 10:32:05 +0000 (13:32 +0300)]
core: Add mode option to external profile default configuration

Some external profiles, FTP and OPP, require a different L2CAP mode such
as ERTM to interoperate properly.

11 years agoinput: Use btd_service userdata pointer
Mikel Astiz [Mon, 27 May 2013 12:04:09 +0000 (14:04 +0200)]
input: Use btd_service userdata pointer

Avoid maintaining an internal list of probed input_device instances by
making use of btd_service's userdata pointer.

11 years agoscanparam: Use btd_service userdata pointer
Mikel Astiz [Mon, 27 May 2013 12:04:08 +0000 (14:04 +0200)]
scanparam: Use btd_service userdata pointer

Avoid maintaining an internal list of probed struct scan instances by
making use of btd_service's userdata pointer.

11 years agodeviceinfo: Use btd_service userdata pointer
Mikel Astiz [Mon, 27 May 2013 12:04:07 +0000 (14:04 +0200)]
deviceinfo: Use btd_service userdata pointer

Avoid maintaining an internal list of probed deviceinfo instances by
making use of btd_service's userdata pointer.

11 years agonetwork: Remove find_connection()
Mikel Astiz [Mon, 27 May 2013 12:04:06 +0000 (14:04 +0200)]
network: Remove find_connection()

The userdata pointer in btd_service provides the necessary information
to find which service should be connected. This makes possible to remove
the restriction of having one single UUID instance per profile.

11 years agonetwork: Fix missing NULL check for given UUID
Mikel Astiz [Mon, 27 May 2013 12:04:05 +0000 (14:04 +0200)]
network: Fix missing NULL check for given UUID

The code dereferences a NULL pointer if find_connection() doesn't find
an existing connection, which will be the case if the input UUID is
invalid or not supported.

11 years agonetwork: Remove duplicated search
Mikel Astiz [Mon, 27 May 2013 12:04:04 +0000 (14:04 +0200)]
network: Remove duplicated search

Commit 0624791ea6e917d6c9ecb8e7e6e5a1327199448d seems to accidentally
have introduced this duplicated search as part of a non-trivial revert.

11 years agoclient: prettify help table
Lucas De Marchi [Fri, 21 Jun 2013 14:17:35 +0000 (11:17 -0300)]
client: prettify help table

cmd + options have a maximum length of 25. Align the description
after this value. In order not to reach 80 chars so easily change the
first \t to 2 spaces, like is done in udev, kmod, systemd, etc.

11 years agoclient: Add description for default-agent command
Lucas De Marchi [Fri, 21 Jun 2013 14:17:34 +0000 (11:17 -0300)]
client: Add description for default-agent command

11 years agoadapter: Remove never used parameter
Lucas De Marchi [Fri, 21 Jun 2013 14:17:33 +0000 (11:17 -0300)]
adapter: Remove never used parameter

adapter_remove_device() is always called with remove_storage set to
TRUE, so remove it.

11 years agogitignore: Add missing tools
Lucas De Marchi [Fri, 21 Jun 2013 14:17:32 +0000 (11:17 -0300)]
gitignore: Add missing tools

11 years agolib: Cleanup SDP logs to not include double new lines
Szymon Janc [Fri, 21 Jun 2013 20:48:20 +0000 (22:48 +0200)]
lib: Cleanup SDP logs to not include double new lines

SDPERR and SDPDBG already add new line to prints.

11 years agoRelease 5.6
Marcel Holtmann [Wed, 19 Jun 2013 06:22:52 +0000 (08:22 +0200)]
Release 5.6

11 years agobuild: Update library version
Marcel Holtmann [Wed, 19 Jun 2013 06:04:14 +0000 (08:04 +0200)]
build: Update library version

11 years agoobexd: Fix crash when retrieving multiple MAP event reports
Christian Fetzer [Mon, 17 Jun 2013 08:35:31 +0000 (10:35 +0200)]
obexd: Fix crash when retrieving multiple MAP event reports

The remote address used for dispatching the MAP notifications is
initialized when the MNS is connected. Therefore it needs to be freed
when the session is destroyed and not after receiving an event report.

Trace:

  0  0x00007ffff6a6a1c9 in raise () from /usr/lib/libc.so.6
  1  0x00007ffff6a6b5c8 in abort () from /usr/lib/libc.so.6
  2  0x00007ffff6aa8037 in __libc_message () from /usr/lib/libc.so.6
  3  0x00007ffff6aad8ae in malloc_printerr () from /usr/lib/libc.so.6
  4  0x00007ffff6aae587 in _int_free () from /usr/lib/libc.so.6
  5  0x00000000004273b0 in event_report_close (obj=0x69a5b0)
     at obexd/client/mns.c:295
  6  0x0000000000429549 in os_reset_session (os=0x69c210)
     at obexd/src/obex.c:199
  7  0x000000000041bec6 in transfer_complete (transfer=0x69a9d0, err=0x0)
     at gobex/gobex-transfer.c:103
  8  0x000000000041c20c in transfer_put_req (obex=0x69b470,
     req=<optimized out>, user_data=0x69a9d0) at
       gobex/gobex-transfer.c:407
  9  0x000000000041988d in handle_request (req=0x69f3d0, obex=0x69b470)
     at gobex/gobex.c:1022
  10 incoming_data (io=<optimized out>, cond=<optimized out>,
     user_data=0x69b470) at gobex/gobex.c:1194
  11 0x00007ffff702de46 in g_main_context_dispatch ()
     from /usr/lib/libglib-2.0.so.0
  12 0x00007ffff702e198 in ?? () from /usr/lib/libglib-2.0.so.0
  13 0x00007ffff702e59a in g_main_loop_run () from
       /usr/lib/libglib-2.0.so.0
  14 0x000000000040dead in main (argc=1, argv=0x7fffffffddc8)
     at obexd/src/main.c:319

11 years agoobexd: Use correct callback in obc_session_mkdir
Christian Fetzer [Mon, 17 Jun 2013 12:10:55 +0000 (14:10 +0200)]
obexd: Use correct callback in obc_session_mkdir

The function obc_session_mkdir needs to use file_op_complete as
callback.

  0  0x00007ffff72f7553 in ?? () from /usr/lib/libdbus-1.so.3
  1  0x00007ffff72f7dff in ?? () from /usr/lib/libdbus-1.so.3
  2  0x00007ffff72fef9a in dbus_message_get_sender ()
     from /usr/lib/libdbus-1.so.3
  3  0x00007ffff72feff9 in dbus_message_new_method_return ()
     from /usr/lib/libdbus-1.so.3
  4  0x000000000043c93f in async_cb (session=0x6a9d30, transfer=0x0,
       err=0x0,
     user_data=0x675660) at obexd/client/ftp.c:65
  5  0x0000000000438c7c in async_cb (obex=0x6aa980, err=0x0,
       rsp=0x67a690,
     user_data=0x67ced0) at obexd/client/session.c:1035
  6  0x000000000041cbcc in handle_response (obex=0x6aa980, err=0x0,
     rsp=0x67a690) at gobex/gobex.c:949
  7  0x000000000041d49f in incoming_data (io=0x67d0f0, cond=G_IO_IN,
     user_data=0x6aa980) at gobex/gobex.c:1192
  8  0x00007ffff702de46 in g_main_context_dispatch ()
     from /usr/lib/libglib-2.0.so.0
  9  0x00007ffff702e198 in ?? () from /usr/lib/libglib-2.0.so.0
  10 0x00007ffff702e59a in g_main_loop_run () from
       /usr/lib/libglib-2.0.so.0
  11 0x0000000000430a09 in main (argc=1, argv=0x7fffffffddc8)
     at obexd/src/main.c:319

11 years agoobexd: Fix file_op_complete callback
Christian Fetzer [Mon, 17 Jun 2013 12:10:54 +0000 (14:10 +0200)]
obexd: Fix file_op_complete callback

The file_op_complete callback added for the OBEX session command queuing
is called with a file_data parameter and not with a pending_request.

This fixes a crash when calling one of the file commands (like delete).

  0  0x0000000000438cd6 in file_op_complete (session=0x6a9d30,
       transfer=0x0,
     err=0x0, user_data=0x6762e0) at obexd/client/session.c:1054
  1  0x0000000000438c64 in async_cb (obex=0x6aa980, err=0x0,
       rsp=0x67a710,
     user_data=0x6ac2c0) at obexd/client/session.c:1035
  2  0x000000000041cbcc in handle_response (obex=0x6aa980, err=0x0,
     rsp=0x67a710) at gobex/gobex.c:949
  3  0x000000000041d49f in incoming_data (io=0x67d0f0, cond=G_IO_IN,
     user_data=0x6aa980) at gobex/gobex.c:1192
  4  0x00007ffff702de46 in g_main_context_dispatch ()
     from /usr/lib/libglib-2.0.so.0
  5  0x00007ffff702e198 in ?? () from /usr/lib/libglib-2.0.so.0
  6  0x00007ffff702e59a in g_main_loop_run () from
       /usr/lib/libglib-2.0.so.0
  7  0x00000000004309f0 in main (argc=1, argv=0x7fffffffddc8)
     at obexd/src/main.c:319

11 years agoobexd: Call setpath_complete with the correct parameter
Christian Fetzer [Mon, 17 Jun 2013 12:10:53 +0000 (14:10 +0200)]
obexd: Call setpath_complete with the correct parameter

The function setpath_complete has to be called with a pending_request as
user_data. In one possible error case, the current code calls it
incorrectly with setpath_data.

11 years agoobexd: Fix handling error cases in setpath
Christian Fetzer [Mon, 17 Jun 2013 12:10:52 +0000 (14:10 +0200)]
obexd: Fix handling error cases in setpath

This adds a setpath_op_complete callback, that unpacks the user data and
finally calls the user callback. The callback is now used for success and error
cases.

The previous implementation was using setpath_complete which did not
work for error cases, because it was called with incorrect user data.
This was leading to a crash, that can be reproduced by disconnecting PBAP
after trying to select a non existing phone book.

  0  setpath_complete (session=0x66bd90, transfer=0x0, err=0x69b370,
     user_data=0x69a810) at obexd/client/session.c:912
  1  0x000000000042d100 in obc_session_shutdown (session=0x66bd90)
     at obexd/client/session.c:537
  2  0x000000000040f227 in service_filter (connection=0x664b20,
     message=<optimized out>, user_data=0x66bed0) at gdbus/watch.c:486
  3  0x000000000040f49b in message_filter (connection=0x664b20,
     message=0x66ba30, user_data=<optimized out>) at gdbus/watch.c:554
  4  0x00007ffff72f40a6 in dbus_connection_dispatch ()
     from /usr/lib/libdbus-1.so.3
  5  0x000000000040e148 in message_dispatch (data=0x664b20)
     at gdbus/mainloop.c:76
  6  0x00007ffff702e9a3 in ?? () from /usr/lib/libglib-2.0.so.0
  7  0x00007ffff702de46 in g_main_context_dispatch ()
     from /usr/lib/libglib-2.0.so.0
  8  0x00007ffff702e198 in ?? () from /usr/lib/libglib-2.0.so.0
  9  0x00007ffff702e59a in g_main_loop_run () from
     /usr/lib/libglib-2.0.so.0
  10 0x000000000040dd72 in main (argc=1, argv=0x7fffffffddc8)
     at obexd/src/main.c:319

11 years agoaudio/media: Fix setting player settings
Luiz Augusto von Dentz [Tue, 18 Jun 2013 08:09:54 +0000 (11:09 +0300)]
audio/media: Fix setting player settings

The value has to be converted to MPRIS setting otherwise the player won't
recognize it and will probably discard the change.

11 years agoaudio/AVRCP: Fix invalid response to RegisterNotification
Luiz Augusto von Dentz [Tue, 18 Jun 2013 08:09:53 +0000 (11:09 +0300)]
audio/AVRCP: Fix invalid response to RegisterNotification

The response to RegisterNotification for event settings changed was
not setting the initial length properly which cause the code to send
malformed/invalid PDUs.

11 years agoaudio/media: Fix notifying settings changed incorrectly
Luiz Augusto von Dentz [Tue, 18 Jun 2013 08:09:52 +0000 (11:09 +0300)]
audio/media: Fix notifying settings changed incorrectly

We should notify only the setting that has changed not all of them.

11 years agocore: Fix crash when a duplicated record is found
Luiz Augusto von Dentz [Tue, 18 Jun 2013 08:08:54 +0000 (11:08 +0300)]
core: Fix crash when a duplicated record is found

 Invalid read of size 8
    at 0x470101: update_bredr_services (device.c:2784)
    by 0x470591: browse_cb (device.c:2975)
    by 0x458B0E: search_completed_cb (sdp-client.c:186)
    by 0x47C154: sdp_process (sdp.c:4343)
    by 0x458954: search_process_cb (sdp-client.c:205)
    by 0x3F31A47A54: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.3400.2)
    by 0x3F31A47D87: ??? (in /usr/lib64/libglib-2.0.so.0.3400.2)
    by 0x3F31A48181: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.3400.2)
    by 0x40A265: main (main.c:595)
  Address 0x0 is not stack'd, malloc'd or (recently) free'd

11 years agoaudio/player: Create item on media_player_set_playlist_item
Luiz Augusto von Dentz [Thu, 13 Jun 2013 13:09:18 +0000 (16:09 +0300)]
audio/player: Create item on media_player_set_playlist_item

This makes sure that even if /NowPlaying folder has not been listed the
current item is available and its metadata is updated.

11 years agoaudio/player: Add implementation of MediaFolder.Search
Luiz Augusto von Dentz [Wed, 12 Jun 2013 15:32:19 +0000 (18:32 +0300)]
audio/player: Add implementation of MediaFolder.Search

11 years agoaudio/AVRCP: Add support for Search command
Luiz Augusto von Dentz [Wed, 12 Jun 2013 14:33:41 +0000 (17:33 +0300)]
audio/AVRCP: Add support for Search command

This adds support for Search command via player callback.

11 years agoaudio/player: Add implementation of MediaItem.AddToNowPlaying
Luiz Augusto von Dentz [Fri, 17 May 2013 11:48:27 +0000 (14:48 +0300)]
audio/player: Add implementation of MediaItem.AddToNowPlaying

11 years agoaudio/AVRCP: Add support for AddToNowPlaying command
Luiz Augusto von Dentz [Fri, 17 May 2013 11:45:55 +0000 (14:45 +0300)]
audio/AVRCP: Add support for AddToNowPlaying command

This adds support for AddToNowPlaying command via player callback.

11 years agoaudio/player: Add implementation of MediaItem.Play
Luiz Augusto von Dentz [Fri, 17 May 2013 12:46:12 +0000 (15:46 +0300)]
audio/player: Add implementation of MediaItem.Play

11 years agoaudio/AVRCP: Add support for PlayItem command
Luiz Augusto von Dentz [Fri, 17 May 2013 12:43:49 +0000 (15:43 +0300)]
audio/AVRCP: Add support for PlayItem command

This adds support for PlayItem command via player callback.

11 years agoaudio/player: Add implementation of MediaFolder.ChangeFolder
Luiz Augusto von Dentz [Fri, 17 May 2013 13:47:40 +0000 (16:47 +0300)]
audio/player: Add implementation of MediaFolder.ChangeFolder

11 years agoaudio/AVRCP: Add support for ChangePath command
Luiz Augusto von Dentz [Fri, 17 May 2013 13:42:01 +0000 (16:42 +0300)]
audio/AVRCP: Add support for ChangePath command

This adds support for ChangePath command via player callback.

11 years agoaudio/player: Add support for MediaItem.Metadata property
Luiz Augusto von Dentz [Thu, 23 May 2013 22:55:55 +0000 (15:55 -0700)]
audio/player: Add support for MediaItem.Metadata property

11 years agoaudio/player: Add function media_item_set_playable
Luiz Augusto von Dentz [Sat, 25 May 2013 22:25:22 +0000 (15:25 -0700)]
audio/player: Add function media_item_set_playable

11 years agoaudio/player: Add support for setting current Item object
Luiz Augusto von Dentz [Sat, 25 May 2013 22:34:20 +0000 (15:34 -0700)]
audio/player: Add support for setting current Item object

This introduces media_player_set_playlist_item which is used when the
current item UID is known, with this the application can tell what
is the current item in the playlist.

11 years agoaudio/player: Add implementation of MediaFolder.ListItems
Luiz Augusto von Dentz [Sat, 25 May 2013 22:59:24 +0000 (15:59 -0700)]
audio/player: Add implementation of MediaFolder.ListItems

11 years agoaudio/AVRCP: Add support for GetFolderItems command
Luiz Augusto von Dentz [Mon, 27 May 2013 08:10:38 +0000 (11:10 +0300)]
audio/AVRCP: Add support for GetFolderItems command

This adds support for GetFolderItems command via player callback.

11 years agoaudio/AVRCP: Add browsed flag to player
Luiz Augusto von Dentz [Mon, 27 May 2013 08:45:07 +0000 (11:45 +0300)]
audio/AVRCP: Add browsed flag to player

This flag indicates if the player is browsed and are checked to avoid
setting the same player as browsed multiple times.

11 years agoaudio/player: Split item creation
Luiz Augusto von Dentz [Thu, 23 May 2013 22:45:55 +0000 (15:45 -0700)]
audio/player: Split item creation

This split item creation into two functions, media_player_create_folder
for folders and media_player_create_item for regular items.

11 years agotools/mpris-player: Fix crash when forwarding player message
Luiz Augusto von Dentz [Mon, 17 Jun 2013 11:23:04 +0000 (14:23 +0300)]
tools/mpris-player: Fix crash when forwarding player message

The iterator to which the message should be copied to should be the copy
message not the original message.

11 years agoemulator: Fix Remote Name Request Cancel command complete
Anderson Lizardo [Wed, 5 Jun 2013 21:04:53 +0000 (17:04 -0400)]
emulator: Fix Remote Name Request Cancel command complete

The Command Complete event for this HCI command contains two parameters,
status and bd_addr.

11 years agoemulator: Fix uninitialised memory usage on inquiry
Anderson Lizardo [Wed, 5 Jun 2013 20:35:16 +0000 (16:35 -0400)]
emulator: Fix uninitialised memory usage on inquiry

This happens when using "btvirt -l2" and running "discoverable on" on
hci1 and "scan on" on hci0 using bluetoothctl:

==1870== Syscall param write(buf) points to uninitialised byte(s)
==1870==    at 0x4114443: __write_nocancel (syscall-template.S:82)
==1870==    by 0x804B503: send_packet (btdev.c:478)
==1870==    by 0x804B599: send_event (btdev.c:503)
==1870==    by 0x804B8C0: inquiry_complete (btdev.c:589)
==1870==    by 0x804C538: default_cmd (btdev.c:881)
==1870==    by 0x804E5DE: process_cmd (btdev.c:1559)
==1870==    by 0x804E646: btdev_receive_h4 (btdev.c:1577)
==1870==    by 0x804A487: vhci_read_callback (vhci.c:82)
==1870==    by 0x804923E: mainloop_run (mainloop.c:142)
==1870==    by 0x8048FD4: main (main.c:145)
==1870==  Address 0x41e4d0f is 15 bytes inside a block of size 258
alloc'd
==1870==    at 0x402B56C: malloc (vg_replace_malloc.c:270)
==1870==    by 0x804B531: send_event (btdev.c:490)
==1870==    by 0x804B8C0: inquiry_complete (btdev.c:589)
==1870==    by 0x804C538: default_cmd (btdev.c:881)
==1870==    by 0x804E5DE: process_cmd (btdev.c:1559)
==1870==    by 0x804E646: btdev_receive_h4 (btdev.c:1577)
==1870==    by 0x804A487: vhci_read_callback (vhci.c:82)
==1870==    by 0x804923E: mainloop_run (mainloop.c:142)
==1870==    by 0x8048FD4: main (main.c:145)
==1870==

11 years agoadapter: rename compare_discovery_sender
Gustavo Padovan [Tue, 11 Jun 2013 10:56:22 +0000 (11:56 +0100)]
adapter: rename compare_discovery_sender

The new name "compare_sender" is more generic and will be used for more
than one purpose.

11 years agoadapter: rename discovery_client to watch_client
Gustavo Padovan [Tue, 11 Jun 2013 10:56:21 +0000 (11:56 +0100)]
adapter: rename discovery_client to watch_client

Rename to a more generic name since we will have different uses for this.

11 years agoadapter: remove unused toggle_discoverable
Gustavo Padovan [Tue, 11 Jun 2013 10:56:20 +0000 (11:56 +0100)]
adapter: remove unused toggle_discoverable

11 years agoadapter: fix setting of discoverable timeout
Gustavo Padovan [Tue, 11 Jun 2013 10:56:19 +0000 (11:56 +0100)]
adapter: fix setting of discoverable timeout

The mgmt_cp_set_discoverable struct was getting reset for no reason after
we set up the discoverable timeout value.

11 years agolib: Fix two size constants
Alex Deymo [Tue, 11 Jun 2013 21:16:42 +0000 (14:16 -0700)]
lib: Fix two size constants

Fixes the value of RESET_FAILED_CONTACT_COUNTER_RP_SIZE and
RESET_FAILED_CONTACT_COUNTER_RP_SIZE macros to respect the
associated struct.

11 years agotools/mpris-player: Fix append_iter to copy all fields
Luiz Augusto von Dentz [Fri, 14 Jun 2013 09:39:07 +0000 (12:39 +0300)]
tools/mpris-player: Fix append_iter to copy all fields

This makes append_iter to work properly when copying another iter with
more than one field.

11 years agocore: Avoid unnecessary gboolean on pincode callback API
Anderson Lizardo [Tue, 21 May 2013 13:06:44 +0000 (09:06 -0400)]
core: Avoid unnecessary gboolean on pincode callback API

Use standard "bool" type instead. Callers in plugins/* are fixed on the
same commit to avoid compilation errors.

11 years agoplugins: Use open()/read() instead of fopen()/fread() on autopair
Anderson Lizardo [Tue, 21 May 2013 13:06:43 +0000 (09:06 -0400)]
plugins: Use open()/read() instead of fopen()/fread() on autopair

open()/read() is more common on BlueZ code. Incidentally, get rid of
this compilation error (using gcc 4.6.3):

plugins/autopair.c: In function â€˜autopair_init’:
plugins/autopair.c:154:8: error: ignoring return value of â€˜fread’,
declared with attribute warn_unused_result [-Werror=unused-result]

11 years agotools/hcidump: Fix parsing of Search PDU
Luiz Augusto von Dentz [Thu, 13 Jun 2013 08:58:12 +0000 (11:58 +0300)]
tools/hcidump: Fix parsing of Search PDU

11 years agorfcomm: Remove bogus manual entry
Szymon Janc [Thu, 30 May 2013 22:01:57 +0000 (00:01 +0200)]
rfcomm: Remove bogus manual entry

This was introduced in commit b1b5f09d40 "Include security parameters"
back in 2007. Those options are already descibed few lines below.

11 years agotools: Update rfcomm help
Szymon Janc [Thu, 30 May 2013 22:01:56 +0000 (00:01 +0200)]
tools: Update rfcomm help

This includes:
remove describtion of non-existing option '-f'
add missing description of '-L' option
add missing long version of '-i' option

11 years agobuild: Fix generating bluetoothd manpage
Szymon Janc [Thu, 30 May 2013 22:01:55 +0000 (00:01 +0200)]
build: Fix generating bluetoothd manpage

CONFIGDIR was not properly substituted in bluetoothd.8 manpage.

11 years agoman: Update bluetoothd manual
Szymon Janc [Fri, 31 May 2013 20:40:45 +0000 (22:40 +0200)]
man: Update bluetoothd manual

This puts manual up-to-date with bluetoothd options.

11 years agocore: Only page device once per connect attempt
Luiz Augusto von Dentz [Wed, 12 Jun 2013 12:13:36 +0000 (15:13 +0300)]
core: Only page device once per connect attempt

In case of EHOSTDOWN/page timeout the code should not proceed with the
next profile as it is very likely it will fail again, moreover the page
timeout is configurable and should be enough for getting a response from
the remote device in a reasonable time.

11 years agoemulator: Fix typo in supported command comment
Johan Hedberg [Thu, 13 Jun 2013 09:19:00 +0000 (12:19 +0300)]
emulator: Fix typo in supported command comment

11 years agotools/bluetooth-player: Fix crash when using search command
Luiz Augusto von Dentz [Wed, 12 Jun 2013 13:25:44 +0000 (16:25 +0300)]
tools/bluetooth-player: Fix crash when using search command

Invalid read of size 8
   at 0x3F34619C4A: dbus_message_iter_append_basic (in /usr/lib64/libdbus-1.so.3.7.2)
   by 0x40B764: search_setup (bluetooth-player.c:893)
   by 0x4094FC: g_dbus_proxy_method_call (client.c:742)
   by 0x40C2A4: cmd_search (bluetooth-player.c:941)
   by 0x40B307: rl_handler (bluetooth-player.c:1099)
   by 0x3733E2AFDA: rl_callback_read_char (in /usr/lib64/libreadline.so.6.2)
   by 0x40BC0D: input_handler (bluetooth-player.c:1216)
   by 0x3F31A47A54: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.3400.2)
   by 0x3F31A47D87: ??? (in /usr/lib64/libglib-2.0.so.0.3400.2)
   by 0x3F31A48181: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.3400.2)
   by 0x40445F: main (bluetooth-player.c:1434)
 Address 0x4d4beb0 is 0 bytes inside a block of size 4 alloc'd
   at 0x4A0887C: malloc (vg_replace_malloc.c:270)
   by 0x3F31A4D68E: g_malloc (in /usr/lib64/libglib-2.0.so.0.3400.2)
   by 0x3F31A63F0B: g_strdup (in /usr/lib64/libglib-2.0.so.0.3400.2)
   by 0x40C281: cmd_search (bluetooth-player.c:939)
   by 0x40B307: rl_handler (bluetooth-player.c:1099)
   by 0x3733E2AFDA: rl_callback_read_char (in /usr/lib64/libreadline.so.6.2)
   by 0x40BC0D: input_handler (bluetooth-player.c:1216)
   by 0x3F31A47A54: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.3400.2)
   by 0x3F31A47D87: ??? (in /usr/lib64/libglib-2.0.so.0.3400.2)
   by 0x3F31A48181: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.3400.2)
   by 0x40445F: main (bluetooth-player.c:1434)

11 years agoaudio: Fix memory leak while creating SDP records
Anderson Lizardo [Wed, 12 Jun 2013 00:06:40 +0000 (21:06 -0300)]
audio: Fix memory leak while creating SDP records

Fix these leaks:

==674== 8 bytes in 1 blocks are definitely lost in loss record 45 of 201
==674==    at 0x402BE68: malloc (in
/usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==674==    by 0x80DF653: sdp_list_append (sdp.c:1742)
==674==    by 0x8063974: avrcp_ct_record (avrcp.c:297)
==674==    by 0x8068A6D: avrcp_remote_register (avrcp.c:3149)
==674==    by 0x805F31C: avrcp_remote_server_probe (manager.c:320)
==674==    by 0x80BCB4E: probe_profile (adapter.c:2629)
==674==    by 0x80C5880: btd_profile_foreach (profile.c:639)
==674==    by 0x80C3FD4: adapter_register (adapter.c:5619)
==674==    by 0x80C4A01: read_info_complete (adapter.c:5894)
==674==    by 0x80D489A: request_complete (mgmt.c:221)
==674==    by 0x80D4BA8: received_data (mgmt.c:319)
==674==    by 0x40BF17D: ??? (in
/lib/i386-linux-gnu/libglib-2.0.so.0.3200.3)
==674==
==674== 32 bytes in 1 blocks are definitely lost in loss record 127 of
201
==674==    at 0x402BE68: malloc (in
/usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==674==    by 0x80DCE49: sdp_data_alloc_with_length (sdp.c:360)
==674==    by 0x80DD33F: sdp_data_alloc (sdp.c:497)
==674==    by 0x806379D: avrcp_ct_record (avrcp.c:272)
==674==    by 0x8068A6D: avrcp_remote_register (avrcp.c:3149)
==674==    by 0x805F31C: avrcp_remote_server_probe (manager.c:320)
==674==    by 0x80BCB4E: probe_profile (adapter.c:2629)
==674==    by 0x80C5880: btd_profile_foreach (profile.c:639)
==674==    by 0x80C3FD4: adapter_register (adapter.c:5619)
==674==    by 0x80C4A01: read_info_complete (adapter.c:5894)
==674==    by 0x80D489A: request_complete (mgmt.c:221)
==674==    by 0x80D4BA8: received_data (mgmt.c:319)

11 years agoobexd: Fix not checking for valid fd on NewConnection
Luiz Augusto von Dentz [Thu, 6 Jun 2013 08:05:46 +0000 (15:05 +0700)]
obexd: Fix not checking for valid fd on NewConnection

The fd needs to be checked as it may not be valid which cause the
following warnings:

==8162== Warning: invalid file descriptor 1031 in syscall fcntl(DUPFD_CLOEXEC)()

(obexd:8162): GLib-WARNING **: giounix.c:412Error while getting flags for FD: Bad file descriptor (9)

11 years agoobexd: Fix crash when resetting OPP session without a transfer
Luiz Augusto von Dentz [Thu, 6 Jun 2013 07:41:38 +0000 (14:41 +0700)]
obexd: Fix crash when resetting OPP session without a transfer

Invalid read of size 8
   at 0x42A570: manager_emit_transfer_completed (manager.c:863)
   by 0x42A76A: os_reset_session (obex.c:206)
   by 0x42A8BB: disconn_func (obex.c:1085)
   by 0x419C55: incoming_data (gobex.c:1224)
   by 0x3F31A47A54: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.3400.2)
   by 0x3F31A47D87: ??? (in /usr/lib64/libglib-2.0.so.0.3400.2)
   by 0x3F31A48181: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.3400.2)
   by 0x40DDB2: main (main.c:319)
 Address 0x10 is not stack'd, malloc'd or (recently) free'd

Invalid read of size 1
   at 0x42A231: manager_unregister_transfer (manager.c:672)
   by 0x420F8B: opp_disconnect (opp.c:158)
   by 0x42A8EC: disconn_func (obex.c:1088)
   by 0x419C55: incoming_data (gobex.c:1224)
   by 0x3F31A47A54: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.3400.2)
   by 0x3F31A47D87: ??? (in /usr/lib64/libglib-2.0.so.0.3400.2)
   by 0x3F31A48181: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.3400.2)
   by 0x40DDB2: main (main.c:319)
 Address 0x0 is not stack'd, malloc'd or (recently) free'd

11 years agoAVRCP: Fix sending SetPlayerApplicationSettingValue using notify command type
Luiz Augusto von Dentz [Thu, 6 Jun 2013 08:55:43 +0000 (15:55 +0700)]
AVRCP: Fix sending SetPlayerApplicationSettingValue using notify command type

The command type for SetPlayerApplicationSettingValue is control

11 years agoAVRCP: Allways fallback to GetElementAttributes if GetItemAttributes fails
Luiz Augusto von Dentz [Tue, 11 Jun 2013 12:32:21 +0000 (15:32 +0300)]
AVRCP: Allways fallback to GetElementAttributes if GetItemAttributes fails

Although GetItemAttributes is mandatory when browsing is supported this
depend on the actual browsed player which may still not support it.

11 years agoAVRCP: Fix sending invalid attributes when responding to GetElementAttributes
Luiz Augusto von Dentz [Thu, 6 Jun 2013 04:06:45 +0000 (11:06 +0700)]
AVRCP: Fix sending invalid attributes when responding to GetElementAttributes

The list returned by media.c contains the attributes in string format not
the binary format which cause us to send wrong/reserved attributes as can
be observed bellow:

> ACL data: handle 12 flags 0x02 dlen 58
    L2CAP(d): cid 0x0041 len 54 [psm 23]
      AVCTP Control: Response : pt 0x00 transaction 14 pid 0x110e
        AV/C: Stable: address 0x48 opcode 0x00
          Subunit: Panel
          Opcode: Vendor Dependent
          Company ID: 0x001958
          AVRCP: GetElementAttributes: pt Single len 0x0029
            AttributeCount: 0x05
            Attribute: 0x00df9490 (Reserved)
            CharsetID: 0x006a (UTF-8)
            AttributeValueLength: 0x0000
            AttributeValue:
            Attribute: 0x00e0e880 (Reserved)
            CharsetID: 0x006a (UTF-8)
            AttributeValueLength: 0x0000
            AttributeValue:
            Attribute: 0x00e07b00 (Reserved)
            CharsetID: 0x006a (UTF-8)
            AttributeValueLength: 0x0000
            AttributeValue:
            Attribute: 0x00e16bc0 (Reserved)
            CharsetID: 0x006a (UTF-8)
            AttributeValueLength: 0x0000
            AttributeValue:
            Attribute: 0x00e07bc0 (Reserved)
            CharsetID: 0x006a (UTF-8)
            AttributeValueLength: 0x0000
            AttributeValue:

11 years agocore: Fix not been able to cancel Device.Connect with Device.Disconnect
Luiz Augusto von Dentz [Thu, 6 Jun 2013 04:03:37 +0000 (11:03 +0700)]
core: Fix not been able to cancel Device.Connect with Device.Disconnect

Device.Disconnect should be able to interrupt the connection attempt
started by Device.Connect.

11 years agoAVRCP: Fix crash while setting player volume
Luiz Augusto von Dentz [Wed, 5 Jun 2013 15:40:55 +0000 (22:40 +0700)]
AVRCP: Fix crash while setting player volume

Invalid read of size 8
   at 0x41A4EA: avrcp_handle_set_volume (avrcp.c:3619)
   by 0x418598: session_cb (avctp.c:790)
   by 0x3F31A47A54: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.3400.2)
   by 0x3F31A47D87: ??? (in /usr/lib64/libglib-2.0.so.0.3400.2)
   by 0x3F31A48181: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.3400.2)
   by 0x40A335: main (main.c:595)
 Address 0x48 is not stack'd, malloc'd or (recently) free'd

11 years agoAVRCP: Fix crash when connecting role without a record
Luiz Augusto von Dentz [Wed, 5 Jun 2013 10:08:29 +0000 (17:08 +0700)]
AVRCP: Fix crash when connecting role without a record

Invalid read of size 4
   at 0x469310: btd_service_connecting_complete (service.c:315)
   by 0x41B29F: session_ct_init_control (avrcp.c:3208)
   by 0x41AD70: state_changed (avrcp.c:3356)
   by 0x417B84: avctp_set_state (avctp.c:550)
   by 0x419E04: avctp_connect_cb (avctp.c:1222)
   by 0x450869: accept_cb (btio.c:202)
   by 0x3F31A47A54: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.3400.2)
   by 0x3F31A47D87: ??? (in /usr/lib64/libglib-2.0.so.0.3400.2)
   by 0x3F31A48181: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.3400.2)
   by 0x40A335: main (main.c:595)
 Address 0x20 is not stack'd, malloc'd or (recently) free'd

11 years agoAVRCP: Fix setting reserved bit in GetCapabilities response
Luiz Augusto von Dentz [Wed, 5 Jun 2013 07:04:04 +0000 (14:04 +0700)]
AVRCP: Fix setting reserved bit in GetCapabilities response

EventID 0x00 is reserved:

< ACL data: handle 12 flags 0x00 dlen 25
    L2CAP(d): cid 0x0541 len 21 [psm 23]
      AVCTP Control: Response : pt 0x00 transaction 2 pid 0x110e
        AV/C: Stable: address 0x48 opcode 0x00
          Subunit: Panel
          Opcode: Vendor Dependent
          Company ID: 0x001958
          AVRCP: GetCapabilities: pt Single len 0x0008
            CapabilityID: 0x03 (EventsID)
            CapabilityCount: 0x06
            EventsID: 0x00 (Reserved)
            EventsID: 0x01 (EVENT_PLAYBACK_STATUS_CHANGED)
            EventsID: 0x02 (EVENT_TRACK_CHANGED)
            EventsID: 0x03 (EVENT_TRACK_REACHED_END)
            EventsID: 0x04 (EVENT_TRACK_REACHED_START)
            EventsID: 0x08 (EVENT_PLAYER_APPLICATION_SETTING_CHANGED)

11 years agoAVRCP: Fix crash if player status is NULL
Luiz Augusto von Dentz [Wed, 5 Jun 2013 06:52:45 +0000 (13:52 +0700)]
AVRCP: Fix crash if player status is NULL

Assume status is 'stopped' in case the status is NULL.

11 years agoAVRCP: Fix crash when current addressed player is removed
Luiz Augusto von Dentz [Wed, 5 Jun 2013 01:46:04 +0000 (08:46 +0700)]
AVRCP: Fix crash when current addressed player is removed

In some stacks e.g. iOS the addressed player is removed before a new
player is set which leaves the session poiting to invalid player.

11 years agoAVRCP: Add additional protocol discriptor list for Browsing channel
Luiz Augusto von Dentz [Tue, 4 Jun 2013 06:59:11 +0000 (13:59 +0700)]
AVRCP: Add additional protocol discriptor list for Browsing channel

This is documented in the spec and is checked by PTS when testing the
browsing channel.

11 years agoAVRCP: Fix crash while listing available settings in TG role
Luiz Augusto von Dentz [Tue, 4 Jun 2013 01:24:50 +0000 (08:24 +0700)]
AVRCP: Fix crash while listing available settings in TG role

Invalid read of size 1
   at 0x41AFD0: attrval_to_val (avrcp.c:492)
   by 0x41B0E1: avrcp_handle_list_player_attributes (avrcp.c:931)
   by 0x41D606: handle_vendordep_pdu (avrcp.c:1620)
   by 0x4185F8: session_cb (avctp.c:985)
   by 0x3F31A47A54: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.3400.2)
   by 0x3F31A47D87: ??? (in /usr/lib64/libglib-2.0.so.0.3400.2)
   by 0x3F31A48181: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.3400.2)
   by 0x40A2E5: main (main.c:595)
 Address 0x0 is not stack'd, malloc'd or (recently) free'd

11 years agoAVCTP: Call callback in case the request timeout
Luiz Augusto von Dentz [Mon, 3 Jun 2013 06:09:09 +0000 (13:09 +0700)]
AVCTP: Call callback in case the request timeout

If the request timeout deliver a empty PDU to the callback so it
can take proper action.

11 years agoAVCTP: Fix coding style
Luiz Augusto von Dentz [Mon, 3 Jun 2013 04:40:19 +0000 (11:40 +0700)]
AVCTP: Fix coding style

Fix unnecessary extra tabs

11 years agoAVRCP: Fix crash when registering unsupported notification
Luiz Augusto von Dentz [Mon, 3 Jun 2013 03:55:53 +0000 (10:55 +0700)]
AVRCP: Fix crash when registering unsupported notification

Reject command if notification is not supported otherwise this can
cause crashes.

11 years agotools/bluetooth-player: Add show-item command
Luiz Augusto von Dentz [Mon, 10 Jun 2013 08:02:03 +0000 (11:02 +0300)]
tools/bluetooth-player: Add show-item command

Add support for show-item command which can be used to print item
information.

11 years agotools/bluetooth-player: Add search command
Luiz Augusto von Dentz [Fri, 7 Jun 2013 08:44:24 +0000 (15:44 +0700)]
tools/bluetooth-player: Add search command

Add support for search command which can be used to search a for items
containing a given string.

11 years agotools/bluetooth-player: Add scan command
Luiz Augusto von Dentz [Tue, 4 Jun 2013 10:14:17 +0000 (17:14 +0700)]
tools/bluetooth-player: Add scan command

Add support for scan command which can be used to set scan mode.

11 years agotools/bluetooth-player: Add shuffle command
Luiz Augusto von Dentz [Tue, 4 Jun 2013 10:03:59 +0000 (17:03 +0700)]
tools/bluetooth-player: Add shuffle command

Add support for shuffle command which can be used to set shuffle mode.

11 years agotools/bluetooth-player: Add repeat command
Luiz Augusto von Dentz [Tue, 4 Jun 2013 09:45:42 +0000 (16:45 +0700)]
tools/bluetooth-player: Add repeat command

Add support for equalizer command which can be used to set repeat mode.

11 years agotools/bluetooth-player: Add equalizer command
Luiz Augusto von Dentz [Tue, 4 Jun 2013 06:19:25 +0000 (13:19 +0700)]
tools/bluetooth-player: Add equalizer command

Add support for equalizer command which can be used to enable/disable
equalizer.

11 years agotools/bluetooth-player: Add queue command
Luiz Augusto von Dentz [Tue, 4 Jun 2013 02:49:01 +0000 (09:49 +0700)]
tools/bluetooth-player: Add queue command

Add support for queue command which can be used to add an item to the
current playlist.

11 years agotools/bluetooth-player: Add item argument to play command
Luiz Augusto von Dentz [Mon, 3 Jun 2013 15:57:36 +0000 (22:57 +0700)]
tools/bluetooth-player: Add item argument to play command

Add item argument to play command so it can be used to e.g. jump to
different item in the playlist.

11 years agotools/bluetooth-player: Add list-items command
Luiz Augusto von Dentz [Sun, 2 Jun 2013 02:26:16 +0000 (09:26 +0700)]
tools/bluetooth-player: Add list-items command

Add support for list-items command which can be used list items of
current folder.

11 years agotools/bluetooth-player: Add change-folder command
Luiz Augusto von Dentz [Sat, 1 Jun 2013 16:42:47 +0000 (23:42 +0700)]
tools/bluetooth-player: Add change-folder command

Add support for change-folder command which can be used to change
current folder.

11 years agotools/bluetooth-player: Print playlist name in command show
Luiz Augusto von Dentz [Sat, 1 Jun 2013 16:21:02 +0000 (23:21 +0700)]
tools/bluetooth-player: Print playlist name in command show

This makes command show to print playlist name if available

11 years agotools/bluetooth-player: Add proxy handling for org.bluez.MediaItem1
Luiz Augusto von Dentz [Sat, 1 Jun 2013 15:57:47 +0000 (22:57 +0700)]
tools/bluetooth-player: Add proxy handling for org.bluez.MediaItem1

This adds proxy handling for org.bluez.MediaItem1 so changes to the
proxy are printed in the output.

11 years agotools/bluetooth-player: Add folder properties to command show output
Luiz Augusto von Dentz [Sat, 1 Jun 2013 13:45:35 +0000 (20:45 +0700)]
tools/bluetooth-player: Add folder properties to command show output

This add folder properties to command show output if MediaFolder1 is
supported.

11 years agotools/bluetooth-player: Add proxy handling for org.bluez.MediaFolder1
Luiz Augusto von Dentz [Sat, 1 Jun 2013 13:39:45 +0000 (20:39 +0700)]
tools/bluetooth-player: Add proxy handling for org.bluez.MediaFolder1

This adds proxy handling for org.bluez.MediaFolder1 so changes to the
proxy are printed in the output.

11 years agotools/bluetooth-player: Add select command
Luiz Augusto von Dentz [Fri, 31 May 2013 08:59:00 +0000 (11:59 +0300)]
tools/bluetooth-player: Add select command

Add support for select command which can be used to set the default
player

11 years agotools/bluetooth-player: Add show command
Luiz Augusto von Dentz [Fri, 31 May 2013 08:09:51 +0000 (11:09 +0300)]
tools/bluetooth-player: Add show command

Add support for show command which can be used to show player
information

11 years agotools/bluetooth-player: Add list command
Luiz Augusto von Dentz [Fri, 31 May 2013 07:49:04 +0000 (10:49 +0300)]
tools/bluetooth-player: Add list command

Add support for list command which can be used to list available players

11 years agotools/bluetooth-player: Add rewind command
Luiz Augusto von Dentz [Thu, 30 May 2013 19:51:57 +0000 (22:51 +0300)]
tools/bluetooth-player: Add rewind command

Add support for rewind command which can be used to rewind the playback

11 years agotools/bluetooth-player: Add fast-forward command
Luiz Augusto von Dentz [Thu, 30 May 2013 19:46:03 +0000 (22:46 +0300)]
tools/bluetooth-player: Add fast-forward command

Add support for fast-forward command which can be used to fast forward
the playback

11 years agotools/bluetooth-player: Add previous command
Luiz Augusto von Dentz [Thu, 30 May 2013 17:29:36 +0000 (20:29 +0300)]
tools/bluetooth-player: Add previous command

Add support for next command which can be used to jump to the previous
item