OSDN Git Service

android-x86/external-bluetooth-bluez.git
8 years agomonitor: Add support for Broadcom diagnostic channel decoding
Marcel Holtmann [Wed, 7 Oct 2015 20:42:29 +0000 (22:42 +0200)]
monitor: Add support for Broadcom diagnostic channel decoding

8 years agomonitor: Allow padded LL messages from diagnostic channel
Marcel Holtmann [Wed, 7 Oct 2015 20:39:51 +0000 (22:39 +0200)]
monitor: Allow padded LL messages from diagnostic channel

8 years agomonitor: Print LMP master vs slave transaction identification
Marcel Holtmann [Wed, 7 Oct 2015 20:39:05 +0000 (22:39 +0200)]
monitor: Print LMP master vs slave transaction identification

8 years agomonitor: Allow padded LMP messages from diagnostic channel
Marcel Holtmann [Wed, 7 Oct 2015 19:53:24 +0000 (21:53 +0200)]
monitor: Allow padded LMP messages from diagnostic channel

8 years agomonitor: Fix typo with LMP channel classification parameter
Marcel Holtmann [Wed, 7 Oct 2015 19:52:57 +0000 (21:52 +0200)]
monitor: Fix typo with LMP channel classification parameter

8 years agomonitor: Forward correct manufacturer value to vendor events
Marcel Holtmann [Wed, 7 Oct 2015 18:41:49 +0000 (20:41 +0200)]
monitor: Forward correct manufacturer value to vendor events

8 years agomonitor: Fix array boundary issue with version information
Marcel Holtmann [Wed, 7 Oct 2015 18:40:45 +0000 (20:40 +0200)]
monitor: Fix array boundary issue with version information

8 years agomonitor: Add support for vendor diagnostic packets
Marcel Holtmann [Wed, 7 Oct 2015 16:15:34 +0000 (18:15 +0200)]
monitor: Add support for vendor diagnostic packets

8 years agomonitor: Add support for showing index information updates
Marcel Holtmann [Wed, 7 Oct 2015 13:35:31 +0000 (15:35 +0200)]
monitor: Add support for showing index information updates

8 years agocore/advertising: Fix string match in le adv search
Andrejs Hanins [Tue, 6 Oct 2015 11:46:47 +0000 (14:46 +0300)]
core/advertising: Fix string match in le adv search

Instead of searching for matched entry in the list, the function
match_advertisement was searching for the first non-matched entry, as a
result, it wasn't possible to unregister existing advertisement from LE
Adv manager.

8 years agoemulator: Refactor le set scan enable command handler
Mariusz Skamra [Wed, 23 Sep 2015 11:36:59 +0000 (13:36 +0200)]
emulator: Refactor le set scan enable command handler

le_set_scan_enable_complete should be called as post hook action.

8 years agoemulator: Enable Slave-initiated Features Exchange feature
Mariusz Skamra [Wed, 23 Sep 2015 11:36:58 +0000 (13:36 +0200)]
emulator: Enable Slave-initiated Features Exchange feature

8 years agoemulator: Add support for LE Remote Connection Parameter Request Negative Reply
Mariusz Skamra [Wed, 23 Sep 2015 11:36:57 +0000 (13:36 +0200)]
emulator: Add support for LE Remote Connection Parameter Request Negative Reply

< HCI Command: LE Connection Update (0x08|0x0013) plen 14
                                                 [hci1] 915.472416
        Handle: 42
        Min connection interval: 0.00 msec (0x0000)
        Max connection interval: 18.75 msec (0x000f)
        Connection latency: 0x0000
        Supervision timeout: 32000 msec (0x0c80)
        Min connection length: 0.625 msec (0x0001)
        Max connection length: 0.625 msec (0x0001)
> HCI Event: Command Status (0x0f) plen 4         [hci1] 915.472432
      LE Connection Update (0x08|0x0013) ncmd 1
        Status: Success (0x00)
> HCI Event: LE Meta Event (0x3e) plen 11         [hci0] 915.472443
      LE Remote Connection Parameter Request (0x06)
        Handle: 42
        Min connection interval: 0.00 msec (0x0000)
        Max connection interval: 18.75 msec (0x000f)
        Connection latency: 0x0000
        Supervision timeout: 32000 msec (0x0c80)
< HCI Command: LE Remote Connection Parameter Request Negative Reply
(0x08|0x0021) plen 3       [hci0] 915.474095
        Handle: 42
        Reason: Invalid LMP Parameters / Invalid LL Parameters (0x1e)
> HCI Event: Command Complete (0x0e) plen 6        [hci0] 915.474119
      LE Remote Connection Parameter Request Negative Reply
(0x08|0x0021) ncmd 1
        Status: Success (0x00)
        Handle: 42
> HCI Event: LE Meta Event (0x3e) plen 10          [hci1] 915.474124
      LE Connection Update Complete (0x03)
        Status: Invalid LMP Parameters / Invalid LL Parameters (0x1e)
        Handle: 42
        Connection interval: 4800.00 msec (0x0f00)
        Connection latency: 0.00 msec (0x0000)
        Supervision timeout: 327680 msec (0x8000)

LE Connection Update rejected due to invalid parameter:
Min connection interval: 0.00 msec (0x0000)

8 years agoemulator: Add support for LE Remote Connection Parameter Request Reply
Mariusz Skamra [Wed, 23 Sep 2015 11:36:56 +0000 (13:36 +0200)]
emulator: Add support for LE Remote Connection Parameter Request Reply

< HCI Command: LE Connection Update (0x08|0x0013) plen 14
                          [hci0] 92750.079447
        Handle: 42
        Min connection interval: 50.00 msec (0x0028)
        Max connection interval: 70.00 msec (0x0038)
        Connection latency: 0x0000
        Supervision timeout: 420 msec (0x002a)
        Min connection length: 0.000 msec (0x0000)
        Max connection length: 0.000 msec (0x0000)
> HCI Event: Command Status (0x0f) plen 4
                                  [hci0] 92750.079459
      LE Connection Update (0x08|0x0013) ncmd 1
        Status: Success (0x00)
> HCI Event: LE Meta Event (0x3e) plen 11
                                          [hci1] 92750.079462
      LE Remote Connection Parameter Request (0x06)
        Handle: 42
        Min connection interval: 50.00 msec (0x0028)
        Max connection interval: 70.00 msec (0x0038)
        Connection latency: 0x0000
        Supervision timeout: 420 msec (0x002a)
< HCI Command: LE Remote Connection Parameter Request Reply
(0x08|0x0020) plen 14   [hci1] 92750.079476
        Handle: 42
        Min connection interval: 50.00 msec (0x0028)
        Max connection interval: 70.00 msec (0x0038)
        Connection latency: 0x0000
        Supervision timeout: 420 msec (0x002a)
        Min connection length: 0.000 msec (0x0000)
        Max connection length: 0.000 msec (0x0000)
> HCI Event: Command Complete (0x0e) plen 6
  [hci1] 92750.079507
      LE Remote Connection Parameter Request Reply (0x08|0x0020)
ncmd 1
        Status: Success (0x00)
        Handle: 42
> HCI Event: LE Meta Event (0x3e) plen 10
                                          [hci0] 92750.079510
      LE Connection Update Complete (0x03)
        Status: Success (0x00)
        Handle: 42
        Connection interval: 50.00 msec (0x0028)
        Connection latency: 0.00 msec (0x0000)
        Supervision timeout: 420 msec (0x002a)
> HCI Event: LE Meta Event (0x3e) plen 10
                                          [hci1] 92750.079509
      LE Connection Update Complete (0x03)
        Status: Success (0x00)
        Handle: 42
        Connection interval: 50.00 msec (0x0028)
        Connection latency: 0.00 msec (0x0000)
        Supervision timeout: 420 msec (0x002a)
@ New Conn Param: 00:AA:01:00:00:23 (1) hint 0 min 0x0028 max 0x0038
latency 0x0000 timeout 0x002a

8 years agoemulator: Remove duplicated assignment
Mariusz Skamra [Wed, 23 Sep 2015 11:36:55 +0000 (13:36 +0200)]
emulator: Remove duplicated assignment

Connection handle has been already assigned few lines earlier.

8 years agoemulator: Fix LE Connection Complete Event data
Mariusz Skamra [Wed, 23 Sep 2015 11:36:54 +0000 (13:36 +0200)]
emulator: Fix LE Connection Complete Event data

This sets LE Connection Complete Event paramaters based on parameters
from LE Create Connection command.
Event parameters like Conn_Interval and Supervision_Timeout
shouldn't be set to 0.

8 years agomonitor: Add support for open and close index events
Marcel Holtmann [Sun, 4 Oct 2015 21:39:59 +0000 (23:39 +0200)]
monitor: Add support for open and close index events

8 years agomonitor: Remove unused copy of btsnoop files
Marcel Holtmann [Sun, 4 Oct 2015 19:17:49 +0000 (21:17 +0200)]
monitor: Remove unused copy of btsnoop files

8 years agodoc: The management API version 1.10 is available since kernel 4.2
Marcel Holtmann [Sat, 3 Oct 2015 10:18:21 +0000 (12:18 +0200)]
doc: The management API version 1.10 is available since kernel 4.2

8 years agotools/sco-tester: Handle HCI emulator setup errors
Kuba Pawlak [Thu, 1 Oct 2015 12:18:41 +0000 (13:18 +0100)]
tools/sco-tester: Handle HCI emulator setup errors

Missing return is causing confusing output from sco-tester:

  Read Index List callback
    Status: 0x00
  Failed to setup HCI emulation
eSCO CVSD - Success - pre setup failed
  New hciemu instance created
eSCO CVSD - Success - done

8 years agounit/test-uhid: Use tester framework
Gowtham Anandha Babu [Thu, 1 Oct 2015 14:32:23 +0000 (20:02 +0530)]
unit/test-uhid: Use tester framework

8 years agounit/test-sdp: Use tester framework
Gowtham Anandha Babu [Thu, 1 Oct 2015 14:32:22 +0000 (20:02 +0530)]
unit/test-sdp: Use tester framework

8 years agounit/test-hfp: Use tester framework
Gowtham Anandha Babu [Thu, 1 Oct 2015 14:32:21 +0000 (20:02 +0530)]
unit/test-hfp: Use tester framework

8 years agotools: Fix Invalid return
Bharat Panda [Thu, 1 Oct 2015 11:49:00 +0000 (17:19 +0530)]
tools: Fix Invalid return

Return DBUS_HANDLER_RESULT_HANDLED instead of
DBUS_HANDLER_RESULT_NOT_YET_HANDLED for player message handle.

8 years agoaudio/control: Add Player property to MediaControl1
Luiz Augusto von Dentz [Tue, 29 Sep 2015 13:10:33 +0000 (16:10 +0300)]
audio/control: Add Player property to MediaControl1

This adds Player property to MediaControl1 interface which contains the
object path of the addressed player.

8 years agoaudio/control: Mark all methods of MediaControl1 as deprecated
Luiz Augusto von Dentz [Mon, 28 Sep 2015 13:54:18 +0000 (16:54 +0300)]
audio/control: Mark all methods of MediaControl1 as deprecated

MediaControl1 is deprecated according to its documentation.

8 years agodoc/media-api: Add Player property to MediaControl1
Luiz Augusto von Dentz [Tue, 29 Sep 2015 13:15:24 +0000 (16:15 +0300)]
doc/media-api: Add Player property to MediaControl1

Player property is use to inform the current addressed player which is
necessary in case more than one player is available.

This is also remove the deprecated status of MediaControl1 and instead
deprecated just its methods which similar functionality have been moved
to MediaPlayer1.

8 years agoaudio/avrcp: Fix possible crash when current player is removed
Luiz Augusto von Dentz [Mon, 28 Sep 2015 07:04:25 +0000 (10:04 +0300)]
audio/avrcp: Fix possible crash when current player is removed

If current player is removed a new player should be assigned.

Note: In normal condition this should never happen since player 0 works
as a place holder but there have been some cases where addressed player
changed don't match with any player returned by GetFolderList which
cause a new player to be created and the old one to be destroyed.

8 years agoshared/ad: Fix license to be LGPL
Marie Janssen [Mon, 28 Sep 2015 20:53:58 +0000 (13:53 -0700)]
shared/ad: Fix license to be LGPL

Code in the shared directory should be LGPL.  It was mistakenly
checked in as GPL.

8 years agoRelease 5.35
Marcel Holtmann [Mon, 28 Sep 2015 12:15:23 +0000 (14:15 +0200)]
Release 5.35

8 years agopolicy: Add AutoEnable config option
Szymon Janc [Tue, 22 Sep 2015 21:42:49 +0000 (23:42 +0200)]
policy: Add AutoEnable config option

This option is used to configure policy for auto enabling adapters when
found. This includes adapters found on start as well as adapters that
are plugged in later on.

Some distributions use legacy "hciconfig hci0 up" in boot-scripts to
automatically enable controllers on start. But that is causing SMP
kernel code to not being properly initialized.

This patch allows distributions to automatically enable adapters in
race free manner even if no agent is provided eg. in login screen.

8 years agobuild: Update library version
Marcel Holtmann [Mon, 28 Sep 2015 11:22:50 +0000 (13:22 +0200)]
build: Update library version

8 years agolib: Update company identifiers
Marcel Holtmann [Sat, 26 Sep 2015 01:26:35 +0000 (03:26 +0200)]
lib: Update company identifiers

8 years agoshared/gatt-helpers: Fix reporting discovery failure
Szymon Janc [Tue, 22 Sep 2015 18:09:10 +0000 (20:09 +0200)]
shared/gatt-helpers: Fix reporting discovery failure

If sending ATT request failed discovery should be reported as failed.
Due to missing goto success was overwritten with true value.
This regression was introduced in db24bf09d66325a.

8 years agoaudio/avrcp: Remove not needed null check in
Szymon Janc [Tue, 22 Sep 2015 18:56:52 +0000 (20:56 +0200)]
audio/avrcp: Remove not needed null check in

Browsing handlers are always getting valid pdu pointer so there is no
need to double check that. Also pdu pointer is already dereferenced
before calling handler.

8 years agocore/gatt: Fix assigning false instead of 0
Luiz Augusto von Dentz [Mon, 21 Sep 2015 13:33:36 +0000 (16:33 +0300)]
core/gatt: Fix assigning false instead of 0

write_id type is unsigned int not boolean.

8 years agogdbus: Remove unnecessary empty line
Johan Hedberg [Sat, 19 Sep 2015 16:04:58 +0000 (19:04 +0300)]
gdbus: Remove unnecessary empty line

8 years agocore/gatt-client: fix losing notifications
Jakub Pawlowski [Fri, 18 Sep 2015 08:35:57 +0000 (01:35 -0700)]
core/gatt-client: fix losing notifications

When notifications are quickly send to BlueZ, it tries to signal that
through dbus using g_dbus_emit_property_changed, which would merge all
changes and schedule sending property changed in g_iddle_add.

If the stream of notifications from device is fast enough, there might be
no iddle moment to send properties changed before next notification
arives, which would result in notifications being lost.

This patch fixes that by using method that sends properties changed
immediately, without waiting for iddle moment.

8 years agogdbus: add method for immediate property update
Jakub Pawlowski [Fri, 18 Sep 2015 08:35:56 +0000 (01:35 -0700)]
gdbus: add method for immediate property update

g_dbus_emit_property_changed doesn't send dbus signal immediately. Instead
it stores changed properties, and schedule signal to be send at
g_iddle_add. Additionally, if this method is called few times for some
property, only last value will be sent in property changed signal.

If remote device sends lots of notifications, they're all scheduled to be
notified using this method. This might result in some notifications being
lost.

This patch adds new method, that can immediately send property changed
signal, instead of sheduling it for nearest iddle moment.

8 years agocore/gatt-client: Fix WriteValue always failing after first request
Luiz Augusto von Dentz [Fri, 18 Sep 2015 08:50:14 +0000 (11:50 +0300)]
core/gatt-client: Fix WriteValue always failing after first request

WriteValue may use write without response proceduce in case it is
supported but since that don't have any response write_id is left set
after first request preventing blocking any new request.

8 years agocore/adapter: probe profiles after loading ltks
Jakub Pawlowski [Wed, 16 Sep 2015 20:33:12 +0000 (13:33 -0700)]
core/adapter: probe profiles after loading ltks

When bluetoothd starts, it loads devices from storage.

During this process, it loads general info. That includes loading UUIDS,
and letting plugins decide whether they're interested in this device. Then
load_irks call is made to load identity resolving keys into kernel.

If during this process plugin decides it's interested in given device,
they might register device for auto connecting by calling
btd_device_add_attio_callback. This update kernel auto connect list.
update_white_list inside "net/bluetooth/hci_request.c" is called. It uses
hci_find_irk_by_addr to decide whether kernel know irk for given address
and shall not use whitelist. However irks were not loaded yet - they're
loaded by bluetoothd after all devices were initialized (and possibly
added to autoconnect).

Because of that, device public address is added to whitelist (instead of
resolvable private address), and whitelist is used. Even worse, after call
to load_irks, or after manually calling connect, device is still
improperly added to whitelist and will be unable to connect (timeout will
happen).

To fix that bluetoothd must call load_irks before letting plugins enable
autoconnect.

8 years agotools/mgmt-tester: Add Device Found test with invalid field
Szymon Janc [Wed, 16 Sep 2015 18:07:23 +0000 (20:07 +0200)]
tools/mgmt-tester: Add Device Found test with invalid field

This test verify if kernel correctly terminates EIR when invalid
advertising data (field length too big) was received from
remote device.

8 years agoshared/gatt-client: enable notifications right after connecting
Jakub Pawlowski [Tue, 15 Sep 2015 20:25:19 +0000 (13:25 -0700)]
shared/gatt-client: enable notifications right after connecting

Right now, if you re-connect to device that was previously registered
in DBus, you can read and write it's characteristic without any error.
Trying to register for notifications would however fail. This patch
fixes that by making sure you can register for notifications before
gatt_client is ready. It also re-register exising clients right after
connection, not when gatt_client is ready.

8 years agocore/device: Store services when they change or after pairing.
Jakub Pawlowski [Tue, 15 Sep 2015 19:58:37 +0000 (12:58 -0700)]
core/device: Store services when they change or after pairing.

Service caching works only for paired devices. Right now caching is
triggered only right after discovery finishes. That means that if already
paired device sends service changed notofication, cache won't be updated.
Also if you connect to new device, and then pair during this connection,
your services won't be cached until reconnect. This will require full
service discovery which is slow.
This patch fixes that by trying to cache services every time services
changed, and right after successful pairing.

8 years agoaudio/transport: Fix emitting volume changed too soon
Luiz Augusto von Dentz [Mon, 14 Sep 2015 14:52:02 +0000 (17:52 +0300)]
audio/transport: Fix emitting volume changed too soon

The volume should start at maximum (127) but at that point there is no
reason to notify the remote since there is no stream ongoing so no
changes can be applied.

8 years agoaudio/transport: Fix not emitting Volume changes
Luiz Augusto von Dentz [Mon, 14 Sep 2015 13:50:19 +0000 (16:50 +0300)]
audio/transport: Fix not emitting Volume changes

If Volume is changed locally the change should be propagated using
PropertiesChanged.

8 years agoaudio/avrcp: Enable volume notifications
Luiz Augusto von Dentz [Fri, 11 Sep 2015 16:43:22 +0000 (19:43 +0300)]
audio/avrcp: Enable volume notifications

When acting as a TG volume changes should be notified using
RegisterNotification not SetAbsoluteVolume as the later is a CT
operation.

8 years agoaudio/avrcp: Fix rejecting SetAbsoluteVolume without a player
Luiz Augusto von Dentz [Fri, 11 Sep 2015 14:17:02 +0000 (17:17 +0300)]
audio/avrcp: Fix rejecting SetAbsoluteVolume without a player

A player is not necessary in order for SetAbsoluteVolume to work.

8 years agoaudio/avrcp: Fix missing event for volume control
Luiz Augusto von Dentz [Fri, 11 Sep 2015 12:54:59 +0000 (15:54 +0300)]
audio/avrcp: Fix missing event for volume control

CT and TG are always relative to client and server role, so although TG is
associated with a player and CT with a remote controller in case of volume
control the CT is in fact the player and the TG the remote controller,
because of that PTS will not register any TG record when testing this thus
controller_init will not register the necessary events.

8 years agocore: Fix removing connected devices after discovery
Johan Hedberg [Tue, 15 Sep 2015 07:17:05 +0000 (10:17 +0300)]
core: Fix removing connected devices after discovery

In case a temporary device is connected when the list of discovered
devices is to be cleaned up we should not go ahead and remove the
device. The disconnection handling code will anyway correctly take
care of removing temporary devices.

8 years agoobexd: Fix not destroying session if owner disconnects
Luiz Augusto von Dentz [Thu, 10 Sep 2015 14:56:25 +0000 (17:56 +0300)]
obexd: Fix not destroying session if owner disconnects

If the owner disconnects the session should be destroyed even if the
connection is pending:

obexd/client/session.c:owner_disconnected()
obexd/client/session.c:obc_session_shutdown() 0x822abb8
obexd/client/session.c:obc_session_ref() 0x822abb8: ref=3
obexd/client/session.c:obc_session_unref() 0x822abb8: ref=2
obexd/client/bluetooth.c:transport_connect() port 19
obexd/client/bluetooth.c:transport_callback()
obexd/client/session.c:transport_func()
obexd/client/bluetooth.c:bluetooth_getpacketopt()
obexd/client/pbap.c:pbap_probe() /org/bluez/obex/client/session1
obexd/client/session.c:obc_session_ref() 0x822abb8: ref=3
obexd/client/session.c:obc_session_register() Session(0x822abb8) registered /org/bluez/obex/client/session1
obexd/client/session.c:obc_session_unref() 0x822abb8: ref=2

To fix this the code now checks if the connect callback is pending, in
that case destroy the callback releasing the reference it carrying.

8 years agotools/btattach: Fix leak of bt_hci object
Johan Hedberg [Mon, 14 Sep 2015 07:04:13 +0000 (10:04 +0300)]
tools/btattach: Fix leak of bt_hci object

8 years agocore/device: Only reload database if empty
Luiz Augusto von Dentz [Tue, 8 Sep 2015 12:16:43 +0000 (15:16 +0300)]
core/device: Only reload database if empty

There is no need to reload the database once it has been populated.

8 years agocore/gatt: Fix not able to read/write on reconnections
Luiz Augusto von Dentz [Tue, 8 Sep 2015 11:38:22 +0000 (14:38 +0300)]
core/gatt: Fix not able to read/write on reconnections

Upon reconnecting the attributes may already be available from cache
which mean the client would be able to issue commands while discovery
is not complete thus btd_gatt_client_ready was not called yet.

To fix now btd_gatt_client_ready is split into btd_gatt_client_connected
which is called whenever connected leaving btd_gatt_client_ready to only
deal with exporting services found during the discovery.

8 years agoshared/gatt-client: Fix not freeing notify data
Luiz Augusto von Dentz [Tue, 8 Sep 2015 11:09:39 +0000 (14:09 +0300)]
shared/gatt-client: Fix not freeing notify data

notify_data_write_ccc takes another reference in case it succeed so
the original reference should be dropped to cause the data to be freed
once notify_data_write_ccc completes.

8 years agohog: handle HoG init failures correctly
Petri Gynther [Fri, 4 Sep 2015 18:30:00 +0000 (11:30 -0700)]
hog: handle HoG init failures correctly

When attio_connected_cb() is called for a HoG device, BlueZ should
be in one of the two states:

1) hogdev->uhid_created == FALSE && hogdev->reports == NULL
   * initial connection to HoG device, or first reconnect after
     BlueZ has been restarted
   * BlueZ needs to discover all HoG device characteristics
     (including report map) and create uHID device for HID input

2) hogdev->uhid_created == TRUE && hogdev->reports != NULL
   * second or subsequent reconnect
   * all HoG device characteristics (including report map) have
     been successfully discovered previously, and uHID device
     has been created

However, it is possible that the connection between BlueZ and
HoG device is abruptly terminated amid HoG device characteristics
discovery. Or, HoG report map discovery might intermittently fail.
This can leave BlueZ in inconsistent state such that it knows about
some of the characteristics, but the report map was never received
and uHID device not created, i.e.:
hogdev->uhid_created == FALSE && hogdev->reports != NULL

attio_connected_cb() needs to detect this condition, clean up
hogdev->reports, and re-discover HoG device characteristics.

8 years agohog: add more debugging to HoG device init
Petri Gynther [Fri, 4 Sep 2015 18:29:59 +0000 (11:29 -0700)]
hog: add more debugging to HoG device init

Add more debugging to HoG device init, so that it is easier to see
whether the HoG device init completes successfully.

8 years agosrc/device: gatt database persistence
Jakub Pawlowski [Sat, 5 Sep 2015 00:45:41 +0000 (17:45 -0700)]
src/device: gatt database persistence

This patch adds whole gatt database persistence for paired LE devices.

Storing whole database can have big impact on reconnection time for paired
devices, because full discovery can take up to 10 seconds.

Sample how stored database looks in cache file:

[Attributes]
0001=2800:0005:1801
0002=2803:0003:20:2a05
0014=2800:001c:1800
0015=2803:0016:02:2a00
0017=2803:0018:02:2a01
0019=2803:001a:02:2aa6
0028=2800:ffff:0000180d-0000-1000-8000-00805f9b34fb
0029=2803:002a:10:00002a37-0000-1000-8000-00805f9b34fb
002b=2803:002c:02:00002a38-0000-1000-8000-00805f9b34fb
002d=2803:002e:08:00002a39-0000-1000-8000-00805f9b34fb

8 years agodoc/settings-storage: describe gatt attributes storage format
Jakub Pawlowski [Sat, 5 Sep 2015 00:45:40 +0000 (17:45 -0700)]
doc/settings-storage: describe gatt attributes storage format

8 years agolib/uuid: Fix bt_uuid_strcmp
Luiz Augusto von Dentz [Fri, 4 Sep 2015 13:35:46 +0000 (16:35 +0300)]
lib/uuid: Fix bt_uuid_strcmp

bt_uuid_strcmp shall first convert the strings to bt_uuid_t using
bt_string_to_uuid since bt_uuid_to_string can produce different formats
depending on the type.

8 years agocore/gatt: Fix not exporting new services
Luiz Augusto von Dentz [Fri, 4 Sep 2015 08:39:02 +0000 (11:39 +0300)]
core/gatt: Fix not exporting new services

Ever since cache validation was introduced the services are no longer
cleared on disconnect so checking for queue empty is not valid anymore.

8 years agoRelease 5.34
Marcel Holtmann [Fri, 4 Sep 2015 01:16:14 +0000 (03:16 +0200)]
Release 5.34

8 years agobuild: Update library version
Marcel Holtmann [Fri, 4 Sep 2015 00:56:25 +0000 (02:56 +0200)]
build: Update library version

8 years agomonitor: Update vendor defined 16-bit UUID entries
Marcel Holtmann [Fri, 4 Sep 2015 00:50:27 +0000 (02:50 +0200)]
monitor: Update vendor defined 16-bit UUID entries

8 years agolib: Update company identifiers
Marcel Holtmann [Fri, 4 Sep 2015 00:45:52 +0000 (02:45 +0200)]
lib: Update company identifiers

8 years agobuild: Move valgrind.supp into tools directory
Marcel Holtmann [Fri, 4 Sep 2015 00:27:26 +0000 (02:27 +0200)]
build: Move valgrind.supp into tools directory

8 years agotest: Add test-gatt-profile
Luiz Augusto von Dentz [Thu, 3 Sep 2015 09:54:26 +0000 (12:54 +0300)]
test: Add test-gatt-profile

test-gatt-profile can be used to register a GATT based profile using
GattManager1 interface.

8 years agocore/gatt: Cleanup service probe
Luiz Augusto von Dentz [Wed, 2 Sep 2015 12:07:54 +0000 (15:07 +0300)]
core/gatt: Cleanup service probe

This cleanup code related to service probe making it use a single
function, because of that now all driver must implement device_probe in
order for the service probe to work properly.

In addition to that a new flag called external was introduced to
btd_profile to be possible to distinguish whether it is a internal
plugin or external client, this was needed in order to decide if an
attribute should be claimed which whould prevent it to be exported over
D-Bus.

8 years agoaudio/avrcp: Assing ids when registering a player
Luiz Augusto von Dentz [Wed, 26 Aug 2015 17:47:53 +0000 (20:47 +0300)]
audio/avrcp: Assing ids when registering a player

This gives the local player an id so when respoding to GetFolderItem they
are distinguishable.

8 years agoaudio/avrcp: Add GetFolderItems support
Bharat Panda [Tue, 1 Sep 2015 12:27:27 +0000 (17:57 +0530)]
audio/avrcp: Add GetFolderItems support

Support added to handle Get Folder Items browsing PDU
for media player scope in TG role.

e.g.
      AVCTP Browsing: Response: type 0x00 label 0 PID 0x110e
        AVRCP: GetFolderItems: len 0x0030
          Status: 0x04 (Success)
          UIDCounter: 0x0000 (0)
          NumOfItems: 0x0001 (1)
          Item: 0x01 (Media Player)
          Length: 0x0028 (40)
          PlayerID: 0x0000 (0)
          PlayerType: 0x0001 (Audio)
          PlayerSubType: 0x00000001 (Audio Book)
          PlayStatus: 0x01 (PLAYING)
          Features: 0x0000000000000007FFF0007000000000
          CharsetID: 0x006a (UTF-8)
          NameLength: 0x000c (12)
          Name: SimplePlayer

8 years agocore/gatt: Fix not setting auto connect flag
Luiz Augusto von Dentz [Tue, 1 Sep 2015 12:13:00 +0000 (15:13 +0300)]
core/gatt: Fix not setting auto connect flag

Profiles registered via org.bluez.GattManager1.RegisterProfile shall
properly register a driver and cause the device to be marked to auto
connect if the device supports the UUID given.

8 years agoshared/att: Make crypto really optional
Luiz Augusto von Dentz [Mon, 31 Aug 2015 13:18:01 +0000 (16:18 +0300)]
shared/att: Make crypto really optional

If bt_crypt_new fails or ext_signed should disable any signing operation
but currently only incoming operations were being ignored and only if
ext_signed is set which ignores the fact that bt_crypt_new can still
fail if the necessary kernel modules are not available.

8 years agoTODO: Add item for agent queueing
Luiz Augusto von Dentz [Mon, 31 Aug 2015 13:04:08 +0000 (16:04 +0300)]
TODO: Add item for agent queueing

8 years agoaudio/avrcp: Fix not listing all players
Luiz Augusto von Dentz [Mon, 31 Aug 2015 12:02:37 +0000 (15:02 +0300)]
audio/avrcp: Fix not listing all players

To list the available player GetFolderItems with scope 0x00 is used but
the code currently don't set the range which means only the first player
is returned.

8 years agomain.conf: Remove %h and %d from example Name
Jonas Holmberg [Wed, 2 Sep 2015 10:07:44 +0000 (12:07 +0200)]
main.conf: Remove %h and %d from example Name

%h and %d are no longer supported.

8 years agoandroid/handsfree: Fix missing HFP WBS callback
Will Wang [Fri, 28 Aug 2015 10:40:30 +0000 (18:40 +0800)]
android/handsfree: Fix missing HFP WBS callback

8 years agoandroid/hal-handsfree: Fix missing HFP WBS callback
Will Wang [Fri, 28 Aug 2015 10:40:29 +0000 (18:40 +0800)]
android/hal-handsfree: Fix missing HFP WBS callback

8 years agoaudio/avrcp: Add player name support
Bharat Panda [Fri, 28 Aug 2015 14:32:31 +0000 (20:02 +0530)]
audio/avrcp: Add player name support

Add support to player name mapping it to Identity property from MPRIS.

8 years agoemulator: Update LE supported commands
Mariusz Skamra [Thu, 27 Aug 2015 15:54:50 +0000 (17:54 +0200)]
emulator: Update LE supported commands

8 years agoaudio/avrcp: Fix sending wrong player id and uid counter
Luiz Augusto von Dentz [Fri, 28 Aug 2015 10:45:49 +0000 (13:45 +0300)]
audio/avrcp: Fix sending wrong player id and uid counter

memset only takes the first byte so it obviously cannot be used as
memcpy.

8 years agoaudio/media - Fix crash at deferencing NULL pointer
Hsin-Yu Chao [Wed, 26 Aug 2015 10:05:15 +0000 (18:05 +0800)]
audio/media - Fix crash at deferencing NULL pointer

The boolean pointer passed in to config_cb could be NULL
in media_endpoint_cancel(). In that case we should not
derefence it but pass FALSE instead to indicate error.

Below is the core dump to demonstrate the crash:

config_cb (endpoint=0xb814ff40, ret=0x0, size=-1,
    user_data=0xb8157758) at profiles/audio/media.c:537
0xb6eb7ba4 in media_endpoint_cancel (request=0xb815b4d0)
    at profiles/audio/media.c:141
0xb6eb7c98 in media_endpoint_cancel_all (endpoint=0xb814ff40)
    at profiles/audio/media.c:149
clear_endpoint (endpoint=endpoint@entry=0xb814ff40)
    at profiles/audio/media.c:250
0xb6eb7e74 in endpoint_reply (call=<optimized out>, user_data=0xb815b4d0)
    at profiles/audio/media.c:277
0xb6d50336 in ?? () from /usr/lib/libdbus-1.so.3

8 years agoaudio/avrcp: Fix memory leak
Luiz Augusto von Dentz [Thu, 27 Aug 2015 14:45:27 +0000 (17:45 +0300)]
audio/avrcp: Fix memory leak

This frees settings list after used otherwise it leaks as follow:

48 (24 direct, 24 indirect) bytes in 1 blocks are definitely lost in loss record 152 of 239
   at 0x4C28C50: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x4E84679: g_malloc (in /usr/lib64/libglib-2.0.so.0.4400.1)
   by 0x4E9BCD2: g_slice_alloc (in /usr/lib64/libglib-2.0.so.0.4400.1)
   by 0x4E7A6E5: g_list_prepend (in /usr/lib64/libglib-2.0.so.0.4400.1)
   by 0x4E6E44B: g_hash_table_get_keys (in /usr/lib64/libglib-2.0.so.0.4400.1)
   by 0x426D5A: list_settings (media.c:1003)
   by 0x4336B4: player_list_settings (avrcp.c:1390)
   by 0x4336B4: avrcp_handle_register_notification (avrcp.c:1514)
   by 0x436711: handle_vendordep_pdu (avrcp.c:1827)
   by 0x42EB6F: session_cb (avctp.c:1025)
   by 0x4E7EA89: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.4400.1)
   by 0x4E7EE1F: ??? (in /usr/lib64/libglib-2.0.so.0.4400.1)
   by 0x4E7F141: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.4400.1)

8 years agoaudio/avrcp: Bump TG to version 1.5
Luiz Augusto von Dentz [Wed, 26 Aug 2015 14:07:56 +0000 (17:07 +0300)]
audio/avrcp: Bump TG to version 1.5

1.4 is deprecated and 1.5 should be used instead.

8 years agoaudio/avrcp: Fix crash on RegisterNotification
Luiz Augusto von Dentz [Thu, 27 Aug 2015 10:43:57 +0000 (13:43 +0300)]
audio/avrcp: Fix crash on RegisterNotification

When registering AVRCP_EVENT_ADDRESSED_PLAYER_CHANGED there may not be
any player available causing a crash.

8 years agoaudio/avrcp: Fix invalid read
Luiz Augusto von Dentz [Thu, 27 Aug 2015 10:23:54 +0000 (13:23 +0300)]
audio/avrcp: Fix invalid read

Player pointer cannot be used after being freed.

8 years agoandroid/hal-ipc-api: Fix missing HFP WBS callback
Will Wang [Thu, 27 Aug 2015 12:02:00 +0000 (20:02 +0800)]
android/hal-ipc-api: Fix missing HFP WBS callback

Add definition of HFP WBS Command notification

8 years agodoc/pts: Update OPP PTS test results
Gowtham Anandha Babu [Wed, 26 Aug 2015 09:59:54 +0000 (15:29 +0530)]
doc/pts: Update OPP PTS test results

PTS issues got resolved after updating the ETS file attached in
https://www.bluetooth.org/pts/issues/view_issue.cfm?id=13842,
which will be updated in next PTS release.

8 years agoshared/tester: Add valgrind support
Luiz Augusto von Dentz [Fri, 21 Aug 2015 13:42:11 +0000 (16:42 +0300)]
shared/tester: Add valgrind support

This add a call to VALGRIND_DO_ADDED_LEAK_CHECK at the end of each test.

8 years agobuild: Add support for running make check with valgrind
Luiz Augusto von Dentz [Fri, 21 Aug 2015 13:40:48 +0000 (16:40 +0300)]
build: Add support for running make check with valgrind

This check if valgrind tool is available adding it to be run with make
check.

8 years agounit/test-gdbus-client: Fix memory leak
Luiz Augusto von Dentz [Fri, 21 Aug 2015 13:27:17 +0000 (16:27 +0300)]
unit/test-gdbus-client: Fix memory leak

The following memory leak is causes if not all interfaces are freed
once closing the connecting:

7,738 (232 direct, 7,506 indirect) bytes in 1 blocks are definitely lost in loss record 302 of 302
       at 0x4C2A9C7: calloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
       by 0x519517F: ??? (in /usr/lib64/libdbus-1.so.3.8.13)
       by 0x519EF8E: ??? (in /usr/lib64/libdbus-1.so.3.8.13)
       by 0x519F462: ??? (in /usr/lib64/libdbus-1.so.3.8.13)
       by 0x5193419: ??? (in /usr/lib64/libdbus-1.so.3.8.13)
       by 0x517E6AE: ??? (in /usr/lib64/libdbus-1.so.3.8.13)
       by 0x517A06B: ??? (in /usr/lib64/libdbus-1.so.3.8.13)
       by 0x4076B9: g_dbus_setup_private (mainloop.c:314)
       by 0x404B8C: client_force_disconnect (test-gdbus-client.c:882)
       by 0x410B52: run_callback (tester.c:417)
       by 0x4E7EA89: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.4400.1)
       by 0x4E7EE1F: ??? (in /usr/lib64/libglib-2.0.so.0.4400.1)

8 years agolib: Update company identifiers
Marcel Holtmann [Wed, 26 Aug 2015 07:19:16 +0000 (09:19 +0200)]
lib: Update company identifiers

8 years agomonitor: Add vendor defined 16-bit UUID entries
Marcel Holtmann [Wed, 26 Aug 2015 07:18:05 +0000 (09:18 +0200)]
monitor: Add vendor defined 16-bit UUID entries

8 years agomonitor/avctp: Fix GetFolderItems field values
Bharat Panda [Thu, 20 Aug 2015 09:02:05 +0000 (14:32 +0530)]
monitor/avctp: Fix GetFolderItems field values

Replaced field names for GetFolderItems response with
correct names, values and fix allignments.

      AVCTP Browsing: Response: type 0x00 label 0 PID 0x110e
        AVRCP: GetFolderItems: len 0x0030
          Status: 0x04 (Success)
          UIDCounter: 0x0000 (0)
          NumOfItems: 0x0001 (1)
          Item: 0x01 (Media Player)
          Length: 0x0028 (40)
          PlayerID: 0x0000 (0)
          PlayerType: 0x0001 (Audio)
          PlayerSubType: 0x00000001 (Audio Book)
          PlayStatus: 0x01 (PLAYING)
          Features: 0x0000000000b701ef0200000000000000
          CharsetID: 0x006a (UTF-8)
          NameLength: 0x000c (12)
          Name: SimplePlayer

8 years agoaudio/avrcp: Add Set Addressed Player support
Bharat Panda [Fri, 14 Aug 2015 13:36:36 +0000 (19:06 +0530)]
audio/avrcp: Add Set Addressed Player support

Support added to handle Set Addressed Player PDU in TG role.
Send EVENT_ADDRESSED_PLAYER_CHANGED on SetAddressedPlayer
SUCCESS and follow procedure to reject all player specific events
currently registered with the player.

      Channel: 64 len 15 [PSM 23 mode 0] {chan 0}
      AVCTP Control: Command: type 0x00 label 0 PID 0x110e
        AV/C: Control: address 0x48 opcode 0x00
          Subunit: Panel
          Opcode: Vendor Dependent
          Company ID: 0x001958
          AVRCP: SetAddressedPlayer pt Single len 0x0002
            PlayerID: 0x0000 (0)

      Channel: 64 len 15 [PSM 23 mode 0] {chan 0}
      AVCTP Control: Response: type 0x00 label 0 PID 0x110e
        AV/C: Accepted: address 0x48 opcode 0x00
          Subunit: Panel
          Opcode: Vendor Dependent
          Company ID: 0x001958
          AVRCP: SetAddressedPlayer pt Single len 0x0002
            Status: 0x04 (Success)

      Channel: 64 len 18 [PSM 23 mode 0] {chan 0}
      AVCTP Control: Response: type 0x00 label 0 PID 0x110e
        AV/C: Changed: address 0x48 opcode 0x00
          Subunit: Panel
          Opcode: Vendor Dependent
          Company ID: 0x001958
          AVRCP: RegisterNotification pt Single len 0x0005
            EventID: 0x0b (EVENT_ADDRESSED_PLAYER_CHANGED)
            PlayerID: 0x0000 (0)
            UIDCounter: 0x0000 (0)

8 years agoaudio: Fix service state
Luiz Augusto von Dentz [Fri, 14 Aug 2015 15:43:44 +0000 (18:43 +0300)]
audio: Fix service state

When profile .disconnect is called the state of the service is already
set to disconnecting this is make no sense to call
btd_service_connect_complete as it will do nothing and the state will
never be updated to disconnected as it should.

8 years agoaudio: Fix not resetting connect_id
Luiz Augusto von Dentz [Fri, 14 Aug 2015 08:29:27 +0000 (11:29 +0300)]
audio: Fix not resetting connect_id

Ever since discovery can be canceled connect_id is now set while
discovering so it needs to be reset on the callback otherwise it will
cause .connect to always return -EBUSY until .disconnect is called.

8 years agoemulator: Fix parameter order in le_conn_update()
Johan Hedberg [Fri, 14 Aug 2015 05:36:30 +0000 (08:36 +0300)]
emulator: Fix parameter order in le_conn_update()

The values are passed by the only caller in min, max order, which
makes sense since that's how they are over HCI as well. Update the
function to match this.

8 years agogatt-database: Return meaningful ecodes for ccc write
Gowtham Anandha Babu [Tue, 11 Aug 2015 08:38:45 +0000 (14:08 +0530)]
gatt-database: Return meaningful ecodes for ccc write

Removed generic ATT protocol error codes and added
Common Profile and Service Error Codes.

8 years agotools/l2test: Fix resource leaks
Luiz Augusto von Dentz [Wed, 12 Aug 2015 15:05:57 +0000 (18:05 +0300)]
tools/l2test: Fix resource leaks

8 years agotools/hcidump: Fix resource leaks
Luiz Augusto von Dentz [Wed, 12 Aug 2015 15:00:17 +0000 (18:00 +0300)]
tools/hcidump: Fix resource leaks