OSDN Git Service
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.
Szymon Janc [Thu, 7 Nov 2013 16:17:03 +0000 (17:17 +0100)]
android: Rename hid.c to hidhost.c
Name of daemon implementation will match Android HAL name. This will
make code navigation easier as daemon part and HAL library implementation
will be in foo.c and hal-foo.c respectively.
Szymon Janc [Thu, 7 Nov 2013 16:17:02 +0000 (17:17 +0100)]
android: Rename hidhost HAL related IPC API to match service name
Use 'Android HAL name' string from IPC doc as base for names.
Lukasz Rymanowski [Thu, 7 Nov 2013 15:57:44 +0000 (16:57 +0100)]
android: Add set/get for discovery timeout
Android handles discoverable timeout in Settings app, however still
expects BT stack to maintain this value so we should do it as well.
Otherwise we will get some unexpected behaviour. For now we keep
discovery_timeout only during runtime, but we need to move it to some
local storage once we will have it.
Note: That since Android Settings up handles timer there is no reason to
use discovery timer we have in kernel.
Szymon Janc [Thu, 7 Nov 2013 15:32:07 +0000 (16:32 +0100)]
android/hal: Use a2dp instead of av in a2dp HAL
Match functions names to HAL name. Where not needed av prefix is
removed.
Szymon Janc [Thu, 7 Nov 2013 15:32:06 +0000 (16:32 +0100)]
android/hal: Rename hal-av.c to hal-a2dp.c
Name of HAL implementation will match Android HAL name. This will make
code navigation easier as daemon part and HAL library implementation
will be in foo.c and hal-foo.c respectively.
Szymon Janc [Thu, 7 Nov 2013 15:32:05 +0000 (16:32 +0100)]
android: Rename a2dp HAL related IPC API to match service name
Use 'Android HAL name' string from IPC doc as base for names.
Andrei Emeltchenko [Thu, 7 Nov 2013 14:51:38 +0000 (16:51 +0200)]
android/ipc: Fix receiving file descriptors
It does make sense iterate over !NULL controll headers. This fixes
the bug that file descriptors cannot be send over IPC.
Lukasz Rymanowski [Thu, 7 Nov 2013 09:19:50 +0000 (10:19 +0100)]
android: Use BASELEN define for property changed
Szymon Janc [Thu, 7 Nov 2013 09:10:37 +0000 (10:10 +0100)]
android: Use payload member to access message data
This make it similar to other places in code.
Szymon Janc [Thu, 7 Nov 2013 09:10:36 +0000 (10:10 +0100)]
android: Remove includes from adapter.h
This is internal header and dependencies should be included in
respective .c files.
Szymon Janc [Thu, 7 Nov 2013 09:10:35 +0000 (10:10 +0100)]
android: Pass notification socket fd to service handlers
IPC helpers were converted to accept socket, not GIOChannel so there
is no need of passing former to handlers.
Szymon Janc [Thu, 7 Nov 2013 09:10:34 +0000 (10:10 +0100)]
android: Make IPC helpers accept file descriptor
There is no need to pass GIOChannel as writes are done immediately.
Andrei Emeltchenko [Wed, 6 Nov 2013 14:03:33 +0000 (16:03 +0200)]
android/hal: Rename hal_op_sock_listen to hal_cmd_sock_listen
This makes structures consistent with the rest of the code.
Andrei Emeltchenko [Wed, 6 Nov 2013 14:03:31 +0000 (16:03 +0200)]
android/hal-sock: Check socket type in connect
Only RFCOMM sockets are supported in Android.
Lukasz Rymanowski [Wed, 6 Nov 2013 15:08:49 +0000 (16:08 +0100)]
android: Change name for get_disc_timeout
Change name to get_discoverable_timeout. Previous name could be
confusing with disconnection timeout.
Johan Hedberg [Wed, 6 Nov 2013 14:38:51 +0000 (16:38 +0200)]
android: Remove useless device.{c,h} files
Marcel Holtmann [Wed, 6 Nov 2013 13:16:09 +0000 (05:16 -0800)]
monitor: Add extra packet length check for Apple vendor data
Johan Hedberg [Wed, 6 Nov 2013 12:35:47 +0000 (14:35 +0200)]
monitor: Fix missing break in switch statement
Johan Hedberg [Wed, 6 Nov 2013 11:48:03 +0000 (13:48 +0200)]
tools/smp-tester: Clarify bthost callback naming
Johan Hedberg [Wed, 6 Nov 2013 11:27:02 +0000 (13:27 +0200)]
tools/smp-tester: Add initial SMP client test code