History log of /system/bt/stack/gatt/gatt_cl.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
12265e39b511f28425236b0dc97c78e7d837304b 13-Feb-2016 Pavlin Radoslavov <pavlin@google.com> Fix C/C++ compiler generated warnings

* Remove unused functions: -Wno-unused-function
* Fix logical operations that are missing parentheses:
-Wno-logical-not-parentheses, -Wno-parentheses
* Add missing braces in initializers: -Wno-missing-braces
* Remove unused variables: -Wno-unused-variable
* Fix printf()-like formatting issues: -Wno-format
* Avoid using unitialized variables:
-Wno-maybe-uninitialized, -Wno-uninitialized
* Fix a bug inside bta_gattc_get_gatt_db_impl()
when the processed GATT DB attribute type is unknown.
* Fix warnings about missing field initializers:
-Wno-missing-field-initializers
* Re-implement macro COMPILE_ASSERT(COND) to fix a compilation warning:
-Wno-non-literal-null-conversion
* Fix sign mismatch comparison warnings:
-Wno-sign-compare
* Fix warnings related to enum conversion:
-Wno-enum-conversion
* Fix warnings related to incompatible pointer types:
-Wno-incompatible-pointer-types
* Fix warnings related to enum conversion:
-Wno-enum-conversion

Bug: 26879229
Change-Id: I522931fe156aeab23ae841051a9e25ceab00b1c2
/system/bt/stack/gatt/gatt_cl.c
5fe6f0cf6b223e3ed6be4912d55b3ed5b41ce0cd 06-Feb-2016 Pavlin Radoslavov <pavlin@google.com> Removed checks for NULL returns after osi_calloc() / osi_malloc()

Removed explicit checks for NULL pointer returns after calls
to osi_calloc() and osi_malloc(), because those are not needed.
If the memory allocation fails, osi_calloc() and osi_malloc()
will trigger an assert.

Bug: 27048759
Change-Id: I2791eb2f69c08f991f8fcdef10e101a41568cd95
/system/bt/stack/gatt/gatt_cl.c
abd70abb5e42c9431df94fe9d2c4a78a0d8d9af9 05-Feb-2016 Pavlin Radoslavov <pavlin@google.com> Replaced osi_getbuf()/osi_freebuf() with osi_malloc()/osi_free()

Removed the alternative buffer allocation osi_getbuf() / osi_freebuf()
and use instead osi_malloc() / osi_free().

Correspondingly, replaced usage of osi_freebuf_and_reset()
with osi_free_and_reset().

Bug: 24914560
Change-Id: I7a9599ba7fa900321f087da684428133eb0ddd6b
/system/bt/stack/gatt/gatt_cl.c
78bcff79e1b1f0efce436b33bdd6da88745bfc8a 05-Dec-2015 Pavlin Radoslavov <pavlin@google.com> Refactor the Bluetooth timers

* Updated the alarm API:
- Existing API alarm_new() is modified to take an alarm name
as an argument.
- New API alarm_new_periodic() is used to create a periodic
alarm.
- Added new API alarm_is_scheduled() to test whether an alarm is
scheduled.
- Existing API alarm_set_periodic() is removed: a periodic
alarm is created by alarm_new_periodic().
- Added new API alarm_set_on_queue() to set an alarm whose
callback is executed on a specific queue.
- Added new API alarm_register_processing_queue() and
alarm_unregister_processing_queue() to register/unregister
a queue and the corresponding thread for alarm processing.
- Added corresponding unit tests.

* Updated the alarm internals:
- Added alarm_info_t for collecting alarm-related information
and statistics.
- Collect and store alarm-related statistics into alarm_info_t
per alarm.
- Include the alarm-related statistics and info into the native
dumpsys output for Bluetooth.
- Once an alarm expires, the alarm execution is scheduled for
processing on another internal alarm-specific thread, not
on the thread that is maintaining the alarms.
- Implemented callback execution ordering guarantee among
timers on the same thread with exactly same timeout values.

* Refactor some of the usage of alarm_set() and simplify the
code by using alarm_set_on_queue() instead.

* Removed the non_repeating timers wrapper, and use directly
the alarm mechanism / API.

* Refactored all timer_entry_t timers and replaced them with alarm_t
timers:
- Replaced the btu_start_timer() / btu_stop_timer() /
btu_start_quick_timer() / btu_stop_quick_timer() /
btu_oneshot_alarm() mechanism with alarm_set_on_queue() and
alarm_cancel()
- Removed the whole mechanism around the BTU_TTYPE_* timers.

* Fixed a bug when processing the GATT indication confirmation timer
expiration (timer tGATT_TCB.conf_timer: b/26610829).

* Renamed and/or split misc. timeout functions, fields, and timers

* Renamed time-related constants and changed the values from seconds
to milliseconds

* Replaced timer tAVDT_CCB.timer_entry with three mutually exclusive timers:
idle_ccb_timer, ret_ccb_timer, rsp_ccb_timer
The reason we are using three timers, is because in the original code
function avdt_ccb_chk_timer() used the timer type in its logic: it
would stop the timer only if the type is "idle".

* Removed btm_ble_timeout() and replaced it with multiple timeout
callback functions (per timer)

* Fix the actual value of the global constant BT_1SEC_TIMEOUT and
rename it to BT_1SEC_TIMEOUT_MS

* Removed btu_cb and associated timers and events, because they are
never used.

* Removed unused timers, functions, struct and declarations that are
not used / needed.

Bug: 26611369
Bug: 26610829

Change-Id: I812c8c31710a5daefc58b01fcf35c353768f390f
/system/bt/stack/gatt/gatt_cl.c
258c2538e3b62a8cdb403f2730c45d721e5292b4 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/stack/gatt/gatt_cl.c
636d6714a4c08dd99d2147dcce05dc3892e804b4 18-Dec-2014 Priti Aghera <paghera@broadcom.com> LE Data Packet Extension support

Included support for LE data packet extension feature according
to BT 4.2 spec. This patch checks if the controller supports LE
packet extension and provides functions to set the PDU length.

Bug: 20013956
Change-Id: I6a92970fede2f793ad48c9fa2e0247ad00297533
/system/bt/stack/gatt/gatt_cl.c
5d5b041ca497013df4ecfeb415db3843d0a90eb3 12-Jan-2015 Andre Eisenbach <eisenbach@google.com> LE: Add error status to failed write operation

Bug: 18833375
Change-Id: Ib91c8e92658a276d813954264897b02863f1148b
/system/bt/stack/gatt/gatt_cl.c
4dcde90649cc51ca815a50d338a73adb408ab258 28-Jun-2014 Matthew Xie <mattx@google.com> resolved conflicts for merge of b44cc59d to master

Change-Id: I74c86dd5a13d4cc0b225a4b1d516904c4382db74
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/stack/gatt/gatt_cl.c
b44cc59d286ad255e872c60df02e032bd8d9d75b 04-May-2014 Sharvil Nanavati <sharvil@google.com> Logging cleanup: AVRC, MCA, GATT, and SMP.

Change-Id: I6d1e61ff023b5fd19f144955cff16831cc18c6e6
/system/bt/stack/gatt/gatt_cl.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/stack/gatt/gatt_cl.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/stack/gatt/gatt_cl.c
b83a823466bf93f7d484f7c8d23513e0e7c1a5a8 11-Feb-2014 Mike J. Chen <mjchen@google.com> Merge changes Ifc373f95,I95eb887a,I1e6be2ab,Ia6ea939a,I147d0138, ... into klp-modular-dev

* changes:
Make all warnings fatal compilation errors
Major warnings cleanup
Add macro UNUSED() to bt_utils.h
Fix unused parameter warning in static function
Add "static" to a static function
Fix a number of unused parameter warnings in static functions
Fix bug with wrong parameter passed to logu
Default send_ind_evt should be FALSE
Fix warning "implicit declaration of function 'GAP_BleReadPeerPrefConnParams'"
Fix unused parameter warnings in static functions by changing prototype
Fix some unused parameter warnings in static functions
Fix warnings about implicit declaration of bdcmp and bdcpy
Fix warning "comparison is always true due to limited range of data type"
Fix warning "suggest braces around empty body in an 'if' statement"
Fix warning "comparison is always true due to limited range of data type"
Add a function prototype for btm_ble_test_command_complete
Change argument to return ptr rather than assign to unused local
Fix warning "comparison is always true due to limited range of data type"
Fix warnings about implicit declarations
Fix warning "implicit declaration of function 'bdcmp'"
Fix warning "case label value exceeds maximum value for type"
Fix missing initializer warning
Fix missing initializer warning
Fix warning about missing initializer
d2710d0185aa2a2164ec9028f0517d33cc828c39 01-Feb-2014 Mike J. Chen <mjchen@google.com> Add "static" to a static function

Change-Id: I147d0138f2871d1fa873184b1e6e8075328a8501
Signed-off-by: Mike J. Chen <mjchen@google.com>
/system/bt/stack/gatt/gatt_cl.c
5fba60a8761b28adec2704dcbf69376ebde4f19b 06-Feb-2014 Zhihai Xu <zhihaixu@google.com> resend discovery primary service ATT request with timeout

This is to work around the problem with iphone.
The iphone didn't respond with our first ATT request
(read By group type Request for for primary service).
the clockwork/phone host keep waiting for ATT response until disconnection
from iphone due to timeout.
The workaround is to
resend discovery primary service before disconnection from remote device
when response timeout happen.
This workaround will be better for us to interop with remote BLE device.

bug:12895830
Change-Id: I236af8eca9790f2dae7098061c74cec55348ca6d
/system/bt/stack/gatt/gatt_cl.c
22df1f746e3d579a516583b92c26f2fd4063ba14 01-Feb-2014 Mike J. Chen <mjchen@google.com> Fix some unused parameter warnings in static functions

Fixed by changing the prototypes of the functions and the
calling location.

Change-Id: Ic27ce9e61f5b66699b59bb14258709cb7ca733a8
Signed-off-by: Mike J. Chen <mjchen@google.com>
/system/bt/stack/gatt/gatt_cl.c
ccf9c15f52eea21858d994601d71308e84c7c859 03-Oct-2013 Andre Eisenbach <andre@broadcom.com> LE: Improved handling of illegal GATT PDUs

Do additional length checks when handling malformed messages. These
messages are never valid, and should be dropped if seen.

Before starting to parse out PDU content, it is verified that the
buffer contains sufficient bytes and error condition is returned
if this is not the case.

Bug: 11045073
Change-Id: Ifb792d1575e0514f33e75ed73247ea638807901e
/system/bt/stack/gatt/gatt_cl.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/stack/gatt/gatt_cl.c
ead3cde4bac0c3e32cd31f149093f004eef8ceeb 06-Feb-2013 Ganesh Ganapathi Batta <ganeshg@broadcom.com> Initial version of BLE support for Bluedroid

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

Change-Id: Ia2de32ccb97a9641462c72363b0a8c4288f4f36d
/system/bt/stack/gatt/gatt_cl.c