summaryrefslogtreecommitdiff
path: root/attrib/att.c
Commit message (Collapse)AuthorAgeFilesLines
* attrib: Add SPDX License IdentifierTedd Ho-Jeong An2020-09-211-14/+1
| | | | | | | | | | | | | | | | | | | | | | | | 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
* build: Move declaration of _GNU_SOURCE back into individual source filesMarcel Holtmann2018-12-061-1/+1
|
* attrib: Use local libbluetooth includesMarcel Holtmann2015-02-281-3/+3
|
* android/gatt: Fix signed write command encodingLukasz Rymanowski2014-05-301-4/+7
| | | | | | | 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: Add helpers to enc and dec signed write commandLukasz Rymanowski2014-05-261-0/+55
|
* Replace att_put_u16() by put_le16()Claudio Takahasi2014-03-241-24/+24
|
* Replace att_put_uuid() by util.h helpersClaudio Takahasi2014-03-241-2/+11
|
* Replace att_get_uuid128() by bswap_128()Claudio Takahasi2014-03-241-10/+28
| | | | | | GATT/ATT use little-endian byte order format for 128-bit UUID. No matter the system byte order representation, internally the core will handle 128-bit UUID on big-endian format.
* Replace att_get_u16() by get_le16()Claudio Takahasi2014-03-241-22/+22
|
* Replace att_get_uuid16() by get_le16()Claudio Takahasi2014-03-241-3/+3
|
* Replace att_put_uuid16() by put_le16()Claudio Takahasi2014-03-241-1/+2
|
* attrib: Add extra PDU checks when decoding Read by Type ResponseAnderson Lizardo2014-01-111-0/+17
| | | | These checks are needed to avoid invalid memory access on bogus PDUs.
* attrib: Fix PDU length check for Read by Type RequestAnderson Lizardo2014-01-111-1/+1
| | | | PDU length must be either 7 or 21 octets.
* attrib: Reject incomplete PDU in dec_find_by_type_resp()Anderson Lizardo2014-01-111-0/+9
| | | | | Otherwise, an incomplete PDU may be silently accepted (with any remaining data discarded).
* attrib: Remove unnecessary local variables from dec_find_by_type_req()Anderson Lizardo2014-01-111-10/+4
| | | | | | | Use number instead of "min_len", which is easier to review (with help of the documented parameter sizes). valuelen is redundant as *vlen can be used directly.
* attrib: Remove unnecessary NULL checks on dec_find_by_type_req()Anderson Lizardo2014-01-111-15/+9
| | | | | Just assume that the caller will pass non-NULL pointers as arguments (which is true for the only current caller of this function).
* attrib: Add extra PDU checks when decoding Read by Group Type ResponseAnderson Lizardo2014-01-111-0/+18
| | | | These checks are needed to avoid invalid memory access on bogus PDUs.
* attrib: Fix PDU length check for Read by Group Type RequestAnderson Lizardo2014-01-111-1/+1
| | | | PDU length must be either 7 or 21 octets.
* attrib: Remove unnecessary checks for PDU length on ATT encodingAnderson Lizardo2014-01-111-85/+46
| | | | | | | | | | Both userspace and kernel enforce a minimum ATT MTU of 23 octets, which is also used as minimum size for buffers passed to ATT encoding functions. Therefore, it is unnecessary to perform these checks on ATT requests that are guaranteed to fit into 23 octets. Also document ATT parameter lengths where a constant is being used for calculating the PDU length.
* attrib: Use att_put_u16() instead of htobs() + memcpy()Anderson Lizardo2014-01-111-3/+1
|
* attrib: Allow dec_read_resp() to just check if PDU is validAnderson Lizardo2013-07-241-3/+3
| | | | | If a NULL "value" parameter is given, only check whether PDU is valid, without copying attribute value to a buffer.
* attrib: Add encode/decode execute write supportAlvaro Silva2013-07-241-0/+31
| | | | Add functions for encoding/decoding Execute Write Request PDUs.
* attrib: Add encode/decode prepare write supportAlvaro Silva2013-07-241-0/+56
| | | | Add functions for encoding/decoding Prepare Write Request PDUs.
* attrib: Remove unused parameter from enc_write_resp()Alvaro Silva2013-07-241-1/+1
|
* attrib: Fix coding style for various enc_*/dec_* functionsEder Ruiz Maria2013-07-241-7/+10
| | | | | | Fix coding style for enc_read_blob(), enc_read_blob_resp(), dec_read_resp(), enc_error_resp(), enc_find_info_req(), enc_find_info_resp() and enc_prep_write().
* attrib: Fix compilation errors when compiled without optimizationAnderson Lizardo2013-01-101-2/+2
| | | | | | | | | | | | | | | Fix these build errors: attrib/att.c: In function ‘dec_read_by_grp_req’: attrib/att.c:165:10: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] attrib/att.c:170:10: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] attrib/att.c: In function ‘dec_read_by_type_req’: attrib/att.c:393:10: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] attrib/att.c:402:10: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
* attrib: Fix remaining references to bluetooth/uuid.hAnderson Lizardo2013-01-101-1/+1
| | | | These headers are not public anymore, so need to use "lib/uuid.h".
* attrib: Fix missing config.h includesCristian Rodríguez2012-12-231-0/+4
|
* attrib: Fix not checking if att_data_list_alloc failsVinicius Costa Gomes2012-10-111-0/+6
| | | | | Now that this function may fail in more usual situations (invalid input), we have to check its return value.
* att: Fix sending pdu's with invalid dataVinicius Costa Gomes2012-10-111-0/+3
| | | | | | When encoding an att_data_list we need to make sure that each element lenght of the data list will not exceed 255, because that information will be encoded as a octet later.
* attrib: Use proper types for size variablesJohan Hedberg2012-08-151-63/+69
| | | | | | | | | size_t/ssize_t/off_t/etc are more appropriate for variables denoting some kind of size than simply using int. This patch includes a couple of other related changes to avoid gcc signedness errors resulting from it treating (for whatever reason) const variables and integer literals as signed.
* att: Add encode/decode execute write supportEder Ruiz Maria2012-08-151-0/+35
| | | | | Add functions for encoding/decoding Execute Write Request and Response PDUs.
* att: Add prepare write supportEder Ruiz Maria2012-08-151-0/+54
| | | | | Add functions for encoding/decoding Prepare Write Request and Response PDUs.
* ATT: Avoid invalid memory access for large PDUClaudio Takahasi2012-06-271-8/+9
| | | | | | This patch avoids invalid memory access when decoding ATT read response PDUs. The ATT_MTU value is a per ATT Bearer value defined by the higher layer specification.
* gattrib: Fix command timeout handlingJohan Hedberg2012-06-051-0/+4
| | | | | | | | This patch fixes command timeout handling. Previously attrib_destroy was explicitly called which ignored any reference holders. This patch fixes the issue by first passing errors to command callbacks and after that marking the GAttrib object as stale so no further operations can be done.
* Fix using the attribute struct for encoding ATT pdusVinicius Costa Gomes2011-10-071-20/+25
| | | | | | | | | | The enconding and decoding of ATT pdus should be kept as much free of dependences from other parts of the code as possible, so it can be used in many contexts. In this case, for encoding and decoding notifications and indications we did have to pass an instance of an attribute instead of direct values.
* Fix memory allocation of struct attributeAnderson Lizardo2011-09-221-4/+3
| | | | | | | On commit 6a6da5de107e192f62ce2ecdde96eae985181df0 the struct attribute "data[0]" member was replaced with a dynamically allocated "data" pointer. This commit fixes remaining places where the old allocation scheme was still assumed.
* Remove empty line before declarationAnderson Lizardo2011-09-221-1/+0
|
* Fix common misspelled wordsLucas De Marchi2011-07-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Accounting of misspelled words, as detected by codespell: acording 2 ancilliary 1 appropiate 1 atribute 1 cant 1 comming 2 gracefull 1 lenght 1 mispelled 1 occured 1 occurences 1 ocurred 3 prefered 1 presense 1 reponse 1 seperate 1 succesful 1 successully 1 sucessfull 1 sucessfully 1
* Remove "authen" and "autho" short versions for ATT constantsClaudio Takahasi2011-03-301-2/+2
|
* Use new UUID functions in GATTElvis Pfützenreuter2011-03-151-27/+20
| | | | | | This patch puts the new UUID functions into use for GATT-related code, and adds some convenience functions to ATT API (att.h). Example GATT server is also changed.
* Coding standard change replacing malloc by glib functionsClaudio Takahasi2011-02-241-31/+45
| | | | | Use glib memory allocation functions instead of malloc for attribute data list in ATT protocol utility functions.
* Add encode/decode for write responseBruna Moreira2011-02-151-0/+21
| | | | | The encode/decode functions for Write Response operations were created to keep consistency with the rest of GATT API.
* Add READ_BLOB_REQUEST support to attribute serverBrian Gix2011-01-201-0/+44
|
* Add enc_read_blob_req() as defined in BT Core Spec v4.0Brian Gix2010-12-191-0/+19
|
* Attrib server should truncate attribute value to pdu lengthSheldon Demario2010-11-291-8/+7
| | | | | When the size of attribute value is greater than pdu size, it should be truncated to the pdu length - 2
* Add Find By Type Value Response encoding/decoding functionsClaudio Takahasi2010-11-181-0/+46
| | | | | Find by type operation is used by Discover Primary Service by Service UUID. Find By Type Value Response shall contain one or more group handles.
* Implement Find by Type request encode/decodingBruna Moreira2010-11-181-2/+70
|
* Add support for Attribute Write RequestAnderson Lizardo2010-10-091-0/+50
| | | | | | | Implement encoders/decoders for Write Request/Response and the handling on attribute server. The attribute client still uses the Write Command because currently SetProperty() has no means to wait for the server response.
* Modify dec_read_req() to get PDU length as parameterAnderson Lizardo2010-10-041-1/+4
| | | | This is consistent with other att.h functions, and allows length checks.