summaryrefslogtreecommitdiffstats
path: root/stack/gatt
Commit message (Collapse)AuthorAgeFilesLines
* GATT: Handle too short Error Response PDUJakub Pawlowski2018-09-091-3/+19
| | | | | | | | | | Since the spec is not clear what to do in this case, use one of reserved error codes as a failure reason, and pass it to upper layers. Bug: 79591688 Change-Id: Ie6a53e9c8e4ceb8f1e5a75aee44baa5f4a798c4f Merged-In: Ie6a53e9c8e4ceb8f1e5a75aee44baa5f4a798c4f (cherry picked from commit f63c4b652b3231c2b4907bffd13410c6eb2aa760)
* DO NOT MERGE Handle bad packet length in gatts_process_read_reqStanley Tng2018-06-081-0/+16
| | | | | | | | | | | | | | | Added error check and handling code in gatts_process_read_req to make sure that the packet length is correct. Please note that there is another earlier CL that is reverted and this is the updated one. Bug: 73172115 Test: Run the test program, poc, that was attached in the bug report Merged-In: Ia9b4e502fa8f8384bf9767e68f73b48a0915141b Change-Id: Ia9b4e502fa8f8384bf9767e68f73b48a0915141b (cherry picked from commit cc9c7330d1c3507d745170ae7b2e0546197b7acb) (cherry picked from commit 16f4c21be5bd0ea1968eee8a0f00648b1e326253) CVE-2018-9358
* git merge android-6.0.1_r3 on to remote branchSudharma Damgatla2015-12-102-1/+6
|\ | | | | | | Change-Id: I501838b5f3f9d8bf60ab8df59a322a6f1e9199b9
| * Prevent integer overflows during GATT signingAjay Panicker2015-10-271-0/+5
| | | | | | | | | | Bug: 17901099 Change-Id: Ib61113b19c9c9798b9ea992fad0ce997dcc2e2f8
| * Fix 128-bit UUID byte order for GATT-over-BR/EDRAndre Eisenbach2015-10-211-1/+1
| | | | | | | | | | | | | | | | | | 128-bit UUIDs for GATT services discovered using SDP are byte-ordered incorrectly. This patch fixes both the SDP discovery as well as the SDP record creation code. Bug: 24344122 Change-Id: Iee4bf33dcbbc5ee0f2380b48330107232bd0401b
* | Validates the PDU length of GATT Write attribute requestsSubramanian Srinivasan2015-11-181-0/+41
| | | | | | | | | | | | | | | | Validates whether the PDU length of GATT Write requests satisfy the minimum length requirements of GATT write attribute request format. Change-Id: I5136f468e823248a5b1301b5c3146257b0563842
* | Bluetooth: Ignore unexpected notifications to cause disconnectionNitin Arora2015-10-221-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | The GattIf = 1 and the corresponding callbacks struct gatt_profile_cback is specifically used for GATT protocol connections by the stack and additionally for handling the service change indication registration when pairing to a remote device. The operation callbacks received on this Id disconnects the remote device if any indication/notification is received while this process is ongoing. This patch ignores such events. Change-Id: I04273f6a1ab5e2d74f49687c9a70670e40db9d39
* | Bluetooth : Ignores Included service read response event of HOGP remoteSatish kumar sugasi2015-10-151-7/+0
| | | | | | | | | | | | | | | | | | This discards if remote sends response with invalid handle value pairs for read response for included services read by type request sent by hogp device Change-Id: I61bd715118444a117b074111ed9dd6a182920eb8 CRs-Fixed: 616492
* | BT: Fixed Static Analysis IssuesMatadeen Mishra2015-10-061-1/+1
| | | | | | | | | | | | | | | | | | | | - This fix avoids NULL pointer dereferences, Array Index Out of Bounds Exceptions and Banned funciton in the bluedroid code space of Bluetooth. CRs-Fixed: 890309, 890321 Change-Id: I24ae794ee01b65b5ab15c73cd82677b0481910ad
* | Bluetooth: update gatt channel state to closing during disconnectionSatish kumar sugasi2015-10-061-1/+1
| | | | | | | | | | | | | | | | This changes Gatt state to CLOSING from OPEN to avoid any farther gatt operations from that particular fixed channel CID during gatt disconnection process. Change-Id: I8511caa477881de4f4eaf18b84f23530e1958fe9
* | Bluetooth: LE-L2CAP-COC on M.Balraj Selvaraj2015-10-061-0/+5
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | LE L2CAP Connection Oriented Channel implementation for credit based flow control on LE L2CAP. - This feature is enabled only when BLE feature is enabled. - Handled signalling commands on channel id 5 to establish the connection of LE COC. - Implemented the SM for LE L2CAP channel to handle events from App layer and hci layer. - Introduced security levels for LE L2CAP channels. - Introduced tranport variable for major functions where BREDR and LE shares common data structures. - Implemented segmentation and reassembly of LE L2CAP SDU. - Introduced congestion mechanism for LE L2CAP channel - As the new LE L2CAP callbacks not required for existing BREDR services, made it as null for newly introduced LE L2CAP callbacks. - New APIs introduced for LE L2CAP connection establishment. - New APIs provided for LE L2CAP security procedure. - Relevent L2cap APIs from Test app interface exposed to the test tool. - New macros, definitions, structures introduced for LE L2CAP channel establishment/data tranfer. CRs-Fixed: 776657 Change-Id: I50a24374659f9802cbc92421db139f75f2790f2e
* Disconnect Gatt during failure of service changed discovery processNitin Arora2015-06-171-0/+2
| | | | | | | | | | Gatt service changed discovery holds link till it completes discovery of service, characteristics, descriptots and writing notification for characteristic descriptor, this change takes care of removing the link if service discovery fails during any stage of this process. Bug: 21896912 Change-Id: Ie97a039568fedc66403895e7e917e4d72a5419e1
* LE Data Packet Extension supportPriti Aghera2015-04-152-1/+5
| | | | | | | | | 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
* am f29a2fb..e07ad10 from mirror-m-wireless-internal-releaseVinit Deshpande2015-04-145-13/+20
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | e07ad10 merge in m-wireless-internal-release history after reset to d232721ae5e5b6949a5249f0d116408b8a3c5f1d d232721 L2CAP socket - fix merge errors 899b771 BR/EDR secure connections support 7fb0da6 Support numeric comparison in SMP aa351f2 merge in m-wireless-internal-release history after reset to 399e89150b3df87172bdf92d54712b379324b149 399e891 Fix for AVRCP CTRL stops sending pass through command daddea9 Free Avrcp Controller callbacks on Cleanup 764babe Protect reset of out stream with mutex 444a8da LE Privacy 1.2 and LE secure connections 8372aa5 L2CAP and SDP Search API for BT profiles (2/2) fd422a7 Update Service Availability. 2a0652a merge in m-wireless-internal-release history after reset to 0b47e0a35c16f5b7d77c30ec1c095ed92ff4fd74 78d0f4c merge in m-wireless-internal-release history after reset to m-wireless-internal-dev 0b47e0a Avoid duplicate disconnection callbacks for fixed channel connections 5646973 Add a section on assertions to the style guide. d768767 Merge "Avoid null-pointer dereference in l2c_release_lcb()" into m-wireless-dev ef92b53 Avoid null-pointer dereference in l2c_release_lcb() 4bf68bf merge in m-wireless-internal-release history after reset to f538707fe64c62b1dbb8e4210e4a1bfa0bab2b56 de6ac86 Add a 'Bluedroid conventions' section to the style guide. 1b80439 Add a section to the style guide on variable declarations. 485f19e merge in m-wireless-internal-release history after reset to 4540f59bc447dc2b7b31a3e974b74a60b2417e7d bef8940 merge in m-wireless-internal-release history after reset to 841c9103cad1898ceca87b734acd4d4537f9f452 ab4c38c merge in m-wireless-internal-release history after reset to a7e698f5a9e062f62e21bc435643975c30bab846 2807a74 merge in m-wireless-internal-release history after reset to a7e698f5a9e062f62e21bc435643975c30bab846 99dbe9a merge in m-wireless-internal-release history after reset to 78c0b060f29b7b7014adddb2f98bf6ae9755c488 f7f8399 merge in m-wireless-internal-release history after reset to a5371c238b4e874d8313ac56a23451e7345ff541 3aa60d7 Make A2DP audio HAL a shared library again 3256a31 Move unused include file out of hci_audio.h b866b69 Add option for schedule_next_instance to force rescheduling 4ae5e3e Ensure alarms are called back when they expire in the past a7bd03e Rewrite alarms to use a single posix timer instance 88e7b15 Resolved hardware error observed during SCO Connection setup Change-Id: Ib9a0a2ffca1d4811a9a9e56674bf43275d8b2205
| * LE Privacy 1.2 and LE secure connectionsSatya Calloji2015-04-135-8/+13
| | | | | | | | | | | | Bug: 19816438 Original author: Chaojing Sun <cjsun@broadcom.com> Change-Id: I5951f4d4e038f8348a62aa6d19b2111bae0b3ecc
| * L2CAP and SDP Search API for BT profiles (2/2)Kim Schulz2015-04-101-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Added support for exposing L2CAP to Java such that OBEX over L2CAP is made possible. Added support to create SDP records as a seperate step.(as opposed to creating a SDP record when a BluetoothSocket is created). This allows both a RFCOMM channel and a L2CAP PSM to be included in a SDP record. (Additionally the content of the SDP record is set by the profile in Java, in stead of beeing hardcoded in the socket layer.) This completes the L2CAP channel exposure to Java. Change-Id: Iaf68a07d910145cdd33e940d73cd680f79164100
* | Merge commit 'f7f839985b3931682363d2ef3b7c5cae55a842ee' into mergeEtan Cohen2015-03-318-36/+56
|\| | | | | | | Change-Id: Iaaec1ea0bf3009b7e32a9a60f697631a3f56e889
| * Rectify allocation of GATT control blockNitin Arora2015-03-251-3/+6
| | | | | | | | | | | | | | | | | | | | This change ensures that a valid value is returned while requesting available control block or allocating memory for a new control block for saving GATT discovery handles. The bug if not fixed causes memory corruption and thus modifying some callback handles. Change-Id: I148ee82d2ea9fe77bebd34fd345b4fb6a6eee3cd
| * Make build more strict by adding more warning flags.Sharvil Nanavati2015-03-162-9/+1
| | | | | | | | | | | | This change introduces -Wunused-but-set-variable to help catch programming errors. It also undefines NDEBUG so assertions are fatal and defines LOG_NDEBUG=1 to suppress LOGV.
| * Removing unnecessary BTAPI #defines.June R. Tate-Gans2015-03-161-5/+3
| |
| * Correct comments and some redundant statements.Steve Gu2015-03-162-9/+13
| |
| * Enforce GKI API buffer usageChris Manton2015-03-165-10/+14
| | | | | | | | Also add another API GKI_queue_length(BUFFER_Q *)
| * Fix gatt_main.c compile error due to log macro changeAndre Eisenbach2015-03-161-1/+1
| |
| * Release GATT resources upon teardownChris Manton2015-03-162-0/+19
| |
* | am 5d5b041c: LE: Add error status to failed write operationAndre Eisenbach2015-01-121-1/+1
|\| | | | | | | | | * commit '5d5b041ca497013df4ecfeb415db3843d0a90eb3': LE: Add error status to failed write operation
| * LE: Add error status to failed write operationAndre Eisenbach2015-01-121-1/+1
| | | | | | | | | | Bug: 18833375 Change-Id: Ib91c8e92658a276d813954264897b02863f1148b
* | resolved conflicts for merge of ed0bdd42 to lmp-mr1-dev-plus-aospChih-Hung Hsieh2014-12-111-1/+0
|\ \ | | | | | | | | | Change-Id: Ife8b72d3688ed78a95ccb8d5e0b60f40e7fec9e9
| * | Cleanups needed to make clang happyBernhard Rosenkränzer2014-12-052-27/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch removes a slew of unused variables and some unused functions, fixes some incomplete initializations of structs and an sprintf parameter mismatching the format string. Change-Id: I35f22fdccc8350f885cd357d3685b869224fa433 Signed-off-by: Bernhard Rosenkränzer <Bernhard.Rosenkranzer@linaro.org>
| * | am 8b52f5f2: Merge "Suppress the warning compiled with gcc-4.9"Elliott Hughes2014-09-191-1/+1
| |\ \ | | | | | | | | | | | | | | | | * commit '8b52f5f2f0eb1e3748a19af4438147872cba1cd2': Suppress the warning compiled with gcc-4.9
* | \ \ am 40053090: Merge "LE: Register for service change indication" into lmp-mr1-devAndre Eisenbach2014-12-102-48/+280
|\ \ \ \ | | |_|/ | |/| | | | | | | | | | * commit '40053090c5e4faaf0b1906164569666ae722e6fa': LE: Register for service change indication
| * | | LE: Register for service change indicationChaojing Sun2014-12-052-48/+280
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some bonded remote devices require the client to register for service change indication and actually set the client configuration descriptor before service change indications can be removed. This change add an additional step after device bonding has occured to register for service change indication if possible. Bug: 18173911 Change-Id: I25386faec0d58834ee2b0a9d1db2d2e052311264
* | | am 8b52f5f2: Merge "Suppress the warning compiled with gcc-4.9"Elliott Hughes2014-09-191-1/+1
|\ \ \ | |/ / |/| / | |/ | | * commit '8b52f5f2f0eb1e3748a19af4438147872cba1cd2': Suppress the warning compiled with gcc-4.9
| * Suppress the warning compiled with gcc-4.9Lai Wei-Chih2014-09-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix the warning below: gatt_sr.c: In function 'gatt_sr_process_app_rsp': gatt_sr.c:175:27: warning: 'p_rsp' may be used uninitialized in this function [-Wmaybe-uninitialized] p_rsp = (tGATTS_RSP *)GKI_getnext (p_rsp); ^ gatt_sr.c:125:23: note: 'p_rsp' was declared here tGATTS_RSP *p_rsp; ^ Change-Id: I894495ed7893e958f009778e629525b85d56b2f6
| * DO NOT MERGE BLE HID device connection failure due to security error.Zhihai Xu2014-03-072-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * DO NOT MERGE LE: Add service UUIDs and data to advertising dataAndre Eisenbach2014-03-061-0/+2
| | | | | | | | | | | | | | | | | | | | Add support for UUIDs and custom service data in the advertising and scan response records. Cherry picking ble advertising changes from master to KLP MR2. b/13137996 Change-Id: I6470427ad194871488cc90f3ab384b9ecf326b15
* | Merge "Service change indication is not sent to a bonded remote device ↵Andre Eisenbach2014-07-291-2/+2
|\ \ | | | | | | | | | sometimes" into lmp-dev
| * | Service change indication is not sent to a bonded remote device sometimesMudumba Ananth2014-07-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -> The service change indication was requested before GATT profile finished processing the connection callback. -> Sending service change indication after profile connection is up solves the problem. Bug: 16560957 Change-Id: I99dd7528883efbedcbf785132fe6aaa3aea5b42c
* | | Execute Write Response shall be sent after the attributes are writtenMudumba Ananth2014-07-302-8/+6
|/ / | | | | | | | | Bug: 16560957 Change-Id: I085a2218644615bc13f5a0d0d78fc2afe0605a04
* | LE: Fix problem where pending command is not sent after pairingAndre Eisenbach2014-07-281-1/+1
| | | | | | | | | | | | | | | | | | If a read/write or other operation triggers SMP pairing with a remote device, the operation should complete once pairing has finished. This patch fixes a bug where the pending command was not sent after pairing. Bug: 16405565 Change-Id: Idb2e54931c71b0a9e009cac318712eb9f5c7e15a
* | resolved conflicts for merge of b44cc59d to masterMatthew Xie2014-06-289-293/+293
|\ \ | | | | | | | | | Change-Id: I74c86dd5a13d4cc0b225a4b1d516904c4382db74
| * | Logging cleanup: AVRC, MCA, GATT, and SMP.Sharvil Nanavati2014-06-199-292/+292
| | | | | | | | | | | | Change-Id: I6d1e61ff023b5fd19f144955cff16831cc18c6e6
| * | Merge BT 4.1 featuresGanesh Ganapathi Batta2014-04-3010-276/+406
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | Workaround IPHONE problemZhihai Xu2014-04-161-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we send LL_ENC_REQ to iphone early, iphone didn't send LL_ENC_RESPONSE back to us, later the iphone will disconnect from us. The workaround is to send LL_ENC_REQ after receive first ATT read request from iphone, Iphone will be ready at that time by experiment. bug:13417692 Change-Id: Ic42dda36b927df260113771152cff67032b22e5f
| * | print MTU size after get MTU request from iphone.Zhihai Xu2014-04-161-0/+2
| | | | | | | | | | | | | | | bug:13568537 Change-Id: If1a4e93b7ef53662bd740da0d3bb91fe747de031
| * | support peripheral mode feature to connect iphone to android device.Zhihai Xu2014-04-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | enable BLE_PERIPHERAL_MODE_SUPPORT flag and fix the bug the discoverability flag is not set in advertisement packet, which cause the central device(iphone) can not find android device during scan. use displayOnly IO cap for dory, so dory can display the pin, and the iphone(central device) will input the pin. bug:12797572 Change-Id: Ie15ea9e340e3692df846399b9a85aa6d2a97eba7
* | | LE: Add notification sent and congestion callbacks (2/4)Andre Eisenbach2014-06-256-49/+135
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Fix build break for Platina.Nick Vaccaro2014-06-201-1/+1
| | | | | | | | | | | | | | | Bug: 15143878 Change-Id: I7a0b3aa289b69e7c86fbc8abed151690fb0e8112
* | | Merge BT 4.1 featuresGanesh Ganapathi Batta2014-05-0610-276/+406
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Workaround IPHONE problemZhihai Xu2014-03-311-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we send LL_ENC_REQ to iphone early, iphone didn't send LL_ENC_RESPONSE back to us, later the iphone will disconnect from us. The workaround is to send LL_ENC_REQ after receive first ATT read request from iphone, Iphone will be ready at that time by experiment. bug:13417692 Change-Id: Ic42dda36b927df260113771152cff67032b22e5f
* | | print MTU size after get MTU request from iphone.Zhihai Xu2014-03-201-0/+2
| | | | | | | | | | | | | | | bug:13568537 Change-Id: If1a4e93b7ef53662bd740da0d3bb91fe747de031