OSDN Git Service
Zach Johnson [Fri, 29 Aug 2014 00:05:08 +0000 (17:05 -0700)]
Remove indirection in the controller reset sequence
Sharvil Nanavati [Thu, 28 Aug 2014 04:56:41 +0000 (21:56 -0700)]
Fix issue where last character of device name is missing
The device name stored on disk is correct but has a missing character
at the end when read off of disk. This happened because the returned
|length| parameter to |btif_config_get_str| is in number of *bytes*,
not in number of characters (i.e. must add one for NULL character).
Sharvil Nanavati [Thu, 28 Aug 2014 02:03:03 +0000 (19:03 -0700)]
Add a UUID module to btcore for operating on UUIDs.
This change only adds a single function, uuid_is_empty, but I expect
other UUID-related functions to find themselves here.
Sharvil Nanavati [Wed, 20 Aug 2014 16:39:25 +0000 (09:39 -0700)]
Introduce btcore, a low-level library to manipulate Bluetooth data types.
This change adds a single module to btcore: bdaddr. The bdaddr module
is reponsible for manipulating and working with Bluetooth addresses.
Zach Johnson [Thu, 21 Aug 2014 00:09:25 +0000 (17:09 -0700)]
Fix digital transposition in saving binary config data
Was causing link keys to be saved/read incorrectly, causing reconnect on reboot to fail.
Sharvil Nanavati [Tue, 19 Aug 2014 16:50:18 +0000 (09:50 -0700)]
Eliminate unused arguments to btif_config and clarify variable names
Sharvil Nanavati [Sat, 16 Aug 2014 01:58:22 +0000 (18:58 -0700)]
Switch over from an XML based file format to .INI-style conf files
This change moves us to using a single file format for all configuration
throughout bluedroid. I've provided a transcoder that converts the
previous config file to the new format so settings will be preserved.
In a future revision of bluedroid, we should remove the transcoder and
drop our dependency on tinyxml2.
Sharvil Nanavati [Thu, 28 Aug 2014 02:05:40 +0000 (19:05 -0700)]
Add a method to check for available bytes on a socket
The available bytes function shouldn't normally be required (and
if it is, the code design is probably bad and should be rethought) but
is introduced as a stop-gap until we can redesign the BTA code that
expects a priori knowledge of the number of bytes that can be read from
the socket.
This change also relaxes the requirement that on socket_register that
at least one of read_cb or write_cb must be specified.
Zach Johnson [Thu, 28 Aug 2014 03:26:00 +0000 (20:26 -0700)]
Make osi_strdup report allocation size correctly
Zach Johnson [Wed, 27 Aug 2014 23:30:29 +0000 (16:30 -0700)]
Move HCI over to the osi allocators, and fix the tests accordingly
Zach Johnson [Wed, 27 Aug 2014 03:16:03 +0000 (20:16 -0700)]
Finish allocation tracking for the rest of osi
And found a memory leak in config, so it's doing its job! :)
Chris Manton [Wed, 27 Aug 2014 04:20:44 +0000 (21:20 -0700)]
Remove unused #define RPC_INCLUDED
Zach Johnson [Wed, 27 Aug 2014 22:45:35 +0000 (15:45 -0700)]
Fix timer allocations in the test harness, so bdtest runs again
Steve Gu [Wed, 27 Aug 2014 17:44:52 +0000 (10:44 -0700)]
Correct comments and some redundant statements.
Chris Manton [Tue, 26 Aug 2014 23:11:45 +0000 (16:11 -0700)]
Remove must-always-be-on #define HCISU_H4_INCLUDED
Zach Johnson [Wed, 27 Aug 2014 03:15:19 +0000 (20:15 -0700)]
Add strdup to tracked allocations
Zach Johnson [Wed, 27 Aug 2014 00:21:44 +0000 (17:21 -0700)]
Add internal constructors to hash map and list
This makes allocation tracker safe and ensures the hash map
and associated lists for the allocation tracker don't show
up in the allocation tracker's stats.
Zach Johnson [Tue, 26 Aug 2014 19:23:09 +0000 (12:23 -0700)]
Clean up scattered naive hash functions
Zach Johnson [Tue, 26 Aug 2014 06:22:24 +0000 (23:22 -0700)]
Move some of osi to use the allocation interfaces
Also changes some tests to ensure all memory freed.
Sharvil Nanavati [Fri, 22 Aug 2014 01:13:46 +0000 (18:13 -0700)]
Add a method to pass file descriptors and one to create a socket from an fd.
June R. Tate-Gans [Thu, 19 Feb 2015 22:29:35 +0000 (14:29 -0800)]
Rewrite the SCO socket implementation to be more robust.
This code presents a socket interface for SCO connections. Like the
previous implementation, it does not support sending/receiving data
over the sockets; rather, it only provides a mechanism to establish
and tear down connections. It is assumed that all SCO data routing is
done out-of-band over PCM/I2S.
A SCO socket is represented internally by a file descriptor and SCO
handle. The file descriptor is one end of a socketpair (the other
end is sent to the Java process) and the SCO handle represents a
server (listening) or client (connecting) socket owned by the BTM
layer of the stack.
The most notable implementation detail is that, unlike typical
sockets, listening SCO sockets get "upgraded" when a connection is
established. In other words, a SCO handle for a listening socket
turns into a handle for a connected socket. To present a BSD-style
API to Java processes, we play a trick: when a listening socket gets
upgraded, we create a new listening SCO socket and reassociate the
SCO handle for the two sockets. The reassociation allows the Java
process to continue listening for new incoming SCO connections on
the same file descriptor.
Ian McKellar [Wed, 19 Feb 2014 23:33:32 +0000 (15:33 -0800)]
Move the disconnect_immediately logic so that it's only in effect for data sockets
Ian McKellar [Thu, 13 Feb 2014 22:11:06 +0000 (14:11 -0800)]
Clear connected & disconnect_immediately flags when intializing SCO sockets
Ian McKellar [Tue, 11 Feb 2014 00:52:26 +0000 (16:52 -0800)]
Fix a race condition where closing a SCO connection that was not yet fully open would silently fail.
Ian McKellar [Fri, 10 Jan 2014 02:28:30 +0000 (18:28 -0800)]
Clean up closed SCO listen sockets
Ian McKellar [Thu, 9 Jan 2014 22:51:49 +0000 (14:51 -0800)]
Fix locking in btsock_sco_signaled
Ian McKellar [Mon, 16 Dec 2013 20:26:19 +0000 (12:26 -0800)]
Refactor SCO code to allow closing
Ian McKellar [Fri, 8 Nov 2013 00:30:05 +0000 (16:30 -0800)]
SCO socket support in bluedroid
Chris Manton [Tue, 6 May 2014 17:35:42 +0000 (10:35 -0700)]
Enforce GKI API buffer usage
Also add another API GKI_queue_length(BUFFER_Q *)
Sharvil Nanavati [Fri, 22 Aug 2014 20:44:24 +0000 (13:44 -0700)]
Refactor RFCOMM code; also fixes a random-disconnect / performance bug.
The majority of this change is just style cleanup and eliminating
unnecessary code. There was a bug in the code where, if an entire
data buffer gets successfully written to the app, the rest of the
queue is not drained and the connection may get dropped. This bug
came about due to an early function exit from a switch statement
instead of breaking out of the switch.
Zach Johnson [Mon, 25 Aug 2014 23:44:56 +0000 (16:44 -0700)]
Implement memory allocation tracker
Provides an interface to track memory allocations, and assert
bad things like double frees don't happen.
Zach Johnson [Tue, 26 Aug 2014 01:21:12 +0000 (18:21 -0700)]
Add common hash functions so we don't have to redefine everywhere
Chris Manton [Tue, 26 Aug 2014 00:54:40 +0000 (17:54 -0700)]
Remove unnecessary layer of indirection
Chris Manton [Tue, 26 Aug 2014 16:41:13 +0000 (09:41 -0700)]
Add back hash_map_test to ositests
Somewhere along the way it got lost
Chris Manton [Wed, 13 Aug 2014 23:36:50 +0000 (16:36 -0700)]
Global counter API for bluedroid
Chris Manton [Wed, 13 Aug 2014 23:25:24 +0000 (16:25 -0700)]
Added encapulsated iterator to hashmap
Also added back hash_map_test which seemed
to have been dropped somewhere along the way.
Zach Johnson [Fri, 22 Aug 2014 04:00:43 +0000 (21:00 -0700)]
Modify eager reader to support multi-byte reads
Zach Johnson [Thu, 21 Aug 2014 06:25:36 +0000 (23:25 -0700)]
H4: -1 -> INVALID_FD; make uart_fd invalid on close
Zach Johnson [Thu, 21 Aug 2014 06:12:33 +0000 (23:12 -0700)]
Implement an HCI HAL for MCT
Unit tested. Needs verification on actual device (i.e. HDP profile).
Zach Johnson [Thu, 21 Aug 2014 01:09:06 +0000 (18:09 -0700)]
Scope the lock_count variable in the alarm test harness
Zach Johnson [Thu, 21 Aug 2014 00:51:26 +0000 (17:51 -0700)]
Unspecial-case the zero queue in the data dispatcher
Since hash map supports zero keys now this is no longer necessary.
Zach Johnson [Sat, 16 Aug 2014 00:00:17 +0000 (17:00 -0700)]
Refactor HCI layer
Refactor the HCI layer for better testability.
A future CL will add a HAL implementation for multi channel transport.
Since btsnoop and vendor are modified, it's not easy to incrementally introduce these changes.
Zach Johnson [Tue, 5 Aug 2014 03:51:06 +0000 (20:51 -0700)]
Add eager reader
Zach Johnson [Fri, 15 Aug 2014 23:50:32 +0000 (16:50 -0700)]
Add stub testing macros
Zach Johnson [Fri, 15 Aug 2014 23:49:15 +0000 (16:49 -0700)]
Refactor alarm tests to use a test harness
This improves the test writing experience for tests that rely on alarm code.
Zach Johnson [Fri, 15 Aug 2014 23:46:59 +0000 (16:46 -0700)]
Add some stream skip macros for code clarity
Zach Johnson [Fri, 15 Aug 2014 23:44:46 +0000 (16:44 -0700)]
Add peek + dequeue registratation to fixed queue
Zach Johnson [Fri, 15 Aug 2014 23:43:32 +0000 (16:43 -0700)]
Add a join function to thread
Zach Johnson [Fri, 15 Aug 2014 23:41:58 +0000 (16:41 -0700)]
Make hash map support NULL or 0 keys
Zach Johnson [Fri, 15 Aug 2014 23:39:33 +0000 (16:39 -0700)]
Add an allocator interface + default malloc allocator
Sharvil Nanavati [Wed, 13 Aug 2014 07:40:49 +0000 (00:40 -0700)]
Switch to an epoll-based reactor implementation.
epoll is a much nicer interface that very closely matches the
reactor interface. It's also thread-safe which makes it a more
suitable choice for bluedroid. As a result of this change,
reactor_register and reactor_unregister are both thread-safe without
introducing any synchronization in user-space.
Sharvil Nanavati [Sat, 9 Aug 2014 01:26:27 +0000 (18:26 -0700)]
Fix build after enabling assertions: variable reactor is no longer defined.
Sharvil Nanavati [Sat, 16 Aug 2014 01:39:16 +0000 (18:39 -0700)]
Add a function to check if a string represents a bdaddr
Sharvil Nanavati [Fri, 15 Aug 2014 23:14:26 +0000 (16:14 -0700)]
Const-correctness for str2bd.
Sharvil Nanavati [Fri, 15 Aug 2014 22:04:46 +0000 (15:04 -0700)]
Add a method to create a config object without loading from disk.
Sharvil Nanavati [Thu, 14 Aug 2014 19:36:39 +0000 (12:36 -0700)]
Add thread_is_self function
This is useful to compare the current thread against another one.
Sharvil Nanavati [Wed, 13 Aug 2014 08:14:49 +0000 (01:14 -0700)]
Add a tool to inject HCI commands into bluedroid.
This tool is very primitive in a number of ways. First, each new
HCI command needs to be carefully crafted. Second, it is entirely
stateless and operates in "fire-and-forget" mode. In other words,
there's no "read-modify-write" capability yet. That being said,
this tool will grow along with the infrastructure in bluedroid.
Chris Manton [Tue, 12 Aug 2014 21:11:38 +0000 (14:11 -0700)]
btpan thread signal function workaround
btsock does not provide a reliable teardown
procedure. Stale file descriptors may continue
to actively invoke signal callbacks from the
btsock thread. Extra logic to handle gracefully.
Chris Manton [Wed, 13 Aug 2014 18:00:17 +0000 (11:00 -0700)]
Extend add/subtract operations to atomics
Going to be used for counters
Chris Manton [Wed, 6 Aug 2014 16:36:17 +0000 (09:36 -0700)]
Add 64 bit atomic types
Chris Manton [Tue, 5 Aug 2014 19:16:48 +0000 (12:16 -0700)]
Increase thread queue size above default
The UART enqueues work requests in addition to
the actual work onto the rx_q. Many small byte
packets received by the UART cause many work requests
which may fill the work queue causing deadlock.
Chris Manton [Tue, 5 Aug 2014 18:10:12 +0000 (11:10 -0700)]
Add fixed queue size option to thread creation
Chris Manton [Tue, 5 Aug 2014 18:07:23 +0000 (11:07 -0700)]
Expose fixed queue capacity
Zach Johnson [Tue, 5 Aug 2014 03:49:49 +0000 (20:49 -0700)]
Fix reactor to use prepend, fix reactor tests
Zach Johnson [Tue, 5 Aug 2014 03:47:52 +0000 (20:47 -0700)]
Fix socket to use safe reactor registration
Zach Johnson [Tue, 29 Jul 2014 23:25:02 +0000 (16:25 -0700)]
Implement a data dispatcher.
This will be useful at layer boundaries.
Zach Johnson [Tue, 5 Aug 2014 03:45:22 +0000 (20:45 -0700)]
Hide thread's reactor
Zach Johnson [Wed, 30 Jul 2014 20:40:09 +0000 (13:40 -0700)]
Add functions on fixed_queue to check empty state
Steve Gu [Tue, 5 Aug 2014 19:34:33 +0000 (12:34 -0700)]
Replace magic number used instead of MAX_RFC_CHANNEL number.
Chris Manton [Wed, 30 Jul 2014 17:51:07 +0000 (10:51 -0700)]
osi: Support for atomic data types
Sharvil Nanavati [Sat, 2 Aug 2014 01:40:15 +0000 (18:40 -0700)]
Fix build: include osi.h from semaphore to get definition of INVALID_FD
Sharvil Nanavati [Sat, 2 Aug 2014 00:00:12 +0000 (17:00 -0700)]
Define INVALID_FD to improve readability and reduce likelihood of errors
Sharvil Nanavati [Mon, 28 Jul 2014 04:12:20 +0000 (21:12 -0700)]
Allow iterating over sections in a config file and writing config to disk.
These two additional operations will allow us to replace the existing
XML-based config files and switch to a single file format.
Sharvil Nanavati [Sat, 26 Jul 2014 05:20:46 +0000 (22:20 -0700)]
Switch over duplicated timer_create routines to new alarm code.
Sharvil Nanavati [Fri, 25 Jul 2014 23:03:15 +0000 (16:03 -0700)]
Add a mechanism for debug tools to inject HCI commands into the HCI stream.
Sharvil Nanavati [Thu, 24 Jul 2014 21:24:27 +0000 (14:24 -0700)]
Expose thread's reactor so we can register new fds with it.
This change allows a thread's reactor loop to manage additional
file descriptors, e.g. sockets and queues, entirely within that
thread's context.
Chris Manton [Thu, 31 Jul 2014 16:22:09 +0000 (09:22 -0700)]
hci: Renaming of callback functions
Changing name to conform to *_cb convention already
in place. Further, current names will be re-used
for osi buffer resource management.
Sharvil Nanavati [Fri, 25 Jul 2014 22:09:51 +0000 (15:09 -0700)]
hash_map header uses standard integral types so it must include stdint.h.
Sharvil Nanavati [Fri, 25 Jul 2014 22:12:36 +0000 (15:12 -0700)]
Wake up reactor whenever a new object is registered/unregistered.
Before this change, if the reactor was blocked waiting for an event
and a new object was registered, it would not wait for events on the
new object until it woke up on its own. This change forces the reactor
to re-evaluate the file descriptor set whenever the object list is
modified.
Sharvil Nanavati [Fri, 25 Jul 2014 22:50:17 +0000 (15:50 -0700)]
Introduce a socket class
This socket implementation is limited to TCP server sockets and
provides no mechanism to connect to a remote host. It's primarily
intended to be used to interface with debugging tools. It's designed
to work seamlessly with the reactor (event-driven) model.
Zach Johnson [Mon, 28 Jul 2014 20:51:03 +0000 (13:51 -0700)]
Remove some unused code in L2CAP
Chris Manton [Tue, 3 Jun 2014 18:02:38 +0000 (11:02 -0700)]
osi: hash map implementation
Andre Eisenbach [Wed, 18 Feb 2015 00:53:48 +0000 (16:53 -0800)]
Fix gatt_main.c compile error due to log macro change
Chris Manton [Tue, 17 Jun 2014 18:17:29 +0000 (11:17 -0700)]
rfcomm: Check for null pointers on DLC request
The function to get the port control block from the DLCI
explicitly mentions it will return NULL if there is no
active rfcomm connection for the given DLCI.
Chris Manton [Fri, 21 Feb 2014 20:36:18 +0000 (12:36 -0800)]
Release GATT resources upon teardown
Sharvil Nanavati [Tue, 21 Jan 2014 02:20:28 +0000 (18:20 -0800)]
Add a system property for libbt-vendor.so initialization timeout
Use a system property, bluetooth.enable_timeout_ms, to specify in ms
how long to wait for libbt-vendor.so to initialize.
Justin Harrison [Thu, 19 Feb 2015 04:48:38 +0000 (04:48 +0000)]
am
45085bf6: Merge "Ignore service UUID length if no UUID filter is specified" into lmp-mr1-dev
* commit '
45085bf6ed93ea9398047c21bc4b94c8516f9daa':
Ignore service UUID length if no UUID filter is specified
Justin Harrison [Thu, 19 Feb 2015 04:44:12 +0000 (04:44 +0000)]
Merge "Ignore service UUID length if no UUID filter is specified" into lmp-mr1-dev
Andre Eisenbach [Thu, 19 Feb 2015 02:14:02 +0000 (02:14 +0000)]
am
114c9ce4: Merge "Increase SDP buffer from 750 bytes to 4096 bytes" into lmp-mr1-dev
* commit '
114c9ce459e9d9e40d55586da1d18d0d65c45c8d':
Increase SDP buffer from 750 bytes to 4096 bytes
Andre Eisenbach [Thu, 19 Feb 2015 01:16:36 +0000 (01:16 +0000)]
Merge "Increase SDP buffer from 750 bytes to 4096 bytes" into lmp-mr1-dev
Andre Eisenbach [Thu, 19 Feb 2015 00:33:34 +0000 (16:33 -0800)]
Ignore service UUID length if no UUID filter is specified
Bug:
19016326
Change-Id: I6156fee1d6079fec7879f47b6120befe2c4d35cd
Andre Eisenbach [Tue, 10 Feb 2015 00:27:01 +0000 (00:27 +0000)]
am
dfb3b2f2: Add flag indicating encrypted connections to btif_dm_get_connection_state()
* commit '
dfb3b2f2595dc16fe7f576a4b0c2f5e73db0327f':
Add flag indicating encrypted connections to btif_dm_get_connection_state()
Andre Eisenbach [Fri, 6 Feb 2015 04:00:45 +0000 (20:00 -0800)]
Add flag indicating encrypted connections to btif_dm_get_connection_state()
Add a check to btif_dm_get_connection_state() to see if the currently
active connection is encrypted.
Bug:
19186961
Change-Id: I27bcc6e296d272ffd17c0bbe97631ffa4df57ccd
Andre Eisenbach [Thu, 5 Feb 2015 05:02:29 +0000 (05:02 +0000)]
am
d6f2fa93: (-s ours) am
d6419cd6: am
0a8c803a: am
7f34538a: (-s ours) am
65aec3a3: am
6d429d9d: (-s ours) am
3efb9e2e: DO NOT MERGE Change pairing_cb to assume temporary pairing by default
* commit '
d6f2fa93052c1d9bdf6035ace6b32345013516db':
DO NOT MERGE Change pairing_cb to assume temporary pairing by default
Andre Eisenbach [Thu, 5 Feb 2015 04:52:37 +0000 (04:52 +0000)]
am
e791f732: (-s ours) am
ae9d174b: am
408dec19: am
977acabd: (-s ours) am
eebc8ab9: DO NOT MERGE Change pairing_cb to assume temporary pairing by default
* commit '
e791f73202a2832b4d20dbc1ecd4b520adbb75d3':
DO NOT MERGE Change pairing_cb to assume temporary pairing by default
Andre Eisenbach [Thu, 5 Feb 2015 04:52:25 +0000 (04:52 +0000)]
am
0ad6cfde: (-s ours) am
ce5ae4ab: am
a708936d: DO NOT MERGE Change pairing_cb to assume temporary pairing by default
* commit '
0ad6cfdee8857a7bc54d4c3eb98bf1cdc82dc9a7':
DO NOT MERGE Change pairing_cb to assume temporary pairing by default
Andre Eisenbach [Thu, 5 Feb 2015 04:38:21 +0000 (04:38 +0000)]
am
d6419cd6: am
0a8c803a: am
7f34538a: (-s ours) am
65aec3a3: am
6d429d9d: (-s ours) am
3efb9e2e: DO NOT MERGE Change pairing_cb to assume temporary pairing by default
* commit '
d6419cd6309bd20a2ab095c783bb6ad1f208bf4f':
DO NOT MERGE Change pairing_cb to assume temporary pairing by default
Andre Eisenbach [Thu, 5 Feb 2015 04:32:54 +0000 (04:32 +0000)]
am
0a8c803a: am
7f34538a: (-s ours) am
65aec3a3: am
6d429d9d: (-s ours) am
3efb9e2e: DO NOT MERGE Change pairing_cb to assume temporary pairing by default
* commit '
0a8c803a48fe5afa71d1f8660539012e9b1f9642':
DO NOT MERGE Change pairing_cb to assume temporary pairing by default
Andre Eisenbach [Thu, 5 Feb 2015 04:25:27 +0000 (04:25 +0000)]
am
7f34538a: (-s ours) am
65aec3a3: am
6d429d9d: (-s ours) am
3efb9e2e: DO NOT MERGE Change pairing_cb to assume temporary pairing by default
* commit '
7f34538ac0e447a88d1f54ff819c28b3574f0aa4':
DO NOT MERGE Change pairing_cb to assume temporary pairing by default
Andre Eisenbach [Thu, 5 Feb 2015 04:21:04 +0000 (04:21 +0000)]
am
65aec3a3: am
6d429d9d: (-s ours) am
3efb9e2e: DO NOT MERGE Change pairing_cb to assume temporary pairing by default
* commit '
65aec3a3f62c004d7073470f18330007b7ecf230':
DO NOT MERGE Change pairing_cb to assume temporary pairing by default