Commit Graph

17498 Commits

Author SHA1 Message Date
Andrzej Kaczmarek
18f045b574 android/socket: Simplify SDP records handling
Records are now created using helper function which creates SDP record
with common contents like service class, name and protocols. Other
attributes are then added by custom functions.
2014-02-12 13:50:49 +01:00
Andrzej Kaczmarek
a5e248b29d android/socket: Improve logging
This patch makes logging more consistent by including rfsock pointer in
most messages which identifies socket structure unambigously (instead
of using bunch of file descriptors for the same purpose) and puts other
parameters in order in some cases.

Additionally, some new logs are introduced to better track socket
structures and connections lifetime.
2014-02-12 13:50:49 +01:00
Andrzej Kaczmarek
30023350be android/socket: Refactor socket related symbol names
This patch changes names of symbols related to various sockets to be
consistent and easier to follow in code.

Symbols related to actual BT (RFCOMM) socket are prefixed with "bt_".
Symbols related to local socket for Java comm are prefixed with "jv_".
Remote socket for Java comm is called "hal_sock".
2014-02-12 13:50:49 +01:00
Andrzej Kaczmarek
eb5e7f97e6 android/bluetooth: Handle 128-bit UUIDs
It's now possible to add record with 128-bit UUID Service Class which
are used for custom applications. To simplify implementation adapter
uuids list stores now full UUID in uuid_t structure instead of uint16_t
short UUID.
2014-02-12 13:50:49 +01:00
Szymon Janc
b751d1894b android: Fix btmon build 2014-02-12 13:49:53 +01:00
Anderson Lizardo
8e2a1c26b5 unit: Fix memory leaks in gobex tests 2014-02-12 11:49:31 +02:00
Anderson Lizardo
124f6f0595 android: Add test-ipc to "make check" 2014-02-12 11:49:31 +02:00
Anderson Lizardo
10be885113 android/test-ipc: Fix crash due to invalid ipc_register() parameter
This test checks for proper handling of invalid Service ID on a IPC
message, but it was attempting to register handlers for this invalid ID,
which on current ipc_register() implementation was causing a buffer
overrun.

The fix was to use a valid ID during registration, but still attempt to
use an invalid one when sending the message.
2014-02-12 11:26:56 +02:00
Anderson Lizardo
e6c0fa067b android/client: Fix set_info command
Although this command is not implemented by BlueZ, make sure it is
callable from haltest so at least the IPC can be tested.

Also memset() the hid_info parameter to not pass uninitialized data
around.
2014-02-12 11:26:56 +02:00
Anderson Lizardo
cdbede8514 android/hidhost: Trivial coding style fix
Fix two lines over 80 columns.
2014-02-12 11:26:56 +02:00
Anderson Lizardo
03a24ae461 android/tester: Update SDP PDU after UUID change
Now it is expected to receive a 16-bit UUID for PNP_INFO.
2014-02-12 11:26:56 +02:00
Anderson Lizardo
9b00e93b11 android: Use 16-bit UUID for SDP search
These UUIDs are assigned by BT-SIG and therefore there is no need to
use full 128-bit UUIDs. This also avoids unnecessary conversion from
string representation.
2014-02-12 11:26:56 +02:00
Marcel Holtmann
849cc4f912 tools: Use shared btsnoop.h header file for utility 2014-02-11 11:55:06 -08:00
Marcel Holtmann
6d30d42da2 monitor: Use shared btsnoop for reading and writing trace files 2014-02-11 11:53:00 -08:00
Marcel Holtmann
b1e20ea79a shared: Add reading/writing support for btsnoop HCI packets 2014-02-11 11:52:14 -08:00
Marcel Holtmann
f5bf07f499 monitor: Use shared btsnoop code wherever possible 2014-02-11 11:13:59 -08:00
Marcel Holtmann
657958bdc4 shared: Add data structure for new index monitor event 2014-02-11 11:12:44 -08:00
Marcel Holtmann
56fb98f3b6 shared: Update copyright information 2014-02-11 11:04:11 -08:00
Marcel Holtmann
e691f2573a monitor: Update copyright and license details 2014-02-11 10:59:14 -08:00
Marcel Holtmann
cde69653e0 android: Update copyright and license details 2014-02-11 10:42:56 -08:00
Luiz Augusto von Dentz
6260f507a5 avrcp: Fix sending invalid attributes in GetCurrentPlayerValue
If the response to ListPlayerAttributes contains invalid attributes they
should not be send in GetCurrentPlayerValue.
2014-02-11 20:25:21 +02:00
Andrei Emeltchenko
bc13c6b63d avrcp: Fix using incorrect buffer for SetVolume
The command requires one parameter.
2014-02-11 19:21:09 +02:00
Andrei Emeltchenko
1ee30fa6ef unit/avctp: Cleanup code, remove fragmentation support 2014-02-11 19:21:09 +02:00
Andrei Emeltchenko
d3fd69d980 unit/avctp: Use pre-defined values instead of magic numbers 2014-02-11 19:21:09 +02:00
Andrzej Kaczmarek
0a38f7f3e5 android/README: Add Valgrind description 2014-02-11 17:31:42 +01:00
Andrzej Kaczmarek
1b7c044dc4 android: Add support for Valgrind in debug variants
This patch allows bluetoothd to be run with Valgrind easily in debug
variants.

For userdebug and eng variants bluetoothd is renamed to bluetoothd-main
and bluetoothd acts a wrapper to launch it either with or without
Valgrind (this is decided by value of persist.sys.bluetooth.valgrind
property).
2014-02-11 17:31:39 +01:00
Szymon Janc
ba4702b208 android/handsfree: Use uint16_t for buffer length in IPC messages
This will match other IPC messages format.
2014-02-10 16:08:50 +01:00
Szymon Janc
5827e1f047 android: Fix Handsfree volume command notification description 2014-02-10 13:38:36 +01:00
Szymon Janc
b79d1f2d39 android/hal-msg: Match handsfree structures to IPC document 2014-02-10 13:38:36 +01:00
Luiz Augusto von Dentz
ea609c0b01 android/avdtp: Fix coding style
Respect 80 columns limit.
2014-02-10 14:08:45 +02:00
Andrei Emeltchenko
6f166ec0c9 bnep: Calculate ifindex after NULL check 2014-02-10 14:08:45 +02:00
Andrei Emeltchenko
00c35d3f1d android/avdtp: Fix passing NULL pointer to memcpy
The patch fixes following clang warning:
...
profiles/audio/avdtp.c:3293:2: warning: Null pointer passed as an
argument to a 'nonnull' parameter
        memcpy(cap->data, data, length);
        ^                 ~~~~
2014-02-10 14:08:45 +02:00
Andrei Emeltchenko
47f6853fa2 android/avdtp: Fix passing NULL pointer to memcpy
send_request can be called as
send_request(session, FALSE, NULL, AVDTP_DISCOVER, NULL, 0) with NULL
pointer which is passed to memcpy().
2014-02-10 14:08:45 +02:00
Andrei Emeltchenko
600ad0f6cd android/haltest: Remove unneeded assignment 2014-02-10 14:08:45 +02:00
Szymon Janc
d2e481c322 android/build: Some whitespace fixes 2014-02-10 13:05:45 +01:00
Szymon Janc
6a43401fb7 android/build: Match compiler options used in autotools and Android.mk 2014-02-10 13:05:45 +01:00
Andrzej Kaczmarek
4190ac1223 android/a2dp: Fix audio deregistration
Unregistering a SEP can trigger abort_cfm callback if some device is
connected thus we should free setups list after all endpoints are
unregistered to avoid error in abort_cfm due to non-existing setup.
2014-02-10 13:22:57 +02:00
Andrzej Kaczmarek
496dd38b11 android/a2dp: Disconnect headset on IPC failure
In case audio IPC is suddenly disconnected (most likely due to crash of
mediaserver process) we should disconnect headset since it is no longer
associated with valid setup and cannot be used properly.
2014-02-10 13:22:57 +02:00
Andrzej Kaczmarek
17b55a1f90 android/hal-audio: Write SBC parameters to logcat 2014-02-10 13:22:57 +02:00
Andrzej Kaczmarek
3290badf07 android/hal-audio: Ignore write call when closing
We should not try to neither auto-resume nor write when state is set to
NONE as this is case when we're being closed and it's ok do ignore
write request.
2014-02-10 13:22:57 +02:00
Andrzej Kaczmarek
217b2102f1 android/a2dp: Notify audio state on SEP close 2014-02-10 13:22:57 +02:00
Andrzej Kaczmarek
4e50a5f7ff android/a2dp: Shutdown AVDTP gracefully
When shutting down AVDTP connection we first abort and wait for stream
to go to idle state before disconnecting signalling channel.
2014-02-10 13:22:56 +02:00
Andrei Emeltchenko
a7032c97ef android/haltest: Close file in case of error 2014-02-07 11:03:08 +01:00
Szymon Janc
7bb2a16843 android/pan: Bring bridge interface down before removing it
Otherwise bridge will be 'in use' and won't be removed.
2014-02-07 11:21:22 +02:00
Szymon Janc
5ab76c6042 android/pan: Pass error in nap_remove_bridge
Don't return EOPNOTSUPP but just pass error from errno.
2014-02-07 11:21:22 +02:00
Szymon Janc
b4fbbb033e android/pan: Use ioctl instead of sysfs for setting forward delay
Using sysfs is causing problems due to filesystem permissions
(bluetoothd is running as bluetooth user) and bluetoothd already has
required capabilities for setting forward delay through ioctl.
2014-02-07 11:21:22 +02:00
Ravi kumar Veeramally
ce8bf58e5f android/pan: Fix bnep interface name
Android uses bt-pan static interface in PAN profile. In server role
it uses it as bridge name. But current implementaion passes interface
names like bnep0, bnep1... Android Framework is unaware of this name
and unable to allocate IP address after profile connection setup.
2014-02-07 11:21:22 +02:00
Szymon Janc
375bed1c4d android/pan: Fix unregistering NAP bridge
This fix not removing NAP bridge in case of error or last device
disconnect.
2014-02-07 11:21:22 +02:00
Szymon Janc
29bf1a3aab android/pan: Move functions up to avoid forward declarations 2014-02-07 11:21:22 +02:00
Szymon Janc
800c6b6678 profiles/network: Allow to pass interface name to bnep_new 2014-02-07 11:21:22 +02:00