Commit Graph

15976 Commits

Author SHA1 Message Date
Johan Hedberg
80a2ea61f2 android: Use more common 'failed' label instead of 'error' 2013-11-06 10:12:13 +02:00
Szymon Janc
40fb9b2032 android: Add option to specify controller index to use
This will be usefull while testing on Linux where more controllers
can be present.
2013-11-06 10:10:14 +02:00
Szymon Janc
6dc9321e2e android: Stop mainloop if reading index list failed
If reading index list failed mainloop should be stopped since adapter
init guard timer is not yet running.
2013-11-06 10:08:15 +02:00
Szymon Janc
8a98e083b8 android: Stop mainloop if reading version failed
If reading mgmt version failed or kernel supported version is to old
mainloop should be stopped.
2013-11-06 10:07:54 +02:00
Szymon Janc
81c0c34ef6 android: Remove mgmt_version and mgmt_revision static variables
There is no need to keep those as Android daemon is expecting new
enough kernel to operate.
2013-11-06 10:07:47 +02:00
Szymon Janc
9d89bb121b android: Require at least 1.3 version of mgmt interface
Android daemon is not providing old kernels compatibility features.
2013-11-06 10:07:37 +02:00
Szymon Janc
85e557ff67 adapter: Move MGMT_VERSION macro to mgmt.h
This will be also used in Android daemon.
2013-11-06 10:07:33 +02:00
Szymon Janc
231cf864f1 monitor: Fallback to 80 columns terminal if not able to get real size
This makes num_columns always return valid number of columns, which is
expected by print_packets function.

This also fix garbage prints while using btmon via adb shell.
2013-11-06 10:03:05 +02:00
Marcin Kraglak
c17cf38ecf android: Pass found uuids to remote_device_properties_cb
Send remote device's uuids in remote_device_properties_cb.
This patch will pack found uuids to buffer containing property
with list of uuids and send it to notification socket.
2013-11-05 18:23:03 +02:00
Marcin Kraglak
4b9e1d80a9 android: Fetch remote device uuids after pairing
Android framework expects list of bonded device's uuids.
Start sdp query after setting bond state to BOND_STATE_BONBED.
2013-11-05 18:22:40 +02:00
Marcin Kraglak
1ee0b2f9f9 android: Initial implementation of get_remote_services
This patch implements method to retrieve remote device sdp records.
Caching struct is implemented for adding fetched uuids to list.
sdp_req_list will contain list of devices which are asked for records.
Function get_remote_services will check if device is on list, and will
start sdp procedure.
2013-11-05 18:20:46 +02:00
Luiz Augusto von Dentz
cd8bbd29f4 android/hid: Fix passing wrong adapter address to bt_io_listen 2013-11-05 15:21:27 +02:00
Jerzy Kasenberg
ef0609cc15 android/client: Fix build for android 4.3
Chagnes in HAL interface from 4.3 to 4.4 result in build failure:

target thumb C: haltest <=
    external/bluetooth/bluez/android/client/if-gatt.c
external/bluetooth/bluez/android/client/if-gatt.c:225:1:
    error: unknown type name 'btgatt_gatt_id_t'

This patch allows to build GATT for Android 4.3 (api level 18).
2013-11-05 14:55:37 +02:00
Ravi kumar Veeramally
5de2f26a11 android/hid: Add hid event proto mode structure to hal msg headers 2013-11-05 14:52:34 +02:00
Johan Hedberg
ced41b02f9 tools/smp-tester: Add simple success test case 2013-11-05 13:40:30 +02:00
Szymon Janc
762a2ef434 android: Suppress compiler warnings not enabled by autotools build
missing-field-initializers warning is not enabled on autotools build.
Current code rely on implicit fields intializations resulting in flood
of bogus compiler warnings while building for Android.

monitor/packet.c:348:2: warning: missing initializer
    [-Wmissing-field-initializers]
monitor/packet.c:348:2: warning: (near initialization for
    'error2str_table[64].error') [-Wmissing-field-initializers]
monitor/packet.c:542:2: warning: missing initializer
    [-Wmissing-field-initializers]
monitor/packet.c:542:2: warning: (near initialization for
    'svc_class_table[8].bit') [-Wmissing-field-initializers]
monitor/packet.c:557:2: warning: missing initializer
    [-Wmissing-field-initializers]
monitor/packet.c:557:2: warning: (near initialization for
    'major_class_computer_table[8].val') [-Wmissing-field-initializers]
2013-11-05 13:04:00 +02:00
Luiz Augusto von Dentz
b01319a33f android/adapter: Make adapter_set_name call adapter_name_changed
This simplifies the code since the action of changing the name should
always be progated to the HAL there is no point in doing this
separately.
2013-11-05 12:43:43 +02:00
Andrei Emeltchenko
324ba2b35f android/daemon: Save adapter name on complete event
Saving adapter name was missing from set name complete event.
Refactor code to function and reuse it in both places where
name is changed.
2013-11-05 12:32:53 +02:00
Jerzy Kasenberg
126aad3a5d android/client: Change adapter to bluetooth
This fixes all places where adapter should be changed to
bluetooth.
2013-11-05 12:31:27 +02:00
Jerzy Kasenberg
c73ddc609b android/client: Fix style and typos
Fixes spelling errors and white space style errors.
2013-11-05 12:31:25 +02:00
Andrei Emeltchenko
6886d16e6c android: Add btmon to Android Makefile
Build btmon for Android image. btmon requires fresh bionic to build.
2013-11-05 12:30:40 +02:00
Johan Hedberg
5d09808201 tools: Add smp-tester for automated LE SMP end-to-end tests 2013-11-05 11:38:12 +02:00
Johan Hedberg
d5306edce0 emulator/bthost: Add support for CID hooks
This patch adds support for registering CID based hooks to a bthost.
These are intended for test tools to override the default data handling
for specific CIDs.
2013-11-05 11:38:12 +02:00
Ravi kumar Veeramally
c5ca292eb6 android/hid: Retrieve BOOT_DEVICE attribute from SDP and cache it
It will be usefull to handle when application level requests
get or set protocol from hid device.
2013-11-05 10:19:15 +02:00
Ravi kumar Veeramally
34492997bf android/hid: Rename function name set_state to notify_state
Renaming notification preparation function name from bt_hid_set_state
to bt_hid_notify_state. Rest of the funtions name will have proper
notify* names.
2013-11-05 10:18:51 +02:00
Szymon Janc
d2064df699 android: Send current state of all properties while powering adapter
When adapter is powered on it is expected to emit all properties so
that framework could synchronize its state machine with current
state of HAL. There is no need to set scan mode to none on startup
as framework will set scan mode if current mode is different than
desired one.
2013-11-04 21:31:27 +02:00
Szymon Janc
556c5ceb71 android: Implement scan_mode property in get property command
This will allow to query current state of scan mode property.
2013-11-04 21:31:20 +02:00
Szymon Janc
a880b227bd android: Add support for handling get properties commands
When this commands is received all properties shall be reported to HAL.
2013-11-04 21:31:16 +02:00
Andrei Emeltchenko
8baa84b767 android/client: Fix printing not NULL terminated strings
Android passes not NULL terminated strings.
2013-11-04 21:17:50 +02:00
Andrei Emeltchenko
5af8a574eb android/daemon: Fix setting adapter name
Android use the full string returned even if we terminate it with '\0'.
2013-11-04 21:15:58 +02:00
Andrei Emeltchenko
2dda637c83 android/daemon: Clean up get_address name
Make function name consistent with the rest of the code.
2013-11-04 21:15:46 +02:00
Andrei Emeltchenko
c98ce8a67b android/daemon: Implement get adapter name
Use adapter_name_changed for get_property call.
2013-11-04 21:15:37 +02:00
Jerzy Kasenberg
fe552a1a5d android/client: Fix annoying delay in command line
Move fflush(stdout) to after prints and user input.
This removes delay of showing prompt.
2013-11-04 21:14:35 +02:00
Jerzy Kasenberg
180bc6dbd8 android/client: Change interface name to bluetooth
This changes 'adapter' to 'bluetooth' as name of HAL interface.
This name matches name fond in bluetooth.h where all interfaces
are defined.
2013-11-04 21:13:52 +02:00
Luiz Augusto von Dentz
1ca4c658d9 android/pan: Add initial code for handling commands 2013-11-04 21:13:05 +02:00
Luiz Augusto von Dentz
8e955dfd82 android: Add initial skeleton for pan in the daemon 2013-11-04 21:12:40 +02:00
Luiz Augusto von Dentz
00e69a7570 android/a2dp: Add initial code for handling commands 2013-11-04 21:12:25 +02:00
Luiz Augusto von Dentz
5daffcb642 android: Add initial skeleton for a2dp in the daemon 2013-11-04 21:12:23 +02:00
Giovanni Campagna
d0682a5f25 hid2hci: fix regression in /dev format after moving away from libusb
The paths under /dev, in the default udev configuration, are formatted
with two leading zeros, but the number obtained from sysfs don't have
them, so we must convert them to integers and reformat them.
2013-11-04 20:06:25 +02:00
Jerzy Kasenberg
bd75bd816e android: Bump PLATFORM_SDK_VERSION to KitKat
This updates PLATFORM_SDK_VERSION to 19 since
bluetooth headers were updated already.
2013-11-04 12:15:45 +02:00
Szymon Janc
3c82cea914 android: Fix not sending scan mode change notification
Check for current settings instead of changed setting mask when
sending notification. Otherwise scan mode change would be communicated
only if power state changed at the same time.
2013-11-04 12:15:04 +02:00
Jerzy Kasenberg
6807460f1b android/client: Fix uninitialized variable
Pin accept variable was intended to be set to 1
only when pin was typed by user. If no pin was given
accept should be set to 0. This patch fixes this.
2013-11-04 12:14:18 +02:00
Luiz Augusto von Dentz
d661ba725c android: Add the missing HAVE_CONFIG_H check daemon files 2013-11-04 12:10:31 +02:00
Luiz Augusto von Dentz
f18bb68ba5 android/hid: Use BT_IO_OPT_SOURCE_BDADDR whenever possible 2013-11-04 12:10:29 +02:00
Marcin Kraglak
992f3f669f Fix incorrect result type in set_adapter_name 2013-11-04 12:07:47 +02:00
Marcin Kraglak
c304a4c963 android: Add stub of get_remote_services command 2013-11-04 10:20:28 +02:00
Marcin Kraglak
5658fadf26 android/hal: Send get_remote_services cmd 2013-11-04 10:20:07 +02:00
Marcin Kraglak
ef4e9a8884 android: Fix typo in get_remote_services command 2013-11-04 09:37:13 +02:00
Andrei Emeltchenko
f2782699e8 android/daemon: Add logs to trace failed cmd 2013-11-04 09:33:19 +02:00
Andrei Emeltchenko
be06afd877 android/hal: Add extra logs to HAL
Use exported functions from hal test tool to print properties.
2013-11-04 09:29:09 +02:00