Commit Graph

15872 Commits

Author SHA1 Message Date
Szymon Janc
96bdbe13a9 android: Add missing SSP variant definitions to IPC header 2013-10-25 15:00:22 +03:00
Szymon Janc
ea713c98e6 android: Add missing SSP Variant definitions to IPC document
Those are used to specify SSP association model.
2013-10-25 14:29:02 +03:00
Szymon Janc
6748668dc7 android/hal: Add support for sending adapter PIN reply command
This allows HAL to reply to PIN code request.
2013-10-25 14:28:57 +03:00
Szymon Janc
c853f60dd1 android/hal: Add support for sending adapter remove bond command
This allows HAL to remove bonding.
2013-10-25 14:28:52 +03:00
Szymon Janc
6312df1ed5 android/hal: Add support for sending cancel bond command
This allows HAL to cancel pending bonding.
2013-10-25 14:28:47 +03:00
Szymon Janc
34043763e3 android/hal: Add support for sending create bond command
This allows HAL to start bonding.
2013-10-25 14:28:42 +03:00
Szymon Janc
0e35111ec4 android/hal: Add support for sending adapter get properties command
This allows HAL to get all adapter properties.
2013-10-25 14:28:36 +03:00
Szymon Janc
0c5d044175 android/hal: Add support for sending adapter get property command
This allows HAL to get adapter property.
2013-10-25 14:28:30 +03:00
Szymon Janc
32e236d70e android/hal: Add support for sending adapter set property command
This allows HAL to set adapter property.
2013-10-25 14:28:25 +03:00
Szymon Janc
56bfb47be9 android: Add properties defines to hal-msg.h
Android HAL defines some properties as adapter specific, some as
device specific and some as common. We split those to separate
adapter and device properties hence overlaping or holes in codes.
2013-10-25 14:28:21 +03:00
Szymon Janc
e4db4fdd60 android: Remove not needed local variable in connect_hal
err variable was set but never read.
2013-10-25 14:28:16 +03:00
Jerzy Kasenberg
9acf421380 android/client: Add processing of .haltestrc
This patch allows tool to read commands from .haltestrc.
So it is possible to call some functions that are typically used.
So user can have:
  adapter init
  adapter get_profile_interface socket
  adapter get_profile_interface pan
  adapter get_profile_interface hidhost
  adapter get_profile_interface a2dp
  pan init
  av init
2013-10-25 14:17:54 +03:00
Jerzy Kasenberg
a5383e2137 android/client: Add source command to haltest
New command allows to read script file into tool and
execute its contents as if it was typed.
2013-10-25 14:17:54 +03:00
Jerzy Kasenberg
1927259430 android/client: Fix incorrect casts of addresses
This fixes printing of addresses.
If char is set to be signed (as it should) some addresses were
printed with leading FFFFFF.
2013-10-25 13:31:44 +03:00
Jerzy Kasenberg
81e2fa91a3 android/client: Fix various coding style issues
Mostly indentation of arguments in functions and calls.
Prefix p remove from puser/penum_func.
Some empty lines added after closing } when needed.
Magic number for string length changed to preprocessor define.
Added spaces after casts.
2013-10-25 11:12:37 +03:00
Andrei Emeltchenko
9918a415ab android: Make haltest and bluetoothd depend on HAL lib
The patch makes haltest and bluetoothd depend on bluetooth.default target
which is already defined. glib dependency Android resolves itself.
Fixes issue that for the fresh build only bluetooth.default.so is built.
2013-10-25 11:09:39 +03:00
Szymon Janc
17f8aa67a6 android: Fix debug logs when running on Android
Current Android log backed dones't enable debug logs. Instead of coping
code from src/log.c, just use it on Android as well.

No functionality is lost as currently Android log backed only prints
to standard output.
2013-10-24 18:39:00 +03:00
Szymon Janc
54345db3b1 android: Use adapter index in mgmt functions
Instead of hardcoding index 0 use real index of adapter. This fix
using invalid index if adapter ID happens to be different than 0.

This should not happen on Android but is possible while testing on
Linux PC.
2013-10-24 18:32:47 +03:00
Szymon Janc
194d2d5d3d android: Use default adapter in adapter functions
There is no need to pass pointer to adapter between function as there
is only one adapter in android daemon. Also default_adapter is renamed
to adapter.

There is no need to pass adapter pointer as user data since there is
only one adapter present.
2013-10-24 18:32:44 +03:00
Szymon Janc
78761a80af android: Remove not needed adapter parameter from bt_adapter_ready
There is no need to pass adapter pointer in bt_adapter_ready callback
as there is only one present.
2013-10-24 18:31:41 +03:00
Szymon Janc
5d044fff91 android: Fix bt_adapter_init
Make bt_adapter_init return void and use ready callback for error
reporting. This also fix returning incorrect status and invalid
mgmt_if unref (mgmt_send return 0 on error or >0 on success).
2013-10-24 18:31:33 +03:00
Szymon Janc
f9c5137dfd android: Start command watch after notify channel is connected
Daemon should start processing commands only after both communication
channels were connected.
2013-10-24 18:23:08 +03:00
Luiz Augusto von Dentz
55a25cb83c android/hal-msg: Reduce length of defines and struct names
The current defines and struct names are way too big and sometimes
incosistent.
2013-10-24 10:46:24 +03:00
Andrei Emeltchenko
d60490a7c3 android: Enable AV interface
Include av_interface to get_interface function.
2013-10-24 10:24:24 +03:00
Andrei Emeltchenko
4569aaf0b5 android: haltest: Enable av interface in test tool 2013-10-24 10:24:23 +03:00
Jerzy Kasenberg
e5c9c6c3b0 android: Add calls to av methods in haltest
This patch adds calls to av interface in haltest.
2013-10-23 19:34:22 +03:00
Szymon Janc
ff3d7aa235 android: Fix use of invalid service ID in response
Adapter should use HAL_SERVICE_ID_BLUETOOTH service ID.
2013-10-23 19:33:22 +03:00
Szymon Janc
3dbfab4372 android/hal: Verify if command response service ID match
Received response service ID should match command service ID in
command, abort if it doesn't.
2013-10-23 19:33:03 +03:00
Szymon Janc
d7e0cfe033 android: Send notification on adapter power state change 2013-10-23 19:32:30 +03:00
Szymon Janc
f94baef84e android/hal: Fix crash while receiving notification
This fix following crash:
Invalid read of size 8
   at 0x408B33: notification_handler (hal-ipc.c:122)
   by 0x4E39E99: start_thread (pthread_create.c:308)
 Address 0x8 is not stack'd, malloc'd or (recently) free'd
2013-10-23 19:32:16 +03:00
Szymon Janc
280d52cefd android: Add missing adapter state values to IPC header 2013-10-23 19:32:08 +03:00
Szymon Janc
9e6bcb42b3 android: Add missing adapter state values to IPC documentation 2013-10-23 19:31:59 +03:00
Andrei Emeltchenko
6c47a0a0a6 android: Use helper function for finding headers
Using helper function allows us to overcome possible location
change in future Android releases. This was inspired by
Szymon Janc's comment to my previous patch.
2013-10-23 17:39:53 +03:00
Andrei Emeltchenko
e3e957e068 android: Fix compilation error
The patch fixes errors with undefined symbols EXIT_FAILURE on Android.
2013-10-23 16:06:32 +03:00
Lukasz Rymanowski
5619f854f9 android: Fix build error for Android
Android uses functions and defines from sys/capability.h which
requires additional include. However file capability.h shows up
in bionic in version Android 4.3, therefore we do check
PLATFORM_SDK_VERSION to no break builds of previous Android versions.
In previous Android version unistd.h contain this functionality.
2013-10-23 15:58:29 +03:00
Andrei Emeltchenko
63c3679a81 android: Make use of Android system headers instead of local one
Since the headers were copied to android/ folder Android build started
to use those instead of original Android system headers. The patch
puts Android system headers first.
2013-10-23 15:58:27 +03:00
Johan Hedberg
16102bea3d android: Add convenience variable for adapter bdaddr 2013-10-23 14:32:03 +03:00
Szymon Janc
46467fd5d1 android: Add support for registering and unregistering hid service 2013-10-23 14:26:40 +03:00
Szymon Janc
9f696ad971 android: Add initial code for socket service
Only handle register/unregister for now.
2013-10-23 14:26:40 +03:00
Szymon Janc
97732368fb android: Add bt_adapter_get_address function
It will be used to obtain adapter address.
2013-10-23 14:26:40 +03:00
Szymon Janc
eea8d8e2d8 android: Add support for registering "bluetooth" service 2013-10-23 14:24:58 +03:00
Szymon Janc
ec2dc713b1 android: Add initial code for services unregister
This will be used to disable services on respective HAL cleanup calls.
2013-10-23 14:24:24 +03:00
Szymon Janc
f4fc4273eb android: Add initial code for services register
This will be used to enable services on respective HAL init calls.
2013-10-23 14:23:59 +03:00
Johan Hedberg
8071e96a3e tools/l2cap-tester: Fix command reject expected responses
Invalid CID responses also contain the CID(s) that were invalid.
2013-10-23 14:11:21 +03:00
Andrei Emeltchenko
3adac8d715 android: Check that service is started
Add check that we are able to start Bluetooth service in
Android. If service is not started we should not try to connect to it.
2013-10-23 14:02:07 +03:00
Johan Hedberg
de10a3d060 android/hid: Fix service type in error response 2013-10-23 13:22:39 +03:00
Luiz Augusto von Dentz
89a85ed6a8 android: Fix checking return of hal_ipc_cmd
hal_ipc_cmd should never return negative values
2013-10-23 13:16:17 +03:00
Luiz Augusto von Dentz
2f1277b170 android: Use sock prefix
This adds sock prefix for static function and replaces those that had
bt_sock as prefix.
2013-10-23 13:06:50 +03:00
Luiz Augusto von Dentz
0ee10ed2e5 android: Use pan prefix instead of bt_pan
This replaces the use of bt_pan as function prefix with pan.
2013-10-23 13:06:50 +03:00
Johan Hedberg
5526825ed9 android/client: Fix various coding style issues 2013-10-23 13:04:40 +03:00