OSDN Git Service

android-x86/external-bluetooth-bluez.git
10 years agotest/test-hfp: Fix passing missing backlog parameter to sco.listen()
Johan Hedberg [Sat, 28 Sep 2013 19:49:24 +0000 (22:49 +0300)]
test/test-hfp: Fix passing missing backlog parameter to sco.listen()

10 years agoobexd/client: Fix not setting Transfer.Size for GET operations
Luiz Augusto von Dentz [Fri, 27 Sep 2013 11:21:36 +0000 (14:21 +0300)]
obexd/client: Fix not setting Transfer.Size for GET operations

GET operations may return the length header in the first response which
should be set as transfer Size property.

10 years agogobex: Revert g_obex_pending_req_abort to static pending_req_abort
Luiz Augusto von Dentz [Tue, 24 Sep 2013 14:14:25 +0000 (17:14 +0300)]
gobex: Revert g_obex_pending_req_abort to static pending_req_abort

This reverts the changes introduced in
9095deb82572112fc0870095bf2222964610eafe that made pending_req_abort
public which is not necessary considering g_obex_cancel_req can do the
same and is safe to call even if the request is not pending.

10 years agogobex: Fix crash on g_obex_pending_req_abort
Luiz Augusto von Dentz [Tue, 24 Sep 2013 14:34:02 +0000 (17:34 +0300)]
gobex: Fix crash on g_obex_pending_req_abort

It is not safe to call g_obex_pending_req_abort directly as pending_req
can be NULL:
Invalid read of size 4
   at 0x41231E: g_obex_pending_req_abort (gobex.c:693)
   by 0x416A8A: g_obex_cancel_transfer (gobex-transfer.c:647)
   by 0x42DEF2: obc_transfer_cancel (transfer.c:180)
   by 0x43D833: process_message.isra.5 (object.c:259)
   by 0x3B0701CE85: ??? (in /usr/lib64/libdbus-1.so.3.7.4)
   by 0x3B0700FA30: dbus_connection_dispatch (in /usr/lib64/libdbus-1.so.3.7.4)
   by 0x43A5B7: message_dispatch (mainloop.c:76)
   by 0x3B03C48962: ??? (in /usr/lib64/libglib-2.0.so.0.3600.3)
   by 0x3B03C47E05: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.3600.3)
   by 0x3B03C48157: ??? (in /usr/lib64/libglib-2.0.so.0.3600.3)
   by 0x3B03C48559: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.3600.3)
   by 0x40D53C: main (main.c:319)
 Address 0x30 is not stack'd, malloc'd or (recently) free'd

10 years agotools: Limit controller type to two bits of device info type
Marcel Holtmann [Sun, 29 Sep 2013 04:00:02 +0000 (21:00 -0700)]
tools: Limit controller type to two bits of device info type

10 years agolib: Update company identifiers
Marcel Holtmann [Sat, 28 Sep 2013 07:05:50 +0000 (00:05 -0700)]
lib: Update company identifiers

10 years agoobexd/bluetooth: Fix memory leak when adapter is off
Luiz Augusto von Dentz [Wed, 25 Sep 2013 15:03:21 +0000 (18:03 +0300)]
obexd/bluetooth: Fix memory leak when adapter is off

sdp_connect fails when Bluetooth adapter is off which leads to the
following leak:
37 bytes in 1 blocks are definitely lost in loss record 68 of 165
   at 0x4A06409: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x3B03C4D89E: g_malloc (in /usr/lib64/libglib-2.0.so.0.3600.3)
   by 0x3B03C64BAE: g_strdup (in /usr/lib64/libglib-2.0.so.0.3600.3)
   by 0x427D5D: bluetooth_connect (bluetooth.c:410)
   by 0x426CC9: obc_session_create (session.c:454)
   by 0x425693: create_session (manager.c:203)
   by 0x43D8A3: process_message.isra.5 (object.c:259)
   by 0x3B0701CE85: ??? (in /usr/lib64/libdbus-1.so.3.7.4)
   by 0x3B0700FA30: dbus_connection_dispatch (in /usr/lib64/libdbus-1.so.3.7.4)
   by 0x43A627: message_dispatch (mainloop.c:76)
   by 0x3B03C48962: ??? (in /usr/lib64/libglib-2.0.so.0.3600.3)
   by 0x3B03C47E05: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.3600.3)

10 years agoobexd: Clarify the folder property of PushMessage
Christian Fetzer [Mon, 23 Sep 2013 09:24:29 +0000 (11:24 +0200)]
obexd: Clarify the folder property of PushMessage

The folder property of PushMessages does not accept path information,
it allows only to request the messages to be added to a subfolder of the
current folder.

10 years agoobexd: Clarify the folder property of ListMessages
Christian Fetzer [Mon, 23 Sep 2013 09:24:28 +0000 (11:24 +0200)]
obexd: Clarify the folder property of ListMessages

The folder property of ListMessages does not accept path information,
it allows only to request the messages of a subfolder of the current
folder.

10 years agoobexd: Fix setting message folder for relative folder in ListMessages
Christian Fetzer [Mon, 23 Sep 2013 09:24:27 +0000 (11:24 +0200)]
obexd: Fix setting message folder for relative folder in ListMessages

The method ListMessages allows to specify a relative subfolder.
This subfolder needs to be added to the current path when registering
a new message interface.

10 years agoobexd: Add folder property to map_msg_create
Christian Fetzer [Mon, 23 Sep 2013 09:24:26 +0000 (11:24 +0200)]
obexd: Add folder property to map_msg_create

Message interfaces are not necessarily created for the current folder,
therefore the folder needs to be specified in a parameter.

For example, messages can be created for sub folders when using the folder
parameter in ListMessages.

10 years agodoc: Update description for Set Advertising command
Marcel Holtmann [Wed, 25 Sep 2013 16:32:04 +0000 (09:32 -0700)]
doc: Update description for Set Advertising command

10 years agotools/mgmt-tester: Add basic rejection test case for LE advertising
Johan Hedberg [Tue, 24 Sep 2013 12:38:18 +0000 (15:38 +0300)]
tools/mgmt-tester: Add basic rejection test case for LE advertising

10 years agotools/mgmt-tester: Add basic LE advertising success test cases
Johan Hedberg [Tue, 24 Sep 2013 12:36:02 +0000 (15:36 +0300)]
tools/mgmt-tester: Add basic LE advertising success test cases

10 years agotools/mgmt-tester: Take into account new "advertising" supported setting
Johan Hedberg [Tue, 24 Sep 2013 11:45:46 +0000 (14:45 +0300)]
tools/mgmt-tester: Take into account new "advertising" supported setting

10 years agomonitor: Add support for LE Advertising mgmt setting
Johan Hedberg [Tue, 24 Sep 2013 12:41:41 +0000 (15:41 +0300)]
monitor: Add support for LE Advertising mgmt setting

10 years agoemulator/bthost: Add support for creating LE connections
Johan Hedberg [Fri, 20 Sep 2013 15:16:19 +0000 (18:16 +0300)]
emulator/bthost: Add support for creating LE connections

10 years agotools/btmgmt: Add support for setting LE advertising
Johan Hedberg [Tue, 24 Sep 2013 12:24:34 +0000 (15:24 +0300)]
tools/btmgmt: Add support for setting LE advertising

10 years agomgmt: Add defines for new advertising setting
Johan Hedberg [Tue, 24 Sep 2013 12:22:34 +0000 (15:22 +0300)]
mgmt: Add defines for new advertising setting

10 years agodoc: Fix mgmt_set_le error code list
Johan Hedberg [Wed, 25 Sep 2013 10:45:52 +0000 (13:45 +0300)]
doc: Fix mgmt_set_le error code list

10 years agodoc: Add mgmt_set_advertising details to mgmt API
Johan Hedberg [Wed, 25 Sep 2013 09:34:07 +0000 (12:34 +0300)]
doc: Add mgmt_set_advertising details to mgmt API

10 years agoobexd/service: Fix possible leaking drivers list
Luiz Augusto von Dentz [Wed, 25 Sep 2013 08:32:19 +0000 (11:32 +0300)]
obexd/service: Fix possible leaking drivers list

When registering a new driver with obex_service_driver_register there
could exist another driver for the service which will cause the drivers
list to leak.

10 years agoobexd/server: Fix leaking drivers list
Luiz Augusto von Dentz [Wed, 25 Sep 2013 08:31:08 +0000 (11:31 +0300)]
obexd/server: Fix leaking drivers list

The leak can be detected by using G_SLICE=always-malloc which will
produce the following trace using valgrind:
112 bytes in 7 blocks are definitely lost in loss record 123 of 167
   at 0x4A06409: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x3B03C4D89E: g_malloc (in /usr/lib64/libglib-2.0.so.0.3600.3)
   by 0x3B03C6344D: g_slice_alloc (in /usr/lib64/libglib-2.0.so.0.3600.3)
   by 0x3B03C647A5: g_slist_append (in /usr/lib64/libglib-2.0.so.0.3600.3)
   by 0x424DD3: obex_service_driver_list (service.c:76)
   by 0x42517F: obex_server_init (server.c:64)
   by 0x40D439: main (main.c:304)

10 years agounit: Remove not needed functions from test-sdp
Szymon Janc [Thu, 19 Sep 2013 14:00:45 +0000 (16:00 +0200)]
unit: Remove not needed functions from test-sdp

SDP code no longer depends on adapter code.

10 years agocore: Remove not needed sdp_init_services_list function
Szymon Janc [Thu, 19 Sep 2013 14:00:44 +0000 (16:00 +0200)]
core: Remove not needed sdp_init_services_list function

It is doing nothing now and can be removed.

10 years agoadapter: Handle removing of SDP records
Szymon Janc [Thu, 19 Sep 2013 14:00:43 +0000 (16:00 +0200)]
adapter: Handle removing of SDP records

Make adapter in charge of updating SDP database. This allow to decouple
SDP of code used for notifying adapters about SDP database change.

10 years agoadapter: Handle adding new SDP records
Szymon Janc [Thu, 19 Sep 2013 14:00:42 +0000 (16:00 +0200)]
adapter: Handle adding new SDP records

Make adapter in charge of updating SDP database. This allow to decouple
SDP of code used for notifying adapters about SDP database change.

10 years agoadapter: Insert DeviceID record if setting DeviceID data to controller
Szymon Janc [Thu, 19 Sep 2013 14:00:41 +0000 (16:00 +0200)]
adapter: Insert DeviceID record if setting DeviceID data to controller

DeviceID is special since its record is registered on start by
sdpd-server and always has handle 0x10000.

10 years agolib: Update company identifiers
Marcel Holtmann [Sat, 21 Sep 2013 18:40:31 +0000 (11:40 -0700)]
lib: Update company identifiers

10 years agocore: Fix passing timeout when disabling discoverable mode
Johan Hedberg [Fri, 20 Sep 2013 16:17:34 +0000 (11:17 -0500)]
core: Fix passing timeout when disabling discoverable mode

We should only pass a timeout value when enabling discoverable mode.
When disabling passing something non-zero would yield a "invalid
parameters" error.

10 years agoemulator/bthost: Fix using correct address type for LE connections
Johan Hedberg [Fri, 20 Sep 2013 14:38:49 +0000 (17:38 +0300)]
emulator/bthost: Fix using correct address type for LE connections

10 years agoemulator/bthost: Fix ACL handle packing
Johan Hedberg [Fri, 20 Sep 2013 03:18:19 +0000 (06:18 +0300)]
emulator/bthost: Fix ACL handle packing

10 years agoemulator/bthost: Track address type for connections
Johan Hedberg [Thu, 19 Sep 2013 22:49:37 +0000 (01:49 +0300)]
emulator/bthost: Track address type for connections

10 years agoemulator/bthost: Use right CID for LE signaling
Johan Hedberg [Thu, 19 Sep 2013 23:45:09 +0000 (02:45 +0300)]
emulator/bthost: Use right CID for LE signaling

10 years agoemulator/bthost: Pass full ACL connection context around
Johan Hedberg [Thu, 19 Sep 2013 23:28:17 +0000 (02:28 +0300)]
emulator/bthost: Pass full ACL connection context around

10 years agoemulator: Add initial LE L2CAP signaling support to bthost
Johan Hedberg [Thu, 19 Sep 2013 15:42:49 +0000 (18:42 +0300)]
emulator: Add initial LE L2CAP signaling support to bthost

10 years agoemulator: Add LE Connection Complete handling to bthost
Johan Hedberg [Thu, 19 Sep 2013 18:42:14 +0000 (21:42 +0300)]
emulator: Add LE Connection Complete handling to bthost

10 years agoemulator: Refactor bthost ACL connection tracking
Johan Hedberg [Thu, 19 Sep 2013 18:35:29 +0000 (21:35 +0300)]
emulator: Refactor bthost ACL connection tracking

10 years agoemulator: Add skeleton for LE meta event handler in bthost
Johan Hedberg [Thu, 19 Sep 2013 18:31:05 +0000 (21:31 +0300)]
emulator: Add skeleton for LE meta event handler in bthost

10 years agoemulator: Add basic advertise enable support for bthost
Johan Hedberg [Thu, 19 Sep 2013 16:42:02 +0000 (19:42 +0300)]
emulator: Add basic advertise enable support for bthost

10 years agotools/l2cap-tester: Fix using right hciemu type
Johan Hedberg [Thu, 19 Sep 2013 16:41:06 +0000 (19:41 +0300)]
tools/l2cap-tester: Fix using right hciemu type

10 years agoemulator: Add basic support for LE connections
Johan Hedberg [Thu, 19 Sep 2013 15:27:26 +0000 (18:27 +0300)]
emulator: Add basic support for LE connections

10 years agomonitor: Add define for "Connection Failed To Be Established"
Johan Hedberg [Thu, 19 Sep 2013 15:27:12 +0000 (18:27 +0300)]
monitor: Add define for "Connection Failed To Be Established"

10 years agoemulator: Remove redundant empty line
Johan Hedberg [Thu, 19 Sep 2013 15:06:57 +0000 (10:06 -0500)]
emulator: Remove redundant empty line

10 years agosdp: Check correct number of bytes received in recv
Andrei Emeltchenko [Tue, 17 Sep 2013 14:40:20 +0000 (17:40 +0300)]
sdp: Check correct number of bytes received in recv

Instead of checking for error check that correct number of bytes received.

10 years agodoc: Update supported A2DP version to 1.3
Johan Hedberg [Wed, 18 Sep 2013 17:03:50 +0000 (12:03 -0500)]
doc: Update supported A2DP version to 1.3

10 years agotools/l2cap-tester: Add invalid config request server test
Johan Hedberg [Tue, 17 Sep 2013 07:05:54 +0000 (08:05 +0100)]
tools/l2cap-tester: Add invalid config request server test

10 years agotools/l2cap-tester: Add invalid CID server test case
Johan Hedberg [Tue, 17 Sep 2013 06:56:48 +0000 (07:56 +0100)]
tools/l2cap-tester: Add invalid CID server test case

10 years agotools/l2cap-tester: Fix sending right req code in tests
Johan Hedberg [Tue, 17 Sep 2013 06:54:26 +0000 (07:54 +0100)]
tools/l2cap-tester: Fix sending right req code in tests

10 years agotools/l2cap-tester: Add expected response data to nval PDU test
Johan Hedberg [Tue, 17 Sep 2013 06:38:30 +0000 (07:38 +0100)]
tools/l2cap-tester: Add expected response data to nval PDU test

10 years agoRelease 5.9
Marcel Holtmann [Mon, 16 Sep 2013 15:08:22 +0000 (08:08 -0700)]
Release 5.9

10 years agoobexd/bluetooth: Fix memory leak
Luiz Augusto von Dentz [Mon, 16 Sep 2013 10:35:10 +0000 (13:35 +0300)]
obexd/bluetooth: Fix memory leak

g_io_channel_unix_new creates a reference which is then passed to
obex_session_start which creates its on reference via g_io_channel_ref
leading to the following leak:

at 0x4A06409: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
by 0x3B03C4D89E: g_malloc (in /usr/lib64/libglib-2.0.so.0.3600.3)
by 0x3B03C88224: g_io_channel_unix_new (in /usr/lib64/libglib-2.0.so.0.3600.3)
by 0x418967: profile_new_connection (bluetooth.c:148)
by 0x43D763: process_message.isra.5 (object.c:259)

10 years agoobexd: Remove msg from MAP session structure
Christian Fetzer [Fri, 13 Sep 2013 15:28:36 +0000 (17:28 +0200)]
obexd: Remove msg from MAP session structure

The D-Bus message for a pending method call is now stored in the
pending_request struct.

10 years agoobexd: Use pending request in UpdateInbox
Christian Fetzer [Fri, 13 Sep 2013 15:28:35 +0000 (17:28 +0200)]
obexd: Use pending request in UpdateInbox

10 years agoobexd: Use pending request in ListMessages
Christian Fetzer [Fri, 13 Sep 2013 15:28:34 +0000 (17:28 +0200)]
obexd: Use pending request in ListMessages

10 years agoobexd: Use pending request in ListFolders
Christian Fetzer [Fri, 13 Sep 2013 15:28:33 +0000 (17:28 +0200)]
obexd: Use pending request in ListFolders

10 years agoobexd: Use pending request in SetFolder
Christian Fetzer [Fri, 13 Sep 2013 15:28:32 +0000 (17:28 +0200)]
obexd: Use pending request in SetFolder

10 years agoobexd: Add request struct to MAP
Christian Fetzer [Fri, 13 Sep 2013 15:28:31 +0000 (17:28 +0200)]
obexd: Add request struct to MAP

This adds a pending_request struct in order to store the D-Bus request
data.

The current version stores the received D-Bus message in the MAP session
struct. The stored message is overridden by intermediate D-Bus method
calls which can lead into a crash.

Trace:
  arguments to dbus_message_unref() were incorrect,
  assertion "!message->in_cache" failed in file dbus-message.c line 1618.

 0  0x00007ffff6a6a1c9 in raise () from /usr/lib/libc.so.6
 1  0x00007ffff6a6b5c8 in abort () from /usr/lib/libc.so.6
 2  0x00007ffff7313de5 in ?? () from /usr/lib/libdbus-1.so.3
 3  0x00007ffff730ab91 in ?? () from /usr/lib/libdbus-1.so.3
 4  0x000000000043721c in message_listing_cb (session=0x6a7d30,
    transfer=0x6a9450, err=0x0, user_data=0x6a9950) at obexd/client/map.c:1166
 5  0x000000000042f7af in session_terminate_transfer (session=0x6a7d30,
    transfer=0x6a9450, gerr=0x0) at obexd/client/session.c:830
 6  0x000000000042f83d in session_notify_complete (session=0x6a7d30,
    transfer=0x6a9450) at obexd/client/session.c:845
 7  0x000000000042f8dc in transfer_complete (transfer=0x6a9450, err=0x0,
    user_data=0x6a7d30) at obexd/client/session.c:865
 8  0x0000000000439ee7 in xfer_complete (obex=0x677250, err=0x0,
    user_data=0x6a9450) at obexd/client/transfer.c:577
 9  0x000000000043a05f in get_xfer_progress_first (obex=0x677250, err=0x0,
    rsp=0x678730, user_data=0x6a9450) at obexd/client/transfer.c:621
 10 0x0000000000413f08 in handle_response (obex=0x677250, err=0x0,
    rsp=0x678730) at gobex/gobex.c:949
 11 0x00000000004147db in incoming_data (io=0x6a8a00, cond=G_IO_IN,
    user_data=0x677250) at gobex/gobex.c:1192
 12 0x00007ffff702dda6 in g_main_context_dispatch ()
   from /usr/lib/libglib-2.0.so.0
 13 0x00007ffff702e0f8 in ?? () from /usr/lib/libglib-2.0.so.0
 14 0x00007ffff702e4fa in g_main_loop_run () from /usr/lib/libglib-2.0.so.0
 15 0x0000000000427ce8 in main (argc=1, argv=0x7fffffffdd48)
    at obexd/src/main.c:319

10 years agocore: Remove legacy parsing of OUI database
Marcel Holtmann [Mon, 16 Sep 2013 03:01:00 +0000 (20:01 -0700)]
core: Remove legacy parsing of OUI database

10 years agosap: Keep reference to btd_adapter in struct sap_server
Szymon Janc [Fri, 13 Sep 2013 11:30:47 +0000 (13:30 +0200)]
sap: Keep reference to btd_adapter in struct sap_server

Path and adapter address can be obtained easily from btd_adapter
and there is no need to keep local copy.

10 years agocore: Minor whitespace fix
Szymon Janc [Fri, 13 Sep 2013 11:30:46 +0000 (13:30 +0200)]
core: Minor whitespace fix

10 years agogitignore: Add tools/btinfo
Szymon Janc [Fri, 13 Sep 2013 11:30:45 +0000 (13:30 +0200)]
gitignore: Add tools/btinfo

10 years agoobexd: Use documented values in org.bluez.obex.Message1 Type property
Christian Fetzer [Mon, 9 Sep 2013 16:30:57 +0000 (18:30 +0200)]
obexd: Use documented values in org.bluez.obex.Message1 Type property

This updates the values that are presented in the Type property to use
the values from the documentation ("email", "sms-gsm", "sms-cdma", "mms").
The existing code directly used the values as received in the messages
listing object ("EMAIL", "SMS_GSM", "SMS_CDMA", "MMS").

10 years agoshared/hciemu: Fix sending a proper vhci create request for new kernels
Johan Hedberg [Thu, 12 Sep 2013 14:42:36 +0000 (17:42 +0300)]
shared/hciemu: Fix sending a proper vhci create request for new kernels

10 years agogdbus/client: Use g_dbus_add_properties_watch to track properties
Luiz Augusto von Dentz [Wed, 4 Sep 2013 18:57:20 +0000 (21:57 +0300)]
gdbus/client: Use g_dbus_add_properties_watch to track properties

This make the handling much simpler and avoids duplicates of the same
match rule.

10 years agogdbus/client: Use g_dbus_add_signal_watch to track signals
Luiz Augusto von Dentz [Mon, 2 Sep 2013 15:54:33 +0000 (18:54 +0300)]
gdbus/client: Use g_dbus_add_signal_watch to track signals

This make the handling much simpler and avoids duplicates of the same
match rule.

10 years agogdbus/client: Use g_dbus_add_service_watch to track services
Luiz Augusto von Dentz [Mon, 2 Sep 2013 13:02:05 +0000 (16:02 +0300)]
gdbus/client: Use g_dbus_add_service_watch to track services

This make the handling much simpler and avoids duplicates of the same
match rule.

10 years agogdbus/watch: Fix crash when disconnecting from D-Bus
Luiz Augusto von Dentz [Mon, 9 Sep 2013 08:25:12 +0000 (11:25 +0300)]
gdbus/watch: Fix crash when disconnecting from D-Bus

When disconnecting from D-Bus a message could be recieved with no sender:
Invalid read of size 1
   at 0x4A09EE1: strcmp (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x3B03C386B8: g_str_equal (in /usr/lib64/libglib-2.0.so.0.3600.3)
   by 0x4065D6: message_filter (watch.c:529)
   by 0x3B0700F9E5: dbus_connection_dispatch (in /usr/lib64/libdbus-1.so.3.7.4)
   by 0x4052E7: message_dispatch (mainloop.c:76)
   by 0x3B03C48962: ??? (in /usr/lib64/libglib-2.0.so.0.3600.3)
   by 0x3B03C47E05: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.3600.3)
   by 0x3B03C48157: ??? (in /usr/lib64/libglib-2.0.so.0.3600.3)
   by 0x3B03C48559: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.3600.3)
   by 0x4038C5: client_proxy_removed (test-gdbus-client.c:902)
   by 0x3B03C6B566: ??? (in /usr/lib64/libglib-2.0.so.0.3600.3)
   by 0x3B03C6B6E5: ??? (in /usr/lib64/libglib-2.0.so.0.3600.3)
 Address 0x0 is not stack'd, malloc'd or (recently) free'd

10 years agogdbus/watch: Fix aborting when removing D-Bus filter
Luiz Augusto von Dentz [Tue, 3 Sep 2013 15:00:35 +0000 (18:00 +0300)]
gdbus/watch: Fix aborting when removing D-Bus filter

In case of filter_data having a watch to a service name it may call
dbus_connection_remove_filter twice causing libdbus to abort:

process 24723: Attempt to remove filter function 0x4063e0 user data (nil), but no such filter has been added

To fix this the code will now only attempt to call
dbus_connection_remove_filter once in filter_data_free which is the
counterpart of filter_data_get where dbus_connection_add_filter is called.

10 years agogdbus/watch: Fix crash when g_dbus_remove_watch is called from connect callback
Luiz Augusto von Dentz [Mon, 2 Sep 2013 12:55:45 +0000 (15:55 +0300)]
gdbus/watch: Fix crash when g_dbus_remove_watch is called from connect callback

 at 0x40570C: update_service (watch.c:601)
 by 0x40584B: service_reply (watch.c:627)
 by 0x3B0700C511: ??? (in /usr/lib64/libdbus-1.so.3.7.4)
 by 0x3B0700F740: dbus_connection_dispatch (in /usr/lib64/libdbus-1.so.3.7.4)
 by 0x405167: message_dispatch (mainloop.c:76)
 by 0x3B03C48962: ??? (in /usr/lib64/libglib-2.0.so.0.3600.3)
 by 0x3B03C47E05: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.3600.3)
 by 0x3B03C48157: ??? (in /usr/lib64/libglib-2.0.so.0.3600.3)
 by 0x3B03C48559: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.3600.3)
Address 0x4c58a30 is 32 bytes inside a block of size 56 free'd
 at 0x4A074C4: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
 by 0x3B03C4D9AE: g_free (in /usr/lib64/libglib-2.0.so.0.3600.3)
 by 0x406102: filter_data_remove_callback (watch.c:378)
 by 0x405FC0: g_dbus_remove_watch (watch.c:798)
 by 0x40A22B: g_dbus_client_unref (client.c:1227)
 by 0x40570B: update_service (watch.c:599)
 by 0x40584B: service_reply (watch.c:627)

10 years agounit: Add gdbus/client_force_disconnect
Luiz Augusto von Dentz [Mon, 9 Sep 2013 09:55:54 +0000 (12:55 +0300)]
unit: Add gdbus/client_force_disconnect

This tests if watches created using g_dbus_proxy_set_removed_watch works
when the service disconnects from the bus.

10 years agounit: Add gdbus/client_proxy_removed
Luiz Augusto von Dentz [Mon, 9 Sep 2013 08:31:14 +0000 (11:31 +0300)]
unit: Add gdbus/client_proxy_removed

This tests if watches created using g_dbus_proxy_set_removed_watch works
when the interface is removed.

10 years agomonitor: Add missing include
Szymon Janc [Wed, 11 Sep 2013 14:03:28 +0000 (16:03 +0200)]
monitor: Add missing include

Bionic library requires explicit include for data types used in ioctl
call. This fix following build error with bionic:

target  C: btmon <= external/bluetooth/bluez/monitor/display.c
external/bluetooth/bluez/monitor/display.c: In function 'num_columns':
external/bluetooth/bluez/monitor/display.c:59:18: error: storage size
    of 'ws' isn't known

10 years agoprofile: Remove support for Cancel method
Denis Kenzior [Tue, 10 Sep 2013 16:42:23 +0000 (11:42 -0500)]
profile: Remove support for Cancel method

10 years agodoc: Remove Profile1.Cancel() method
Denis Kenzior [Tue, 10 Sep 2013 16:42:22 +0000 (11:42 -0500)]
doc: Remove Profile1.Cancel() method

There does not seem to be any actual need for this method.

The current implementation calls Cancel when a pending
NewConnection() or RequestDisconnection() method call fails.
Additionally it calls Cancel() when the remote client has disconnected.
In either case BlueZ calls shutdown on the file descriptor associated
with the agent and issues a Cancel() method call.

The closing of the file descriptor will trigger a HUP on the agent side,
which will trigger normal cleanup procedures.  The received Cancel()
method call is redundant in both cases.

10 years agodoc: Label Profile1.Release() method as no reply
Denis Kenzior [Tue, 10 Sep 2013 16:42:21 +0000 (11:42 -0500)]
doc: Label Profile1.Release() method as no reply

The current implementation does not expect a reply, nor would it make
sense for BlueZ to wait for one from the agent.  So explicitly label
this method as noreply.

10 years agoavdtp: Remove unused STREAM_TIMEOUT define
Szymon Janc [Wed, 11 Sep 2013 13:52:14 +0000 (15:52 +0200)]
avdtp: Remove unused STREAM_TIMEOUT define

10 years agoavdtp: Remove not used includes
Szymon Janc [Wed, 11 Sep 2013 13:52:13 +0000 (15:52 +0200)]
avdtp: Remove not used includes

10 years agoavdtp: Remove not used pending_auth from struct avdtp
Szymon Janc [Wed, 11 Sep 2013 13:52:12 +0000 (15:52 +0200)]
avdtp: Remove not used pending_auth from struct avdtp

10 years agoshared: Check HCI packet type before sending it to btdev
Marcel Holtmann [Wed, 11 Sep 2013 14:13:31 +0000 (07:13 -0700)]
shared: Check HCI packet type before sending it to btdev

10 years agocodingstyle: Change __FUNCTION__ to __func__
Andrei Emeltchenko [Tue, 10 Sep 2013 13:11:37 +0000 (16:11 +0300)]
codingstyle: Change __FUNCTION__ to __func__

The __func__ macro is part of the C99 standard whereas __FUNCTION__ is a
legacy gcc specific alias for it:

http://gcc.gnu.org/onlinedocs/gcc/Function-Names.html

Additionally, checkpatch.pl that's commonly used to verify coding style
also recommends to use __func__ instead of __FUNCTION__.

10 years agoemulator: Add missing HCI commands to the supported commands response
Johan Hedberg [Wed, 11 Sep 2013 07:54:41 +0000 (10:54 +0300)]
emulator: Add missing HCI commands to the supported commands response

10 years agoemulator: Disallow SCO HCI commands on LE-only controllers
Johan Hedberg [Wed, 11 Sep 2013 07:54:22 +0000 (10:54 +0300)]
emulator: Disallow SCO HCI commands on LE-only controllers

10 years agoemulator: Disallow HCI_Write_Current_IAP_LAP for LE-only controllers
Johan Hedberg [Wed, 11 Sep 2013 07:53:56 +0000 (10:53 +0300)]
emulator: Disallow HCI_Write_Current_IAP_LAP for LE-only controllers

10 years agoemulator: Add support for reading local out-of-band data
Marcel Holtmann [Wed, 11 Sep 2013 07:04:35 +0000 (00:04 -0700)]
emulator: Add support for reading local out-of-band data

10 years agoemulator: Add options to usage description
Marcel Holtmann [Wed, 11 Sep 2013 04:12:05 +0000 (21:12 -0700)]
emulator: Add options to usage description

10 years agoobexd/bluetooth: Fix error on register_profile
Luiz Augusto von Dentz [Tue, 10 Sep 2013 11:38:55 +0000 (14:38 +0300)]
obexd/bluetooth: Fix error on register_profile

The error happens whenever RegisterProfile fails the interface is not
unregistered causing any subsequent call to register_profile function
to fail:

obexd[944]: D-Bus failed to register /org/bluez/obex/00005005_0000_1000_8000_0002ee000001
obexd[944]: bluetooth: Failed to register profile (null)

10 years agobuild: Check for clock_gettime with -lrt
Marcel Holtmann [Mon, 9 Sep 2013 21:21:49 +0000 (14:21 -0700)]
build: Check for clock_gettime with -lrt

10 years agoobexd: Make use of g_dbus_send_message*
Luiz Augusto von Dentz [Mon, 19 Aug 2013 14:12:04 +0000 (17:12 +0300)]
obexd: Make use of g_dbus_send_message*

This replaces dbus_connection_send* with g_dbus_send_message* which do
not alter message order.

10 years agoaudio/media: Make use of g_dbus_send_message_with_reply
Luiz Augusto von Dentz [Mon, 19 Aug 2013 12:45:11 +0000 (15:45 +0300)]
audio/media: Make use of g_dbus_send_message_with_reply

This replaces dbus_connection_send_with_reply with
g_dbus_send_message_with_reply which does not alter message order.

10 years agoneard: Make use of g_dbus_send_message_with_reply
Luiz Augusto von Dentz [Mon, 19 Aug 2013 14:17:17 +0000 (17:17 +0300)]
neard: Make use of g_dbus_send_message_with_reply

This replaces dbus_connection_send_with_reply with
g_dbus_send_message_with_reply which does not alter message order.

10 years agocore: Make use of g_dbus_send_message_with_reply
Luiz Augusto von Dentz [Mon, 19 Aug 2013 12:41:49 +0000 (15:41 +0300)]
core: Make use of g_dbus_send_message_with_reply

This replaces dbus_connection_send_with_reply with
g_dbus_send_message_with_reply which does not alter message order.

10 years agogdbus: Fix emitting PropertiesChanged twice
Luiz Augusto von Dentz [Mon, 19 Aug 2013 13:54:35 +0000 (16:54 +0300)]
gdbus: Fix emitting PropertiesChanged twice

This fixes double emission of PropertiesChanged introduced by flushing
changes, the flushing can happen during the pending processing so the
pending_prop flag needs to be updated in the beginning and the list of
properties can be freed before g_dbus_send_message as it is not required
anymore.

10 years agogdbus: Avoid calling dbus_connection_send*
Luiz Augusto von Dentz [Mon, 19 Aug 2013 13:05:15 +0000 (16:05 +0300)]
gdbus: Avoid calling dbus_connection_send*

dbus_connection_send* should not be called directly except by
g_dbus_send_message.

10 years agogdbus: Add g_dbus_send_message_with_reply
Luiz Augusto von Dentz [Mon, 19 Aug 2013 12:25:57 +0000 (15:25 +0300)]
gdbus: Add g_dbus_send_message_with_reply

g_dbus_send_message_with_reply flushes pending signals before calling
dbus_connection_send_with_reply so it does not alter the message order

10 years agogdbus: Fix sending ObjectManager/Properties signals out of order
Luiz Augusto von Dentz [Mon, 19 Aug 2013 11:39:28 +0000 (14:39 +0300)]
gdbus: Fix sending ObjectManager/Properties signals out of order

In some cases the order of the messages is altered when a message is
sent without processing the pending signals first, currently this affect
client_check_order unit test:

/gdbus/client_check_order: **
ERROR:unit/test-gdbus-client.c:795:property_check_order: assertion failed: (g_strcmp0(string, "value1") == 0)

As can be observed the value of the property is not yet updated because the
signal it is still pending, once this fix is applied the test pass:

/gdbus/client_check_order: OK

Note that the flushing only works when g_dbus_send_message is used so
places where dbus_connection_send and other variants are called directly
may still change the order.

10 years agounit: Add gdbus/client_check_order
Luiz Augusto von Dentz [Mon, 19 Aug 2013 11:38:46 +0000 (14:38 +0300)]
unit: Add gdbus/client_check_order

10 years agobuild: Fix not rebuilding bluetoothd if gdbus changes
Luiz Augusto von Dentz [Mon, 19 Aug 2013 13:49:51 +0000 (16:49 +0300)]
build: Fix not rebuilding bluetoothd if gdbus changes

src_bluetoothd_DEPENDENCIES should list all local libraries including gdbus
otherwise it does not get relinked whenever gdbus changes.

10 years agosco-tester: Update ECONNABORTED to EOPNOTSUPP
Frédéric Dalleau [Fri, 9 Aug 2013 15:42:55 +0000 (17:42 +0200)]
sco-tester: Update ECONNABORTED to EOPNOTSUPP

Kernel interface has evolved in between.

10 years agomonitor: Decode page scan and page scan period mode commands
Marcel Holtmann [Mon, 9 Sep 2013 05:29:19 +0000 (22:29 -0700)]
monitor: Decode page scan and page scan period mode commands