OSDN Git Service

android-x86/external-bluetooth-bluez.git
12 years agosimple-agent: add DisplayPinCode
Scott James Remnant [Thu, 5 Apr 2012 22:29:40 +0000 (15:29 -0700)]
simple-agent: add DisplayPinCode

12 years agodoc: document DisplayPinCode
Scott James Remnant [Thu, 5 Apr 2012 22:29:39 +0000 (15:29 -0700)]
doc: document DisplayPinCode

12 years agoDisplay PIN generated by plugin
Scott James Remnant [Thu, 5 Apr 2012 22:29:38 +0000 (15:29 -0700)]
Display PIN generated by plugin

If a plugin pincode callback sets the display parameter to TRUE, send
the generated PIN to the agent for display using the new DisplayPinCode
agent method, including its fallback to RequestPinCode.

12 years agoAdd display parameter to plugin pincode callback
Scott James Remnant [Thu, 5 Apr 2012 22:29:37 +0000 (15:29 -0700)]
Add display parameter to plugin pincode callback

Pass a display parameter to the plugin pincode callback, a plugin
may set this to TRUE to indicate the PIN it generates should be
displayed on the screen for entry into the remote device.

12 years agoAdd AUTH_TYPE_NOTIFY_PASSKEY to device_request_authentication
Scott James Remnant [Thu, 5 Apr 2012 22:29:36 +0000 (15:29 -0700)]
Add AUTH_TYPE_NOTIFY_PASSKEY to device_request_authentication

This new authentication type accepts a pincode and calls the
DisplayPinCode agent method, a fallback is provided so that if the
method is not implemented the older RequestPinCode method is used
instead.

Due to this fallback, the agent_pincode_cb is used and calling
functions should send the pincode passed to the callback to the
adapter, which may differ from that generated.

12 years agoagent: add DisplayPinCode method
Scott James Remnant [Thu, 5 Apr 2012 22:29:35 +0000 (15:29 -0700)]
agent: add DisplayPinCode method

In constrast to DisplayPasskey, this sends a UTF-8 string PIN code
to the agent; also we support a callback for the case where the
Agent doesn't implement this new method so we can fallback.

12 years agoPass passkey by pointer rather than by value
Scott James Remnant [Thu, 5 Apr 2012 22:29:34 +0000 (15:29 -0700)]
Pass passkey by pointer rather than by value

This allows alternate data of a different type to be passed to
device_request_authentication() for other notification types such
as those that require a PIN.

12 years agoRename AUTH_TYPE_NOTIFY to AUTH_TYPE_NOTIFY_PASSKEY
Scott James Remnant [Thu, 5 Apr 2012 22:29:33 +0000 (15:29 -0700)]
Rename AUTH_TYPE_NOTIFY to AUTH_TYPE_NOTIFY_PASSKEY

This makes room for additional notification types to be added.

12 years agofakehid: Remove define not referenced
Claudio Takahasi [Thu, 5 Apr 2012 22:54:38 +0000 (19:54 -0300)]
fakehid: Remove define not referenced

12 years agofakehid: Remove unneeded header includes
Claudio Takahasi [Thu, 5 Apr 2012 22:54:37 +0000 (19:54 -0300)]
fakehid: Remove unneeded header includes

12 years agomgmtops: Handle Start Discovery Complete in case of failure
Hemant Gupta [Tue, 10 Apr 2012 10:13:27 +0000 (15:43 +0530)]
mgmtops: Handle Start Discovery Complete in case of failure

This patch adds handling of start discovery complete event in cases
when discovery fails to get started.

12 years agomgmt: update mgmt control channel id
Gustavo Padovan [Thu, 5 Apr 2012 19:22:55 +0000 (16:22 -0300)]
mgmt: update mgmt control channel id

kernel side has updated its control channel id from 1 to 3.

12 years agoDeviceInfo: Fix compilation with old glib
Szymon Janc [Wed, 4 Apr 2012 14:58:22 +0000 (16:58 +0200)]
DeviceInfo: Fix compilation with old glib

Add missing include glib-compat.h to deviceinfo.c. deviceinfo_free
is using g_slist_free_full() which is not available in old glib
resulting in compilation error.

deviceinfo/deviceinfo.c: In function ‘deviceinfo_free’:
deviceinfo/deviceinfo.c:66: error: implicit declaration of function ‘g_slist_free_full’

12 years agoAVRCP: Fix response length for Subunit Info command
Joohi Rastogi [Thu, 5 Apr 2012 05:58:08 +0000 (11:28 +0530)]
AVRCP: Fix response length for Subunit Info command

This affect PTS Test Case TC_TG_ICC_BV_02_I

12 years agoAVRCP: Fix response length for Unit Info command
Joohi Rastogi [Thu, 5 Apr 2012 05:41:09 +0000 (11:11 +0530)]
AVRCP: Fix response length for Unit Info command

This affect PTS Test Case TC_TG_ICC_BV_01_I

12 years agoDeviceInfo: Read PNP ID
Chen Ganir [Wed, 4 Apr 2012 08:28:57 +0000 (11:28 +0300)]
DeviceInfo: Read PNP ID

Read the PNP ID characteristic of the DeviceInfo Service, and
store it inside the btd_device, for use by other profiles.

12 years agoDeviceInfo: Discover Characteristics
Chen Ganir [Wed, 4 Apr 2012 08:28:56 +0000 (11:28 +0300)]
DeviceInfo: Discover Characteristics

Add logic to discover all characteristics and build a
characteristic list.

12 years agoDeviceInfo: Add connection logic
Chen Ganir [Wed, 4 Apr 2012 08:28:55 +0000 (11:28 +0300)]
DeviceInfo: Add connection logic

Add connection logic to the Device Information Plugin. When the
driver is loaded, it will request a connection to the remote device
and release the connection request when destroyed.

12 years agoAdd DeviceInformation GATT Client
Chen Ganir [Wed, 4 Apr 2012 08:28:54 +0000 (11:28 +0300)]
Add DeviceInformation GATT Client

Add the DeviceInformation GATT Client plugin skeleton.

12 years agoFix spelling errors
Rafael Fonseca [Tue, 3 Apr 2012 13:16:22 +0000 (10:16 -0300)]
Fix spelling errors

Fix spelling errors found using the codespell tool
(https://github.com/lucasdemarchi/codespell).

12 years agoAdapter: Fix Discovering state while Powering Off
Hemant Gupta [Tue, 3 Apr 2012 11:53:59 +0000 (17:23 +0530)]
Adapter: Fix Discovering state while Powering Off

This patch fixes the adapter discovering state while powering off.
Without this fix, BlueZ sends incorrect discovering state to upper
layers while switching off.

12 years agoattrib: Fix D-Bus service disconnect watch removal
Anderson Lizardo [Tue, 3 Apr 2012 16:15:00 +0000 (12:15 -0400)]
attrib: Fix D-Bus service disconnect watch removal

watcher_free() will be automatically called when removing the D-Bus
watch (it was set as the destroy callback when adding the watch),
therefore it is only necessary to remove the watch.

12 years agothermometer: Fix D-Bus service disconnect watch removal
Anderson Lizardo [Tue, 3 Apr 2012 16:14:59 +0000 (12:14 -0400)]
thermometer: Fix D-Bus service disconnect watch removal

destroy_watcher() will be automatically called when removing the D-Bus
watch (it was set as the destroy callback when adding the watch),
therefore it is only necessary to remove the watch.

12 years agogdbus: Use destroy callback for service watch
Anderson Lizardo [Tue, 3 Apr 2012 16:14:58 +0000 (12:14 -0400)]
gdbus: Use destroy callback for service watch

Even though service watches accepted a "destroy" callback, they were
being ignored. This fix properly pass them along so they are called when
the watch is removed.

12 years agoattrib: Fix "make distcheck" build
Anderson Lizardo [Tue, 3 Apr 2012 16:01:31 +0000 (12:01 -0400)]
attrib: Fix "make distcheck" build

Any new header files (att-database.h in this case) need to be added to
Makefile.am.

Fixes this "make distcheck" error:

  CC     attrib/bluetoothd-gatt-service.o
../attrib/gatt-service.c:35:26: fatal error: att-database.h: No such
file or directory
compilation terminated.
make[2]: *** [attrib/bluetoothd-gatt-service.o] Error 1
make[1]: *** [all] Error 2
make: *** [distcheck] Error 1

12 years agoupdate Gustavo's email address
Gustavo Padovan [Wed, 4 Apr 2012 03:44:25 +0000 (00:44 -0300)]
update Gustavo's email address

12 years agogattrib: Protect GAttrib when there is a pending write
Claudio Takahasi [Mon, 2 Apr 2012 13:56:36 +0000 (09:56 -0400)]
gattrib: Protect GAttrib when there is a pending write

12 years agoattrib: Fix missing Discovery reply when disconnected
Claudio Takahasi [Mon, 2 Apr 2012 13:56:35 +0000 (09:56 -0400)]
attrib: Fix missing Discovery reply when disconnected

This patch fixes missing reply for DiscoverCharacteristics method on
Generic Attribute. If link is disconnected reply message is not sent.

12 years agoproximity: reporter: implement D-Bus API
Arik Nemtsov [Mon, 2 Apr 2012 19:12:42 +0000 (22:12 +0300)]
proximity: reporter: implement D-Bus API

Use a device driver to track all GATT supporting devices and register
a D-Bus interface per remote device.

Implement the "GetProperties" method of the D-Bus interface by querying
the alert level of the remote device in the link-loss and
immediate-alert proximity profiles. The default alert level values for
non-connected devices are "none".

12 years agoproximity: immediate alert: implement immediate alert server
Arik Nemtsov [Mon, 2 Apr 2012 19:12:41 +0000 (22:12 +0300)]
proximity: immediate alert: implement immediate alert server

The profile is implemented in immalert.[ch]. A GATT service is
registered with a write callback on the immediate alert level attribute.
This attribute is write-only and is maintained per remote device.

When a remote device write a raises or lowers the alert level,
an appropriate PropertyChanged signal is emitted. When the alert level
of a device is non-zero, a callback is registered on its disconnection.
When the callback is called, the alert level of the device is reset to
zero and an appropriate signal is emitted.

12 years agoproximity: link loss: implement link loss server
Arik Nemtsov [Mon, 2 Apr 2012 19:12:40 +0000 (22:12 +0300)]
proximity: link loss: implement link loss server

The profile is implemented in linkloss.[ch]. A GATT service is
registered with read/write callbacks on the link-loss alert level
attribute. The alert level is maintained per device. It is returned
on read and updated on write.

When the alert level is non-zero, a callback is registered on the
disconnection of the remote device. If a device with non-zero alert
state is disconnected, an appropriate PropertyChanged signal is emitted
with the alert level previously set by the device. We avoid emitting
a signal when the disconnection was requested by us.

12 years agoproximity: reporter: move definitions to .h and add util function
Arik Nemtsov [Mon, 2 Apr 2012 19:12:39 +0000 (22:12 +0300)]
proximity: reporter: move definitions to .h and add util function

This allows us to re-use these definitions in GATT sub-profiles.

12 years agoproximity: reporter: save global D-Bus connection
Arik Nemtsov [Mon, 2 Apr 2012 19:12:38 +0000 (22:12 +0300)]
proximity: reporter: save global D-Bus connection

This connection will be used by reporter GATT sub-profiles.

12 years agoatt: add remote btd_device to ATT read/write callbacks
Arik Nemtsov [Mon, 2 Apr 2012 19:12:37 +0000 (22:12 +0300)]
att: add remote btd_device to ATT read/write callbacks

This allows us to identify the remote device that made the ATT
read/write.

12 years agoadapter: Fix segfault when icon is uninitialized
Bruna Moreira [Mon, 2 Apr 2012 20:05:22 +0000 (16:05 -0400)]
adapter: Fix segfault when icon is uninitialized

If device type is LE and GAP Appearance characteristic does not exist,
the icon will not be initialized.

12 years agoAVCTP: return not-implemented for unknown passthrough
Lucas De Marchi [Tue, 28 Feb 2012 14:20:17 +0000 (11:20 -0300)]
AVCTP: return not-implemented for unknown passthrough

12 years agoMakefile: Add simple-player and test-nap to EXTRA_DIST
Daniel Wagner [Fri, 30 Mar 2012 12:22:36 +0000 (14:22 +0200)]
Makefile: Add simple-player and test-nap to EXTRA_DIST

Add simple-player and test-nap to the EXTRA_DIST target.

12 years agoeir: Read GAP appearance from advertising data
Bruna Moreira [Tue, 27 Mar 2012 18:06:47 +0000 (14:06 -0400)]
eir: Read GAP appearance from advertising data

This was introduced on Core Specification Supplement (CSS) v1.

12 years agodevice: Appearance characteristic from GAP service
Bruna Moreira [Thu, 29 Mar 2012 14:38:02 +0000 (10:38 -0400)]
device: Appearance characteristic from GAP service

After searching for primary services, the appearance characteristic is
read from GAP service and saved in "appearance" file. Running
GetProperty in device interface, will show the respective icon based in
"appearance" value.

12 years agostorage: Add storage to GAP characteristic
Bruna Moreira [Tue, 27 Mar 2012 13:29:36 +0000 (09:29 -0400)]
storage: Add storage to GAP characteristic

Add functions to read and write remote Appearance characteristic. The values
are saved in "appearance" file.

12 years agodbus-common: Map GAP Appearance characteristic to icon
Bruna Moreira [Tue, 27 Mar 2012 13:29:35 +0000 (09:29 -0400)]
dbus-common: Map GAP Appearance characteristic to icon

Add function appearance_to_icon() to map values from Appearance
Characteristic to icon available.

Note: The Appearance Characteristic is composed of a category (10-bits)
and sub-categories (6-bits). These categories are defined at:
http://developer.bluetooth.org/gatt/characteristics/Pages/
CharacteristicViewer.aspx?u=org.bluetooth.characteristic.gap.appearance.xml

12 years agoattrib: Attempt to remove attio callback on watcher exit
Anderson Lizardo [Tue, 27 Mar 2012 20:43:48 +0000 (16:43 -0400)]
attrib: Attempt to remove attio callback on watcher exit

When registering a watcher, it is attempted to add an attio callback.
Therefore, when the watcher is unregistered or exits, this attio should
be removed if there are no other users.

This is already done when unregistering a watcher, it just missed when
it exits without unregistering.

12 years agoattrib: Fix missing D-Bus message unref on DiscoverCharacteristics
Claudio Takahasi [Tue, 27 Mar 2012 20:43:47 +0000 (16:43 -0400)]
attrib: Fix missing D-Bus message unref on DiscoverCharacteristics

This patch fixes a missing message unref when DiscoverCharacteristics on
Generic Attribute finishes.

12 years agoattrib: Register only new characteristics found
Claudio Takahasi [Tue, 27 Mar 2012 20:43:45 +0000 (16:43 -0400)]
attrib: Register only new characteristics found

This avoids duplicating registration for previously found
characteristics.

12 years agoattrib: Move Characteristic Discovery reply to a new function
Claudio Takahasi [Tue, 27 Mar 2012 20:43:44 +0000 (16:43 -0400)]
attrib: Move Characteristic Discovery reply to a new function

Minor cleanup patch moving the creation of the reply for Discover
All Characteristics call to a new local function in the Generic
Attribute.

12 years agoattrib: Discover Characteristics if already connected
Claudio Takahasi [Tue, 27 Mar 2012 20:43:43 +0000 (16:43 -0400)]
attrib: Discover Characteristics if already connected

On Generic Attribute, Discover All Characteristics of a Service can be
started immediately if already connected, without registering a ATTIO
connection callback.

12 years agoattrib: Centralize ATTIO connection management
Claudio Takahasi [Tue, 27 Mar 2012 20:43:42 +0000 (16:43 -0400)]
attrib: Centralize ATTIO connection management

On Generic Attribute, register only one ATTIO connection callback to
centralize the connection management.

Also make sure the connection reference is properly dropped only if
there is no pending operation.

12 years agoFix common spelling error in code and comments
Szymon Janc [Thu, 29 Mar 2012 14:12:44 +0000 (16:12 +0200)]
Fix common spelling error in code and comments

Correct spelling is "incoming" not "incomming".

12 years agocore: Fix device version in GetProperties
Chen Ganir [Wed, 28 Mar 2012 15:26:44 +0000 (17:26 +0200)]
core: Fix device version in GetProperties

Fix how device version is added to the property dictionary.

12 years agoMove common code to sdp to avoid duplication
Szymon Janc [Wed, 28 Mar 2012 10:03:19 +0000 (12:03 +0200)]
Move common code to sdp to avoid duplication

LanguageBaseAttributeIDList is set from few places and each time static
function was copied and used for that. Move this funtion to sdp code
and use that instead of copying code.

12 years agoBump Device ID service version to 1.3
Szymon Janc [Wed, 28 Mar 2012 10:03:18 +0000 (12:03 +0200)]
Bump Device ID service version to 1.3

Device ID information in EIR are specified in DID 1.3 and this is
supported by BlueZ.

12 years agobtmgmt: Add support for setting Device ID
Szymon Janc [Wed, 28 Mar 2012 10:03:17 +0000 (12:03 +0200)]
btmgmt: Add support for setting Device ID

12 years agomgmtops: Add support for setting Device ID
Szymon Janc [Wed, 28 Mar 2012 10:03:16 +0000 (12:03 +0200)]
mgmtops: Add support for setting Device ID

12 years agoAdd support for setting VID source in DeviceID from config file
Szymon Janc [Wed, 28 Mar 2012 10:03:15 +0000 (12:03 +0200)]
Add support for setting VID source in DeviceID from config file

This allows to set if VID source is Bluetooth SIG or USB. Assigner is
provided as string {bluetooth,usb} and fallback to usb if none is set
in config.

12 years agoSet DeviceID when registering adapter not when sdp server is starting
Szymon Janc [Wed, 28 Mar 2012 10:03:14 +0000 (12:03 +0200)]
Set DeviceID when registering adapter not when sdp server is starting

Adapter ops are registered after sdp server is started. Thus no
adapters were registered yet when setting DID on sdp startup and DID
was never set.

12 years agoParse config DeviceID string on bluetoothd startup
Szymon Janc [Wed, 28 Mar 2012 10:03:13 +0000 (12:03 +0200)]
Parse config DeviceID string on bluetoothd startup

Instead of parsing config DeviceID string on sdp server startup, parse
it in main while reading config file. This allow to store logical DID
values in main_opts (instead of raw config string) and make use of them
in bluetoothd code.

12 years agoinput: fix coding style
João Paulo Rechi Vita [Tue, 27 Mar 2012 21:14:32 +0000 (18:14 -0300)]
input: fix coding style

Fix line going over 80 columns.

12 years agogatttool: Update interactive prompt if connection is lost
Jefferson Delfes [Tue, 27 Mar 2012 13:21:55 +0000 (09:21 -0400)]
gatttool: Update interactive prompt if connection is lost

In interactive mode, when connection is lost, the prompt used to remain
in "connected" state. This patch fixes that case, by always showing the
actual connection state.

12 years agoevent: Store Class of Device after connection
Anderson Lizardo [Tue, 27 Mar 2012 13:06:14 +0000 (09:06 -0400)]
event: Store Class of Device after connection

The Class of Device is usually sent on the EIR returned by the Device
Connected mgmt event. For hciops, the Class of Device is always NULL on
the connection complete event.

The stored Class of Device is used later for Class/Icon device
properties.

12 years agoHDP: Omit MainChannel when first reliable channel is nil
Elvis Pfützenreuter [Tue, 27 Mar 2012 13:03:25 +0000 (10:03 -0300)]
HDP: Omit MainChannel when first reliable channel is nil

Do not add MainChannel to property list when HDP first reliable channel
does not exist. Upon channel destruction, ChannelDeleted signal is already
emitted.

This also fixes a crash where MainChannel was filled with invalid path ""
when first reliable channel did not exist.

12 years agoavdtp: fix audio source init check
Michael Brudevold [Fri, 23 Mar 2012 15:03:47 +0000 (10:03 -0500)]
avdtp: fix audio source init check

12 years agosdp: Fix sdp_get_profile_descs for Mac Os X Lion
Frédéric Dalleau [Mon, 19 Mar 2012 14:04:07 +0000 (15:04 +0100)]
sdp: Fix sdp_get_profile_descs for Mac Os X Lion

Mac OS X 10.7.3 publishes the following SDP record for HFP Gateway.
      record #2
          aid 0x0000 (SrvRecHndl)
             uint 0x10003
          aid 0x0001 (SrvClassIDList)
             < uuid-16 0x111f (Handsfree AG) uuid-16 0x1203 (Audio) >
          aid 0x0004 (ProtocolDescList)
             < < uuid-16 0x0100 (L2CAP) > <
             uuid-16 0x0003 (RFCOMM) uint 0x2 > >
          aid 0x0005 (BrwGrpList)
             < uuid-16 0x1002 (PubBrwsGrp) >
          aid 0x0006 (LangBaseAttrIDList)
             < uint 0x656e uint 0x6a uint 0x100 >
          aid 0x0009 (BTProfileDescList)
             < uuid-16 0x111e (Handsfree) uint 0x105 >
          aid 0x0100 (SrvName)
             str "Hands Free Audio Gateway"
          aid 0x0301 (SuppDataStoresList)
             uint 0x0
          aid 0x0311 (SuppFeatures)
             uint 0x0

BlueZ do not read correctly the version number of the profile.
The patch fixes this.

From my understanding, the SDP profile descriptor is a list. The for
loop in sdp_get_profile_desc iterates that list.  Until now, bluez
expected a collection of either uuid or lists with a uuid and a
version number. This can be represented as follow:
list=(uuid, uuid, (uuid, version))

The patch fixes the situation where the profile descriptor list
contains a uuid AND a version number both on the root level and not
enclosed in a sublist. If the next item after uuid is uint16, then
this is the version number. This can be represented as follow:
list=(uuid, uuid, version, uuid, (uuid, version))

Note that core v4.0 spec. states that the Profile Descriptor
list is a data sequence of profile descriptors. Each profile descriptor
is a data sequence whose first element is a UUID and second element is
a version number. This can be represented as follow:
list=((uuid, version), (uuid, version))

12 years agoGATT: Replace start/end with att_range
Chen Ganir [Mon, 26 Mar 2012 07:35:59 +0000 (09:35 +0200)]
GATT: Replace start/end with att_range

Use att_range struct instead of individual start/end handles in
gatt_primary structure

12 years agoGATT: Rename service and char structs
Chen Ganir [Mon, 26 Mar 2012 07:35:58 +0000 (09:35 +0200)]
GATT: Rename service and char structs

Rename the att_primary to gatt_primary and att_char to gatt_char.
Characteristic and Service do not exist in the ATT spec, only in
GATT.

12 years agoGATT: Profile support for EnableGatt
Chen Ganir [Mon, 19 Mar 2012 14:57:53 +0000 (16:57 +0200)]
GATT: Profile support for EnableGatt

Add support for the EnableGatt for all GATT profiles.

12 years agoGATT: Rename AttributeServer switch
Chen Ganir [Mon, 19 Mar 2012 14:57:52 +0000 (16:57 +0200)]
GATT: Rename AttributeServer switch

Rename the AttributeServer main.conf option to EnableGatt and
change its purpose to enable/disable all GATT related activity.

12 years agoGATT: Remove individual config switches
Chen Ganir [Mon, 19 Mar 2012 14:57:51 +0000 (16:57 +0200)]
GATT: Remove individual config switches

Remove individual GATT plugin configuration switches and add a
new master gatt switch called --enable-gatt to enable/disable all
GATT related plugins at once.

12 years agoFix not marking a reverse SDP discovery as "reverse"
Vinicius Costa Gomes [Tue, 20 Mar 2012 17:49:33 +0000 (14:49 -0300)]
Fix not marking a reverse SDP discovery as "reverse"

Some devices "hide" some of their records while connected to other
devices. Setting a service discovery as reverse makes BlueZ to not
remove the records that are "hidden".

This patch fixes a mistake that reverse parameter was changed to false
when it should be true.

12 years agoRemove leftover code of main_opts operation
Chan-yeol Park [Wed, 22 Feb 2012 14:15:26 +0000 (23:15 +0900)]
Remove leftover code of main_opts operation

12 years agowiimote: Detect Wii Remotes by device name
David Herrmann [Wed, 22 Feb 2012 20:29:51 +0000 (21:29 +0100)]
wiimote: Detect Wii Remotes by device name

We currently detect Wii Remotes by DID information. However, not all Wii
Remotes (especially 3rd party Wii Remotes) provide DID information.
Moreover, they provide no way of identifying them aside from their
device name. Hence, this adds an experimental name-detection for Wii
Remotes.

12 years agoinput: Remove unneeded alias
Claudio Takahasi [Mon, 12 Mar 2012 20:05:27 +0000 (17:05 -0300)]
input: Remove unneeded alias

12 years agoinput: Remove unneeded Bluetooth Address arguments
Claudio Takahasi [Mon, 12 Mar 2012 20:05:26 +0000 (17:05 -0300)]
input: Remove unneeded Bluetooth Address arguments

12 years agoattrib-server: Fix sending "not supported" for indications/notifications
Vinicius Costa Gomes [Wed, 14 Mar 2012 22:07:40 +0000 (19:07 -0300)]
attrib-server: Fix sending "not supported" for indications/notifications

Now that our Attribute Client is able to handle notifications and
indications we don't need to respond that they are not supported.

12 years agoHFP gateway: fix failure on very first GSM connection
Arnaud Mouiche [Thu, 25 Aug 2011 10:09:05 +0000 (12:09 +0200)]
HFP gateway: fix failure on very first GSM connection

This patch fix the very first incoming connection from a GSM device
(playing the gateway role), when 'device->gateway' is NULL (when we
didn't perform a SDP browse request yet)

we add the service with 'btd_device_add_uuid(device->btd_dev,
remote_uuid)' but we provide HFP_HS_UUID as remote_uuid. Consequently,
the HFP headset service is activated instead the gateway service.

12 years agoRevert "core: Add provision for terminating an ATT connection"
Arik Nemtsov [Thu, 8 Mar 2012 13:44:39 +0000 (15:44 +0200)]
Revert "core: Add provision for terminating an ATT connection"

This reverts commit f89a77478af78d41c80ab7605662382b9e4e1c36.

This is not needed and actually introduces a bug. When the "Disconnect"
API of device is called device->attrib is unref-ed via a watch set on
G_IO_HUP. The channel is shutdown when the last reference is removed.

The code introduced here shuts down the channel and prevents the watch
from getting called. This means we leak a reference to device->attrib.
This can cause a number of bad things. For example, if the device is
temporary, it will never be freed, and we won't be able to pair to it
again.

12 years agodevice: don't auto-connect on disc-cb attio callback registration
Arik Nemtsov [Thu, 8 Mar 2012 13:44:38 +0000 (15:44 +0200)]
device: don't auto-connect on disc-cb attio callback registration

If a device is already connected, don't auto-connect if we register
a disconnect-only attio callback. This will obviously fail.

12 years agosdp: Check type of sdp data before dereferencing
Frédéric Dalleau [Mon, 20 Feb 2012 20:57:57 +0000 (21:57 +0100)]
sdp: Check type of sdp data before dereferencing

12 years agoaudio: fix io channel shutdown on error
Mikel Astiz [Tue, 13 Mar 2012 13:19:56 +0000 (14:19 +0100)]
audio: fix io channel shutdown on error

In the unlikely case of service record allocation error, the io channel
should be properly shut down.

12 years agoaudio: fix missing io channel shutdown
Mikel Astiz [Tue, 13 Mar 2012 13:19:55 +0000 (14:19 +0100)]
audio: fix missing io channel shutdown

Channel must be explicitly shut down because otherwise the reference
counter never reaches zero, due to the server installed by bt_io_listen.

12 years agoaudio: fix missing unref in case of error
Mikel Astiz [Tue, 13 Mar 2012 13:19:54 +0000 (14:19 +0100)]
audio: fix missing unref in case of error

audio_adapter_get() increases the reference counter of the adapter, so
it's necessary to decrement it in case of error.

12 years agoavrcp: Add error code for rejected vendor command
Michal Labedzki [Wed, 7 Mar 2012 16:23:14 +0000 (17:23 +0100)]
avrcp: Add error code for rejected vendor command

Fix response for any vendor commands when there are no players
registered. According to the specification responses should be
REJECTED with error code.

"For error response PDU the response parameter is always the
error code independent of the response format defined for
ACCEPTED PDU response for the corresponding PDU command."
(source: section 4.7.9 of AVRCP 1.3 specification)

12 years agoavrcp: Fix response ctype of AbortContinuingResponse
Michal Labedzki [Thu, 1 Mar 2012 14:45:33 +0000 (15:45 +0100)]
avrcp: Fix response ctype of AbortContinuingResponse

Request ctype of "AbortContinuingResponse" is CONTROL, so response
should be ACCEPTED instead of STABLE. This affect PTS Test Case for
TP/RCR/BV-04-C.

12 years agotest-discovery: Fix printing non-ASCII characters
Johan Hedberg [Mon, 12 Mar 2012 12:03:57 +0000 (14:03 +0200)]
test-discovery: Fix printing non-ASCII characters

12 years agomedia: register disconnect watch at transport add
Frédéric Dalleau [Tue, 21 Feb 2012 16:46:50 +0000 (17:46 +0100)]
media: register disconnect watch at transport add

disconnect watch is not removed when the media owner is freed if
an error occurs while resuming in acquire (id == 0).

12 years agogateway: Fix crash if SCO connection fails
Frédéric Dalleau [Tue, 21 Feb 2012 16:46:49 +0000 (17:46 +0100)]
gateway: Fix crash if SCO connection fails

In some situations, a connect callback is created, but
this callback is not added to media_owner. Thus when the owner
is destroyed and at rfcomm disconnect, the callback is executed
with an invalid pointer.

12 years agoAdd emulator/btvirt to .gitignore
Anderson Lizardo [Tue, 6 Mar 2012 20:46:54 +0000 (16:46 -0400)]
Add emulator/btvirt to .gitignore

12 years agoRelease 4.99
Marcel Holtmann [Tue, 6 Mar 2012 17:04:22 +0000 (09:04 -0800)]
Release 4.99

12 years agoUpdate library version
Marcel Holtmann [Tue, 6 Mar 2012 17:02:51 +0000 (09:02 -0800)]
Update library version

12 years agolib: Update company identifiers
Marcel Holtmann [Tue, 6 Mar 2012 16:59:58 +0000 (08:59 -0800)]
lib: Update company identifiers

12 years agolib: Add a2mp.h to lib_headers
Johan Hedberg [Tue, 6 Mar 2012 00:36:22 +0000 (16:36 -0800)]
lib: Add a2mp.h to lib_headers

12 years agolib: Add A2MP definitions
Peter Krystad [Tue, 6 Mar 2012 00:14:48 +0000 (16:14 -0800)]
lib: Add A2MP definitions

12 years agomgmtops: Use DBG not error for printing name in read_info_complete
Szymon Janc [Mon, 5 Mar 2012 19:05:25 +0000 (20:05 +0100)]
mgmtops: Use DBG not error for printing name in read_info_complete

This is debug not an error message.

12 years agomgmtops: Add debug print to update_settings
Szymon Janc [Mon, 5 Mar 2012 19:05:24 +0000 (20:05 +0100)]
mgmtops: Add debug print to update_settings

Print settings for easier tracking what has changed.

12 years agomgmtops: When settings discoverable also set connectable if not set yet
Szymon Janc [Mon, 5 Mar 2012 19:05:23 +0000 (20:05 +0100)]
mgmtops: When settings discoverable also set connectable if not set yet

Otherwise command would be rejected e.g. when setting discoverable at
bluetoothd startup.

12 years agoRemove not needed total variable in get_ltk_info
Szymon Janc [Mon, 5 Mar 2012 18:58:39 +0000 (19:58 +0100)]
Remove not needed total variable in get_ltk_info

This variable is not really needed and was mostly dead assigned.

12 years agoinput: Set up uinput device again, if it was previously closed.
Jeff Hansen [Mon, 5 Mar 2012 03:44:19 +0000 (20:44 -0700)]
input: Set up uinput device again, if it was previously closed.

If you connect a PS3 controller to bluetoothd as an input device, then
take the batteries out of a PS3 controller, then put them back in and
push a few buttons, it will eventually cause an error which causes the
uinput socket to be closed. It will then re-connect to bluetoothd, but
the uinput socket fd will be -1, so it needs to be set up again after
the re-connect.

12 years agolib: Fix compile issue when using in C++
Patrick Ohly [Mon, 16 Jan 2012 10:11:55 +0000 (11:11 +0100)]
lib: Fix compile issue when using in C++

The compiler error is:
 /usr/include/bluetooth/bluetooth.h::131:9: error: invalid conversion from 'void*' to 'bt_get_le64(void*)::<anonymous struct>*'
 ...

The reason is that C++, in contrast to C, does not allow conversion of
void * to anything, and this code gets compiled as C++ when the app is
written in C++. The macro with the assignment itself is older, but only
recent Bluez starts to use it in inline functions, thus triggering the
problem.

This patch keeps the "struct __attribute__((packed))" magic and merely
changes the typecast so that it works in C and C++. Like the existing
macro this patch relies on support for typeof.

12 years agocore: Fix calling stop_discovery through btd_adapter_stop
Johan Hedberg [Sat, 3 Mar 2012 03:12:38 +0000 (19:12 -0800)]
core: Fix calling stop_discovery through btd_adapter_stop

12 years agocore: remove set_limited_discoverable from adapter_ops driver
Luiz Augusto von Dentz [Thu, 1 Mar 2012 09:15:04 +0000 (11:15 +0200)]
core: remove set_limited_discoverable from adapter_ops driver

Core should not longer need to take care of details of discoverable bits

12 years agocore: Make adapter_ops->set_discoverable to take discoverable timeout
Luiz Augusto von Dentz [Thu, 1 Mar 2012 09:15:03 +0000 (11:15 +0200)]
core: Make adapter_ops->set_discoverable to take discoverable timeout

This enables the driver to implements its own handling of the timeout