OSDN Git Service

android-x86/external-bluetooth-bluez.git
12 years agodevice: Fix NULL pointer dereference during GATT service discovery
Anderson Lizardo [Tue, 14 Feb 2012 16:06:01 +0000 (12:06 -0400)]
device: Fix NULL pointer dereference during GATT service discovery

If reverse service discovery for GATT is triggered,
device_browse_primary() is called with a NULL "conn" parameter. This fix
is based on similar code found in device_browse_sdp().

This fixes errors like:

process 871: arguments to dbus_connection_ref() were incorrect,
assertion "connection != NULL" failed in file dbus-connection.c line
2549.
This is normally a bug in some application using the D-Bus library.
process 871: arguments to dbus_connection_get_object_path_data() were
incorrect, assertion "connection != NULL" failed in file
dbus-connection.c line 5639.
This is normally a bug in some application using the D-Bus library.
process 871: arguments to dbus_connection_register_object_path() were
incorrect, assertion "connection != NULL" failed in file
dbus-connection.c line 5461.
This is normally a bug in some application using the D-Bus library.

12 years agobtmgmt: Update opcode and event tables
Johan Hedberg [Wed, 15 Feb 2012 12:01:41 +0000 (14:01 +0200)]
btmgmt: Update opcode and event tables

12 years agobtmgmt: Add read_commands support
Johan Hedberg [Wed, 15 Feb 2012 11:52:53 +0000 (13:52 +0200)]
btmgmt: Add read_commands support

12 years agotest-discovery: Make output a bit more readable
Johan Hedberg [Wed, 15 Feb 2012 11:17:01 +0000 (13:17 +0200)]
test-discovery: Make output a bit more readable

Add an empty line between device found entries to make the output more
readable.

12 years agomgmtops: Improve event size mismatch messages
Anderson Lizardo [Mon, 13 Feb 2012 13:12:25 +0000 (09:12 -0400)]
mgmtops: Improve event size mismatch messages

This makes them consistent, and updates the function names.

12 years agoadapter: Fix possible invalid memory access
Vinicius Costa Gomes [Fri, 10 Feb 2012 21:47:52 +0000 (18:47 -0300)]
adapter: Fix possible invalid memory access

12 years agohciconfig: Fix compiler warnings related to unaligned memory access
Vinicius Costa Gomes [Fri, 10 Feb 2012 21:40:06 +0000 (18:40 -0300)]
hciconfig: Fix compiler warnings related to unaligned memory access

12 years agohciconfig: Fix using old-style initializers
Vinicius Costa Gomes [Fri, 10 Feb 2012 21:40:05 +0000 (18:40 -0300)]
hciconfig: Fix using old-style initializers

12 years agomgmtops: Fix doing a useless memset()
Vinicius Costa Gomes [Fri, 10 Feb 2012 21:40:02 +0000 (18:40 -0300)]
mgmtops: Fix doing a useless memset()

The buffers were already allocated using g_try_malloc0().

12 years agonetwork: Fix clang compiler warnings related to unaligned memory access
Vinicius Costa Gomes [Fri, 10 Feb 2012 21:40:01 +0000 (18:40 -0300)]
network: Fix clang compiler warnings related to unaligned memory access

12 years agoaudio: Fix clang compiler warnings regarding implicit enum conversion
Vinicius Costa Gomes [Fri, 10 Feb 2012 21:39:59 +0000 (18:39 -0300)]
audio: Fix clang compiler warnings regarding implicit enum conversion

It was expected that source_get_state() returned a source_state_t, and
that sink_get_state() returned a sink_state_t.

12 years agodun: Fix using old-style initializers
Vinicius Costa Gomes [Fri, 10 Feb 2012 21:39:55 +0000 (18:39 -0300)]
dun: Fix using old-style initializers

12 years agotools: Fix using old-style initializers
Vinicius Costa Gomes [Fri, 10 Feb 2012 21:39:49 +0000 (18:39 -0300)]
tools: Fix using old-style initializers

12 years agolib: Fix using old-style initializers
Vinicius Costa Gomes [Fri, 10 Feb 2012 21:39:51 +0000 (18:39 -0300)]
lib: Fix using old-style initializers

12 years agoattrib-server: Fix invalid IO channel unref
Claudio Takahasi [Thu, 9 Feb 2012 16:02:21 +0000 (13:02 -0300)]
attrib-server: Fix invalid IO channel unref

This patch fixes an invalid read for incoming connections when
the remote initiates the link disconnection.

12 years agoGAttrib: Remove unused function
Claudio Takahasi [Thu, 9 Feb 2012 15:56:09 +0000 (12:56 -0300)]
GAttrib: Remove unused function

GAttrib disconnection tracking is being moved to device.c

12 years agodevice: Add common ATT connection cleanup function
Claudio Takahasi [Thu, 9 Feb 2012 15:56:08 +0000 (12:56 -0300)]
device: Add common ATT connection cleanup function

12 years agodevice: Remove GAttrib disconnect callback
Claudio Takahasi [Thu, 9 Feb 2012 15:56:07 +0000 (12:56 -0300)]
device: Remove GAttrib disconnect callback

This patch replaces the usage of GAttrib disconnection callback by
GIOChannel watch to track ATT channel disconnection. Connection
management is being centralized in device to allow multi-profile
implementations.

12 years agoattrib-server: Remove GAttrib disconnect callback
Claudio Takahasi [Thu, 9 Feb 2012 15:56:06 +0000 (12:56 -0300)]
attrib-server: Remove GAttrib disconnect callback

This patch replaces the usage of GAttrib disconnection callback by
GIOChannel watch to track ATTIO channel disconnection aiming to achieve
less dependencies between attrib server, device and GAttrib.

12 years agodevice: Fix trying to connect if already connected
Vinicius Costa Gomes [Thu, 9 Feb 2012 15:56:05 +0000 (12:56 -0300)]
device: Fix trying to connect if already connected

12 years agodevice: Fix notifying ATTIO drivers when browsing
Claudio Takahasi [Thu, 9 Feb 2012 15:56:04 +0000 (12:56 -0300)]
device: Fix notifying ATTIO drivers when browsing

If disconnection happens during the primary service discovery ATTIO
drivers should not be notified.

12 years agodevice: Consolidate ATT connection management
Claudio Takahasi [Thu, 9 Feb 2012 15:56:03 +0000 (12:56 -0300)]
device: Consolidate ATT connection management

This patch centralizes the connection management for ATT channels
grouping the common code. Based on the result of the ATT connection
result, error or success callback is called.

12 years agoaudio: do not disconnect on gateway SCO failure
Mikel Astiz [Tue, 14 Feb 2012 09:06:34 +0000 (10:06 +0100)]
audio: do not disconnect on gateway SCO failure

Failure on BlueZ-initiated SCO requests should not drop the RFCOMM
connection to the gateway. Instead, considering the stream as suspended
should be enough.

12 years agoa2dp: return NotSupported error if no server found
Mikel Astiz [Tue, 14 Feb 2012 09:06:33 +0000 (10:06 +0100)]
a2dp: return NotSupported error if no server found

With both sink and sources disabled, the A2DP server is not even
registered in audio_manager_init. When trying to register the endpoint,
this should result in the same error as if the server existed but the
profile was disabled.

12 years agoaudio: gateway_unlock together with in_use = FALSE
Mikel Astiz [Tue, 14 Feb 2012 09:06:32 +0000 (10:06 +0100)]
audio: gateway_unlock together with in_use = FALSE

Calling gateway_unlock seems safer in gateway_suspend_complete, in
combination with the update of transport->in_use. This avoids the
transitional state of having the gateway unlocked but the transport
still in use.

This approach is also more consistent with the way headset and a2dp
handle it.

12 years agomgmt-api: Reorder parameters for read_commands
Johan Hedberg [Fri, 10 Feb 2012 10:18:12 +0000 (12:18 +0200)]
mgmt-api: Reorder parameters for read_commands

It makes more sense to have the num_commands and num_events parameters
in the beginning so that the message length can be validated up front.

12 years agomgmt: Add mgmt_rp_read_commands struct definition
Johan Hedberg [Thu, 9 Feb 2012 16:24:26 +0000 (18:24 +0200)]
mgmt: Add mgmt_rp_read_commands struct definition

12 years agomgmt-api: Add proper management supported commands command
Marcel Holtmann [Thu, 9 Feb 2012 16:18:12 +0000 (17:18 +0100)]
mgmt-api: Add proper management supported commands command

12 years agodevice: Remove unused variable
Claudio Takahasi [Thu, 9 Feb 2012 15:41:38 +0000 (12:41 -0300)]
device: Remove unused variable

12 years agoGAttrib: Fix leak when remote disconnects
Claudio Takahasi [Thu, 9 Feb 2012 15:41:37 +0000 (12:41 -0300)]
GAttrib: Fix leak when remote disconnects

12 years agoGAttrib: Add debug message for GAttrib references
Claudio Takahasi [Thu, 9 Feb 2012 15:41:36 +0000 (12:41 -0300)]
GAttrib: Add debug message for GAttrib references

12 years agomgmtops: Add support for mgmt_ev_device_unpaired
Johan Hedberg [Thu, 9 Feb 2012 14:58:00 +0000 (16:58 +0200)]
mgmtops: Add support for mgmt_ev_device_unpaired

12 years agoevent: Add btd_event_device_unpaired callback
Johan Hedberg [Thu, 9 Feb 2012 14:57:42 +0000 (16:57 +0200)]
event: Add btd_event_device_unpaired callback

12 years agobtmgmt: Add Device Unpaired event decoding support
Johan Hedberg [Thu, 9 Feb 2012 14:57:01 +0000 (16:57 +0200)]
btmgmt: Add Device Unpaired event decoding support

12 years agoadapter_opts: Add address type to block() and unblock()
Johan Hedberg [Thu, 9 Feb 2012 14:02:51 +0000 (16:02 +0200)]
adapter_opts: Add address type to block() and unblock()

12 years agoadapter_ops: Add address type to confirm_reply and passkey_reply
Johan Hedberg [Thu, 9 Feb 2012 13:41:15 +0000 (15:41 +0200)]
adapter_ops: Add address type to confirm_reply and passkey_reply

12 years agoadapter_ops: Add address type to disconnect()
Johan Hedberg [Thu, 9 Feb 2012 12:32:30 +0000 (14:32 +0200)]
adapter_ops: Add address type to disconnect()

12 years agoadapter_ops: Add address type to remove_bonding()
Johan Hedberg [Thu, 9 Feb 2012 12:06:04 +0000 (14:06 +0200)]
adapter_ops: Add address type to remove_bonding()

12 years agomgmt: Update implementation to match latest API
Johan Hedberg [Thu, 9 Feb 2012 11:33:54 +0000 (13:33 +0200)]
mgmt: Update implementation to match latest API

12 years agoproximity: Fix Proximity API to match documentation
Anderson Lizardo [Fri, 3 Feb 2012 13:42:56 +0000 (09:42 -0400)]
proximity: Fix Proximity API to match documentation

Recently, the documented D-Bus interface for Proximity was changed to
prepare for the upcoming Proximity Reporter API.

12 years agodevice: Remove unused fields from browse_req
Andre Guedes [Wed, 8 Feb 2012 20:35:49 +0000 (17:35 -0300)]
device: Remove unused fields from browse_req

12 years agodevice: Move GAttrib reference to device
Andre Guedes [Wed, 8 Feb 2012 20:35:48 +0000 (17:35 -0300)]
device: Move GAttrib reference to device

Save GAttrib reference directly in struct btd_device instead of the
temporary browse_req. GAttrib instance scope should not be restricted to
primary service browsing context only, it needs to be shared to upper
layers.

12 years agodevice: Remove unused function parameter
Andre Guedes [Wed, 8 Feb 2012 20:35:47 +0000 (17:35 -0300)]
device: Remove unused function parameter

This patch removes the unused shutdown parameter from
browse_request_free function.

12 years agodevice: Use att_io in device_browse_primary
Andre Guedes [Wed, 8 Feb 2012 20:35:46 +0000 (17:35 -0300)]
device: Use att_io in device_browse_primary

In order to have the same approach as att_connect function,
device_browse_primary function should save the reference to GIOChannel
at device->att_io. This way, we can properly shut it down if the browse
request is canceled during the connection attempt.

12 years agomgmtops: Fix memory leak when parsing EIR
Anderson Lizardo [Wed, 8 Feb 2012 20:04:17 +0000 (16:04 -0400)]
mgmtops: Fix memory leak when parsing EIR

12 years agodevice: Shutdown connection if ATTIO list is empty
Andre Guedes [Wed, 8 Feb 2012 19:05:10 +0000 (16:05 -0300)]
device: Shutdown connection if ATTIO list is empty

Shutdown the ongoing connection attempt if the last ATTIO callback is
removed from the list.

12 years agodevice: Reply ATT requests during bonding
Andre Guedes [Wed, 8 Feb 2012 17:55:08 +0000 (14:55 -0300)]
device: Reply ATT requests during bonding

Unlike BR/EDR which has a dynamically allocated L2CAP data channel, LE
has a fixed L2CAP channel where data are transmitted (CID 4). This means
that once the LE link is established the remote device is able to send
data (ATT messages) to the local device.

Due to the ATT sequential request-response protocol, once a client sends
a request to a server, that client shall send no other request to the
same server until a response PDU has been received. If the response PDU
arrives in 30 secs the remote device disconnects.

This way, in order to be able to reply ATT requests which may come
through channel ID 4 during the pairing, we first establish an ATT
connection and then we start the pairing process.

That issue was discovered during test sessions in UPF. We found some LE
devices sending ATT Requests in CID 4 while pairing was still in
progress

12 years agodevice: Fix invalid read in att_connect_cb
Andre Guedes [Wed, 8 Feb 2012 17:55:07 +0000 (14:55 -0300)]
device: Fix invalid read in att_connect_cb

We should keep a reference to GIOChannel created in att_connect so we
can properly shut it down if the device is removed during a connection
attempt. After establishing the connection, we drop the GIOChannel
reference because GAttrib will take the responsability of disconnect the
link based on the registered ATTIO connection callbacks.

This patch fixes the following invalid read reported by valgrind when
the device is removed and we have a ongoing connection attempt:

Invalid read of size 4
   at 0x1A90D8: att_connect_cb (device.c:1712)
   by 0x17EDB9: connect_cb (btio.c:169)
   by 0x4E6E29C: g_main_context_dispatch (in /usr/lib/libglib-2.0.so.0.2800.8)
   by 0x4E6EA77: ??? (in /usr/lib/libglib-2.0.so.0.2800.8)
   by 0x4E6F0B9: g_main_loop_run (in /usr/lib/libglib-2.0.so.0.2800.8)
   by 0x18ACB3: main (main.c:485)
 Address 0x68aacb8 is 456 bytes inside a block of size 472 free'd
   at 0x4C2556E: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x1A596B: device_free (device.c:248)
   by 0x121EB5: remove_interface (object.c:563)
   by 0x122288: g_dbus_unregister_interface (object.c:715)
   by 0x1AAFD8: btd_device_unref (device.c:2636)
   by 0x1A7912: device_remove (device.c:1058)
   by 0x19F371: adapter_remove_device (adapter.c:1122)
   by 0x1A0AD4: remove_device (adapter.c:1720)
   by 0x1214C4: process_message (object.c:224)
   by 0x121B60: generic_message (object.c:447)
   by 0x51348C0: ??? (in /usr/lib/libdbus-1.so.3.5.7)
   by 0x512679F: dbus_connection_dispatch (in /usr/lib/libdbus-1.so.3.5.7)

12 years agodevice: Split att_connect_cb
Andre Guedes [Wed, 8 Feb 2012 17:55:06 +0000 (14:55 -0300)]
device: Split att_connect_cb

In order to reduce code complexity, all code related to
device_browse_primary was moved to a new function called
browse_primary_connect_cb. This way att_connect_cb has only code related
to att_connect.

12 years agoproximity: Remove unused variable
Anderson Lizardo [Wed, 8 Feb 2012 16:12:50 +0000 (12:12 -0400)]
proximity: Remove unused variable

12 years agoattrib-server: Fix bad error message
Santiago Carot-Nemesio [Tue, 7 Feb 2012 13:37:58 +0000 (14:37 +0100)]
attrib-server: Fix bad error message

12 years agoattrib-server: Fix memory leak attaching attribute channels
Santiago Carot-Nemesio [Tue, 7 Feb 2012 13:26:44 +0000 (14:26 +0100)]
attrib-server: Fix memory leak attaching attribute channels

Channel is not being released when the channel is attached over
an uninitialized GATT server.

12 years agonetwork: Add retries for BNEP connection setup
Ilia Kolomisnky [Sun, 5 Feb 2012 14:58:58 +0000 (16:58 +0200)]
network: Add retries for BNEP connection setup

According to BNEP spec. v1.0, section 2.6.3, the
BNEP_SETUP_CONNECTION_REQUEST_MSG should be retransmitted if the response
is not received for a period between 1 to 30 sec. Current implementation
uses SO_RCVTIMEO socket option to sense reply time-out, which is
incorrect because it does not have effect on g_io_add_watch monitored
descriptors. This patch allows passing of TP/BNEP/CTRL/BV-02-C
certification test.

12 years agosdptool: Add GoepL2capPsm decoding support
Luiz Augusto von Dentz [Mon, 6 Feb 2012 13:19:01 +0000 (15:19 +0200)]
sdptool: Add GoepL2capPsm decoding support

12 years agomgmt-api: Remove bogus Key_Type field from LTK messages
Johan Hedberg [Mon, 6 Feb 2012 20:54:14 +0000 (22:54 +0200)]
mgmt-api: Remove bogus Key_Type field from LTK messages

12 years agomgmt-api: Update to latest plans
Johan Hedberg [Mon, 6 Feb 2012 10:03:11 +0000 (12:03 +0200)]
mgmt-api: Update to latest plans

- "Remove Keys" renamed to "Unpair Device" and moved to a more
  appropriate location (after the other pairing commands)
- "Device Unpaired" event added
- Address_Type parameters added the relevant commands and events
- Address_Type vs Key_Type distinction made clearer
- Bogus '0' removed from opcodes

12 years agodevice: Fix doing SDP discovery for LE devices
Vinicius Costa Gomes [Fri, 3 Feb 2012 23:06:45 +0000 (20:06 -0300)]
device: Fix doing SDP discovery for LE devices

If ReverseServiceDiscovery is enabled and we are connected to a LE
device, we should do a Primary Service Discovery, not a SDP discovery
(which doesn't even make sense).

12 years agobtmgmt: Add support for BR/EDR-only and LE-only discovery
Johan Hedberg [Fri, 3 Feb 2012 22:28:08 +0000 (00:28 +0200)]
btmgmt: Add support for BR/EDR-only and LE-only discovery

12 years agoproximity: make reporter work per-adapter
Arik Nemtsov [Fri, 3 Feb 2012 21:34:04 +0000 (23:34 +0200)]
proximity: make reporter work per-adapter

Register an adapter driver for reporter and add the adapter argument in
appropriate places.

12 years agogatt-example: Fix g_assert checks when an uint16_t value overflows
Santiago Carot-Nemesio [Wed, 25 Jan 2012 13:12:41 +0000 (14:12 +0100)]
gatt-example: Fix g_assert checks when an uint16_t value overflows

g_assert statements are buggy when the last handler available
overflows the uint16_t range. This check is currently used to
evaluate if the number of requested attributes for a sevice
match with the number of attributes added in the data base.

12 years agoattrib-server: Allocate 128-bits UUIDs using highest available handlers
Santiago Carot-Nemesio [Wed, 25 Jan 2012 13:12:40 +0000 (14:12 +0100)]
attrib-server: Allocate 128-bits UUIDs using highest available handlers

128-uuids services are grouped at the end of the handlers database list.
This group grows from the highest handlers toward lowers handlers
until the whole range is used or the last 16 bit-uuid service is reached.

12 years agoglib-compat: Add g_list_free_full to deal with issues in old GLib versions
Santiago Carot-Nemesio [Wed, 25 Jan 2012 13:12:39 +0000 (14:12 +0100)]
glib-compat: Add g_list_free_full to deal with issues in old GLib versions

12 years agoattrib-server: Set database uuids as a double linked list
Santiago Carot-Nemesio [Wed, 25 Jan 2012 13:12:38 +0000 (14:12 +0100)]
attrib-server: Set database uuids as a double linked list

16-bit UUIDs are allocated at the begining of the database list and
128-bit ones are grouped at the end. Replacing the list type with a double
linked one enables us to look for available handles in the 128-bit group
efficiently.

12 years agoattrib-server: Allocate 16-bits UUIDS at the begining of the list
Santiago Carot-Nemesio [Wed, 25 Jan 2012 13:12:37 +0000 (14:12 +0100)]
attrib-server: Allocate 16-bits UUIDS at the begining of the list

12 years agogatt-service: Provide service uuid in attrib_db_find_avail function
Santiago Carot-Nemesio [Wed, 25 Jan 2012 13:12:36 +0000 (14:12 +0100)]
gatt-service: Provide service uuid in attrib_db_find_avail function

We need to provide the service uuid because of GATT server should group
16-bit uuid services together and 128-bit uuid services together,
(Bluetooth 4.0, Vol 3, Part G, 3.1).

12 years agogatt-service: Move va_end just after processing the argument list
Santiago Carot-Nemesio [Wed, 25 Jan 2012 13:12:35 +0000 (14:12 +0100)]
gatt-service: Move va_end just after processing the argument list

12 years agogatt-service: Add support for 128-bit Bluetooth UUIDs
Santiago Carot-Nemesio [Wed, 25 Jan 2012 13:12:34 +0000 (14:12 +0100)]
gatt-service: Add support for 128-bit Bluetooth UUIDs

UUID services in GATT should be either 16-bit or 128-bit. Current
GATT interface does not allow to provide 128-bit ones. This patch
enables plugins to register services using 128-bit UUIDs.

12 years agoFix GLib assertion failure in media.c get_setting()
Szymon Janc [Thu, 2 Feb 2012 22:21:19 +0000 (23:21 +0100)]
Fix GLib assertion failure in media.c get_setting()

If get_setting is called before set_setting, mp->settings would be
NULL resulting in GLib assertion. Hashmap is now allocated in
media_player_create instead of on-demand allocation in set_setting.

external/bluetooth/bluez/audio/media.c:get_setting() Equalizer
CRITICAL **: g_hash_table_lookup: assertion `hash_table != NULL' failed

12 years agobtio: Add BtIOMode enum to be used with BT_IO_OPT_MODE
Luiz Augusto von Dentz [Thu, 2 Feb 2012 21:57:05 +0000 (13:57 -0800)]
btio: Add BtIOMode enum to be used with BT_IO_OPT_MODE

12 years agocore: Add provision for terminating an ATT connection
Smriti Gupta [Fri, 20 Jan 2012 11:54:26 +0000 (17:24 +0530)]
core: Add provision for terminating an ATT connection

In order to terminate any existing ATT connection from the client side
existing function device_request_disconnect has been updated.

12 years agodevice: Fix segmentation fault removing devices
Santiago Carot-Nemesio [Tue, 31 Jan 2012 15:59:05 +0000 (16:59 +0100)]
device: Fix segmentation fault removing devices

There is an unbalanced control regarding to the GATT channel and its
attachid, we have to to update the attach id value by setting it to
zero whenever we detach a GATT channel.

12 years agolib: Add stub for A2MP
Johan Hedberg [Thu, 2 Feb 2012 17:48:55 +0000 (09:48 -0800)]
lib: Add stub for A2MP

12 years agosimple-agent: Ensure passkeys are padded to 6 digits
Johan Hedberg [Thu, 2 Feb 2012 17:14:41 +0000 (19:14 +0200)]
simple-agent: Ensure passkeys are padded to 6 digits

12 years agosimple-agent: Update default capability to KeyboardDisplay
Johan Hedberg [Thu, 2 Feb 2012 17:11:38 +0000 (19:11 +0200)]
simple-agent: Update default capability to KeyboardDisplay

Now that both user space and kernel mgmt code supports this new
capability it makes sense to set it as the default for simple-agent.

12 years agomgmtops: Implement mgmt_cancel_bonding
Johan Hedberg [Thu, 2 Feb 2012 01:58:11 +0000 (03:58 +0200)]
mgmtops: Implement mgmt_cancel_bonding

12 years agomgmt: Update event opcodes to latest API spec
Johan Hedberg [Wed, 1 Feb 2012 22:33:49 +0000 (14:33 -0800)]
mgmt: Update event opcodes to latest API spec

12 years agomgmt-api: Move New Long Term Key Event to a more logical place
Johan Hedberg [Wed, 1 Feb 2012 22:31:59 +0000 (14:31 -0800)]
mgmt-api: Move New Long Term Key Event to a more logical place

12 years agomgmt: Update commands to latest API
Johan Hedberg [Wed, 1 Feb 2012 22:26:16 +0000 (14:26 -0800)]
mgmt: Update commands to latest API

12 years agomgmt-api: Remove unused/implemented commands
Johan Hedberg [Wed, 1 Feb 2012 21:15:26 +0000 (23:15 +0200)]
mgmt-api: Remove unused/implemented commands

12 years agomgmt-api: Move Load Long Term Keys Command to a more logical place
Johan Hedberg [Wed, 1 Feb 2012 21:14:28 +0000 (23:14 +0200)]
mgmt-api: Move Load Long Term Keys Command to a more logical place

12 years agomgmt-api: Add missing cancel pairing command
Johan Hedberg [Wed, 1 Feb 2012 21:12:22 +0000 (23:12 +0200)]
mgmt-api: Add missing cancel pairing command

12 years agobtio: Add L2ERTM type
Luiz Augusto von Dentz [Wed, 1 Feb 2012 01:25:34 +0000 (17:25 -0800)]
btio: Add L2ERTM type

L2ERTM type uses L2CAP socket in SOCK_STREAM instead of SOCK_SEQPACKET

12 years agoadapter_ops: Add address type information to the pair_device command
Vinicius Costa Gomes [Tue, 31 Jan 2012 17:10:53 +0000 (14:10 -0300)]
adapter_ops: Add address type information to the pair_device command

Now that we have address type information we have to inform it
when pairing with an device.

12 years agodevice: Fix not using the "bonded" property for new bondings
Vinicius Costa Gomes [Tue, 31 Jan 2012 17:10:52 +0000 (14:10 -0300)]
device: Fix not using the "bonded" property for new bondings

When checking if a device was already bonded, we should
use the paired property instead of reading the link key
from storage. This method will work for LE links, also.

12 years agodevice: Fix not using the same way for pairing LE devices
Vinicius Costa Gomes [Tue, 31 Jan 2012 17:10:51 +0000 (14:10 -0300)]
device: Fix not using the same way for pairing LE devices

Now that both backends (hciops and mgmtops) are capable
of pairing LE devices, we don't have to force the procedure.

12 years agodevice: Fix doing SDP discovery for LE devices after bonding is complete
Vinicius Costa Gomes [Tue, 31 Jan 2012 17:10:50 +0000 (14:10 -0300)]
device: Fix doing SDP discovery for LE devices after bonding is complete

12 years agodevice: Fix setting the device as bonded when restoring from the LTK
Vinicius Costa Gomes [Tue, 31 Jan 2012 17:10:49 +0000 (14:10 -0300)]
device: Fix setting the device as bonded when restoring from the LTK

12 years agoevent: Add type information to the mgmt "Device Connected" event
Vinicius Costa Gomes [Tue, 31 Jan 2012 17:10:48 +0000 (14:10 -0300)]
event: Add type information to the mgmt "Device Connected" event

In the case of incomming connections we have to know the type of
the device that connected to us.

Through hciops we have the LE Connection Complete event, that
information was lost when Management interface was being used.

12 years agoTODO: Remove already implemented mgmt features
Johan Hedberg [Fri, 27 Jan 2012 18:16:29 +0000 (20:16 +0200)]
TODO: Remove already implemented mgmt features

12 years agoattrib-server: Fix missing NULL check for adapter_find_device
Johan Hedberg [Tue, 31 Jan 2012 01:43:04 +0000 (03:43 +0200)]
attrib-server: Fix missing NULL check for adapter_find_device

12 years agoaudio: Fix disabling local A2DP endpoints when UNIX socket is disabled
Luiz Augusto von Dentz [Thu, 26 Jan 2012 21:39:02 +0000 (23:39 +0200)]
audio: Fix disabling local A2DP endpoints when UNIX socket is disabled

Local endpoints can only be used when UNIX socket API is available.

12 years agobtio: Fix users to not expect a default security level
Vinicius Costa Gomes [Tue, 24 Jan 2012 13:57:23 +0000 (10:57 -0300)]
btio: Fix users to not expect a default security level

The users of btio should not expect that btio will set the security
level to medium if it wasn't specified. Now, all the users specfify
the security level needed.

12 years agobtio: Remove the default security level from btio
Vinicius Costa Gomes [Tue, 24 Jan 2012 13:57:22 +0000 (10:57 -0300)]
btio: Remove the default security level from btio

The default value of sec_level when setting *any* option
using bt_io_set() was BT_SECURITY_MEDIUM. This was causing
the security procedure being started in some situations that
it should not.

12 years agotest: Add support for btiotest to returning the key size
Vinicius Costa Gomes [Tue, 24 Jan 2012 13:57:21 +0000 (10:57 -0300)]
test: Add support for btiotest to returning the key size

12 years agotest: Add support for passing the CID to btiotest
Vinicius Costa Gomes [Tue, 24 Jan 2012 13:57:20 +0000 (10:57 -0300)]
test: Add support for passing the CID to btiotest

If we want to test LE connections using btiotest we need to be
able to inform btio the Channel ID that we want to connect to, so
the kernel is able to learn that we want to establish a LE connection.

12 years agobtio: Add support for getting the Encryption Key Size via btio
Vinicius Costa Gomes [Tue, 24 Jan 2012 13:57:19 +0000 (10:57 -0300)]
btio: Add support for getting the Encryption Key Size via btio

Some profiles specify some restriction depending on the length
of the key used to encrypt the link, this adds an way to retrieve
that value from the kernel.

12 years agolib: Add Key Size information to the security information
Vinicius Costa Gomes [Tue, 24 Jan 2012 13:57:18 +0000 (10:57 -0300)]
lib: Add Key Size information to the security information

Since some time the kernel has the capability to return the length of
the key that was used to encrypt the link.

This patch exposes that field to userspace so more applications can take
decisions based on this information.

12 years agohciops: Fix memory leak when loading keys
Vinicius Costa Gomes [Tue, 24 Jan 2012 00:21:51 +0000 (21:21 -0300)]
hciops: Fix memory leak when loading keys

If we need a copy of those keys we should copy them.

12 years agoRemove the SMP Long Term Key when the device is removed
Vinicius Costa Gomes [Wed, 18 Jan 2012 23:13:32 +0000 (20:13 -0300)]
Remove the SMP Long Term Key when the device is removed

12 years agoUse the helper function to convert a string to a binary buffer
Vinicius Costa Gomes [Wed, 18 Jan 2012 23:13:30 +0000 (20:13 -0300)]
Use the helper function to convert a string to a binary buffer

When loading Link Keys from storage we are able to re-use the function
that was introduced earlier for the LTK case.