History log of /system/bt/bta/gatt/bta_gattc_main.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
56658ccb40957a296f6600bdfed529d3f6e264a7 06-Mar-2016 Jakub Pawlowski <jpawlowski@google.com> GATT cache storage refactoring

Currently when storing GATT cache into file, we save it piece
after piece, max 10 elements at once. This is not necessary,
we have enough space to just save all at once.
Also the logic doesn't need to be so complicated - no need
to state machine for such simple task.

Bug: 27455533
Change-Id: I82923dbedfb317835e45e13e0ea28151eb524d37
/system/bt/bta/gatt/bta_gattc_main.c
a11035b5ecbc6cbd9da5bd707683504c47e2744e 28-Sep-2015 Pavlin Radoslavov <pavlin@google.com> GKI cleanup - moved GKI buffer allocation wrappers to OSI

* Moved the following GKI buffer allocation functions to OSI:
- GKI_getbuf() -> osi_getbuf()
- GKI_freebuf() -> osi_freebuf()
- GKI_get_buf_size() -> osi_get_buf_size()

For now we need the osi_getbuf() / osi_freebuf() allocation wrapper,
because we need to be able to call osi_get_buf_size() on the allocated
buffer.
In the future those should be replaced with osi_malloc() / osi_free().
Currently, the osi_malloc() buffer size internal allocation tracker
does not always track the size, hence we need the osi_getbuf() wrapper.

* Replaced GKI_MAX_BUF_SIZE with BT_DEFAULT_BUFFER_SIZE

* Added new file include/bt_common.h that can be usee to include
few files that should be included alost everywhere (e.g. bt_target.h"
NOTE: This file might be removed in the future and we should include
everywhere the right set of header files.

* Removed some of the GKI-related references

* Removed file include/gki_target.h

Change-Id: Ie87830e73143de200746d54235aa99f228a95024
/system/bt/bta/gatt/bta_gattc_main.c
90715aad34cdead03fc22bc18891c04838e90e87 01-Jul-2014 Mike J. Chen <mjchen@google.com> Fix GKI buffer leak in GATT event handling

The GATT event handler was telling the BTA dispatcher that
it would always free the GKI msg buffers itself, but in fact
this wasn't true. There were some cases where the buffer is
queued and freed later (queued in p_clcb->p_q_cmd for later
access and freeing), but many times the event handlers
(like bta_gattc_ci_save()) don't queue the buffer and don't
free it, causing a GKI buffer leak.

Also, prevent a double free case (not certain it happens, but
in theory it could) if bta_gattc_sm_execute() queues a buffer
in bta_gattc_disc_cmpl().

Lastly, remove held flag since it's redundant with whether
p_q_cmd is null or not. Just go with one source of truth and
not have one shadow the other.

Change-Id: I1bd43919b8a2e125076e26cd6a3a08480b3e7e2d
Signed-off-by: Mike J. Chen <mjchen@google.com>
/system/bt/bta/gatt/bta_gattc_main.c
afa6e1abbedaad8fe854b0f43999b8aeb801af91 28-Jun-2014 Matthew Xie <mattx@google.com> resolved conflicts for merge of e8c3d75b to master

Change-Id: I78ef69c4d54a36243620ae14296d3507e3339567
17b04bd498405f2bb109a85562ebbdcb6bb06e95 28-Mar-2014 Andre Eisenbach <andre@broadcom.com> LE: Add notification sent and congestion callbacks (2/4)

This change introduces two new callbacks for applications to better
handle LE notification flow control and transport congestion. The
notification callback is invoked when the remote platform confirms an
indication or when a local notification has been passed to the
controller. No new notifications should be sent until a callback is
received.

Congestion callbacks are triggered when a GATT operation cannot be sent
to the local Bluetooth controller. Repeatedly calling
writeCharacteristic() for example will eventually trigger a congestion
callback. Applications cannot send additional data until a further
callback is received, indicating that the congestion has cleared up.

Also fixes a memory leak issue that can trigger GKI exception for
certain GATT operations.

Change-Id: Ib470c15ca1f577573a632e9afe4cb9e86680fd8c
/system/bt/bta/gatt/bta_gattc_main.c
e8c3d75b75493911ebf0f99c83676359657178f7 04-May-2014 Sharvil Nanavati <sharvil@google.com> Logging cleanup: BTIF and APPL.

Change-Id: I5b1214642bbb4b9aecc0fd2c899a6ec2c9793286
/system/bt/bta/gatt/bta_gattc_main.c
7fa4fba6f59f97df00aff07dbe8fb21b114b3c2c 17-Apr-2014 Ganesh Ganapathi Batta <ganeshg@broadcom.com> Merge BT 4.1 features

The features include:
- LE Peripheral Mode
- Link Layer topology (LE Central & Peripheral Concurrency)
- Dual Mode Topology (Ability to choose LE transport when connecting with
other Dual Mode devices)
- Fast advertising Interval
- Limited Discovery Time Changes
- GAP Authentication and Lost Bond
- Dual Mode Addressing
- Common Profile and Service Error Code
- 32 bit UUIDs

Change-Id: Ic6701da4cf6aaa390ff2c8816b43157f36b7fb42

Conflicts:
stack/btu/btu_hcif.c
/system/bt/bta/gatt/bta_gattc_main.c
8fe58875ce67c6e1099e7ba2339dcd2b979491b0 17-Apr-2014 Ganesh Ganapathi Batta <ganeshg@broadcom.com> Merge BT 4.1 features

The features include:
- LE Peripheral Mode
- Link Layer topology (LE Central & Peripheral Concurrency)
- Dual Mode Topology (Ability to choose LE transport when connecting with
other Dual Mode devices)
- Fast advertising Interval
- Limited Discovery Time Changes
- GAP Authentication and Lost Bond
- Dual Mode Addressing
- Common Profile and Service Error Code
- 32 bit UUIDs

Change-Id: Ic6701da4cf6aaa390ff2c8816b43157f36b7fb42
/system/bt/bta/gatt/bta_gattc_main.c
9291a71c28b2eedff2c1ad760ebe3b3c1f5a6a29 25-Mar-2014 Zhihai Xu <zhihaixu@google.com> LE: Add API to configure MTU for a given connection (2/4)
This patch from broadcom(andre)
bug:13571470
Change-Id: I932905590ee9c40cb67e7d09715c0f8e59d2f662
/system/bt/bta/gatt/bta_gattc_main.c
7723c29824ed6e8fc5b97efb6c5a18a72838f859 03-Mar-2014 Zhihai Xu <zhihaixu@google.com> open GATT client didn't reserve the BLE link if open after connected.

need to reserve the BLE link to avoid BLE disconnection.
BTA_GATTC_OPEN_ERROR won't resereve the BLE link usage.
use BTA_GATTC_OPEN instead of BTA_GATTC_OPEN_ERROR to reserve the
BLE link. other the stack disconnect the BLE link due to no Gatt interface
use this connection.

bug:13228455
Change-Id: I1f9daa2171668f2ae535d998b401f1f0825d0451
/system/bt/bta/gatt/bta_gattc_main.c
d5733232313da1a9a6c27c37c1ce8dc2d7c790ac 03-Mar-2014 Zhihai Xu <zhihaixu@google.com> open GATT client didn't reserve the BLE link if open after connected.

need to reserve the BLE link to avoid BLE disconnection.
BTA_GATTC_OPEN_ERROR won't resereve the BLE link usage.
use BTA_GATTC_OPEN instead of BTA_GATTC_OPEN_ERROR to reserve the
BLE link. other the stack disconnect the BLE link due to no Gatt interface
use this connection.

bug:13228455
Change-Id: I1f9daa2171668f2ae535d998b401f1f0825d0451
/system/bt/bta/gatt/bta_gattc_main.c
e96ce0e945e210b22bbf6a3869809852c7e1d35e 06-Mar-2014 Andre Eisenbach <andre@broadcom.com> DO NOT MERGE: LE: Add status callback function for LE broadcasts
Cherry pick from master

Change-Id: If4342050ce1141a9c2111286e7b3cccdc012a91e
/system/bt/bta/gatt/bta_gattc_main.c
9426d530e9bbc5d3ffae55515388d49185c61325 25-Mar-2014 Andre Eisenbach <andre@broadcom.com> LE: Add API to configure MTU for a given connection (2/4)

bug:13571470
Change-Id: I932905590ee9c40cb67e7d09715c0f8e59d2f662
/system/bt/bta/gatt/bta_gattc_main.c
a4611ac05f07360785adcff8640da01a3894e4c5 06-Mar-2014 Andre Eisenbach <andre@broadcom.com> DO NOT MERGE: cherrypick from master to fix b/13289050

LE: Add status callback function for LE broadcasts

Change-Id: If4342050ce1141a9c2111286e7b3cccdc012a91e
/system/bt/bta/gatt/bta_gattc_main.c
b9912730d082c7bca7d94bb9ddac4447cfad362f 13-Nov-2013 Zhihai Xu <zhihaixu@google.com> DO NOT MERGE BLE HID device connection failure due to security error.

When HID BLE device start encryption, if some other GATT application
already start encryption(but not finished yet) by calling
gatt_security_check_start. The HID BLE device will be failed to start
encryption, which will cause it to disconnect the BLE HID connection.
The solution is to check whether we already started the encryption
, If the encryption is already started, wait until the encryption
finished, then continue to start security check for BLE HID device.
add encrytion complete event to notify all GATT client encryption done.
filter the event just for BTA HH LE GATT client.

bug:11636246
Change-Id: If58e57c623cc8cfa05208587b010bec68c71306c
/system/bt/bta/gatt/bta_gattc_main.c
7051db3a486aae771d9b5a81c3546790f86ede34 13-Nov-2013 Zhihai Xu <zhihaixu@google.com> BLE HID device connection failure due to security error.

When HID BLE device start encryption, if some other GATT application
already start encryption(but not finished yet) by calling
gatt_security_check_start. The HID BLE device will be failed to start
encryption, which will cause it to disconnect the BLE HID connection.
The solution is to check whether we already started the encryption
, If the encryption is already started, wait until the encryption
finished, then continue to start security check for BLE HID device.
add encrytion complete event to notify all GATT client encryption done.
filter the event just for BTA HH LE GATT client.

bug:11636246
Change-Id: If58e57c623cc8cfa05208587b010bec68c71306c
/system/bt/bta/gatt/bta_gattc_main.c
5c44e45473e5fc2fa89411ab1add7dbfc979f1f8 07-Aug-2013 Andre Eisenbach <andre@broadcom.com> LE: Add peripheral role support (2/4)

Initial stack support for the LE peripheral role.

Change-Id: I261d751b43b7020760bff345b472b6f60caa60be
/system/bt/bta/gatt/bta_gattc_main.c
6975b4d711142b885af479721cada448952c6b41 06-Aug-2013 Andre Eisenbach <andre@broadcom.com> LE: UPF 45 bug fixes

This change fixes the following issues:
- Second GATT-over-BR/EDR channel cannot be established when there
already is an existing GATT-over-BR/EDR channel
- If encryption fails for an LE connection due to a missing key,
the security state is not being cleared and blocks all further
security processing
- When DM discovery of an LE Peripheral device fails with a
connection timeout, no further discovery requests can be made
- GATT service discovery can get into endless loop when duplicate descriptor
definitions are found on the remote device
- When GATT over BR/EDR fails, BTA does not give a connection
callback to the application initiating the connection
- BR/EDR connection to remote platform does not generate API callbacks
- Stack crash discovered during UPF after remote disconnects
- The host is sending HCI disconnect to invalid HCI handle when
SMP fails because of a connection timeout
- Possible race condition:
If a disconnect is immediately followed by a connection complete,
the connection complete cannot be processed in the BTA GATT state
machine
- Write Complete event is not triggered for Prepare Write requests

Change-Id: I539cdedd68007818ff4f0d0213cee1c913f72d0f

Conflicts:
bta/gatt/bta_gatts_act.c
/system/bt/bta/gatt/bta_gattc_main.c
e1202caae4920139ea0cfed5c51f5f76b2dc8bc4 15-May-2013 Andre Eisenbach <andre@broadcom.com> LE: Add GATT disable functions

This patch adds required disable functions to the GATT sub-system to
properly unregister with the stack. Without the disable functions in
place, turning Bluetooth off with a GATT device connected may lead to
unexpected behaviour and cause GATT to fail on sub-sequent stack
restarts.

Change-Id: I7cb80e96109e2c09882991298d0487b506f5ffdd
/system/bt/bta/gatt/bta_gattc_main.c
ead3cde4bac0c3e32cd31f149093f004eef8ceeb 06-Feb-2013 Ganesh Ganapathi Batta <ganeshg@broadcom.com> Initial version of BLE support for Bluedroid

Change-Id: I9825a5cef9be2559c34c2a529b211b7d471147cf
/system/bt/bta/gatt/bta_gattc_main.c
5738f83aeb59361a0a2eda2460113f6dc9194271 13-Dec-2012 The Android Open Source Project <initial-contribution@android.com> Snapshot cdeccf6fdd8c2d494ea2867cb37a025bf8879baf

Change-Id: Ia2de32ccb97a9641462c72363b0a8c4288f4f36d
/system/bt/bta/gatt/bta_gattc_main.c