OSDN Git Service

android-x86/external-bluetooth-bluez.git
10 years agobuild: Update library version
Marcel Holtmann [Fri, 27 Dec 2013 17:38:34 +0000 (09:38 -0800)]
build: Update library version

10 years agolib: Update company identifiers
Marcel Holtmann [Fri, 27 Dec 2013 17:33:15 +0000 (09:33 -0800)]
lib: Update company identifiers

10 years agomonitor: Command Complete events with just status are valid
Marcel Holtmann [Thu, 26 Dec 2013 20:52:52 +0000 (12:52 -0800)]
monitor: Command Complete events with just status are valid

10 years agomonitor: Fix small struct indentation issue
Marcel Holtmann [Thu, 26 Dec 2013 20:52:20 +0000 (12:52 -0800)]
monitor: Fix small struct indentation issue

10 years agomonitor: Check that manufacturer part of address is set
Marcel Holtmann [Tue, 24 Dec 2013 01:24:49 +0000 (17:24 -0800)]
monitor: Check that manufacturer part of address is set

10 years agomonitor: Decode OUI company information from addresses
Marcel Holtmann [Tue, 24 Dec 2013 01:16:29 +0000 (17:16 -0800)]
monitor: Decode OUI company information from addresses

10 years agomonitor: Decode vendor and product information from Device ID
Marcel Holtmann [Tue, 24 Dec 2013 00:55:11 +0000 (16:55 -0800)]
monitor: Decode vendor and product information from Device ID

10 years agomonitor: Decode version information from Device ID
Marcel Holtmann [Mon, 23 Dec 2013 18:50:46 +0000 (10:50 -0800)]
monitor: Decode version information from Device ID

10 years agoandroid/tester: Refactor HAL callback check
Grzegorz Kolodziejczyk [Mon, 23 Dec 2013 14:15:54 +0000 (15:15 +0100)]
android/tester: Refactor HAL callback check

This patch removes ID enum in favour of test cases having their own as
implementation of callbacks checking test conditions.
Now each test case uses it own callback function and within it
test conditions are checked, e.g. with property get test case, property
and if it's properly cb is checked.
Count of expected callback is defined as a number and after calling
proper cb, value is decremented.
This also changes to generic - property check used within HAL cb.

10 years agoandroid/tester: Correct bdname set test case struc conditions
Grzegorz Kolodziejczyk [Mon, 23 Dec 2013 14:15:53 +0000 (15:15 +0100)]
android/tester: Correct bdname set test case struc conditions

This patch correct struct elements initialization. Now test name is
declared as variable before test case struct and its size is calculated
using sizeof(), not by hard coded number.

10 years agoandroid/tester: Whitespace and semicolon style correction
Grzegorz Kolodziejczyk [Mon, 23 Dec 2013 14:15:52 +0000 (15:15 +0100)]
android/tester: Whitespace and semicolon style correction

This patch adds semicolon to the last element in test case condition
structure. Additional whitespace was removed from function.

10 years agoandroid/tester: Change test data variables placement
Grzegorz Kolodziejczyk [Mon, 23 Dec 2013 14:15:51 +0000 (15:15 +0100)]
android/tester: Change test data variables placement

This patch moves two test variables to proper place in code - before
test case init structs.

10 years agoandroid/tester: Move BT discovery test cases before Socket Hal
Grzegorz Kolodziejczyk [Mon, 23 Dec 2013 14:15:50 +0000 (15:15 +0100)]
android/tester: Move BT discovery test cases before Socket Hal

This moves and organize test case data. BT discovery test cases to right
place in code.

10 years agoandroid/tester: Seperate Socket HAL cbs from Bluetooth HAL cb
Grzegorz Kolodziejczyk [Mon, 23 Dec 2013 14:15:49 +0000 (15:15 +0100)]
android/tester: Seperate Socket HAL cbs from Bluetooth HAL cb

This patch adds seperate callbacks structure for socket HAL test cases.
Is's needed beceause Socket HAL cb have other purpose than Bluetooth HAL
cb. Callbacks are now initialized outside test setup function and
cb struct depends on HAL type.

10 years agoandroid/bluetooth: Print command opcode in DUT mode functions
Szymon Janc [Mon, 23 Dec 2013 15:40:54 +0000 (16:40 +0100)]
android/bluetooth: Print command opcode in DUT mode functions

Print command opcode in handle_le_test_mode_cmd and
handle_dut_mode_send_cmd. This is valuable information on what kind
of HCI command the Java layer tries to send.

10 years agoandroid: Add comment why umask() is needed in system-emulator
Szymon Janc [Mon, 23 Dec 2013 15:39:10 +0000 (16:39 +0100)]
android: Add comment why umask() is needed in system-emulator

10 years agoandroid/AVDTP: Fix ignoring endpoint delay reporting
Luiz Augusto von Dentz [Mon, 23 Dec 2013 14:08:10 +0000 (16:08 +0200)]
android/AVDTP: Fix ignoring endpoint delay reporting

The code was setting TRUE ignoring what the caller set.

10 years agoandroid/AVDTP: Remove get_all parameter for get_capability callback
Luiz Augusto von Dentz [Mon, 23 Dec 2013 14:08:09 +0000 (16:08 +0200)]
android/AVDTP: Remove get_all parameter for get_capability callback

This is not necessary anymore since all delay reporting is now added
automatically whenever supported.

10 years agoandroid/bluetooth: Print error on unimplemented functions
Szymon Janc [Mon, 23 Dec 2013 11:07:19 +0000 (12:07 +0100)]
android/bluetooth: Print error on unimplemented functions

Functions, callbacks or properties that are not implemented due to
being bogus or not feasible now prints error messages.

10 years agoandroid/bluetooth: Add support for DUT mode configure command
Szymon Janc [Mon, 23 Dec 2013 11:07:18 +0000 (12:07 +0100)]
android/bluetooth: Add support for DUT mode configure command

This allows to enable and disable DUT mode. This is special mode so
adding more info from related kernel commit:

"The Device Under Test (DUT) mode is useful for doing certification
testing and so expose this as debugfs option.

This mode is actually special since you can only enter it. Restoring
normal operation means that a HCI Reset is required. The current mode
value gets tracked as a new device flag and when disabling it, the
correct command to reset the controller is sent."

10 years agoandroid/bluetooth: Fix error message in stop_discovery
Szymon Janc [Mon, 23 Dec 2013 11:47:16 +0000 (12:47 +0100)]
android/bluetooth: Fix error message in stop_discovery

10 years agoandroid/README: Fix consistency issues with whitespace
Johan Hedberg [Mon, 23 Dec 2013 10:00:19 +0000 (12:00 +0200)]
android/README: Fix consistency issues with whitespace

10 years agoandroid: Add shortcommings section to README
Szymon Janc [Fri, 20 Dec 2013 18:30:10 +0000 (19:30 +0100)]
android: Add shortcommings section to README

This sections lists unimplemented methods, callbacks or properties
with few words of comments why feature is missing.

10 years agoandroid/bluetooth: Add support for timestamp device property
Szymon Janc [Fri, 20 Dec 2013 18:30:07 +0000 (19:30 +0100)]
android/bluetooth: Add support for timestamp device property

This allows to handle timestamp property request. Also this will be
usefull for devices info cache (clearing old devices).

10 years agounit/AVDTP: Add /TP/SIG/SYN/BV-06-C test
Luiz Augusto von Dentz [Fri, 20 Dec 2013 08:45:22 +0000 (10:45 +0200)]
unit/AVDTP: Add /TP/SIG/SYN/BV-06-C test

Verify that a delay report received by a SRC IUT while in the STREAMING
state is properly accepted as valid.

10 years agoandroid/AVDTP: Fix rejecting DELAY_REPORT command while in OPEN state
Luiz Augusto von Dentz [Fri, 20 Dec 2013 08:33:40 +0000 (10:33 +0200)]
android/AVDTP: Fix rejecting DELAY_REPORT command while in OPEN state

This fixes rejection of DELAY_REPORT command while in OPEN state which
is tested by /TP/SIG/SYN/BV-05-C.

10 years agounit/AVDTP: Add /TP/SIG/SYN/BV-05-C test
Luiz Augusto von Dentz [Fri, 20 Dec 2013 08:32:59 +0000 (10:32 +0200)]
unit/AVDTP: Add /TP/SIG/SYN/BV-05-C test

Verify that a delay report received by a SRC IUT while in the OPEN state
is properly accepted as valid.

10 years agounit/AVDTP: Add /TP/SIG/SYN/BV-04-C test
Luiz Augusto von Dentz [Fri, 20 Dec 2013 07:51:56 +0000 (09:51 +0200)]
unit/AVDTP: Add /TP/SIG/SYN/BV-04-C test

Verify that an initial delay report is sent by a SNK (INT) device when
the Stream Configuration Procedure is initiated by the SNK device
(transition from IDLE to OPEN state) and that the report conforms to the
specification.

10 years agoandroid/AVDTP: Fix not sending delay reporting capability
Luiz Augusto von Dentz [Wed, 18 Dec 2013 15:42:36 +0000 (17:42 +0200)]
android/AVDTP: Fix not sending delay reporting capability

If the SEP supports delay reporting and remote device request is GET_ALL
add delay report capability.

10 years agounit/AVDTP: Add /TP/SIG/SYN/BV-03-C test
Luiz Augusto von Dentz [Wed, 18 Dec 2013 14:25:12 +0000 (16:25 +0200)]
unit/AVDTP: Add /TP/SIG/SYN/BV-03-C test

Verify that an initial delay report is sent by a SNK (ACP) device when
the Stream Configuration Procedure is initiated by the SRC device
(transition from IDLE to OPEN state) and that the report conforms to the
specification.

10 years agounit/AVDTP: Add /TP/SIG/SYN/BV-02-C test
Luiz Augusto von Dentz [Wed, 18 Dec 2013 14:09:47 +0000 (16:09 +0200)]
unit/AVDTP: Add /TP/SIG/SYN/BV-02-C test

Verify that the delay reporting capability is configured by a SNK device
when it is offered by the SRC device. This allows a SRC device to detect
and use the delay reporting capability of a SNK device when the SNK
device is the INT of the start streaming procedure.

10 years agounit/AVDTP: Add /TP/SIG/SYN/BV-01-C test
Luiz Augusto von Dentz [Wed, 18 Dec 2013 13:33:48 +0000 (15:33 +0200)]
unit/AVDTP: Add /TP/SIG/SYN/BV-01-C test

Verify if the IUT (SNK device) offers the delay reporting capability.
This is required in order to enable a SRC to configure delay reporting.

10 years agoandroid/tester: Fix possible NULL dereference
Andrei Emeltchenko [Mon, 23 Dec 2013 08:28:51 +0000 (10:28 +0200)]
android/tester: Fix possible NULL dereference

value is checked for NULL and later is dereferenced if we do not return.

10 years agomonitor: Add support for decoding inquiry response notification
Marcel Holtmann [Sun, 22 Dec 2013 15:51:49 +0000 (07:51 -0800)]
monitor: Add support for decoding inquiry response notification

10 years agoandroid/bluetooth: Fix memory leaks in load_devices_info
Szymon Janc [Fri, 20 Dec 2013 14:39:53 +0000 (15:39 +0100)]
android/bluetooth: Fix memory leaks in load_devices_info

Groups and key file were not free on function return. This fix
following valgrind reports:

34 (16 direct, 18 indirect) bytes in 1 blocks are definitely lost in
loss record 33 of 77
   at 0x4C2A2DB: malloc (in /usr/lib/valgrind/vgpreload_memcheck-
amd64-linux.so)
   by 0x4E81DD0: g_malloc (in /lib/x86_64-linux-gnu/libglib-2.0.so
.0.3800.1)
   by 0x4E74BF1: g_key_file_get_groups (in /lib/x86_64-linux-gnu/
libglib-2.0.so.0.3800.1)
   by 0x40CDFA: read_info_complete (bluetooth.c:1672)
   by 0x40827C: request_complete (mgmt.c:221)
   by 0x4085E9: received_data (mgmt.c:319)
   by 0x4E7C3B5: g_main_context_dispatch (in /lib/x86_64-linux-gnu/
libglib-2.0.so.0.3800.1)
   by 0x4E7C707: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.3800.1)
   by 0x4E7CB09: g_main_loop_run (in /lib/x86_64-linux-gnu/
libglib-2.0.so.0.3800.1)
   by 0x403B15: main (main.c:439)

1,633 (72 direct, 1,561 indirect) bytes in 1 blocks are definitely lost
in loss record 75 of 77
   at 0x4C2A2DB: malloc (in /usr/lib/valgrind/
vgpreload_memcheck-amd64-linux.so)
   by 0x4E81DD0: g_malloc (in /lib/x86_64-linux-gnu/
libglib-2.0.so.0.3800.1)
   by 0x4E9796D: g_slice_alloc (in /lib/x86_64-linux-gnu/
libglib-2.0.so.0.3800.1)
   by 0x4E97EAD: g_slice_alloc0 (in /lib/x86_64-linux-gnu/
libglib-2.0.so.0.3800.1)
   by 0x4E746DA: g_key_file_new (in /lib/x86_64-linux-gnu/
libglib-2.0.so.0.3800.1)
   by 0x40CDD4: read_info_complete (bluetooth.c:1667)
   by 0x40827C: request_complete (mgmt.c:221)
   by 0x4085E9: received_data (mgmt.c:319)
   by 0x4E7C3B5: g_main_context_dispatch (in /lib/x86_64-linux-gnu/
libglib-2.0.so.0.3800.1)
   by 0x4E7C707: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.3800.1)
   by 0x4E7CB09: g_main_loop_run (in /lib/x86_64-linux-gnu/
libglib-2.0.so.0.3800.1)
   by 0x403B15: main (main.c:439)

10 years agoandroid/tester: Add remote device found success test case
Jakub Tyszkowski [Fri, 20 Dec 2013 12:57:46 +0000 (13:57 +0100)]
android/tester: Add remote device found success test case

Add checking for remote device being found.

10 years agoandroid/bluetooth: Remove not needed local variable
Szymon Janc [Fri, 20 Dec 2013 12:50:42 +0000 (13:50 +0100)]
android/bluetooth: Remove not needed local variable

Both manufacturer and sub_version already have correct type and struct
is marked as packed so there is no need to memcpy to temp variable.

10 years agoandroid/bluetooth-hal: Fix using wrong struct for buffer size
Szymon Janc [Fri, 20 Dec 2013 12:50:41 +0000 (13:50 +0100)]
android/bluetooth-hal: Fix using wrong struct for buffer size

Buffer is for hal_cmd_le_test_mode command.

10 years agoandroid: Include btmon and l2test in userdebug builds
Andrzej Kaczmarek [Fri, 20 Dec 2013 12:35:19 +0000 (13:35 +0100)]
android: Include btmon and l2test in userdebug builds

This patch changes btmon and l2test module tags from 'eng' to 'debug' so
they are automatically installed also for userdebug variant which is
default for AOSP devices.

10 years agobnep: Refactored bnep server apis for bridge addition and deletion
Ravi kumar Veeramally [Fri, 20 Dec 2013 11:40:53 +0000 (13:40 +0200)]
bnep: Refactored bnep server apis for bridge addition and deletion

To simplify bnep server related bridge creation and deletion calls
provided extra apis and moved existing apis to static.

10 years agobnep: Refactored bnep connect and disconnect calls
Ravi kumar Veeramally [Fri, 20 Dec 2013 11:40:52 +0000 (13:40 +0200)]
bnep: Refactored bnep connect and disconnect calls

Refactored bnep connect and disconnect calls to simplify and
keeping bnep related functionality behind curtains.
bnep_connect calls takes care of bnep_setup until interface up
then connect callback will be called. Set disconnect callback
when connect call succeeds. bnep_disconnect should be
called only when iface is up/connected.

10 years agobnep: Add bnep_disconnect and bnep_set_disconnect apis
Ravi kumar Veeramally [Fri, 20 Dec 2013 11:40:51 +0000 (13:40 +0200)]
bnep: Add bnep_disconnect and bnep_set_disconnect apis

Set disconnect call and callback will be triggered by I/O event on
bnep channel. Call bnep_disconnect, it will delete bnep connection
and down the interface, if interface is not up and running do not
use this api, simply call bnep_free.

10 years agobnep: Add bnep_new and bnep_free api's
Ravi kumar Veeramally [Fri, 20 Dec 2013 11:40:50 +0000 (13:40 +0200)]
bnep: Add bnep_new and bnep_free api's

Refactoring connect and disconnect mechanisms. It would be more
convinient for caller to maintain just bnep connection reference
and delete whenever it is not required.

10 years agobnep: Rename struct bnep_conn to bnep and vars for better readability
Ravi kumar Veeramally [Fri, 20 Dec 2013 11:40:49 +0000 (13:40 +0200)]
bnep: Rename struct bnep_conn to bnep and vars for better readability

10 years agoandroid/tester: Fix memory leak
Andrei Emeltchenko [Fri, 20 Dec 2013 12:35:35 +0000 (14:35 +0200)]
android/tester: Fix memory leak

Call del_hook() after add_hook(). This fixes valgrind warnings:

...
==15303==
==15303== HEAP SUMMARY:
==15303==     in use at exit: 3,060 bytes in 27 blocks
==15303==   total heap usage: 6,410 allocs, 6,383 frees, 332,477 bytes
allocated
==15303==
==15303== 24 bytes in 1 blocks are definitely lost in loss record 9 of
27
==15303==    at 0x4C2A2DB: malloc (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==15303==    by 0x406E20: btdev_add_hook (btdev.c:2166)
==15303==    by 0x40BFC2: test_discovery_start_done
(android-tester.c:1401)
==15303==    by 0x409C65: run_callback (tester.c:385)
==15303==    by 0x4E7C3B5: g_main_context_dispatch (in
/lib/x86_64-linux-gnu/libglib-2.0.so.0.3800.1)
==15303==    by 0x4E7C707: ??? (in
/lib/x86_64-linux-gnu/libglib-2.0.so.0.3800.1)
==15303==    by 0x4E7CB09: g_main_loop_run (in
/lib/x86_64-linux-gnu/libglib-2.0.so.0.3800.1)
==15303==    by 0x40A85C: tester_run (tester.c:784)
==15303==    by 0x40368B: main (android-tester.c:1654)
==15303==
==15303== 24 bytes in 1 blocks are definitely lost in loss record 10 of
27
==15303==    at 0x4C2A2DB: malloc (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==15303==    by 0x406E20: btdev_add_hook (btdev.c:2166)
==15303==    by 0x40BF12: test_discovery_stop_success
(android-tester.c:1386)
==15303==    by 0x409C65: run_callback (tester.c:385)
==15303==    by 0x4E7C3B5: g_main_context_dispatch (in
/lib/x86_64-linux-gnu/libglib-2.0.so.0.3800.1)
==15303==    by 0x4E7C707: ??? (in
/lib/x86_64-linux-gnu/libglib-2.0.so.0.3800.1)
==15303==    by 0x4E7CB09: g_main_loop_run (in
/lib/x86_64-linux-gnu/libglib-2.0.so.0.3800.1)
==15303==    by 0x40A85C: tester_run (tester.c:784)
==15303==    by 0x40368B: main (android-tester.c:1654)
==15303==
...

10 years agoandroid/tester: Add test Connect returns valid fd
Andrei Emeltchenko [Fri, 20 Dec 2013 12:09:53 +0000 (14:09 +0200)]
android/tester: Add test Connect returns valid fd

The case is analog for similar test case with listen().

10 years agoandroid/tester: Make code consistent using < 0 comparison
Andrei Emeltchenko [Fri, 20 Dec 2013 12:09:52 +0000 (14:09 +0200)]
android/tester: Make code consistent using < 0 comparison

10 years agoandroid/tester: Add Socket test invalid double listen
Andrei Emeltchenko [Fri, 20 Dec 2013 12:09:51 +0000 (14:09 +0200)]
android/tester: Add Socket test invalid double listen

Add Socket test making listen two times on the same RFCOMM channel.

10 years agoandroid/tester: Fix memory leak using close()
Andrei Emeltchenko [Fri, 20 Dec 2013 12:03:15 +0000 (14:03 +0200)]
android/tester: Fix memory leak using close()

Use device->close() to free device structure. This is the way other
Android devices are closed. Fixes following warnings:

...
==26231== 80 bytes in 1 blocks are definitely lost in loss record 25 of
31
==26231==    at 0x4C2A2DB: malloc (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==26231==    by 0x40F153: open_bluetooth (hal-bluetooth.c:800)
==26231==    by 0x40C8D8: setup (android-tester.c:835)
==26231==    by 0x40CB20: setup_socket_interface_enabled
(android-tester.c:1166)
==26231==    by 0x409C15: setup_callback (tester.c:373)
==26231==    by 0x4E7C3B5: g_main_context_dispatch (in
/lib/x86_64-linux-gnu/libglib-2.0.so.0.3800.1)
==26231==    by 0x4E7C707: ??? (in
/lib/x86_64-linux-gnu/libglib-2.0.so.0.3800.1)
==26231==    by 0x4E7CB09: g_main_loop_run (in
/lib/x86_64-linux-gnu/libglib-2.0.so.0.3800.1)
==26231==    by 0x40A83C: tester_run (tester.c:784)
==26231==    by 0x40362A: main (android-tester.c:1643)
...

10 years agoandroid/hal-bluetooth: Free device on close()
Andrei Emeltchenko [Fri, 20 Dec 2013 12:03:14 +0000 (14:03 +0200)]
android/hal-bluetooth: Free device on close()

10 years agoandroid: Add clarifying comment to store_device_info()
Johan Hedberg [Fri, 20 Dec 2013 12:12:06 +0000 (14:12 +0200)]
android: Add clarifying comment to store_device_info()

10 years agoandroid: Set umask in system-emulator
Szymon Janc [Thu, 19 Dec 2013 12:38:33 +0000 (13:38 +0100)]
android: Set umask in system-emulator

This will make sure files are created with proper permissions so
Android daemon doesn't have to handle that. On Android umask is
set by init.

10 years agoandroid/bluetooth: Add support for restoring devices from storage
Szymon Janc [Thu, 19 Dec 2013 12:38:32 +0000 (13:38 +0100)]
android/bluetooth: Add support for restoring devices from storage

This adds support to restore bonded devices from storage (including
linkkeys).

10 years agoandroid/bluetooth: Add support for storing link keys
Szymon Janc [Thu, 19 Dec 2013 12:38:31 +0000 (13:38 +0100)]
android/bluetooth: Add support for storing link keys

When new linkkey event is received store linkkey in devices info file.
Stored info includes linkkey, linkkey type and pin length.

10 years agoandroid/bluetooth: Add initial support for storing device info
Szymon Janc [Thu, 19 Dec 2013 12:38:30 +0000 (13:38 +0100)]
android/bluetooth: Add initial support for storing device info

This allows to store information about remote device. For now this is
stored only for bonded devices. Currently stored data includes devices
ddress, type, name, friendly name, class and uuids.

10 years agoandroid/bluetooth: Add initial support for permanent storage
Szymon Janc [Thu, 19 Dec 2013 12:38:29 +0000 (13:38 +0100)]
android/bluetooth: Add initial support for permanent storage

This patch adds initial support for storing adapter configuration.
Currently stored data is address, name and discoverable timeout.

Since Android daemon storage format is to be simpler than Linux check
if correct adapter is used before going operational. This is
a precaution to avoid e.g. using linkkeys generated for different
controller.

10 years agoandroid/AVDTP: Duplicate fd passed to avdtp_new
Luiz Augusto von Dentz [Fri, 20 Dec 2013 10:59:26 +0000 (12:59 +0200)]
android/AVDTP: Duplicate fd passed to avdtp_new

This use dup to create a new fd to be used by AVDTP session leaving the
caller free to close the original fd. Note that even if the caller
decides to keep the original fd it will still be notified when
avdtp_shutdown is called since it uses shutdown.

10 years agoemulator/bthost: Remove not used bthost_set_server_psm
Marcin Kraglak [Fri, 20 Dec 2013 10:53:47 +0000 (11:53 +0100)]
emulator/bthost: Remove not used bthost_set_server_psm

This function is not needed and has been replaced with bthost_add_l2cap_server.

10 years agoandroid/android-tester: Remove not necessary bthost_set_server_psm
Marcin Kraglak [Fri, 20 Dec 2013 10:53:46 +0000 (11:53 +0100)]
android/android-tester: Remove not necessary bthost_set_server_psm

Replace this function with bthost_add_l2cap_server().

10 years agotools/l2cap-tester: Remove not necessary bthost_set_server_psm
Marcin Kraglak [Fri, 20 Dec 2013 10:53:45 +0000 (11:53 +0100)]
tools/l2cap-tester: Remove not necessary bthost_set_server_psm

This function can be replaced with bthost_add_l2cap_server().

10 years agoandroid/bluetooth: Add stubs for missing commands
Szymon Janc [Fri, 20 Dec 2013 10:25:40 +0000 (11:25 +0100)]
android/bluetooth: Add stubs for missing commands

This adds stubs for commands that were introduced by BT HAL changes
in Android 4.3+.

10 years agoandroid/hal-bluetooth: Add support for device service record property
Szymon Janc [Fri, 20 Dec 2013 10:25:39 +0000 (11:25 +0100)]
android/hal-bluetooth: Add support for device service record property

This allows to correctly handle device service record property.

10 years agoandroid/hal-bluetooth: Add support for remote version info property
Szymon Janc [Fri, 20 Dec 2013 10:25:38 +0000 (11:25 +0100)]
android/hal-bluetooth: Add support for remote version info property

This allows to correctly handle remote version info property. Although
this property is marked as get/set in HAL only get is implemented as
I fail to see how this property could be settable.

10 years agoandroid/hal-bluetooth: Add support for enabling HCI snoop dump
Szymon Janc [Fri, 20 Dec 2013 10:25:37 +0000 (11:25 +0100)]
android/hal-bluetooth: Add support for enabling HCI snoop dump

This allows to enable HCI SNOOP dump from HAL. This requires that
service named 'bluetoothd_snoop' be available in Android system.

10 years agoandroid/hal-bluetooth: Add support for sending LE_TEST_MODE command
Szymon Janc [Fri, 20 Dec 2013 10:25:36 +0000 (11:25 +0100)]
android/hal-bluetooth: Add support for sending LE_TEST_MODE command

This allows to send LE_TEST_MODE command introduced in Android 4.3.

10 years agotools/l2cap-tester: Fix memory leak
Marcin Kraglak [Fri, 20 Dec 2013 09:30:29 +0000 (10:30 +0100)]
tools/l2cap-tester: Fix memory leak

Set close_on_unref on new created GIOChannel and don't close
its file descriptor.

126 (120 direct, 6 indirect) bytes in 1 blocks aredefinitely
lost in loss record 24 of 28
at 0x4A06409: malloc (in/usr/lib64/valgrind/vgpreload_memcheck
-amd64-linux.so)
by 0x3C9564D88E: g_malloc (in /usr/lib64/libglib-2.0.so.0.3600.3)
by 0x3C956881F4: g_io_channel_unix_new (in/usr/lib64/libglib-
2.0.so.0.3600.3)
by 0x402A5A: l2cap_listen_cb (l2cap-tester.c:774)
by 0x3C95647DF5: g_main_context_dispatch (in/usr/lib64/
libglib-2.0.so.0.3600.3)
by 0x3C95648147: ??? (in /usr/lib64/libglib-2.0.so.0.3600.3)
by 0x3C95648549: g_main_loop_run
(in/usr/lib64/libglib-2.0.so.0.3600.3)
by 0x40A67C: tester_run (tester.c:784)
by 0x4026A9: main (l2cap-tester.c:991)

10 years agotools/l2cap-tester: Fix checking for read() return values
Johan Hedberg [Fri, 20 Dec 2013 08:29:28 +0000 (10:29 +0200)]
tools/l2cap-tester: Fix checking for read() return values

10 years agotools/l2cap-tester: Fix checking for write() return values
Johan Hedberg [Fri, 20 Dec 2013 08:26:18 +0000 (10:26 +0200)]
tools/l2cap-tester: Fix checking for write() return values

10 years agotools/l2cap_tester: Add write server test case
Marcin Kraglak [Thu, 19 Dec 2013 14:29:04 +0000 (15:29 +0100)]
tools/l2cap_tester: Add write server test case

These test case send data from local server to remote client.

10 years agotools/l2cap_tester: Add read server test case
Marcin Kraglak [Thu, 19 Dec 2013 14:29:03 +0000 (15:29 +0100)]
tools/l2cap_tester: Add read server test case

This test checks data transfer from remote client to server.

10 years agotools/l2cap_tester: Add write client test case
Marcin Kraglak [Thu, 19 Dec 2013 14:29:02 +0000 (15:29 +0100)]
tools/l2cap_tester: Add write client test case

This test case write data from client to remote server.

10 years agotools/l2cap_tester: Add read client test case
Marcin Kraglak [Thu, 19 Dec 2013 14:29:01 +0000 (15:29 +0100)]
tools/l2cap_tester: Add read client test case

This test case send data from remote device to client.
It verifies if data is passed corerctly through L2CAP socket.

10 years agoemulator/bthost: Remove double lookup with bthost_find_l2cap_cb_by_psm
Johan Hedberg [Fri, 20 Dec 2013 07:37:00 +0000 (09:37 +0200)]
emulator/bthost: Remove double lookup with bthost_find_l2cap_cb_by_psm

10 years agoemulator/bthost: Make bthost_add_l2cap_conn return the added struct for convenience
Johan Hedberg [Fri, 20 Dec 2013 07:35:33 +0000 (09:35 +0200)]
emulator/bthost: Make bthost_add_l2cap_conn return the added struct for convenience

10 years agoemulator: Add new method for adding l2cap server
Marcin Kraglak [Thu, 19 Dec 2013 14:29:00 +0000 (15:29 +0100)]
emulator: Add new method for adding l2cap server

This method allow user to add l2cap server and register
connect callback. If no callback is specified, it will behave
like bthost_set_server_psm() method.

10 years agoandroid/A2DP: Fix disconnecting after AVDTP session creation
Luiz Augusto von Dentz [Thu, 19 Dec 2013 15:15:56 +0000 (17:15 +0200)]
android/A2DP: Fix disconnecting after AVDTP session creation

Once the connection is handover to AVDTP code the GIOChannel can be
unref but it should not close the connection.

10 years agoandroid/AVDTP: Add avdtp_shutdown
Luiz Augusto von Dentz [Thu, 19 Dec 2013 15:15:55 +0000 (17:15 +0200)]
android/AVDTP: Add avdtp_shutdown

avdtp_shutdown can be used to disconnect closing all existing stream
properly.

10 years agoandroid/A2DP: Use avdtp_add_disconnect_cb to cleanup on disconnect
Luiz Augusto von Dentz [Thu, 19 Dec 2013 15:15:54 +0000 (17:15 +0200)]
android/A2DP: Use avdtp_add_disconnect_cb to cleanup on disconnect

This replaces the use of g_io_add_watch with avdtp_add_disconnect_cb so
connection tracking stay within AVDTP code.

10 years agoandroid/AVDTP: Add avdtp_add_disconnect_cb and avdtp_remove_disconnect_cb
Luiz Augusto von Dentz [Thu, 19 Dec 2013 15:15:53 +0000 (17:15 +0200)]
android/AVDTP: Add avdtp_add_disconnect_cb and avdtp_remove_disconnect_cb

With these functions the user application can detect when the AVDTP has
been disconnected and cleanup properly.

10 years agoandroid/bluetooth: Fix sending invalid RSSI device property
Szymon Janc [Thu, 19 Dec 2013 21:19:25 +0000 (22:19 +0100)]
android/bluetooth: Fix sending invalid RSSI device property

RSSI property is of int32_t type but int8_t was send in durring
remote devices discovery.

10 years agoandroid/tester: Add start device discovery done test case
Jakub Tyszkowski [Thu, 19 Dec 2013 12:42:26 +0000 (13:42 +0100)]
android/tester: Add start device discovery done test case

This tests device discovery start being reported as done because of
ongoing discovery.

10 years agoandroid/tester: Add device discovery cancel success test case
Jakub Tyszkowski [Thu, 19 Dec 2013 12:42:25 +0000 (13:42 +0100)]
android/tester: Add device discovery cancel success test case

Test for successfull discovery canceling after it was started.

10 years agoandroid/tester: Add stop device discovery done test case
Jakub Tyszkowski [Thu, 19 Dec 2013 12:42:24 +0000 (13:42 +0100)]
android/tester: Add stop device discovery done test case

Add test case for stopping device discovery when it wasn't started.

10 years agoandroid/tester: Add start device discovery success test case
Jakub Tyszkowski [Thu, 19 Dec 2013 12:42:23 +0000 (13:42 +0100)]
android/tester: Add start device discovery success test case

Add test case for starting device discovery with success.

10 years agoandroid/tester: Fix bluetooth disable success test case
Jakub Tyszkowski [Thu, 19 Dec 2013 12:42:22 +0000 (13:42 +0100)]
android/tester: Fix bluetooth disable success test case

This fixes not checking for proper status on bluetooth disable.

10 years agoandroid/tester: Fix for not checking for BT_STATUS_SUCCESS
Jakub Tyszkowski [Thu, 19 Dec 2013 12:42:21 +0000 (13:42 +0100)]
android/tester: Fix for not checking for BT_STATUS_SUCCESS

For BT_STATUS_SUCCESS no checks were done as it is 0 in bt_status_t
enum. Valid status for no status expected should be STATUS_NOT_EXPECTED.

10 years agoandroid/build: Add l2test to Android.mk
Sebastian Chlad [Thu, 19 Dec 2013 12:53:15 +0000 (13:53 +0100)]
android/build: Add l2test to Android.mk

Enable l2test tool for the Android target.

10 years agoaudio/AVRCP: Fix check for values out of range in SetAbsoluteVolume
Luiz Augusto von Dentz [Thu, 19 Dec 2013 13:08:39 +0000 (15:08 +0200)]
audio/AVRCP: Fix check for values out of range in SetAbsoluteVolume

Volume is 7 bits since the 8 bit should be ignored as it is reserved it
should never be > 127. Futhermore the value passed to
media_transport_update_device_volume should be the stored in volume as
it ignores the reserved bits properly.

10 years agoandroid/pts: Add PICS, PIXITs and PTS for L2CAP
Sebastian Chlad [Thu, 19 Dec 2013 12:26:41 +0000 (13:26 +0100)]
android/pts: Add PICS, PIXITs and PTS for L2CAP

This allows better tracking of the current state of implementation

10 years agoemulator: Add L2CAP PSM handling to bthost
Marcin Kraglak [Thu, 19 Dec 2013 09:30:01 +0000 (10:30 +0100)]
emulator: Add L2CAP PSM handling to bthost

Store the PSM of L2CAP connections. We retrieve the PSM from the
connection request frame.

10 years agoandroid/socket: Handle Android events for server socket
Andrei Emeltchenko [Thu, 19 Dec 2013 08:51:40 +0000 (10:51 +0200)]
android/socket: Handle Android events for server socket

Add watch for tracking events from Android framework for server socket.
Android might want to close server connection, in this case we close
our listening socket and cleaning up rfsock structure. Glib watch is
added with high priority to avoid races.

10 years agoandroid/tester: Add Socket test close and listen
Andrei Emeltchenko [Thu, 19 Dec 2013 08:51:39 +0000 (10:51 +0200)]
android/tester: Add Socket test close and listen

This test the situation when Android close file descriptor we passed to
it and try to listen() again.

10 years agoandroid/tester: Test that connect call returns channel number
Andrei Emeltchenko [Thu, 19 Dec 2013 08:49:20 +0000 (10:49 +0200)]
android/tester: Test that connect call returns channel number

The test connects to emulated bthost and read channel number

10 years agoandroid/socket: Connect directly to RFCOMM channel if uuid is zero
Andrei Emeltchenko [Thu, 19 Dec 2013 08:49:19 +0000 (10:49 +0200)]
android/socket: Connect directly to RFCOMM channel if uuid is zero

Check uuid and connect to specified RFCOMM channel directly if uuid is
zeroed.

10 years agoandroid/socket: Refactor connect to allow directly connect to rfcomm
Andrei Emeltchenko [Thu, 19 Dec 2013 08:49:18 +0000 (10:49 +0200)]
android/socket: Refactor connect to allow directly connect to rfcomm

Since Socket HAL allows us to specify RFCOMM channel number and directly
connect refactor send function to allow connect directly is uuid is zero
and channel number is specified.

10 years agoandroid/pan: Change local_role to NONE only when device list is empty
Ravi kumar Veeramally [Wed, 18 Dec 2013 14:53:11 +0000 (16:53 +0200)]
android/pan: Change local_role to NONE only when device list is empty

10 years agoandroid/pan: Free device after sending diconnected notification
Ravi kumar Veeramally [Wed, 18 Dec 2013 14:53:10 +0000 (16:53 +0200)]
android/pan: Free device after sending diconnected notification

10 years agoandroid/AVDTP: Fix not removing start_timer source
Luiz Augusto von Dentz [Wed, 18 Dec 2013 12:29:43 +0000 (14:29 +0200)]
android/AVDTP: Fix not removing start_timer source

It is possible that stream->start_timer can be set on stream_free which
should then should take care of remove it properly otherwise it can
trigger which would very likely cause a crash.

Thanks to Hannu Mallat <hannu.mallat@jolla.com> for reporting it.

10 years agoandroid/tester: Add bluetooth HAL test case - name prefix
Grzegorz Kolodziejczyk [Wed, 18 Dec 2013 11:54:37 +0000 (12:54 +0100)]
android/tester: Add bluetooth HAL test case - name prefix

This add prefix for bluetooth HAL test case names. Bluetooth HAL test
cases now can be easily distinguished. Now Bluetooth HAL test cases
can be run separately.

10 years agoandroid/tester: Move Bluetooth HAL functions before socket HAL
Grzegorz Kolodziejczyk [Wed, 18 Dec 2013 11:54:36 +0000 (12:54 +0100)]
android/tester: Move Bluetooth HAL functions before socket HAL

This patch move bluetooth HAL test functions before socket
HAL functions. This make it more readable for future test cases growth.