OSDN Git Service

android-x86/external-bluetooth-bluez.git
11 years agotools: Fix AVRCP parsing of GetFolderItems for media players
Luiz Augusto von Dentz [Wed, 6 Mar 2013 14:49:02 +0000 (16:49 +0200)]
tools: Fix AVRCP parsing of GetFolderItems for media players

Length of name is 2 bytes not 1

11 years agotools: Fix not unregistering all interface when a player disappear
Luiz Augusto von Dentz [Wed, 6 Mar 2013 14:48:07 +0000 (16:48 +0200)]
tools: Fix not unregistering all interface when a player disappear

11 years agosource: Register state callback for specified audio device
Szymon Janc [Tue, 5 Mar 2013 14:59:55 +0000 (15:59 +0100)]
source: Register state callback for specified audio device

State callback will now be registered and called for specified device
only. This will allow for more cleaner callback register/unregister
in roles code.

11 years agosink: Register state callback for specified audio device
Szymon Janc [Tue, 5 Mar 2013 14:59:54 +0000 (15:59 +0100)]
sink: Register state callback for specified audio device

State callback will now be registered and called for specified device
only. This will allow for more cleaner callback register/unregister
in roles code.

Fix following valgrind reports:

16 bytes in 1 blocks are still reachable in loss record 42 of 219
   at 0x4C2B6CD: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x4E7FA78: g_malloc (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.3)
   by 0x4E92CA2: g_slice_alloc (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.3)
   by 0x4E93FC2: g_slist_append (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.3)
   by 0x41F31D: sink_add_state_cb (sink.c:456)
   by 0x41DD67: audio_device_register (device.c:314)
   by 0x416ECA: manager_get_audio_device (manager.c:491)
   by 0x4171A8: a2dp_sink_probe (manager.c:131)
   by 0x46A801: dev_probe (device.c:2347)
   by 0x468C9E: btd_profile_foreach (profile.c:599)
   by 0x46BB95: device_probe_profiles (device.c:2423)
   by 0x461438: load_devices (adapter.c:2549)

24 bytes in 1 blocks are still reachable in loss record 56 of 219
   at 0x4C2B6CD: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x4E7FA78: g_malloc (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.3)
   by 0x41F2F2: sink_add_state_cb (sink.c:451)
   by 0x41DD67: audio_device_register (device.c:314)
   by 0x416ECA: manager_get_audio_device (manager.c:491)
   by 0x4171A8: a2dp_sink_probe (manager.c:131)
   by 0x46A801: dev_probe (device.c:2347)
   by 0x468C9E: btd_profile_foreach (profile.c:599)
   by 0x46BB95: device_probe_profiles (device.c:2423)
   by 0x461438: load_devices (adapter.c:2549)
   by 0x465066: read_info_complete (adapter.c:5514)
   by 0x471381: request_complete (mgmt.c:221)

11 years agoavctp: Remove user data from avctp_session_state_cb
Szymon Janc [Tue, 5 Mar 2013 14:59:53 +0000 (15:59 +0100)]
avctp: Remove user data from avctp_session_state_cb

All users pass NULL as user data so there is no need to keep that.

11 years agoavctp: Allow to register state callback for specified audio device
Szymon Janc [Tue, 5 Mar 2013 14:59:52 +0000 (15:59 +0100)]
avctp: Allow to register state callback for specified audio device

State callback can now be registered and called for specified device
only (or all devices if NULL is passed). This will allow for more
cleaner callback register/unregister in roles code.

Fix following valgrind reports:

16 bytes in 1 blocks are still reachable in loss record 43 of 223
   at 0x4C2B6CD: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x4E7FA78: g_malloc (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.3)
   by 0x4E92CA2: g_slice_alloc (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.3)
   by 0x4E93FC2: g_slist_append (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.3)
   by 0x419ABD: avctp_add_state_cb (avctp.c:1652)
   by 0x41DD87: audio_device_register (device.c:320)
   by 0x416ECA: manager_get_audio_device (manager.c:491)
   by 0x4171A8: a2dp_sink_probe (manager.c:131)
   by 0x46A821: dev_probe (device.c:2347)
   by 0x468CBE: btd_profile_foreach (profile.c:599)
   by 0x46BBB5: device_probe_profiles (device.c:2423)
   by 0x461458: load_devices (adapter.c:2549)

16 bytes in 1 blocks are still reachable in loss record 44 of 223
   at 0x4C2B6CD: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x4E7FA78: g_malloc (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.3)
   by 0x4E92CA2: g_slice_alloc (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.3)
   by 0x4E93FC2: g_slist_append (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.3)
   by 0x419ABD: avctp_add_state_cb (avctp.c:1652)
   by 0x417791: control_init (control.c:290)
   by 0x417097: avrcp_probe (manager.c:156)
   by 0x46A821: dev_probe (device.c:2347)
   by 0x468CBE: btd_profile_foreach (profile.c:599)
   by 0x46BBB5: device_probe_profiles (device.c:2423)
   by 0x461458: load_devices (adapter.c:2549)
   by 0x465086: read_info_complete (adapter.c:5514)

24 bytes in 1 blocks are still reachable in loss record 59 of 223
   at 0x4C2B6CD: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x4E7FA78: g_malloc (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.3)
   by 0x419A92: avctp_add_state_cb (avctp.c:1647)
   by 0x41DD87: audio_device_register (device.c:320)
   by 0x416ECA: manager_get_audio_device (manager.c:491)
   by 0x4171A8: a2dp_sink_probe (manager.c:131)
   by 0x46A821: dev_probe (device.c:2347)
   by 0x468CBE: btd_profile_foreach (profile.c:599)
   by 0x46BBB5: device_probe_profiles (device.c:2423)
   by 0x461458: load_devices (adapter.c:2549)
   by 0x465086: read_info_complete (adapter.c:5514)
   by 0x4713A1: request_complete (mgmt.c:221)

24 bytes in 1 blocks are still reachable in loss record 60 of 223
   at 0x4C2B6CD: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x4E7FA78: g_malloc (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.3)
   by 0x419A92: avctp_add_state_cb (avctp.c:1647)
   by 0x417791: control_init (control.c:290)
   by 0x417097: avrcp_probe (manager.c:156)
   by 0x46A821: dev_probe (device.c:2347)
   by 0x468CBE: btd_profile_foreach (profile.c:599)
   by 0x46BBB5: device_probe_profiles (device.c:2423)
   by 0x461458: load_devices (adapter.c:2549)
   by 0x465086: read_info_complete (adapter.c:5514)
   by 0x4713A1: request_complete (mgmt.c:221)
   by 0x47175B: received_data (mgmt.c:319)

11 years agoavdtp: Remove user data from avdtp_session_state_cb
Szymon Janc [Tue, 5 Mar 2013 14:59:51 +0000 (15:59 +0100)]
avdtp: Remove user data from avdtp_session_state_cb

All users pass NULL as user data so there is no need to keep that.

11 years agoavdtp: Register state callback for specified audio device
Szymon Janc [Tue, 5 Mar 2013 14:59:50 +0000 (15:59 +0100)]
avdtp: Register state callback for specified audio device

State callback will now be registered and called for specified device
only. This will allow for more cleaner callback register/unregister
in roles code.

Fix following valgrind reports:

16 bytes in 1 blocks are still reachable in loss record 43 of 227
   at 0x4C2B6CD: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x4E7FA78: g_malloc (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.3)
   by 0x4E92CA2: g_slice_alloc (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.3)
   by 0x4E93FC2: g_slist_append (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.3)
   by 0x4278BD: avdtp_add_state_cb (avdtp.c:3931)
   by 0x41DDA3: audio_device_register (device.c:315)
   by 0x416ECA: manager_get_audio_device (manager.c:491)
   by 0x4171A8: a2dp_sink_probe (manager.c:131)
   by 0x46A7B1: dev_probe (device.c:2347)
   by 0x468C4E: btd_profile_foreach (profile.c:599)
   by 0x46BB45: device_probe_profiles (device.c:2423)
   by 0x4613E8: load_devices (adapter.c:2549)

16 bytes in 1 blocks are still reachable in loss record 45 of 227
   at 0x4C2B6CD: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x4E7FA78: g_malloc (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.3)
   by 0x4E92CA2: g_slice_alloc (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.3)
   by 0x4E93FC2: g_slist_append (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.3)
   by 0x4278BD: avdtp_add_state_cb (avdtp.c:3931)
   by 0x41F112: sink_init (sink.c:380)
   by 0x4171B8: a2dp_sink_probe (manager.c:137)
   by 0x46A7B1: dev_probe (device.c:2347)
   by 0x468C4E: btd_profile_foreach (profile.c:599)
   by 0x46BB45: device_probe_profiles (device.c:2423)
   by 0x4613E8: load_devices (adapter.c:2549)
   by 0x465016: read_info_complete (adapter.c:5514)

24 bytes in 1 blocks are still reachable in loss record 61 of 227
   at 0x4C2B6CD: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x4E7FA78: g_malloc (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.3)
   by 0x427892: avdtp_add_state_cb (avdtp.c:3926)
   by 0x41DDA3: audio_device_register (device.c:315)
   by 0x416ECA: manager_get_audio_device (manager.c:491)
   by 0x4171A8: a2dp_sink_probe (manager.c:131)
   by 0x46A7B1: dev_probe (device.c:2347)
   by 0x468C4E: btd_profile_foreach (profile.c:599)
   by 0x46BB45: device_probe_profiles (device.c:2423)
   by 0x4613E8: load_devices (adapter.c:2549)
   by 0x465016: read_info_complete (adapter.c:5514)
   by 0x471331: request_complete (mgmt.c:221)

24 bytes in 1 blocks are still reachable in loss record 63 of 227
   at 0x4C2B6CD: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x4E7FA78: g_malloc (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.3)
   by 0x427892: avdtp_add_state_cb (avdtp.c:3926)
   by 0x41F112: sink_init (sink.c:380)
   by 0x4171B8: a2dp_sink_probe (manager.c:137)
   by 0x46A7B1: dev_probe (device.c:2347)
   by 0x468C4E: btd_profile_foreach (profile.c:599)
   by 0x46BB45: device_probe_profiles (device.c:2423)
   by 0x4613E8: load_devices (adapter.c:2549)
   by 0x465016: read_info_complete (adapter.c:5514)
   by 0x471331: request_complete (mgmt.c:221)
   by 0x4716EB: received_data (mgmt.c:319)

11 years agomedia-api: Fix mentioning MediaLibrary instead of MediaFolder
Luiz Augusto von Dentz [Tue, 5 Mar 2013 10:39:17 +0000 (12:39 +0200)]
media-api: Fix mentioning MediaLibrary instead of MediaFolder

11 years agoAVRCP: Fix storing wrong UID counter
Luiz Augusto von Dentz [Wed, 27 Feb 2013 13:03:08 +0000 (15:03 +0200)]
AVRCP: Fix storing wrong UID counter

By the AVRCP spec all messages uses big endian not little endian.

11 years agoAVRCP: Add support to UIDs changed event for CT role
Luiz Augusto von Dentz [Wed, 27 Feb 2013 13:01:41 +0000 (15:01 +0200)]
AVRCP: Add support to UIDs changed event for CT role

This adds support for registering to UIDs changed event if supported by
TG.

11 years agoplayer: Only expose Track property if there is metadata
Luiz Augusto von Dentz [Tue, 26 Feb 2013 12:36:22 +0000 (14:36 +0200)]
player: Only expose Track property if there is metadata

If no metadata is set there is no point in exposing it.

11 years agoplayer: Only emit PropertiesChanged for Position if track exists
Luiz Augusto von Dentz [Tue, 26 Feb 2013 12:33:42 +0000 (14:33 +0200)]
player: Only emit PropertiesChanged for Position if track exists

11 years agoAVRCP: Fix changing track metadata too many times
Luiz Augusto von Dentz [Mon, 25 Feb 2013 13:31:08 +0000 (15:31 +0200)]
AVRCP: Fix changing track metadata too many times

Certain stacks may respond to GetPlayStatus before GetItemAttributes
(e.g iOS 6), which may cause Track to be changed due to duration being
different.

To fix this the code now only attempt to do GetPlayStatus once
GetItemAttributes completes, in addition to this do not require a exact
match of the duration because they can be different as can be observed
bellow:

> L2CAP(d): cid 0x0044 len 141 ctrl 0x0c16 fcs 0xa5ad [psm 27]
    I-frame: Unsegmented TxSeq 11 ReqSeq 12
    AVCTP Browsing: Response : pt 0x00 transaction 11 pid 0x110e
      AVRCP: GetItemAttributes: len 0x0083
...
        AttributeID: 0x00000007 (Track duration)
        CharsetID: 0x006a (UTF-8)
        AttributeLength: 0x0006 (6)
        AttributeValue: 222641
...
> L2CAP(d): cid 0x0043 len 22 [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: GetPlayStatus: pt Single len 0x0009
          SongLength: 0x00036597 (222615 miliseconds)
          SongPosition: 0x00000000 (0 miliconds)
          PlayStatus: 0x02 (PAUSED)

11 years agoplayer: Fix not emitting PropertiesChanged for Browsable and Searchable
Luiz Augusto von Dentz [Mon, 25 Feb 2013 12:23:28 +0000 (14:23 +0200)]
player: Fix not emitting PropertiesChanged for Browsable and Searchable

Browsable and Searchable should emit PropertiesChanged when their values
changes.

11 years agoplayer: Add Playlist property
Luiz Augusto von Dentz [Mon, 25 Feb 2013 12:18:54 +0000 (14:18 +0200)]
player: Add Playlist property

Playlist property refer to the folder where the list of items being
played can be found.

11 years agoplayer: Add enums for item types and folder types
Luiz Augusto von Dentz [Thu, 28 Feb 2013 14:29:50 +0000 (16:29 +0200)]
player: Add enums for item types and folder types

This avoid having to allocate memory just to store string representation
of these types.

11 years agomedia: Rework MediaItem Type property
Luiz Augusto von Dentz [Thu, 28 Feb 2013 11:32:57 +0000 (13:32 +0200)]
media: Rework MediaItem Type property

Type now can assume the value "folder" so it is no longer necessary to
have Folder property, FolderType in introduced to provide the folder type
that before was on the Type itself.

In addition to this add proper documentation what properties are optional
and under what condition they are available.

11 years agoplayer: Fix property Device type
Luiz Augusto von Dentz [Mon, 25 Feb 2013 10:34:43 +0000 (12:34 +0200)]
player: Fix property Device type

Device property should be an objecy path not a string.

11 years agotools/mgmt-tester: Add basic Set Fast Connectable test case
Johan Hedberg [Mon, 4 Mar 2013 13:47:33 +0000 (15:47 +0200)]
tools/mgmt-tester: Add basic Set Fast Connectable test case

11 years agoemulator: Fix missing break statement for LE Read White List Size
Johan Hedberg [Mon, 4 Mar 2013 13:34:42 +0000 (15:34 +0200)]
emulator: Fix missing break statement for LE Read White List Size

11 years agoemulator: Add Page Scan Type HCI command support
Johan Hedberg [Mon, 4 Mar 2013 13:27:52 +0000 (15:27 +0200)]
emulator: Add Page Scan Type HCI command support

11 years agoemulator: Add Page Scan Activity HCI command support
Johan Hedberg [Mon, 4 Mar 2013 13:19:25 +0000 (15:19 +0200)]
emulator: Add Page Scan Activity HCI command support

11 years agomonitor: Add full decoding of Page Scan Type HCI commands
Johan Hedberg [Mon, 4 Mar 2013 13:13:29 +0000 (15:13 +0200)]
monitor: Add full decoding of Page Scan Type HCI commands

11 years agomonitor: Add full decoding of Page Scan Activity HCI commands
Johan Hedberg [Mon, 4 Mar 2013 13:12:58 +0000 (15:12 +0200)]
monitor: Add full decoding of Page Scan Activity HCI commands

11 years agotools/btmgmt: Add fast-conn command for fast connectable mode
Johan Hedberg [Mon, 4 Mar 2013 08:36:39 +0000 (10:36 +0200)]
tools/btmgmt: Add fast-conn command for fast connectable mode

11 years agogdbus: Fix not calling property_changed callback
Luiz Augusto von Dentz [Wed, 27 Feb 2013 12:00:23 +0000 (14:00 +0200)]
gdbus: Fix not calling property_changed callback

In case a property did not appear by the time proxy_added was called
property_changed has to be called if it appear latter otherwise the
application will be unaware of it.

11 years agounit: Add gdbus/client_string_changed
Luiz Augusto von Dentz [Wed, 27 Feb 2013 12:00:22 +0000 (14:00 +0200)]
unit: Add gdbus/client_string_changed

11 years agounit: Add gdbus/client_set_string_property
Luiz Augusto von Dentz [Wed, 27 Feb 2013 12:00:21 +0000 (14:00 +0200)]
unit: Add gdbus/client_set_string_property

11 years agotools: Fix passing wrong argument to g_dbus_proxy_set_property_basic
Luiz Augusto von Dentz [Wed, 27 Feb 2013 10:24:55 +0000 (12:24 +0200)]
tools: Fix passing wrong argument to g_dbus_proxy_set_property_basic

g_dbus_proxy_set_property_basic takes a pointer to value not the value
itself like libdbus does.

11 years agotools: Add support for UIDs changed event to AVRCP parser
Luiz Augusto von Dentz [Mon, 25 Feb 2013 14:58:08 +0000 (16:58 +0200)]
tools: Add support for UIDs changed event to AVRCP parser

11 years agoRelease 5.3
Marcel Holtmann [Sat, 23 Feb 2013 11:20:10 +0000 (12:20 +0100)]
Release 5.3

11 years agobuild: Update library version
Marcel Holtmann [Sat, 23 Feb 2013 11:02:48 +0000 (12:02 +0100)]
build: Update library version

11 years agolib: Update list of company identifiers
Marcel Holtmann [Sat, 23 Feb 2013 11:00:03 +0000 (12:00 +0100)]
lib: Update list of company identifiers

11 years agoconfigure.ac: call AC_SUBST(*_CFLAGS) and AC_SUBST(*_LIBS) only when needed
Antonio Ospite [Sun, 10 Feb 2013 21:20:51 +0000 (22:20 +0100)]
configure.ac: call AC_SUBST(*_CFLAGS) and AC_SUBST(*_LIBS) only when needed

Bring AC_SUBST(*_CFLAGS) and AC_SUBST(*_LIBS) in the same block of the
corresponding PKG_CHECK_MODULES() call.

Having these variables defined outside of the if tests is more than what
is needed as the corresponding PKG_CHECK_MODULES() might not have been
called at all there.

This is the same logic already used for USB_CFLAGS and USB_LIBS.

11 years agoconfigure.ac: call AC_SUBST unconditionally with --with-* options
Antonio Ospite [Sun, 10 Feb 2013 21:20:50 +0000 (22:20 +0100)]
configure.ac: call AC_SUBST unconditionally with --with-* options

Call AC_SUBST unconditionally when specifying --with-* options,
otherwise options like --with-dbusconfdir=DIR or --with-udevdir=DIR have
no effect.

Before this change, configuring with:

  $ mkdir build
  $ ./configure --disable-systemd \
                --prefix=$(pwd)/build \
                --with-dbusconfdir=$(pwd)/build/etc

resulted in the option value to be ignored at "make install" time, with
this error:

  /bin/mkdir: cannot create directory '/dbus-1/system.d': Permission denied

This is what was going on in configure.ac:

  # define the option
  AC_ARG_WITH([dbusconfdir] ... [path_dbusconfdir=${withval}])

  # when --with-dbusconfdir is NOT used
  if (test -z "${path_dbusconfdir}"); then
    ...

    # define the config dir automatically
    path_dbusconfdir="`$PKG_CONFIG --variable=sysconfdir dbus-1`"

    ...

    # set DBUS_CONFDIR
    AC_SUBST(DBUS_CONFDIR, [${path_dbusconfdir}])
  endif

when --with-dbusconfdir=SOMEDIR was used the test above failed, and the
result was that ${path_dbusconfdir} was indeed defined as manually
specified, but DBUS_CONFDIR was not, and the latter was going to be used
in Makefile.am:

  dbusdir = @DBUS_CONFDIR@/dbus-1/system.d

The failure in mkdir can be exposed by the use of the "--prefix" option
and by running "make install" as a normal user; when running "make
install" with the root user /dbus-1/system.d would be happily (and
wrongly) created.

By always setting variables relative to --with-* options (like
DBUS_CONFDIR) the cases when --with-someoption=SOMEDIR are used get
covered.

11 years agogdbus: Always unreference the message in g_dbus_send_message()
Tomasz Bursztyka [Fri, 8 Feb 2013 13:58:10 +0000 (15:58 +0200)]
gdbus: Always unreference the message in g_dbus_send_message()

A quick fix on g_dbus_send_message(), if check_signal() fails it returns
FALSE without unreferencing the message as it should. This patch fixes
it.

11 years agocore: Fix crash when registering an invalid profile
Vinicius Costa Gomes [Fri, 22 Feb 2013 22:50:56 +0000 (19:50 -0300)]
core: Fix crash when registering an invalid profile

When a uuid string is sent and it doesn't indentify a profile
(bt_name2string() returns NULL), bluetoothd crash later when trying to
access the external profile uuid field.

Valgrind log:

bluetoothd[3986]: src/profile.c:register_profile() sender :1.492
==3986== Invalid read of size 1
==3986==    at 0x4C2ACA4: strcasecmp (mc_replace_strmem.c:583)
==3986==    by 0x4656F0: register_profile (profile.c:1920)
==3986==    by 0x40CFF0: process_message.isra.4 (object.c:258)
==3986==    by 0x517C9E5: _dbus_object_tree_dispatch_and_unlock (in /usr/lib64/libdbus-1.so.3.7.2)
==3986==    by 0x5167349: dbus_connection_dispatch (in /usr/lib64/libdbus-1.so.3.7.2)
==3986==    by 0x40AB77: message_dispatch (mainloop.c:76)
==3986==    by 0x4E77BCA: g_timeout_dispatch (in /usr/lib64/libglib-2.0.so.0.3400.2)
==3986==    by 0x4E77044: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.3400.2)
==3986==    by 0x4E77377: g_main_context_iterate.isra.24 (in /usr/lib64/libglib-2.0.so.0.3400.2)
==3986==    by 0x4E77771: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.3400.2)
==3986==    by 0x40A3AE: main (main.c:583)
==3986==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==3986==
==3986==
==3986== Process terminating with default action of signal 11 (SIGSEGV)
==3986==  Access not within mapped region at address 0x0
==3986==    at 0x4C2ACA4: strcasecmp (mc_replace_strmem.c:583)
==3986==    by 0x4656F0: register_profile (profile.c:1920)
==3986==    by 0x40CFF0: process_message.isra.4 (object.c:258)
==3986==    by 0x517C9E5: _dbus_object_tree_dispatch_and_unlock (in /usr/lib64/libdbus-1.so.3.7.2)
==3986==    by 0x5167349: dbus_connection_dispatch (in /usr/lib64/libdbus-1.so.3.7.2)
==3986==    by 0x40AB77: message_dispatch (mainloop.c:76)
==3986==    by 0x4E77BCA: g_timeout_dispatch (in /usr/lib64/libglib-2.0.so.0.3400.2)
==3986==    by 0x4E77044: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.3400.2)
==3986==    by 0x4E77377: g_main_context_iterate.isra.24 (in /usr/lib64/libglib-2.0.so.0.3400.2)
==3986==    by 0x4E77771: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.3400.2)
==3986==    by 0x40A3AE: main (main.c:583)
==3986==  If you believe this happened as a result of a stack
==3986==  overflow in your program's main thread (unlikely but
==3986==  possible), you can try to increase the size of the
==3986==  main thread stack using the --main-stacksize= flag.
==3986==  The main thread stack size used in this run was 8388608.
==3986==

11 years agoA2DP: Mark start flag if resume happen while in configured state
Luiz Augusto von Dentz [Tue, 19 Feb 2013 10:54:55 +0000 (12:54 +0200)]
A2DP: Mark start flag if resume happen while in configured state

If SEP is in configured state that means OPEN is about to happen so just
mark start flag and send START once OPEN completes.

11 years agotools: Add support for registering external player
Luiz Augusto von Dentz [Tue, 19 Feb 2013 10:52:33 +0000 (12:52 +0200)]
tools: Add support for registering external player

This adds --external/-e to register remote players found as local player

11 years agotools: Fix hcidump parser of AVRCP for SetBrowsedPlayer command
Luiz Augusto von Dentz [Fri, 15 Feb 2013 14:12:05 +0000 (16:12 +0200)]
tools: Fix hcidump parser of AVRCP for SetBrowsedPlayer command

11 years agoobexd: Handle absolute paths in obc_session_setpath
Christian Fetzer [Wed, 13 Feb 2013 14:02:29 +0000 (15:02 +0100)]
obexd: Handle absolute paths in obc_session_setpath

For absolute paths (that begin with '/'), obc_session_setpath gets called
twice to reset to the root folder.
This is caused by an empty first element in the folder list created by g_strsplit.

This solution sets the index to the folder array correctly and ignores
empty folder names. This fixes as well paths with double slashes.

Trace for 'SetFolder /telecom':

< ACL data: handle 21 flags 0x00 dlen 21
    L2CAP(d): cid 0x0040 len 17 [psm 3]
      RFCOMM(d): UIH: cr 1 dlci 32 pf 0 ilen 13 fcs 0xd8
        OBEX: SetPath cmd(f): len 13 flags 2 constants 0
        Connection ID (0xcb) = 17
        Name (0x01) = Unicode length 0
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 21 packets 1
> ACL data: handle 21 flags 0x02 dlen 11
    L2CAP(d): cid 0x0041 len 7 [psm 3]
      RFCOMM(d): UIH: cr 0 dlci 32 pf 0 ilen 3 fcs 0x2
        OBEX: SetPath rsp(f): status 200 len 3
< ACL data: handle 21 flags 0x00 dlen 21
    L2CAP(d): cid 0x0040 len 17 [psm 3]
      RFCOMM(d): UIH: cr 1 dlci 32 pf 0 ilen 13 fcs 0xd8
        OBEX: SetPath cmd(f): len 13 flags 2 constants 0
        Connection ID (0xcb) = 17
        Name (0x01) = Unicode length 0
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 21 packets 1
> ACL data: handle 21 flags 0x02 dlen 11
    L2CAP(d): cid 0x0041 len 7 [psm 3]
      RFCOMM(d): UIH: cr 0 dlci 32 pf 0 ilen 3 fcs 0x2
        OBEX: SetPath rsp(f): status 200 len 3
< ACL data: handle 21 flags 0x00 dlen 37
    L2CAP(d): cid 0x0040 len 33 [psm 3]
      RFCOMM(d): UIH: cr 1 dlci 32 pf 0 ilen 29 fcs 0xd8
        OBEX: SetPath cmd(f): len 29 flags 2 constants 0
        Connection ID (0xcb) = 17
        Name (0x01) = Unicode length 16
        0000: 00 74 00 65 00 6c 00 65  00 63 00 6f 00 6d 00 00  .t.e.l.e.c.o.m..
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 21 packets 1
> ACL data: handle 21 flags 0x02 dlen 11
    L2CAP(d): cid 0x0041 len 7 [psm 3]
      RFCOMM(d): UIH: cr 0 dlci 32 pf 0 ilen 3 fcs 0x2
        OBEX: SetPath rsp(f): status 200 len 3

11 years agoobexd: Remove obc_session_setpath limit
Christian Fetzer [Wed, 13 Feb 2013 14:02:28 +0000 (15:02 +0100)]
obexd: Remove obc_session_setpath limit

obc_session_setpath is able to handle multiple folder changes at once.
This removes the limit, that was introduced because of PBAP's limitation
to 3 levels (75d32c6b3a3bddaad19b7880950f9a503afe652b).

Other profiles like MAP might have deeper folder hierarchies.

11 years agotools: btmgmt: Fix return value to return request id
Timo Mueller [Wed, 20 Feb 2013 16:26:34 +0000 (17:26 +0100)]
tools: btmgmt: Fix return value to return request id

Commit 947a7477d2a2ab6a61e5a7de44fd5b7cd2ab8d9c introduced the method
send_cmd which returned the index of the adapter instead of the
request id. As a result no mgmt command could be sent to hci0, as 0
marks an invalid request id.

11 years agobuild: Remove leftover from .gitignore
Anderson Lizardo [Tue, 19 Feb 2013 21:00:04 +0000 (17:00 -0400)]
build: Remove leftover from .gitignore

profiles/sap/sap.c used to be a symlink to a SAP driver. This symlink is
not created anymore (only the dummy driver is linked to bluetoothd at
the moment.)

11 years agotools: btmgmt: Add missing return after g_main_loop_quit()
Anderson Lizardo [Tue, 19 Feb 2013 21:00:03 +0000 (17:00 -0400)]
tools: btmgmt: Add missing return after g_main_loop_quit()

This change keeps semantic of previous code that used to call exit()
directly.

11 years agoavctp: Fix invalid file descriptor close
Syam Sidhardhan [Mon, 18 Feb 2013 16:04:43 +0000 (21:34 +0530)]
avctp: Fix invalid file descriptor close

During avctp_confirm_cb(), if any error happens we set the session
state to AVCTP_STATE_DISCONNECTED, which inturn try to close fd 0.

11 years agotools: Fix compilation error with GINT_TO_POINTER
Syam Sidhardhan [Mon, 18 Feb 2013 16:04:42 +0000 (21:34 +0530)]
tools: Fix compilation error with GINT_TO_POINTER

Fixes the following error:
tools/btmgmt.c: In function â€˜index_rsp’:
tools/btmgmt.c:756:10: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
tools/btmgmt.c: In function â€˜cmd_info’:
tools/btmgmt.c:791:9: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
cc1: all warnings being treated as errors
make[1]: *** [tools/btmgmt.o] Error 1
make: *** [all] Error 2

11 years agotools: btmgmt: Remove old unused mgmt command handling
Johan Hedberg [Mon, 18 Feb 2013 12:38:29 +0000 (14:38 +0200)]
tools: btmgmt: Remove old unused mgmt command handling

11 years agotools: btmgmt: Convert User Confirm replies from mgmt_send_cmd to mgmt_reply
Johan Hedberg [Mon, 18 Feb 2013 12:33:03 +0000 (14:33 +0200)]
tools: btmgmt: Convert User Confirm replies from mgmt_send_cmd to mgmt_reply

11 years agotools: btmgmt: Convert PIN replies from mgmt_send_cmd to mgmt_reply
Johan Hedberg [Mon, 18 Feb 2013 12:28:59 +0000 (14:28 +0200)]
tools: btmgmt: Convert PIN replies from mgmt_send_cmd to mgmt_reply

11 years agotools: btmgmt: Convert confirm_name from mgmt_send_cmd to mgmt_send
Johan Hedberg [Mon, 18 Feb 2013 12:23:58 +0000 (14:23 +0200)]
tools: btmgmt: Convert confirm_name from mgmt_send_cmd to mgmt_send

11 years agotools: btmgmt: Convert from mgmt_send_cmd to mgmt_send
Johan Hedberg [Mon, 18 Feb 2013 12:19:54 +0000 (14:19 +0200)]
tools: btmgmt: Convert from mgmt_send_cmd to mgmt_send

11 years agotools: btmgmt: Convert authentication request event monitoring to new API
Johan Hedberg [Mon, 18 Feb 2013 10:58:38 +0000 (12:58 +0200)]
tools: btmgmt: Convert authentication request event monitoring to new API

11 years agotools: btmgmt: Convert device found event monitoring to new API
Johan Hedberg [Mon, 18 Feb 2013 10:51:51 +0000 (12:51 +0200)]
tools: btmgmt: Convert device found event monitoring to new API

11 years agotools: btmgmt: Convert local name changed event monitoring to new API
Johan Hedberg [Mon, 18 Feb 2013 10:48:58 +0000 (12:48 +0200)]
tools: btmgmt: Convert local name changed event monitoring to new API

11 years agotools: btmgmt: Convert auth failed event monitoring to new API
Johan Hedberg [Mon, 18 Feb 2013 10:47:00 +0000 (12:47 +0200)]
tools: btmgmt: Convert auth failed event monitoring to new API

11 years agotools: btmgmt: Convert connection event monitoring to new API
Johan Hedberg [Mon, 18 Feb 2013 10:41:37 +0000 (12:41 +0200)]
tools: btmgmt: Convert connection event monitoring to new API

11 years agotools: btmgmt: Convert new link key event monitoring to new API
Johan Hedberg [Mon, 18 Feb 2013 10:37:45 +0000 (12:37 +0200)]
tools: btmgmt: Convert new link key event monitoring to new API

11 years agotools: btmgmt: Prefer quitting mainloop over calling exit() directly
Johan Hedberg [Mon, 18 Feb 2013 10:35:47 +0000 (12:35 +0200)]
tools: btmgmt: Prefer quitting mainloop over calling exit() directly

11 years agotools: btmgmt: Convert discovering event monitoring to new API
Johan Hedberg [Mon, 18 Feb 2013 09:56:22 +0000 (11:56 +0200)]
tools: btmgmt: Convert discovering event monitoring to new API

11 years agotools: btmgmt: Convert new settings event monitoring to new API
Johan Hedberg [Mon, 18 Feb 2013 09:53:56 +0000 (11:53 +0200)]
tools: btmgmt: Convert new settings event monitoring to new API

11 years agotools: btmgmt: Convert to using GLib main loop
Johan Hedberg [Mon, 18 Feb 2013 09:50:39 +0000 (11:50 +0200)]
tools: btmgmt: Convert to using GLib main loop

11 years agotools: btmgmt: Convert index added/removed events monitoring to new API
Johan Hedberg [Mon, 18 Feb 2013 09:42:41 +0000 (11:42 +0200)]
tools: btmgmt: Convert index added/removed events monitoring to new API

11 years agotools: btmgmt: Convert controller error event monitoring to new API
Johan Hedberg [Mon, 18 Feb 2013 09:38:51 +0000 (11:38 +0200)]
tools: btmgmt: Convert controller error event monitoring to new API

11 years agotools: btmgmt: Add initial stubs for converting to new mgmt API
Johan Hedberg [Mon, 18 Feb 2013 09:32:50 +0000 (11:32 +0200)]
tools: btmgmt: Add initial stubs for converting to new mgmt API

11 years agodoc: Add short explanation for how to create mgmt sockets
Johan Hedberg [Mon, 18 Feb 2013 08:32:25 +0000 (10:32 +0200)]
doc: Add short explanation for how to create mgmt sockets

11 years agounit: Add tests for sdp_get_server_ver()
Anderson Lizardo [Fri, 15 Feb 2013 15:07:56 +0000 (11:07 -0400)]
unit: Add tests for sdp_get_server_ver()

11 years agounit: Add tests for sdp_get_profile_descs()
Anderson Lizardo [Fri, 15 Feb 2013 15:07:55 +0000 (11:07 -0400)]
unit: Add tests for sdp_get_profile_descs()

11 years agolib: Validate DTDs when parsing VersionNumberList
Anderson Lizardo [Fri, 15 Feb 2013 15:07:54 +0000 (11:07 -0400)]
lib: Validate DTDs when parsing VersionNumberList

11 years agolib: Add comment to BluetoothProfileDescriptorList parsing workaround
Anderson Lizardo [Fri, 15 Feb 2013 15:07:53 +0000 (11:07 -0400)]
lib: Add comment to BluetoothProfileDescriptorList parsing workaround

Commits 0f5a5a9580084a3c4e0644ef5cd75689aeb5ff40 and
46b3a3d2d00bf70bc57ef0c9ad5542a2271e3350 introduced this workaround.

11 years agolib: Validate DTDs when parsing BluetoothProfileDescriptorList
Anderson Lizardo [Fri, 15 Feb 2013 15:07:52 +0000 (11:07 -0400)]
lib: Validate DTDs when parsing BluetoothProfileDescriptorList

The "seq->val.dataseq != NULL" check is also removed from the for()
statement because it should be done after verifying that the data
element is a sequence (inside the "if (SDP_IS_SEQ(...))" block.)

11 years agolib: Validate DTDs when parsing LanguageBaseAttributeIDList
Anderson Lizardo [Fri, 15 Feb 2013 15:07:51 +0000 (11:07 -0400)]
lib: Validate DTDs when parsing LanguageBaseAttributeIDList

Also check if the required number of entries is present.

11 years agolib: Add missing DTD validation in sdp_record_print()
Anderson Lizardo [Fri, 15 Feb 2013 15:07:50 +0000 (11:07 -0400)]
lib: Add missing DTD validation in sdp_record_print()

11 years agounit: Add tests for sdp_get_lang_attr()
Anderson Lizardo [Fri, 15 Feb 2013 15:07:49 +0000 (11:07 -0400)]
unit: Add tests for sdp_get_lang_attr()

11 years agolib: Fix missing DTD validation while accessing SDP data elements
Anderson Lizardo [Fri, 15 Feb 2013 15:07:48 +0000 (11:07 -0400)]
lib: Fix missing DTD validation while accessing SDP data elements

It is necessary to validate the sdp_data_t "dtd" field before accessing
the "val" union members, specially when handling SDP_SEQ*, SDP_ALT* and
SDP_STR* elements, otherwise remote devices can trigger memory
corruption by passing invalid data elements where others are expected.

11 years agolib: Add SDP_IS_ALT() macro
Anderson Lizardo [Fri, 15 Feb 2013 15:07:45 +0000 (11:07 -0400)]
lib: Add SDP_IS_ALT() macro

This macro will simplify internal SDP library code, and is similar to
the existing SDP_IS_SEQ() macro.

11 years agolib: Cleanup coding style in sdp_get_proto_descs()
Anderson Lizardo [Fri, 15 Feb 2013 15:07:47 +0000 (11:07 -0400)]
lib: Cleanup coding style in sdp_get_proto_descs()

11 years agolib: Reuse identical code in sdp_get_{add,}_access_protos()
Anderson Lizardo [Fri, 15 Feb 2013 15:07:46 +0000 (11:07 -0400)]
lib: Reuse identical code in sdp_get_{add,}_access_protos()

sdp_get_access_protos() and sdp_get_add_access_protos() do almost
exactly the same thing, except for an additional statement for the
latter.

11 years agounit: Add initial SDP library unit tests
Anderson Lizardo [Fri, 15 Feb 2013 15:07:44 +0000 (11:07 -0400)]
unit: Add initial SDP library unit tests

These tests will cover all public SDP library API not covered yet by the
tests in test-sdp.c (which focus on the SDP server).

12 years agoAVRCP: Fix parsing of SetBrowsedPlayer response
Luiz Augusto von Dentz [Fri, 15 Feb 2013 14:02:52 +0000 (16:02 +0200)]
AVRCP: Fix parsing of SetBrowsedPlayer response

Folder depth is actually the byte 13 not 14 of the response.

12 years agoAVRCP: Add support for GetItemAttributes
Luiz Augusto von Dentz [Fri, 15 Feb 2013 14:02:51 +0000 (16:02 +0200)]
AVRCP: Add support for GetItemAttributes

GetItemAttributes should be used instead of GetElementAttributes if
browsing is supported.

12 years agoAVRCP: Create folders for /Filesystem and /NowPlaying
Luiz Augusto von Dentz [Fri, 15 Feb 2013 14:02:50 +0000 (16:02 +0200)]
AVRCP: Create folders for /Filesystem and /NowPlaying

If browsing is supported create objects representing /Filesystem and
/NowPlaying, these object implement MediaItem interface and can be
passed to ChangeFolder to change the scope.

12 years agoAVRCP: Move features to avrcp.c
Luiz Augusto von Dentz [Fri, 15 Feb 2013 14:02:49 +0000 (16:02 +0200)]
AVRCP: Move features to avrcp.c

avrcp.c should be responsible for specifics of AVRCP not player.c which
is more high level abstraction.

12 years agomedia-api: Fix referencing to MediaLibrary instead of MediaFolder
Luiz Augusto von Dentz [Fri, 15 Feb 2013 14:02:48 +0000 (16:02 +0200)]
media-api: Fix referencing to MediaLibrary instead of MediaFolder

MediaLibrary was replaced by MediaFolder so doesn't exist anymore.

12 years agoAVRCP: Parse browsing and searching features bits
Luiz Augusto von Dentz [Fri, 15 Feb 2013 14:02:47 +0000 (16:02 +0200)]
AVRCP: Parse browsing and searching features bits

This parses browsing and searching features bits and set the respective
property.

12 years agoAVRCP: Prefix folder name with /Filesystem
Luiz Augusto von Dentz [Fri, 15 Feb 2013 14:02:46 +0000 (16:02 +0200)]
AVRCP: Prefix folder name with /Filesystem

This separate the scopes of the folder as documented in doc/media-api.txt

12 years agoneard: Use more appropriate log levels than info()
Johan Hedberg [Fri, 15 Feb 2013 14:32:38 +0000 (16:32 +0200)]
neard: Use more appropriate log levels than info()

12 years agoneard: Add fallback to legacy register if register failed
Szymon Janc [Fri, 15 Feb 2013 12:09:19 +0000 (13:09 +0100)]
neard: Add fallback to legacy register if register failed

This will allow to work with neard 0.9 which doesn't support handover
agent register with carrier type.

12 years agoneard: Updated neard handover registration agent API calls
Ravi kumar Veeramally [Fri, 15 Feb 2013 12:09:18 +0000 (13:09 +0100)]
neard: Updated neard handover registration agent API calls

neard RegisterHandoverAgent and UnregisterHandoverAgent APIs need an
extra parameter of carrier type(e.g. bluetooth).

12 years agoneard: Update copyright information
Szymon Janc [Fri, 15 Feb 2013 12:09:17 +0000 (13:09 +0100)]
neard: Update copyright information

12 years agoneard: Use bool instead of gboolean for agent_register_postpone
Szymon Janc [Fri, 15 Feb 2013 12:09:16 +0000 (13:09 +0100)]
neard: Use bool instead of gboolean for agent_register_postpone

There is no need to use gboolean as this flag is not used with any
glib function.

12 years agoneard: Restrict method calls only to neard process
Szymon Janc [Fri, 15 Feb 2013 12:09:15 +0000 (13:09 +0100)]
neard: Restrict method calls only to neard process

Disallow methods calls from processes other than registered to as
agent.

12 years agoneard: Use service name and not boolean to track if registered to neard
Szymon Janc [Fri, 15 Feb 2013 12:09:14 +0000 (13:09 +0100)]
neard: Use service name and not boolean to track if registered to neard

12 years agogobex: Fix GPL version reference
Johan Hedberg [Fri, 15 Feb 2013 14:25:24 +0000 (16:25 +0200)]
gobex: Fix GPL version reference

These files (like everything else in the tree) should be GPL 2 or later
instead of GPL 2 only.

12 years agounit: Fix gobex GPL version reference
Johan Hedberg [Fri, 15 Feb 2013 14:19:51 +0000 (16:19 +0200)]
unit: Fix gobex GPL version reference

These files (like everything else in the tree) should be GPL 2 or later
instead of GPL 2 only.

12 years agoadapter: Fix registering adapter with no address
Szymon Janc [Fri, 8 Feb 2013 10:03:13 +0000 (11:03 +0100)]
adapter: Fix registering adapter with no address

adapter->bdaddr is set later in read_info_complete and current check
always returns false. Check against bdaddr received in command response
instead and fail if it is all zeros.

12 years agoA2DP: Fix invalid write
Luiz Augusto von Dentz [Fri, 8 Feb 2013 14:12:08 +0000 (16:12 +0200)]
A2DP: Fix invalid write

Invalid write of size 8
   at 0x41F297: setconf_cfm (a2dp.c:567)
   by 0x42526B: session_cb (avdtp.c:3176)
   by 0x39B0847A54: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.3400.2)
   by 0x39B0847D87: ??? (in /usr/lib64/libglib-2.0.so.0.3400.2)
   by 0x39B0848181: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.3400.2)
   by 0x409C3E: main (main.c:583)
 Address 0x555fda8 is 40 bytes inside a block of size 88 free'd
   at 0x4A077A6: free (vg_replace_malloc.c:446)
   by 0x39B084D79E: g_free (in /usr/lib64/libglib-2.0.so.0.3400.2)
   by 0x41E217: setup_cb_free (a2dp.c:191)
   by 0x41E410: finalize_config (a2dp.c:234)
   by 0x41F296: setconf_cfm (a2dp.c:566)
   by 0x42526B: session_cb (avdtp.c:3176)
   by 0x39B0847A54: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.3400.2)
   by 0x39B0847D87: ??? (in /usr/lib64/libglib-2.0.so.0.3400.2)
   by 0x39B0848181: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.3400.2)
   by 0x409C3E: main (main.c:583)

12 years agocore: Fix calling profile .connect multiple times
Luiz Augusto von Dentz [Fri, 8 Feb 2013 09:51:28 +0000 (11:51 +0200)]
core: Fix calling profile .connect multiple times

Sometimes profiles may complete the connection in different order
than expected so the code has to check if it was actually the
current pending profile to proceed to the next.

12 years agohostname: Fallback to static hostname if pretty hostname is not set
Szymon Janc [Wed, 6 Feb 2013 21:40:38 +0000 (22:40 +0100)]
hostname: Fallback to static hostname if pretty hostname is not set

If pretty hostname is not set fallback to static hostname (if it is
set). If static or pretty hostname is not set appropriate properties
are empty strings not NULLs. This behaviour is recomended by hostnamed.