summaryrefslogtreecommitdiff
path: root/attrib
Commit message (Collapse)AuthorAgeFilesLines
* gatttool: Use consistent spacing before bracketsDave Nicolson2023-02-141-4/+4
|
* attrib: Introduce g_attrib_attach_clientLuiz Augusto von Dentz2023-01-052-0/+48
| | | | | | This introduces g_attrib_attach_client which can be used to attach a bt_gatt_client instance to GAttr so it can be used to register notifications.
* build: Replace use of g_memdup with util_memdupLuiz Augusto von Dentz2022-01-061-6/+6
| | | | | | | | | | | This replaces the uses of g_memdup with util_memdup since the former has been deprecated: warning: ‘g_memdup’ is deprecated: Use 'g_memdup2' instead [-Wdeprecated-declarations] g_memdup2 requires bumping glib version which would likely have its own problems thus why util_memdup was introduced.
* attrib: Remove gatt-service.{c,h} and attrib-server.{c,h}Luiz Augusto von Dentz2022-01-062-406/+0
| | | | | These files are not longer needed since this functionality has been moved to gatt-db.{c,h}.
* gattrib: Fix passing NULL to memcpyLuiz Augusto von Dentz2021-12-231-1/+3
| | | | | | | This fixes the following runtime error: attrib/gattrib.c:198:2: runtime error: null pointer passed as argument 2, which is declared to never be null
* attrib: Make use of bt_att_resendLuiz Augusto von Dentz2021-10-061-73/+22
| | | | | | If the id != 0 that means that a proceedure that needs multiple PDUs is in progress so use bt_att_resend with its id that way the bt_att id and gattrib shall always be the same.
* attrib: Add SPDX License IdentifierTedd Ho-Jeong An2020-09-2113-182/+13
| | | | | | | | | | | | | | | | | | | | | | | | This patch adds SPDX License Identifier and removes the license text. ------------------------------------- License COUNT ------------------------------------- GPL-2.0-or-later : 13 License: GPL-2.0-or-later attrib/att-database.h attrib/gattrib.h attrib/gatttool.h attrib/gatt-service.c attrib/interactive.c attrib/utils.c attrib/gatt.c attrib/gattrib.c attrib/gatt-service.h attrib/att.c attrib/gatt.h attrib/att.h attrib/gatttool.c
* shared/gatt-client: Add support for EATT featuresLuiz Augusto von Dentz2020-03-021-2/+3
| | | | | This enables EATT in the Client Features if the EATT characteristic is present in the database.
* build: Move declaration of _GNU_SOURCE back into individual source filesMarcel Holtmann2018-12-064-4/+5
|
* shared/att: Add ext_signed flag to be able to use external cryptoMariusz Skamra2015-05-194-5/+5
| | | | | | | | | | | | | Due to the issues with CSRK tests ext_signed flag has been added to allow android/gatt handle signed write operations. This patch fixes following tests: GAP__TC_SEC_CSIGN_BV_02_C GAP__TC_SEC_CSIGN_BI_01_C GAP__TC_SEC_CSIGN_BI_02_C GAP__TC_SEC_CSIGN_BI_03_C GAP__TC_SEC_CSIGN_BI_04_C SM__TC_SIGN_BV_03_C
* attrib: Fix not honoring MTULuiz Augusto von Dentz2015-03-151-0/+15
| | | | | If MTU has changed, by bt_gatt_client for example, the code should be able to figure it out without waiting g_attrib_set_mtu to be called.
* attrib: Fix local libbluetooth includes orderMarcel Holtmann2015-02-281-1/+4
|
* attrib: Use local libbluetooth includesMarcel Holtmann2015-02-287-21/+27
|
* attrib/gatt: Improve robustness when searching for included servicesLukasz Rymanowski2015-02-271-1/+14
| | | | | | | | Without this patch it is possible to enter infinite loop when searching included services on remote device. This patch fixes that. Issue happens when remote device replies with ending handle which is lower than start handle we use for search
* attrib/gatt: Improve robustness when searching for descriptorsLukasz Rymanowski2015-02-271-1/+14
| | | | | | | | Without this patch it is possible to enter infinite loop when searching descriptors on remote device. This patch fixes that. Issue happens when remote device replies with ending handle which is lower than start handle we use for search.
* attrib/gatt: Minor refactor in desc_discovered_cbLukasz Rymanowski2015-02-271-2/+6
| | | | This is needed for next patch
* attrib/gatt: Improve robustness when searching for characteristicsLukasz Rymanowski2015-02-271-2/+15
| | | | | | | | | | | Without this patch it is possible to enter infinite loop when searching characteristics on remote device. This patch fixes that. Issue happens when remote device replies with ending handle which is lower than start handle we use for search. Found on robustness session on UPF50
* attrib/gatt: Minor refactor in char_discovered_cbLukasz Rymanowski2015-02-271-2/+7
| | | | This will be needed by next patch
* attrib/gatt: Improve robustness on search primary servicesLukasz Rymanowski2015-02-271-2/+27
| | | | | | | | | | | | Without this it is possible to put BlueZ into infinite loop when doing primary service search on remote device. Issue happens when remote device replies with ending handle which is lower than start handle we use for search. This patch fixes that Found on robustness session on UPF50
* attrib: Add explicit include for lib/bluetooth.hMarcel Holtmann2015-02-181-0/+1
|
* attrib: Fix condition check for attr deleteBharat Panda2015-02-131-1/+7
| | | | | Checks handle value for non-zero as well as >= 0xffff, to avoid infinite loop and deletion of unspecified attrib handles.
* attrib: Fix not disconnectingLuiz Augusto von Dentz2015-01-121-1/+3
| | | | | | | The default behavior of GAttrib is to disconnect on unref but patch 0ea75ab4bb3ff96a50785cf2b9860011c49fd7b7 had changed that in order to fix a warning, this return the old behavior but leaves to bt_att to do the actual closing.
* attrib: Fix warning when closing connectionLuiz Augusto von Dentz2014-12-291-0/+1
| | | | | | | | | | Since bt_att is used internally GAttrib should no longer close the connection otherwise it cause the following warning: bluetoothd[31756]: attrib/gattrib.c:g_attrib_unref() 0x610c130: g_attrib_unref=1 bluetoothd[31756]: attrib/gattrib.c:g_attrib_unref() 0x610c130: g_attrib_unref=0 (bluetoothd:31756): GLib-WARNING **: Invalid file descriptor.
* attrib/gattrib: Add tracking all the internal request idLukasz Rymanowski2014-12-181-53/+43
| | | | | | With this patch gattrib track all the pending request id's to bt_att. When doing g_attrib_cancel_all, only those own by gattrib will be canceled.
* attrib/gatt: Fix for search servicesLukasz Rymanowski2014-12-181-11/+32
| | | | | | | | | | | | | | | | This patch adds means to reuse ATT request id for GATT operations which might need more then one ATT request for complete GATT operation. E.g discover primary\included services and discover characteristics/descriptors This is needed for the user of gattib, to make sure that ATT request id he holds is valid during whole GATT operation. So far, it could happen that gattrib did additional ATT request without user knowledge which leads to situation that user had outdated ATT request id. Note that request id is used by the user for canceling request.
* attrib/gattrib: Add track for request idsLukasz Rymanowski2014-12-181-2/+104
| | | | | | | | | | | | If user provides req_id to the g_attrib_send, he assume that req_id should be used for transaction. With this patch, gattrib keeps track on user requested req_id and actual pending req_id which allow to e.g. cancel correct transaction when user request it. Note that for now specific request id is used in attrib/gatt.c for long write. Next patch will make bigger usage of this but also only in this helper. We do not expect other attrib clients to use that feature.
* attrib/gattrib: Add g_attrib_get_attArman Uguray2014-12-152-0/+11
| | | | | Added the g_attrib_get_att function which returns the underlying bt_att structure associated with a GAttrib.
* attrib/gatt: Fix minor coding styleLukasz Rymanowski2014-12-151-1/+0
|
* attrib/gatt: Minor coding style fixLukasz Rymanowski2014-12-101-1/+0
|
* attrib/gatt: Fix for attrib refLukasz Rymanowski2014-12-101-3/+6
| | | | | This patch makes sure that attrib instance will not disappear while reading characteristic
* attrib: Check if attrib is NULL in functionsArman Uguray2014-12-091-1/+22
| | | | | This patch adds an early return to attrib/gattrib functions if the attrib argument is NULL.
* attrib: List all enum values in switchSzymon Janc2014-12-081-0/+4
| | | | As described in coding style M10
* gattrib: Fix not changing the buffer size when mtu is reducedJakub Tyszkowski2014-12-031-4/+10
| | | | | | Using larger buffer than mtu resulted in not sending the message at all as encode_pdu() in shared/att.c fails when provided data buffer is larger than current mtu.
* gattrib: Fix not setting att's mtu size in g_attrib_new()Jakub Tyszkowski2014-12-011-0/+3
| | | | | | | | | | We were setting only the buffer in gattrib but att was left with the default value of 23 (LE transport layer defaults). For BREDR transport layer this may result in using smaller MTU than the minimum allowed (48). This was affecting cases when MTU Exchange was not supported by the remote device and defaults were used.
* GATT shim to src/shared bt_attMichael Janssen2014-11-171-581/+164
| | | | | | | | This patch implements a version of GAttrib which is backed by bt_att, which enables the simultaneous use of GAttrib and bt_att. This should enable smooth transition of profiles from the GAttrib API to the src/shared bt_att API.
* gattrib: Remove unused GATTRIB_ALL_EVENTSMichael Janssen2014-11-062-4/+0
| | | | | In prep to use shared stack, this is unused and not functionally supported by bt_att.
* attrib: fix GATTRIB_ALL_REQS behaviorMichael Janssen2014-11-031-1/+22
| | | | | | g_attrib_register(..., GATTRIB_ALL_REQS, ...) behavior would previously include indications, this fixes it to only include requests and commands.
* attrib: remove g_attrib_is_encryptedMichael Janssen2014-11-032-14/+0
| | | | | This function is only used in one place and encryption is the responsibility of the channel, not the attribute.
* attrib: Add mtu argument to g_attrib_newMichael Janssen2014-11-034-9/+37
| | | | | | Instead of using the default MTU, use one passed in by the user, and detect it from the channel when it is created.
* attrib: Remove MTU-probing codeMichael Janssen2014-10-311-13/+1
| | | | | | Probing for the MTU using bt_io is problematic for testing because you cannot impersonate AF_BLUETOOTH sockets with a socketpair.
* Remove unused g_attrib_set_debug functionMichael Janssen2014-10-312-8/+0
| | | | This function is not used, and also not implemented.
* attrib: Fix memory leakAndrei Emeltchenko2014-08-011-0/+2
|
* attrib: Fix discovering descriptorsMarcin Kraglak2014-07-181-1/+1
| | | | | Discover all attributes in given range. In same cases we ommited last attribute in range.
* android/gatt: Fix signed write command encodingLukasz Rymanowski2014-05-304-9/+23
| | | | | | | As per spec (BT spec 4.1 Vol[3], Part F, chapter 3.4.5.4) we need to take opcode, handle and parameters to generate signature. In order to support it signing is moved to att.c, place where pdu is encoded
* attrib: Fix minor whitespace issueJakub Tyszkowski2014-05-271-2/+2
| | | | Replace spaces with tabs.
* attrib: Add wrapper to send signed write commandLukasz Rymanowski2014-05-262-0/+21
|
* attrib: Add helpers to enc and dec signed write commandLukasz Rymanowski2014-05-262-0/+66
|
* gatt: Remove gatt_discover_char_descAndrzej Kaczmarek2014-05-052-18/+0
| | | | | This function is no longer used since all code is changed to use gatt_discover_desc instead.
* attrib: Discover descriptors using gatt_discover_descAndrzej Kaczmarek2014-05-052-76/+22
|
* attrib: Add simpler call for descriptors discoveryAndrzej Kaczmarek2014-05-052-0/+156
| | | | | | | | | | | | | This patch adds gatt_discover_desc() function which performs descriptor discovery in a manner similar to gatt_discover_char(), i.e. it does complete discovery procedure and returns list of descriptors found when finished. For 16-bit UUIDs in addition to string UUID, short UUID is provided. It's also possible to specify single descriptor UUID to look for and discovery procedure is interrupted as soon as UUID is found. This way no more than one descriptor is returned which is useful when searching for common descriptors like CCC.