OSDN Git Service
Luiz Augusto von Dentz [Mon, 18 Nov 2013 11:50:14 +0000 (13:50 +0200)]
audio/sink: Remove shutdown parameter from sink_disconnect
This parameter is always false so it never do anything.
Luiz Augusto von Dentz [Mon, 18 Nov 2013 11:50:13 +0000 (13:50 +0200)]
audio/source: Remove shutdown parameter from source_disconnect
This parameter is always false so it never do anything.
Luiz Augusto von Dentz [Mon, 18 Nov 2013 11:50:12 +0000 (13:50 +0200)]
audio/AVDTP: Remove public function that are only used locally
Luiz Augusto von Dentz [Mon, 18 Nov 2013 11:50:11 +0000 (13:50 +0200)]
audio/AVDTP: Remove unused code
Andrei Emeltchenko [Mon, 18 Nov 2013 10:49:35 +0000 (12:49 +0200)]
android/a2dp: Use NULL for zero pointer
Andrei Emeltchenko [Mon, 18 Nov 2013 08:26:05 +0000 (10:26 +0200)]
android/socket: Use static local adapter address
Andrei Emeltchenko [Mon, 18 Nov 2013 08:26:04 +0000 (10:26 +0200)]
android/hal-sock: Add debug flag printing
Szymon Janc [Sat, 16 Nov 2013 14:09:46 +0000 (15:09 +0100)]
android: Refactor update_found_device function
This makes function flow easier to follow and understand. Besides that
it also fix issue with sending to many bytes if some prop were not
present in EIR.
Szymon Janc [Sat, 16 Nov 2013 14:09:45 +0000 (15:09 +0100)]
android: Fix sending invalid remote device property event
Remote device property event has variable length, pass whole event
length to ipc_send, not only header.
Szymon Janc [Sat, 16 Nov 2013 14:09:44 +0000 (15:09 +0100)]
android: Fix sending remote device property if name is not present
This fix missing bdaddr to string convertion if name was NULL. This
was resulting in using undefined dst value.
Marcel Holtmann [Fri, 15 Nov 2013 23:07:36 +0000 (15:07 -0800)]
Release 5.11
Marcel Holtmann [Fri, 15 Nov 2013 22:53:53 +0000 (14:53 -0800)]
build: Update library version
Marcel Holtmann [Fri, 15 Nov 2013 22:52:53 +0000 (14:52 -0800)]
lib: Update company identifiers
Lukasz Rymanowski [Fri, 15 Nov 2013 18:04:01 +0000 (19:04 +0100)]
android: Change TODO with explaining comment
Lukasz Rymanowski [Fri, 15 Nov 2013 18:04:00 +0000 (19:04 +0100)]
android: Update bond state on auth and connect failed
Lukasz Rymanowski [Fri, 15 Nov 2013 18:03:59 +0000 (19:03 +0100)]
android: Cache device name on device list.
Lukasz Rymanowski [Fri, 15 Nov 2013 18:03:58 +0000 (19:03 +0100)]
android: Update bond state on incoming bonding
Before sending any ssp request or pin code request up to HAL library we
need to send bond state change with bonding state. Otherwise incoming
bonding is not correctly handled by Bluetooth.apk.
In this patch also device list has been added in order to e.g track
bonding state.
Note: For incoming paring (security mode 3) there is a need to send
HAL_EVE_REMOTE_DEVICE_PROPS before HAL_EV_PIN_REQUEST.
It is because Android will crash due to bug in pinRequestCallback
function in java. Android checks if device is already in HashMap and if
not then creates device, but forget to use that one, but instead do
operations on NULL. By sending HAL_BOND_STATE_BONDING event it works
better but we have race issue. It is because new device is added to
HashMap not in callback context but later after BONDING msg will be
received by BondStateMachine. If it happens before pin_request_cb hits
java then we are fine, otherwise not. So for that reason we send
HAL_EV_REMOTE_DEVICE_PROPS so in the java handler class new device will
be added to HashMap in the callback context.
In ssp case we don't have this problem as we send device found once acl
is created.
Szymon Janc [Fri, 15 Nov 2013 12:16:47 +0000 (13:16 +0100)]
android: Fix not storing adapter index in index added event
If controller was addded after daemon start its index was not stored
resulting in mgmt commands to be always send to MGMT_INDEX_NONE index.
Ravi kumar Veeramally [Fri, 15 Nov 2013 09:59:25 +0000 (11:59 +0200)]
android/hal-ipc: Add pan notification call to hal-ipc dispatch handler
Ravi kumar Veeramally [Fri, 15 Nov 2013 09:59:24 +0000 (11:59 +0200)]
android/pan: Fix wrong HAL service id
Luiz Augusto von Dentz [Thu, 14 Nov 2013 15:01:28 +0000 (17:01 +0200)]
android/a2dp: Add implementation of SDP record
This adds the following record:
Service Name: Audio Source
Service RecHandle: 0x10001
Service Class ID List:
"Audio Source" (0x110a)
Protocol Descriptor List:
"L2CAP" (0x0100)
PSM: 25
"AVDTP" (0x0019)
uint16: 0x103
Profile Descriptor List:
"Advanced Audio" (0x110d)
Version: 0x0103
Johan Hedberg [Thu, 14 Nov 2013 13:57:27 +0000 (15:57 +0200)]
android/build: Remove unnecessary mentions of source files in EXTRA_DIST
Johan Hedberg [Thu, 14 Nov 2013 13:56:51 +0000 (15:56 +0200)]
android/build: Add missing header files to android_haltest_SOURCES
Szymon Janc [Tue, 12 Nov 2013 23:48:20 +0000 (23:48 +0000)]
android: Rename bluetooth service functions to match service name
Make public functions match service name.
Szymon Janc [Thu, 14 Nov 2013 12:56:50 +0000 (13:56 +0100)]
android: Rename adapter.c to bluetooth.c
Match service name that is implemened in that file. This will also
keep convention of foo.c and hal-foo.c implementing remote parts of
same service.
Szymon Janc [Tue, 12 Nov 2013 23:48:18 +0000 (23:48 +0000)]
android: Remove not needed bt_adapter_get_address function
All services receive adapter address on init so there is no need for
this function. Removing it will also help keeping services not depend
on adapter service.
Szymon Janc [Tue, 12 Nov 2013 23:48:17 +0000 (23:48 +0000)]
android: Report adapter address in adapter_ready callback
Adapter is not going to change while daemon is running so its address
can be stored after init is complete.
Szymon Janc [Tue, 12 Nov 2013 23:48:16 +0000 (23:48 +0000)]
android/hidhost: Use adapter address provided on register
There is no need to use bt_adapter_get_address every time local address
is needed.
Szymon Janc [Tue, 12 Nov 2013 23:48:15 +0000 (23:48 +0000)]
android: Don't use static pointer for storing adapter_ready callback
There is no need to keep ready callback for daemon lifetime as it is
not used after reporting adapter being ready. Use mgmt library feature
for passing user data so that static pointer is not needed.
Szymon Janc [Tue, 12 Nov 2013 23:48:14 +0000 (23:48 +0000)]
android: Move adapter initialization to adapter.c
There is no need to handle that in main.c. Also this removes mgmt
interface dependency from adapter API as all mgmt commands are handled
from adapter code.
Startup and shutdown timeouts handling is left in main.c.
Szymon Janc [Tue, 12 Nov 2013 23:48:13 +0000 (23:48 +0000)]
android: Make adapter static
Only one controller is used so there is no need to keep it as allocable
structure. This will also make memory management simpler and more
correct eg. adapter was never free.
Elements not directly related to adapter are kept outside of adapter
structure.
Luiz Augusto von Dentz [Thu, 14 Nov 2013 12:27:51 +0000 (14:27 +0200)]
core: Do not change service state in btd_service_connect if it fails
If .connect fails and the service state changes it may re-enter
connect_next, inverting the order and messing up the error of each
connect request.
Luiz Augusto von Dentz [Thu, 14 Nov 2013 10:18:21 +0000 (12:18 +0200)]
android/a2dp: Add initial implementation of HAL_OP_A2DP_DISCONNECT
Luiz Augusto von Dentz [Thu, 14 Nov 2013 10:18:20 +0000 (12:18 +0200)]
android/a2dp: Add initial implementation of HAL_OP_A2DP_CONNECT
Luiz Augusto von Dentz [Thu, 14 Nov 2013 10:18:19 +0000 (12:18 +0200)]
android/a2dp: Add initial implementation of socket handling
This adds initial code to handle incoming connection and notifying
connection states.
Luiz Augusto von Dentz [Thu, 14 Nov 2013 10:18:18 +0000 (12:18 +0200)]
android/hal-a2dp: Add defines for possible connection states
Luiz Augusto von Dentz [Thu, 14 Nov 2013 10:18:17 +0000 (12:18 +0200)]
android/hal-a2dp: Add implemention of .cleanup
Luiz Augusto von Dentz [Thu, 14 Nov 2013 10:18:16 +0000 (12:18 +0200)]
android/hal-a2dp: Add implemention of .init
Luiz Augusto von Dentz [Thu, 14 Nov 2013 10:18:15 +0000 (12:18 +0200)]
android/hal-a2dp: Use conn_state instead of connection_state
This is shorter and more consistent with other HAL such as HID.
Andrei Emeltchenko [Thu, 14 Nov 2013 07:14:36 +0000 (09:14 +0200)]
android/debug: Move debug functions to hal-utils.c
Debug functions will be used by HALs and haltest.
Szymon Janc [Wed, 13 Nov 2013 14:47:13 +0000 (15:47 +0100)]
android: Core service should be always registered
Core service is used to register other services and shall be always
consider registered.
Szymon Janc [Wed, 13 Nov 2013 14:47:12 +0000 (15:47 +0100)]
android: Shutdown if IPC command for unregistered service is received
Sending commands to not registered services is violation of IPC spec
and should result in daemon shutdown.
Luiz Augusto von Dentz [Wed, 13 Nov 2013 13:26:36 +0000 (15:26 +0200)]
audio/A2DP: Return -ENOPROTOOPT if record doesn't exist
In case record is not registered it means no endpoint is available so
return -ENOPROTOOPT to indicate that it is currently not available.
Andrei Emeltchenko [Wed, 13 Nov 2013 14:29:34 +0000 (16:29 +0200)]
android/hidhost: Use correct error structure
Andrei Emeltchenko [Wed, 13 Nov 2013 14:29:33 +0000 (16:29 +0200)]
android/hidhost: Fix memory leak
Ravi kumar Veeramally [Wed, 13 Nov 2013 09:25:27 +0000 (11:25 +0200)]
android/pan: Handle connection and control state notifications
Ravi kumar Veeramally [Wed, 13 Nov 2013 09:25:26 +0000 (11:25 +0200)]
android/pan: Add notify method to PAN notifications
Ravi kumar Veeramally [Wed, 13 Nov 2013 09:25:25 +0000 (11:25 +0200)]
android: Fix opcode parameter type from uint16_t to uint8_t
Ravi kumar Veeramally [Tue, 12 Nov 2013 15:07:15 +0000 (17:07 +0200)]
android/hidhost: Set info request from HAL is not supported
Data from hal_cmd_hidhost_set_info is usefull only when we create
UHID device. Once device is created all the transactions will be
done through the fd. There is no way to use this information
once device is created with HID internals.
Ravi kumar Veeramally [Tue, 12 Nov 2013 15:07:14 +0000 (17:07 +0200)]
android/hidhost: Remove deprecated idle opcode from ipc document
Idle time is deprecated in HID_SPEC1_1. So get and set idle time api's
are removed and not implemented. But callback is left out in Android
bt_hh.h. Generally this callback needs to be called when HAL requests
get and set idle time calls with status. So the method calls itself
removed, no point to implement this callback.
Also update GET_REPORT and VIRTUAL_UNPLUG opcode values.
Ravi kumar Veeramally [Tue, 12 Nov 2013 15:07:13 +0000 (17:07 +0200)]
android/hidhost: Handle uhid output and feature events
Data read on uhid events output and feature has to be send through
SET_REPORT request to HID device.
Ravi kumar Veeramally [Tue, 12 Nov 2013 14:20:40 +0000 (16:20 +0200)]
android/pan: Add PAN cleanup interface implementation
Ravi kumar Veeramally [Tue, 12 Nov 2013 14:20:39 +0000 (16:20 +0200)]
android/pan: Add PAN related defines and event struct to hsl-msg header
Szymon Janc [Tue, 12 Nov 2013 15:36:26 +0000 (16:36 +0100)]
android: Register DeviceID record when adapter is initialized
Register DeviceID SDP record and update local UUIDs after DeviceID
information is passed to kernel.
Marcin Kraglak [Tue, 12 Nov 2013 15:36:25 +0000 (16:36 +0100)]
android: Add support for getting UUIDs property
This method will call adapter_properties_cb with uuids of
adapter. Method is called also when uuid is added or removed.
Marcin Kraglak [Tue, 12 Nov 2013 15:36:24 +0000 (16:36 +0100)]
android: Clear adapter uuids during initialization
Clear adapter uuids during init. We have to do it before
other profiles will be able to register sdp records and add
their uuids.
Szymon Janc [Tue, 12 Nov 2013 15:36:23 +0000 (16:36 +0100)]
android: Remove not needed include
bt_uuid_t is not used so lib/uuid.h doesn't need to be included.
Marcin Kraglak [Tue, 12 Nov 2013 15:36:22 +0000 (16:36 +0100)]
android: Add and remove sdp records and uuids
This is api for adding and removing sdp records and uuids
via mgmt interface. Local profiles have to store handle to
own records to remove them in cleanup. Additionally list of
uuids is created in bt_adapter struct.
Luiz Augusto von Dentz [Tue, 12 Nov 2013 14:32:29 +0000 (16:32 +0200)]
core: Do not attempt to connect if adapter is not powered
If the adapter is not yet powered do not attempt to connect, also
abort any connection attempt in case of error -EHOSTUNREACH is returned
by the kernel which also means the adapter is not up or in case of
-ECONNABORTED which means the adapter was powered down during the
connection attempt.
Ravi kumar Veeramally [Tue, 12 Nov 2013 13:05:15 +0000 (15:05 +0200)]
android/hidhost: Fix error handling issue incase of G_IO_HUP
Incase of G_IO_HUP on GIOCondtion when hid device disconnected,
GIOCondition is combination of G_IO_IN and G_IO_HUP. Current code
tries to read as soon as it finds G_IO_IN in condition.
Apparently there is no data to read and loop continues.
Ravi kumar Veeramally [Tue, 12 Nov 2013 09:47:19 +0000 (11:47 +0200)]
android/hidhost: Fix uhid create failure case
If uhid open or create fails then notify state and free the device.
Otherwise it replies bogus success return value on connect request.
Lukasz Rymanowski [Tue, 12 Nov 2013 12:51:39 +0000 (13:51 +0100)]
android: Update HAL with device info on incoming connection
Make sure Android have information about connecting remote device. This
is needed for example to show device name on incoming bonding request.
Johan Hedberg [Tue, 12 Nov 2013 08:56:41 +0000 (10:56 +0200)]
core: Rename attio_error_cb to avoid conflicts with error()
In case error() gets converted to a macro having a function pointer
variable with the same name is going to cause trouble.
Bastien Nocera [Sun, 10 Nov 2013 14:24:20 +0000 (15:24 +0100)]
obex: Use user's cache dir as a default root
It's per-user, so we won't try to overwrite somebody else's
files in /tmp when that happens. It's also (unless we have a
particularly bizarre setup) on the same partition as the destination
folder which means we can atomically move the file to the destination
with a unique filename.
Luiz Augusto von Dentz [Mon, 11 Nov 2013 16:17:55 +0000 (18:17 +0200)]
audio/AVDTP: Remove avdtp_init and avdtp_exit
This is now done on demand by avdtp_register_sep and avdtp_unregister_sep
so the server socket is only registered when there is an endpoint
available and the record is properly registered.
Bastien Nocera [Sat, 9 Nov 2013 17:02:57 +0000 (18:02 +0100)]
gdbus: Fix trying to remove already removed sources
When we return FALSE from idle handlers, the source is removed.
This will be causing warnings in glib 2.40.
See https://bugzilla.gnome.org/show_bug.cgi?id=710724
Ravi kumar Veeramally [Fri, 8 Nov 2013 14:14:54 +0000 (16:14 +0200)]
android/hid: Handle virtual unplug event from hid device
If hid host receives the virtual unplug event from hid device
recipient shall destroy or invalidate all bluetooth bonding and
virtual cable information
Andrei Emeltchenko [Fri, 8 Nov 2013 14:08:50 +0000 (16:08 +0200)]
android/hal-utils: Make hal-utils functions return const string
Andrei Emeltchenko [Fri, 8 Nov 2013 14:08:49 +0000 (16:08 +0200)]
androi/haltest: Make debug functions return const string
Szymon Janc [Fri, 8 Nov 2013 14:00:59 +0000 (15:00 +0100)]
android: Fix error handling in adapter_ready
On error negative value is passed to adapter_ready callback. This fix
passing negative error code to strerror.
Andrei Emeltchenko [Fri, 8 Nov 2013 13:16:01 +0000 (15:16 +0200)]
android/hal-sock: Add UUID debug print in socket HAL
Socket HAL uses uint8_t * strings which are of size bt_uuid_t.
Andrei Emeltchenko [Fri, 8 Nov 2013 13:53:29 +0000 (15:53 +0200)]
android/debug: Convert uuid helper to use uint8_t buffer
At this moment Android uses uint8_t * and bt_uuid_t for representing
UUID for different HALs. Convert debug helper to use uint8_t * string.
Johan Hedberg [Fri, 8 Nov 2013 13:46:31 +0000 (15:46 +0200)]
android/hidhost: Fix up error logs to contain exact error
Andrei Emeltchenko [Fri, 8 Nov 2013 13:15:59 +0000 (15:15 +0200)]
android: Create debug hal-utils helpers
Create hal-utils helpers which helps to decode packets Android
sends through HAL interface.
Ravi kumar Veeramally [Fri, 8 Nov 2013 12:08:51 +0000 (14:08 +0200)]
android/hid: Add virtual unplug implemention in daemon
Send virtual unplug command to hid device and disconnect and remove
hid device details.
Ravi kumar Veeramally [Fri, 8 Nov 2013 12:08:50 +0000 (14:08 +0200)]
android/hid: Add send data implemention in daemon
Send data on interrupt channel on request from hid host.
Ravi kumar Veeramally [Fri, 8 Nov 2013 13:23:04 +0000 (15:23 +0200)]
android/hid: Fill send data command struct in hal-hidhost
Ravi kumar Veeramally [Fri, 8 Nov 2013 12:08:48 +0000 (14:08 +0200)]
android/hid: Fix set report data format in daemon
Report data coming to HAL is in ascii format, HAL sends
data in hex to daemon, so convert to binary.
Ravi kumar Veeramally [Fri, 8 Nov 2013 13:23:03 +0000 (15:23 +0200)]
android/hid: Fill send data command struct in hal-hidhost
Jerzy Kasenberg [Fri, 8 Nov 2013 12:48:30 +0000 (13:48 +0100)]
android/client: Add ssp key confirmation helper
This patch adds handling of ssp_request_cb that prints prompt
asking user if pass key matches. User does not need to type:
bluetooth ssp_reply address BT_SSP_VARIANT_PASSKEY_CONFIRMATION 1 key
Jerzy Kasenberg [Fri, 8 Nov 2013 12:48:29 +0000 (13:48 +0100)]
android/client: Add pin handling for bind
This patch ask user for ping in pin_request_cb, which does
what otherwise would be required to manually type
bluetooth pin_reply address pin.
Jerzy Kasenberg [Fri, 8 Nov 2013 12:48:28 +0000 (13:48 +0100)]
android/client: Add prompting for answer
This patch allows to switch to prompt mode where user will be asked
to supply some information.
Jerzy Kasenberg [Fri, 8 Nov 2013 12:48:27 +0000 (13:48 +0100)]
android/client: Split terminal_process_char
This patch changes the way input characters are handled in function
terminal_process_char from big switch statement to smaller functions.
No functionality is changed in this patch.
Splitting to smaller functions will make easier to change behaviour
of terminal for prompt handling when user will be asked for something
and history substitution or auto completion will not be used.
Jerzy Kasenberg [Fri, 8 Nov 2013 12:48:26 +0000 (13:48 +0100)]
android/client: Add command line arguments
This patch adds command line argument parsing.
Options added:
-h, --help
-n, --no-init - disable initialization of interfaces
--version
Jerzy Kasenberg [Fri, 8 Nov 2013 12:48:25 +0000 (13:48 +0100)]
android/client: Initialize all interfaces at start
Patch adds function that initializes all HAL interfaces.
Jerzy Kasenberg [Fri, 8 Nov 2013 12:48:24 +0000 (13:48 +0100)]
android/client: Add NELEM macro for count elements
NELEM macro will be used in several places.
Jerzy Kasenberg [Fri, 8 Nov 2013 12:48:23 +0000 (13:48 +0100)]
android/client: Export get_interface_method
This method will be used outside tab completion.c.
Marcin Kraglak [Fri, 8 Nov 2013 09:51:48 +0000 (10:51 +0100)]
android: Fix PAN service registration
A2DP service was registered instead of PAN.
Ravi kumar Veeramally [Thu, 7 Nov 2013 22:10:16 +0000 (00:10 +0200)]
android/hid: Rename virtual unplug define and struct
Renaming virtual unplug define and strcut name from VP to more
meaning full.
Andrei Emeltchenko [Thu, 7 Nov 2013 15:25:35 +0000 (17:25 +0200)]
android/ipc: Fix crash when sending file descriptor
Since CMSG_FIRSTHDR is defined as shown below:
((size_t) (mhdr)->msg_controllen >= sizeof (struct cmsghdr) \
? (struct cmsghdr *) (mhdr)->msg_control : (struct cmsghdr *) 0)
it return NULL if msg_controllen is not defined. Accessing
that pointer result in daemon crash.
Ravi kumar Veeramally [Thu, 7 Nov 2013 22:25:41 +0000 (00:25 +0200)]
gitignore: Add tools/smp-tester to .gitignore
Ravi kumar Veeramally [Thu, 7 Nov 2013 22:10:18 +0000 (00:10 +0200)]
android/hid: Handle virtual unplug notification in HID HAL
Ravi kumar Veeramally [Thu, 7 Nov 2013 22:10:17 +0000 (00:10 +0200)]
android/hid: Add hid event virtual unplug structure to HAL msg headers
Ravi kumar Veeramally [Thu, 7 Nov 2013 22:10:14 +0000 (00:10 +0200)]
android/hid: Add missing parameters in send data struct in HAL headers
Ravi kumar Veeramally [Thu, 7 Nov 2013 22:10:13 +0000 (00:10 +0200)]
android/hid: Add missing hid send data parameters in ipc document
Ravi kumar Veeramally [Thu, 7 Nov 2013 22:10:10 +0000 (00:10 +0200)]
android/hid: Remove fixed number of hid set report data length in ipc doc
HAL receives data in ascii format but it should be in hex format. So remove
fixed size of report data length and depend on report length parameter.
Johan Hedberg [Thu, 7 Nov 2013 20:39:26 +0000 (22:39 +0200)]
android: Remove unnecessary allocations of fixed-size buffers
Jakub Tyszkowski [Thu, 7 Nov 2013 09:31:50 +0000 (10:31 +0100)]
android: Fix sending remote device name property
Android use the full string returned even if terminated with '\0'.
Jakub Tyszkowski [Thu, 7 Nov 2013 09:31:49 +0000 (10:31 +0100)]
android: Remove redundant command complete callback
This patch removes command complete callback used only for verbose error
reporting.
Szymon Janc [Thu, 7 Nov 2013 16:17:04 +0000 (17:17 +0100)]
android/hal: Use hidhost instead of hh in hidhost HAL
Match functions names to HAL name. Where not needed hh prefix is
removed.