OSDN Git Service

android-x86/external-bluetooth-bluez.git
11 years agogdbus: Don't call property changed callback during client init
Marcel Holtmann [Mon, 11 Feb 2013 19:19:10 +0000 (20:19 +0100)]
gdbus: Don't call property changed callback during client init

When the client uses ObjectManager to init properties, do not call
property changed callbacks. They should only be called once the proxy
added has been successfully signaled since the proxy itself provides
a full copy of available properties.

11 years agotools: Add mgmt-tester command line option to control power on wait
Johan Hedberg [Mon, 11 Feb 2013 12:00:43 +0000 (14:00 +0200)]
tools: Add mgmt-tester command line option to control power on wait

11 years agotest: Add -p/--push option to map-client
Luiz Augusto von Dentz [Thu, 7 Feb 2013 11:30:17 +0000 (13:30 +0200)]
test: Add -p/--push option to map-client

This option can be used to push messages, it takes as a parameter a
file location which should contain the message in bmsg format.

11 years agoobexd: Add PushMessage
Christian Fetzer [Fri, 25 Jan 2013 16:44:47 +0000 (17:44 +0100)]
obexd: Add PushMessage

Push message has been implemented similar to send file (OPP),
the message to send (in bMessage format) is read from a file.

11 years agotest: Fix missing call to parser.parse_args() in test-proximity
Johan Hedberg [Mon, 4 Feb 2013 12:29:15 +0000 (14:29 +0200)]
test: Fix missing call to parser.parse_args() in test-proximity

11 years agoshared: Fix use after free in read_watch_destroy
Szymon Janc [Sat, 2 Feb 2013 18:39:58 +0000 (19:39 +0100)]
shared: Fix use after free in read_watch_destroy

read_watch_destroy is called when received_data returns FALSE.
free mgmt in read_watch_destroy instead of received_data to avoid
use after free.

Invalid write of size 4
   at 0x8051604: read_watch_destroy (mgmt.c:271)
   by 0x48C7468E: g_source_callback_unref (gmain.c:1457)
   by 0x48C77287: g_main_context_dispatch (gmain.c:2723)
   by 0x48C774FF: g_main_context_iterate.isra.22 (gmain.c:3290)
   by 0x48C77962: g_main_loop_run (gmain.c:3484)
   by 0x805393E: tester_run (tester.c:784)
   by 0x804D1C7: main (mgmt-tester.c:2558)
 Address 0x4039b80 is 16 bytes inside a block of size 76 free'd
   at 0x4007F0F: free (vg_replace_malloc.c:446)
   by 0x48C7D44B: standard_free (gmem.c:98)
   by 0x48C7D607: g_free (gmem.c:252)
   by 0x8051BB6: received_data (mgmt.c:337)
   by 0x48CBA72E: g_io_unix_dispatch (giounix.c:167)
   by 0x48C7715A: g_main_context_dispatch (gmain.c:2715)
   by 0x48C774FF: g_main_context_iterate.isra.22 (gmain.c:3290)
   by 0x48C77962: g_main_loop_run (gmain.c:3484)
   by 0x805393E: tester_run (tester.c:784)
   by 0x804D1C7: main (mgmt-tester.c:2558)

11 years agomonitor: Decode supported commands result
Marcel Holtmann [Sat, 2 Feb 2013 10:19:09 +0000 (11:19 +0100)]
monitor: Decode supported commands result

11 years agomonitor: Fix wrong supported commands bit value
Marcel Holtmann [Sat, 2 Feb 2013 10:18:39 +0000 (11:18 +0100)]
monitor: Fix wrong supported commands bit value

11 years agotools: Fix mgmt-tester LE expected supported settings
Johan Hedberg [Sat, 2 Feb 2013 02:47:20 +0000 (04:47 +0200)]
tools: Fix mgmt-tester LE expected supported settings

11 years agotools: Add basic mgmt_set_local_name EIR test case
Johan Hedberg [Sat, 2 Feb 2013 02:16:35 +0000 (02:16 +0000)]
tools: Add basic mgmt_set_local_name EIR test case

11 years agocore: Use more compact definitions for zero-tail byte arrays
Johan Hedberg [Sat, 2 Feb 2013 02:06:48 +0000 (02:06 +0000)]
core: Use more compact definitions for zero-tail byte arrays

11 years agotools: Add basic mgmt_set_local_name success test cases
Johan Hedberg [Sat, 2 Feb 2013 01:49:36 +0000 (19:49 -0600)]
tools: Add basic mgmt_set_local_name success test cases

11 years agotools: Generalize alternate mgmt event handling for mgmt-tester
Johan Hedberg [Sat, 2 Feb 2013 01:45:53 +0000 (19:45 -0600)]
tools: Generalize alternate mgmt event handling for mgmt-tester

11 years agoaudio: Fix uint64_t format specifier
Johan Hedberg [Sat, 2 Feb 2013 02:40:21 +0000 (02:40 +0000)]
audio: Fix uint64_t format specifier

11 years agoRelease 5.2
Marcel Holtmann [Sat, 2 Feb 2013 00:41:17 +0000 (01:41 +0100)]
Release 5.2

11 years agolib: Update list of company identifiers
Marcel Holtmann [Sat, 2 Feb 2013 00:19:29 +0000 (01:19 +0100)]
lib: Update list of company identifiers

11 years agoAVRCP: Set addressed player as browsed player
Luiz Augusto von Dentz [Fri, 1 Feb 2013 21:28:25 +0000 (15:28 -0600)]
AVRCP: Set addressed player as browsed player

This send SetBrowsedPlayer after getting the player details.

11 years agoAVRCP: Split event handing to its own functions
Luiz Augusto von Dentz [Fri, 1 Feb 2013 21:28:24 +0000 (15:28 -0600)]
AVRCP: Split event handing to its own functions

11 years agoAVRCP: Get player list if supported
Luiz Augusto von Dentz [Fri, 1 Feb 2013 21:28:23 +0000 (15:28 -0600)]
AVRCP: Get player list if supported

If addressed player changed is supported get the list of players

11 years agoAVRCP: Register to addressed player changed event if supported
Luiz Augusto von Dentz [Fri, 1 Feb 2013 21:28:22 +0000 (15:28 -0600)]
AVRCP: Register to addressed player changed event if supported

This enables registering for addressed player changed event and handle
the interim response setting the player id and uid counter to the current
player.

11 years agoAVRCP: Avoid repeating command due to changed event
Luiz Augusto von Dentz [Fri, 1 Feb 2013 21:28:21 +0000 (15:28 -0600)]
AVRCP: Avoid repeating command due to changed event

Currently we are repeating the same command twice for notification, first
for changed and then latter for interim response.

To avoid this the code now just do it for interim responses, changed
responses just trigger another registration.

11 years agomedia-api: Add org.bluez.MediaFolder1
Luiz Augusto von Dentz [Fri, 1 Feb 2013 21:28:20 +0000 (15:28 -0600)]
media-api: Add org.bluez.MediaFolder1

This interface adds support for browsing and searching in the player's
storage using AVRCP 1.4/1.5.

Some remarks about the design:

  - Exposing UIDCounter and UIDs was considered, but the spec seems to have
    missed to define the player's id persistency. There are also the fact that
    UIDCounter alone does not guarantee persistency across sessions and do not
    provide what exact items have changed, so in the end exposing these
    details will bring almost no value.
  - Indexing or caching the whole media library is not recommended, Bluetooth
    is too slow for that and even vendors such as Apple do not recommend doing
    it, so the only items keep in cache are the current listed ones.
  - Addressed vs Browsed player is done implicitly when accessed, this was done
    to simplify the API and avoid confusions between applications and players.

11 years agoAVDTP: Fix memory leak
Luiz Augusto von Dentz [Fri, 1 Feb 2013 18:20:44 +0000 (12:20 -0600)]
AVDTP: Fix memory leak

56 (16 direct, 40 indirect) bytes in 1 blocks are definitely lost in loss record 173 of 263
   at 0x4A0883C: malloc (vg_replace_malloc.c:270)
   by 0x4C8568E: g_malloc (in /usr/lib64/libglib-2.0.so.0.3400.2)
   by 0x4C9A7F1: g_slice_alloc (in /usr/lib64/libglib-2.0.so.0.3400.2)
   by 0x4C9BB92: g_slist_append (in /usr/lib64/libglib-2.0.so.0.3400.2)
   by 0x422072: send_req (avdtp.c:2569)
   by 0x422D0B: avdtp_discover (avdtp.c:3380)
   by 0x41D16C: source_setup_stream (source.c:307)
   by 0x41D1EF: source_connect (source.c:331)
   by 0x465411: connect_next (device.c:1073)
   by 0x466C92: device_profile_connected (device.c:1097)
   by 0x4629EB: ext_connect (profile.c:950)
   by 0x44AECB: connect_cb (btio.c:230)

11 years agocore: Fix missing return statement in ext_svc_complete
Johan Hedberg [Fri, 1 Feb 2013 17:53:07 +0000 (11:53 -0600)]
core: Fix missing return statement in ext_svc_complete

11 years agodevice: Fix not marking svc_resolved when loaded from storage
Vinicius Costa Gomes [Fri, 1 Feb 2013 17:37:16 +0000 (14:37 -0300)]
device: Fix not marking svc_resolved when loaded from storage

When the device is loaded from storage, we should mark it as it
services were resolved.

11 years agocore: Fix trying go stop passive scanning multiple times
Johan Hedberg [Fri, 1 Feb 2013 16:08:48 +0000 (10:08 -0600)]
core: Fix trying go stop passive scanning multiple times

11 years agocore: Add debug log to stop_passive_scanning_complete
Johan Hedberg [Fri, 1 Feb 2013 16:03:06 +0000 (10:03 -0600)]
core: Add debug log to stop_passive_scanning_complete

11 years agonetwork: Fix user data handling on unregister
Patrik Flykt [Fri, 1 Feb 2013 11:19:51 +0000 (13:19 +0200)]
network: Fix user data handling on unregister

User data in unregister_server() is a network_adapter struct. Unregistering
using full UUID will now also work.

11 years agogdbus: Fix unpublished interface signal emission
Johan Hedberg [Fri, 1 Feb 2013 15:03:22 +0000 (09:03 -0600)]
gdbus: Fix unpublished interface signal emission

If we haven't published an interface yet (i.e. it's in the data->added
list), we should just ignore any property changed indications as the
values for the properties will anyway be part of the InterfacesAdded
signal.

11 years agoemulator: Fix BR/EDR-only and LE-only supported command checks
Johan Hedberg [Fri, 1 Feb 2013 03:47:14 +0000 (21:47 -0600)]
emulator: Fix BR/EDR-only and LE-only supported command checks

11 years agoemulator: Add command line options for selecting controller type to btvirt
Johan Hedberg [Fri, 1 Feb 2013 03:32:28 +0000 (21:32 -0600)]
emulator: Add command line options for selecting controller type to btvirt

11 years agoemulator: Use BR/EDR/LE vhci type as default for btvirt
Johan Hedberg [Fri, 1 Feb 2013 03:22:21 +0000 (21:22 -0600)]
emulator: Use BR/EDR/LE vhci type as default for btvirt

11 years agotools: Add LE-only test case support to mgmt-tester
Johan Hedberg [Thu, 31 Jan 2013 22:08:51 +0000 (16:08 -0600)]
tools: Add LE-only test case support to mgmt-tester

11 years agotools: Add BR/EDR-only test case support to mgmt-tester
Johan Hedberg [Thu, 31 Jan 2013 22:04:32 +0000 (16:04 -0600)]
tools: Add BR/EDR-only test case support to mgmt-tester

11 years agotools: Fix mgmt-tester BR/EDR/LE test macro naming
Johan Hedberg [Thu, 31 Jan 2013 22:01:21 +0000 (16:01 -0600)]
tools: Fix mgmt-tester BR/EDR/LE test macro naming

11 years agoemulator: Fix controller version for BR/EDR type
Johan Hedberg [Thu, 31 Jan 2013 20:52:11 +0000 (14:52 -0600)]
emulator: Fix controller version for BR/EDR type

11 years agoAVRCP: Get track duration using GetPlayStatus command
Luiz Augusto von Dentz [Thu, 31 Jan 2013 17:12:43 +0000 (11:12 -0600)]
AVRCP: Get track duration using GetPlayStatus command

Some stacks, notably broadcom, don't send track duration together with
other metadata so it has to be set using GetPlayStatus.

11 years agoA2DP: Fix not setting setup error to NULL
Luiz Augusto von Dentz [Thu, 31 Jan 2013 17:12:42 +0000 (11:12 -0600)]
A2DP: Fix not setting setup error to NULL

Once the error is informed to the callback it should be properly freed and
set to NULL otherwise a subsequent operation may end up reusing the same
error which might lead to crashes.

11 years agoAVCTP: Fix memory leak
Luiz Augusto von Dentz [Thu, 31 Jan 2013 17:12:41 +0000 (11:12 -0600)]
AVCTP: Fix memory leak

651 (280 direct, 371 indirect) bytes in 7 blocks are definitely lost in loss record 306 of 332
   at 0x4A06B2F: calloc (vg_replace_malloc.c:593)
   by 0x319724D706: g_malloc0 (in /usr/lib64/libglib-2.0.so.0.3400.2)
   by 0x418A54: avctp_send_browsing_req (avctp.c:1457)
   by 0x41A330: avrcp_handle_event (avrcp.c:1998)
   by 0x417810: session_cb (avctp.c:702)
   by 0x3197247A74: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.3400.2)
   by 0x3197247DA7: ??? (in /usr/lib64/libglib-2.0.so.0.3400.2)
   by 0x31972481A1: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.3400.2)
   by 0x409D6E: main (main.c:583)

11 years agoAVCTP: Fix allways destroying browsing channel
Luiz Augusto von Dentz [Thu, 31 Jan 2013 17:12:40 +0000 (11:12 -0600)]
AVCTP: Fix allways destroying browsing channel

This reverts commit 53d3fc3fad5152167458625ad2acf19070cdf26a that leads
to always destroy the browsing channel because the callback changes the
state.

To fix session_browsing_cb naw takes care of destroying the channel if it
disconnects.

11 years agotools: Fix mpris-player creating busname starting with digit
Luiz Augusto von Dentz [Thu, 31 Jan 2013 15:33:55 +0000 (09:33 -0600)]
tools: Fix mpris-player creating busname starting with digit

D-Bus does not allow a bus name starting with digits after . so the code
now prefix with bt_ if the device name starts with a digit.

11 years agotools: Use device Alias instead of Name in mpris-player
Luiz Augusto von Dentz [Thu, 31 Jan 2013 15:33:52 +0000 (09:33 -0600)]
tools: Use device Alias instead of Name in mpris-player

User may have set a different Name using Alias, Alias should always
be set.

11 years agohcidump: Fix parsing of SetBrowsedPlayer
Luiz Augusto von Dentz [Thu, 31 Jan 2013 15:33:56 +0000 (09:33 -0600)]
hcidump: Fix parsing of SetBrowsedPlayer

11 years agohcidump: Fix parsing of GetCurrentPlayerApplicationSettingValue
Luiz Augusto von Dentz [Thu, 31 Jan 2013 15:33:54 +0000 (09:33 -0600)]
hcidump: Fix parsing of GetCurrentPlayerApplicationSettingValue

11 years agohcidump: Distinct Control and Browsing AVCTP channels
Luiz Augusto von Dentz [Thu, 31 Jan 2013 15:33:50 +0000 (09:33 -0600)]
hcidump: Distinct Control and Browsing AVCTP channels

This prints the respective channel of the trafic

11 years agotools: Update tester apps to use new hciemu API
Johan Hedberg [Thu, 31 Jan 2013 20:24:19 +0000 (14:24 -0600)]
tools: Update tester apps to use new hciemu API

11 years agoshared: Provide hciemu type in hciemu_new()
Johan Hedberg [Thu, 31 Jan 2013 20:23:58 +0000 (14:23 -0600)]
shared: Provide hciemu type in hciemu_new()

11 years agoemulator: Create separate BR/EDR, BR/EDR/LE and LE vhci types
Johan Hedberg [Thu, 31 Jan 2013 20:11:46 +0000 (14:11 -0600)]
emulator: Create separate BR/EDR, BR/EDR/LE and LE vhci types

11 years agoemulator: Create separate server BR/EDR/LE and BR/EDR types
Johan Hedberg [Thu, 31 Jan 2013 20:08:19 +0000 (14:08 -0600)]
emulator: Create separate server BR/EDR/LE and BR/EDR types

11 years agoshared: Create BR/EDR/LE device type by default
Johan Hedberg [Thu, 31 Jan 2013 20:04:00 +0000 (14:04 -0600)]
shared: Create BR/EDR/LE device type by default

11 years agoemulator: Create separate BR/EDR/LE and BR/EDR device types
Johan Hedberg [Thu, 31 Jan 2013 20:03:32 +0000 (14:03 -0600)]
emulator: Create separate BR/EDR/LE and BR/EDR device types

11 years agoTODO: Remove completed passive scanning entry
Johan Hedberg [Thu, 31 Jan 2013 19:44:41 +0000 (13:44 -0600)]
TODO: Remove completed passive scanning entry

11 years agocore: Stop passive scanning when removing last item from connect_list
Johan Hedberg [Thu, 31 Jan 2013 19:44:18 +0000 (13:44 -0600)]
core: Stop passive scanning when removing last item from connect_list

11 years agocore: Refactor passive scanning stopping into its own function
Johan Hedberg [Thu, 31 Jan 2013 19:40:54 +0000 (13:40 -0600)]
core: Refactor passive scanning stopping into its own function

11 years agocore: Fix missing check for main_opts.reverse_sdp
Johan Hedberg [Thu, 31 Jan 2013 17:49:57 +0000 (11:49 -0600)]
core: Fix missing check for main_opts.reverse_sdp

11 years agocore: Fix checking for correct async operation id
Johan Hedberg [Thu, 31 Jan 2013 17:39:08 +0000 (11:39 -0600)]
core: Fix checking for correct async operation id

11 years agocore: Move SDP record fetching to NewConnection sending function
Johan Hedberg [Thu, 31 Jan 2013 17:32:14 +0000 (11:32 -0600)]
core: Move SDP record fetching to NewConnection sending function

11 years agocore: Do authorization and service resolving in parallel
Johan Hedberg [Thu, 31 Jan 2013 17:24:15 +0000 (11:24 -0600)]
core: Do authorization and service resolving in parallel

11 years agocore: Force discovery timer to run immediately if a profile needs it
Johan Hedberg [Thu, 31 Jan 2013 16:06:02 +0000 (10:06 -0600)]
core: Force discovery timer to run immediately if a profile needs it

11 years agocore: Fix SDP resolving for incoming external profile connections
Johan Hedberg [Thu, 31 Jan 2013 16:00:12 +0000 (10:00 -0600)]
core: Fix SDP resolving for incoming external profile connections

This patch ensures that the reverse SDP procedure completes before we
accept incoming profiles for external profiles.

11 years agocore: Add device API for waiting for SDP completion
Johan Hedberg [Thu, 31 Jan 2013 15:59:48 +0000 (09:59 -0600)]
core: Add device API for waiting for SDP completion

11 years agocore: Remove unnecessary assignment to device->svc_resolved
Johan Hedberg [Thu, 31 Jan 2013 15:58:18 +0000 (09:58 -0600)]
core: Remove unnecessary assignment to device->svc_resolved

The device_svc_resolved() function already takes care of setting
device->svc_resolved to true.

11 years agoTODO: Add item for improving stopping passive scanning
Johan Hedberg [Thu, 31 Jan 2013 15:06:49 +0000 (09:06 -0600)]
TODO: Add item for improving stopping passive scanning

11 years agocore: Fix updating discovery state when stopping passive scanning
Johan Hedberg [Wed, 30 Jan 2013 04:43:41 +0000 (22:43 -0600)]
core: Fix updating discovery state when stopping passive scanning

11 years agocore: Remove unnecessary adapter->passive_scanning variable
Johan Hedberg [Wed, 30 Jan 2013 01:29:40 +0000 (19:29 -0600)]
core: Remove unnecessary adapter->passive_scanning variable

The adapter->discovery_list can function equally well as an indicator of
whether normal discovery or passive scanning is in progress. Normal
discovery always overrides passive scanning so if there's one or more
entries in discovery_list we must be performing normal discovery and not
passive scanning.

11 years agocore: Make device_set_auto_connect private to device.c
Johan Hedberg [Tue, 29 Jan 2013 23:34:38 +0000 (17:34 -0600)]
core: Make device_set_auto_connect private to device.c

11 years agoproximity: Remove unnecessary device_set_auto_connect call
Johan Hedberg [Tue, 29 Jan 2013 23:34:26 +0000 (17:34 -0600)]
proximity: Remove unnecessary device_set_auto_connect call

11 years agoinput: Remove unnecessary device_set_auto_connect call
Johan Hedberg [Tue, 29 Jan 2013 23:34:13 +0000 (17:34 -0600)]
input: Remove unnecessary device_set_auto_connect call

11 years agocore: Let device_set_auto_connect do connect list adding
Johan Hedberg [Tue, 29 Jan 2013 23:32:30 +0000 (17:32 -0600)]
core: Let device_set_auto_connect do connect list adding

The device_set_auto_connect function should be the only function that
needs to call adapter_connect_list_add().

11 years agocore: Make device_get_auto_connect private to device.c
Johan Hedberg [Tue, 29 Jan 2013 23:14:44 +0000 (17:14 -0600)]
core: Make device_get_auto_connect private to device.c

11 years agocore: Move connect_list handling to ATT specific callbacks
Johan Hedberg [Tue, 29 Jan 2013 23:13:36 +0000 (17:13 -0600)]
core: Move connect_list handling to ATT specific callbacks

This is more reliable since we're not always guaranteed to get the right
mgmt events, e.g. a socket connect timeout might not trigger those.

11 years agocore: Allow adapter_connect_list_remove to trigger LE scanning
Johan Hedberg [Tue, 29 Jan 2013 23:12:56 +0000 (17:12 -0600)]
core: Allow adapter_connect_list_remove to trigger LE scanning

11 years agocore: Fix adapter->connect_le updating in connect_list_add/remove
Johan Hedberg [Tue, 29 Jan 2013 23:12:23 +0000 (17:12 -0600)]
core: Fix adapter->connect_le updating in connect_list_add/remove

11 years agocore: Fix g_source_remove() with zero ID while removing device
Anderson Lizardo [Tue, 29 Jan 2013 18:52:26 +0000 (14:52 -0400)]
core: Fix g_source_remove() with zero ID while removing device

store_device_info_cb() is also used as callback for g_idle_add() and
therefore sets device->store_id to zero. During device removal it may be
called manually, which must be done only after the existing
device->store_id is removed from mainloop.

Fix this GLib error (and a bunch of invalid read/writes when
store_device_info_cb() was called after device removal due to this bug):

bluetoothd[1192]: src/device.c:device_remove() Removing device
/org/bluez/hci0/dev_12_34_12_34_12_34

(bluetoothd:1192): GLib-CRITICAL **: g_source_remove: assertion `tag >
0' failed
bluetoothd[1192]: src/device.c:btd_device_unref() Freeing device
/org/bluez/hci0/dev_12_34_12_34_12_34
bluetoothd[1192]: src/device.c:device_free() 0x463a2a0

11 years agogas: Fix not sending response to indication
Vinicius Costa Gomes [Tue, 29 Jan 2013 19:00:06 +0000 (16:00 -0300)]
gas: Fix not sending response to indication

Even if the remote device is not bonded, we should send the response to the
indication. If we don't the remote device may disconnect.

11 years agogas: Move all the code to only one file
Vinicius Costa Gomes [Tue, 29 Jan 2013 19:00:05 +0000 (16:00 -0300)]
gas: Move all the code to only one file

Our Generic Attribute/Access Service plugin is small and simple enough
to be kept in only one file.

11 years agodevice: Fix invalid memory access during Find Included
Vinicius Costa Gomes [Tue, 29 Jan 2013 19:00:04 +0000 (16:00 -0300)]
device: Fix invalid memory access during Find Included

When doing the Find Included Services GATT procedure, the status of the ATT
procedure was being ignored, and in the case of a timeout it is possible to
crash bluetooth with an invalid memory access.

Valgrind log:

==1755== Invalid read of size 8
==1755==    at 0x46971A: find_included_cb (device.c:2964)
==1755==    by 0x4465AE: isd_unref (gatt.c:92)
==1755==    by 0x446885: find_included_cb (gatt.c:425)
==1755==    by 0x448266: disconnect_timeout (gattrib.c:269)
==1755==    by 0x4E76BCA: g_timeout_dispatch (in /usr/lib64/libglib-2.0.so.0.3400.2)
==1755==    by 0x4E76044: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.3400.2)
==1755==    by 0x4E76377: g_main_context_iterate.isra.24 (in /usr/lib64/libglib-2.0.so.0.3400.2)
==1755==    by 0x4E76771: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.3400.2)
==1755==    by 0x40A2EE: main (main.c:583)
==1755==  Address 0x69530a8 is 8 bytes inside a block of size 64 free'd
==1755==    at 0x4C2874F: free (vg_replace_malloc.c:446)
==1755==    by 0x40BFA6: service_filter (watch.c:486)
==1755==    by 0x40BC6A: message_filter (watch.c:554)
==1755==    by 0x5160A1D: dbus_connection_dispatch (in /usr/lib64/libdbus-1.so.3.7.2)
==1755==    by 0x40AAB7: message_dispatch (mainloop.c:76)
==1755==    by 0x4E76BCA: g_timeout_dispatch (in /usr/lib64/libglib-2.0.so.0.3400.2)
==1755==    by 0x4E76044: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.3400.2)
==1755==    by 0x4E76377: g_main_context_iterate.isra.24 (in /usr/lib64/libglib-2.0.so.0.3400.2)
==1755==    by 0x4E76771: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.3400.2)
==1755==    by 0x40A2EE: main (main.c:583)
==1755==
==1755== Invalid read of size 8
==1755==    at 0x4486D5: g_attrib_get_buffer (gattrib.c:657)
==1755==    by 0x4467C5: find_included (gatt.c:363)
==1755==    by 0x4465AE: isd_unref (gatt.c:92)
==1755==    by 0x446885: find_included_cb (gatt.c:425)
==1755==    by 0x448266: disconnect_timeout (gattrib.c:269)
==1755==    by 0x4E76BCA: g_timeout_dispatch (in /usr/lib64/libglib-2.0.so.0.3400.2)
==1755==    by 0x4E76044: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.3400.2)
==1755==    by 0x4E76377: g_main_context_iterate.isra.24 (in /usr/lib64/libglib-2.0.so.0.3400.2)
==1755==    by 0x4E76771: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.3400.2)
==1755==    by 0x40A2EE: main (main.c:583)
==1755==  Address 0x18 is not stack'd, malloc'd or (recently) free'd
==1755==
==1755==
==1755== Process terminating with default action of signal 11 (SIGSEGV)
==1755==  Access not within mapped region at address 0x18
==1755==    at 0x4486D5: g_attrib_get_buffer (gattrib.c:657)
==1755==    by 0x4467C5: find_included (gatt.c:363)
==1755==    by 0x4465AE: isd_unref (gatt.c:92)
==1755==    by 0x446885: find_included_cb (gatt.c:425)
==1755==    by 0x448266: disconnect_timeout (gattrib.c:269)
==1755==    by 0x4E76BCA: g_timeout_dispatch (in /usr/lib64/libglib-2.0.so.0.3400.2)
==1755==    by 0x4E76044: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.3400.2)
==1755==    by 0x4E76377: g_main_context_iterate.isra.24 (in /usr/lib64/libglib-2.0.so.0.3400.2)
==1755==    by 0x4E76771: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.3400.2)
==1755==    by 0x40A2EE: main (main.c:583)

11 years agoneard: Fix memory leak on registering as agent
Szymon Janc [Tue, 29 Jan 2013 08:54:31 +0000 (09:54 +0100)]
neard: Fix memory leak on registering as agent

Message reference was not dropped in register_agent. This fix following
memory leak reported by valgrind:

454 (184 direct, 270 indirect) bytes in 1 blocks are definitely lost in loss record 207 of 220
   at 0x4C29DB4: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x513DCF2: ??? (in /lib/x86_64-linux-gnu/libdbus-1.so.3.5.8)
   by 0x514222E: ??? (in /lib/x86_64-linux-gnu/libdbus-1.so.3.5.8)
   by 0x5149F46: ??? (in /lib/x86_64-linux-gnu/libdbus-1.so.3.5.8)
   by 0x514A070: ??? (in /lib/x86_64-linux-gnu/libdbus-1.so.3.5.8)
   by 0x514AA63: ??? (in /lib/x86_64-linux-gnu/libdbus-1.so.3.5.8)
   by 0x514B0A5: ??? (in /lib/x86_64-linux-gnu/libdbus-1.so.3.5.8)
   by 0x5149E0C: ??? (in /lib/x86_64-linux-gnu/libdbus-1.so.3.5.8)
   by 0x5134D24: ??? (in /lib/x86_64-linux-gnu/libdbus-1.so.3.5.8)
   by 0x5136088: ??? (in /lib/x86_64-linux-gnu/libdbus-1.so.3.5.8)
   by 0x5135643: dbus_connection_send_with_reply_and_block (in /lib/x86_64-linux-gnu/libdbus-1.so.3.5.8)
   by 0x5130C93: dbus_bus_register (in /lib/x86_64-linux-gnu/libdbus-1.so.3.5.8)

102 bytes in 1 blocks are indirectly lost in loss record 154 of 220
   at 0x4C2B7B2: realloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x514F02F: ??? (in /lib/x86_64-linux-gnu/libdbus-1.so.3.5.8)
   by 0x514F0DD: ??? (in /lib/x86_64-linux-gnu/libdbus-1.so.3.5.8)
   by 0x514F239: ??? (in /lib/x86_64-linux-gnu/libdbus-1.so.3.5.8)
   by 0x514DE0A: ??? (in /lib/x86_64-linux-gnu/libdbus-1.so.3.5.8)
   by 0x514E3D3: ??? (in /lib/x86_64-linux-gnu/libdbus-1.so.3.5.8)
   by 0x513C138: ??? (in /lib/x86_64-linux-gnu/libdbus-1.so.3.5.8)
   by 0x513FF4D: dbus_message_iter_append_basic (in /lib/x86_64-linux-gnu/libdbus-1.so.3.5.8)
   by 0x5141790: dbus_message_new_error (in /lib/x86_64-linux-gnu/libdbus-1.so.3.5.8)
   by 0x5135C70: dbus_connection_dispatch (in /lib/x86_64-linux-gnu/libdbus-1.so.3.5.8)
   by 0x40A747: message_dispatch (mainloop.c:76)
   by 0x4E7A91A: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.3)

168 bytes in 1 blocks are indirectly lost in loss record 185 of 220
   at 0x4C2B7B2: realloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x514F02F: ??? (in /lib/x86_64-linux-gnu/libdbus-1.so.3.5.8)
   by 0x514F0DD: ??? (in /lib/x86_64-linux-gnu/libdbus-1.so.3.5.8)
   by 0x514F239: ??? (in /lib/x86_64-linux-gnu/libdbus-1.so.3.5.8)
   by 0x513A3B3: ??? (in /lib/x86_64-linux-gnu/libdbus-1.so.3.5.8)
   by 0x514228F: ??? (in /lib/x86_64-linux-gnu/libdbus-1.so.3.5.8)
   by 0x5149F46: ??? (in /lib/x86_64-linux-gnu/libdbus-1.so.3.5.8)
   by 0x514A070: ??? (in /lib/x86_64-linux-gnu/libdbus-1.so.3.5.8)
   by 0x514AA63: ??? (in /lib/x86_64-linux-gnu/libdbus-1.so.3.5.8)
   by 0x514B0A5: ??? (in /lib/x86_64-linux-gnu/libdbus-1.so.3.5.8)
   by 0x5149E0C: ??? (in /lib/x86_64-linux-gnu/libdbus-1.so.3.5.8)
   by 0x5134D24: ??? (in /lib/x86_64-linux-gnu/libdbus-1.so.3.5.8)

11 years agoneard: Fix passing negative error code to strerror
Szymon Janc [Tue, 29 Jan 2013 08:54:30 +0000 (09:54 +0100)]
neard: Fix passing negative error code to strerror

error_reply expects non-negative error code.

11 years agocore: Allow Device1.Connect/Disconnect to control auto connection
Johan Hedberg [Tue, 29 Jan 2013 21:55:16 +0000 (15:55 -0600)]
core: Allow Device1.Connect/Disconnect to control auto connection

This patch makes it possible to disable the LE auto connections
temporarily through Device1.Disconnect and re-enable them by calling
Device1.Connect().

11 years agocore: Stop passive scanning before connecting LE
Johan Hedberg [Tue, 29 Jan 2013 18:37:08 +0000 (12:37 -0600)]
core: Stop passive scanning before connecting LE

Many controllers do not support creating LE connections at the same time
as doing scanning so stop the scanning before attempting to connect.

11 years agocore: Add device_get_auto_connect() function needed for LE connections
Johan Hedberg [Tue, 29 Jan 2013 21:02:34 +0000 (15:02 -0600)]
core: Add device_get_auto_connect() function needed for LE connections

11 years agocore: Add a variable to track passive scanning
Johan Hedberg [Tue, 29 Jan 2013 17:09:26 +0000 (11:09 -0600)]
core: Add a variable to track passive scanning

This patch adds a state variable to track passive scanning and ensures
that LE connections are only created through this discovery procedure
and not the normal (StartDiscovery based) discovery procedure.

11 years agoattrib: Don't attempt to unregister event id 0
Luiz Augusto von Dentz [Mon, 28 Jan 2013 21:44:01 +0000 (15:44 -0600)]
attrib: Don't attempt to unregister event id 0

Id 0 is considered invalid so the code should not even try to lookup for
it in the event list instead print a warning and return FALSE
immediatelly.

11 years agothermometer: Fix crash while unregistering adapter
Luiz Augusto von Dentz [Mon, 28 Jan 2013 21:44:00 +0000 (15:44 -0600)]
thermometer: Fix crash while unregistering adapter

Invalid read of size 8
   at 0x448200: g_attrib_unregister (gattrib.c:722)
   by 0x440476: destroy_thermometer (thermometer.c:167)
   by 0x40D849: remove_interface (object.c:656)
   by 0x40DAA9: g_dbus_unregister_interface (object.c:1413)
   by 0x3DF7A63C9C: g_slist_foreach (gslist.c:894)
   by 0x469656: device_remove (device.c:2200)
   by 0x45CDC1: adapter_remove (adapter.c:3884)
   by 0x45F146: index_removed (adapter.c:5442)
   by 0x46BC17: received_data (mgmt.c:252)
   by 0x3DF7A47A74: g_main_context_dispatch (gmain.c:2715)
   by 0x3DF7A47DA7: g_main_context_iterate.isra.24 (gmain.c:3290)
   by 0x3DF7A481A1: g_main_loop_run (gmain.c:3484)
 Address 0x40 is not stack'd, malloc'd or (recently) free'd

11 years agomedia: Fix not finding endpoints with different case UUIDs
Vinicius Costa Gomes [Mon, 28 Jan 2013 19:27:36 +0000 (16:27 -0300)]
media: Fix not finding endpoints with different case UUIDs

When multiple Endpoints are registered with different case UUIDs,
the only UUIDs found were those with matching case.

11 years agocore: Fix LE connections based on connect_list
Johan Hedberg [Mon, 28 Jan 2013 16:58:27 +0000 (10:58 -0600)]
core: Fix LE connections based on connect_list

11 years agomonitor: Add supported commands bit numbers
Marcel Holtmann [Mon, 28 Jan 2013 15:24:39 +0000 (16:24 +0100)]
monitor: Add supported commands bit numbers

11 years agomedia: Fix custom property registration for multiple adapters
Luiz Augusto von Dentz [Mon, 21 Jan 2013 13:34:13 +0000 (15:34 +0200)]
media: Fix custom property registration for multiple adapters

The function btd_profile_add_custom_prop register a custom property for
an UUID which is valid for every adapter so its user_data cannot be tied
to a single adapter.

To fix this now NULL is passed as user_data and the callbacks checks if
the adapter passed has been registered and if there is an endpoint for
the UUID requested.

11 years agoAVCTP: Add destroy callback to avctp_register_browsing_pdu_handler
Luiz Augusto von Dentz [Sun, 27 Jan 2013 23:52:16 +0000 (17:52 -0600)]
AVCTP: Add destroy callback to avctp_register_browsing_pdu_handler

This adds a destroy callback which is called when the PDU handler is
destroyed.

11 years agoAVCTP: Fix not destroying browsing channel if disconnected
Luiz Augusto von Dentz [Sun, 27 Jan 2013 23:52:15 +0000 (17:52 -0600)]
AVCTP: Fix not destroying browsing channel if disconnected

If the browsing channel is disconnected it should be destroyed
immediatelly and set to NULL otherwise it will point to invalid channel.

11 years agoAVRCP: Fix not handling commands while browsing is connecting
Luiz Augusto von Dentz [Sun, 27 Jan 2013 23:52:14 +0000 (17:52 -0600)]
AVRCP: Fix not handling commands while browsing is connecting

With introdution of browsing channel the .init callback is called when
browsing channel connection completes, but in the meantime the remote
device can send commands over control channel.

To fix this the init callaback of control and browsing channel are now
separated into .init_control and .init_browsing so the handler can be
register as soon the respective channel connection completes.

11 years agotools: Add mixed UUIDs test case for mgmt_add_uuid
Johan Hedberg [Sun, 27 Jan 2013 17:08:44 +0000 (19:08 +0200)]
tools: Add mixed UUIDs test case for mgmt_add_uuid

11 years agocore: Allow adding all kinds of UUID for mgmt >= 1.3
Johan Hedberg [Sun, 27 Jan 2013 16:40:27 +0000 (10:40 -0600)]
core: Allow adding all kinds of UUID for mgmt >= 1.3

Before 1.3 the kernel wouldn't handle 32 and 128 bit UUIDs properly but
from that revision onwards any type of UUID can be safely added and
removed through mgmt.

11 years agocore: Add convenience macro for comparing mgmt versions
Johan Hedberg [Sun, 27 Jan 2013 16:49:31 +0000 (10:49 -0600)]
core: Add convenience macro for comparing mgmt versions

11 years agoemulator: Fix LE Read White List Size response variable naming
Johan Hedberg [Sun, 27 Jan 2013 11:09:49 +0000 (05:09 -0600)]
emulator: Fix LE Read White List Size response variable naming

11 years agounit: Add extracted UUID string list to each test case
Marcel Holtmann [Sun, 27 Jan 2013 05:04:18 +0000 (06:04 +0100)]
unit: Add extracted UUID string list to each test case

11 years agounit: Compare UUID list from EIR data
Marcel Holtmann [Sun, 27 Jan 2013 04:48:00 +0000 (05:48 +0100)]
unit: Compare UUID list from EIR data

11 years agounit: Print UUID list from EIR parsing in verbose mode
Marcel Holtmann [Sun, 27 Jan 2013 04:36:49 +0000 (05:36 +0100)]
unit: Print UUID list from EIR parsing in verbose mode

11 years agounit: Add inquiry data from Nokia Reaction BH-907 headset for testing
Marcel Holtmann [Sun, 27 Jan 2013 04:20:57 +0000 (05:20 +0100)]
unit: Add inquiry data from Nokia Reaction BH-907 headset for testing