summaryrefslogtreecommitdiff
path: root/attrib/att.c
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* Replace hardcoded minimum length values with constantsAnderson Lizardo2010-10-041-44/+84
|
* Remove typecast from att_get_u16() callsAnderson Lizardo2010-10-041-13/+13
| | | | att_get_u16() already does a cast of the void* parameter to uint16_t*.
* Add encoders/decoders for the Write commandBruna Moreira2010-10-041-0/+45
|
* Add encoders/decoders for Indication/ConfirmationVinicius Costa Gomes2010-09-221-0/+50
|
* Fix coding style issues in attribute codeJohan Hedberg2010-09-221-1/+2
|
* Add support for UUID 128-bit in {enc, dec}_read_by_type_reqBruna Moreira2010-09-141-7/+19
|
* Add support for UUID 128-bit in {enc, dec}_read_by_grp_reqBruna Moreira2010-09-141-6/+17
|
* Add encoders/decoders for MTU ExchangeVinicius Costa Gomes2010-09-131-0/+66
|
* Fix dealing with the minimum MTU sizeVinicius Costa Gomes2010-09-131-4/+10
| | | | | | | When using the minimum MTU, in some cases, mostly when using 128-bit UUIDs, the PDU is exactly the size of the minimum MTU. In those case there were off-by-one errors. Errors are returned if can't put anything useful inside the requested PDU.
* Fix enc_read_resp to respect the buffer sizeAnderson Lizardo2010-09-021-2/+5
| | | | | | When encoding long responses, there could be situations where the attribute value length could be larger than the buffer size and the encoder would try to put more data than the space available.
* Fix enc_read_by_type_resp accessing invalid memoryVinicius Costa Gomes2010-09-021-0/+3
| | | | | We should always make sure that the buffer has room to hold at least one element.
* Fix encoding functions when buffer is smallBruna Moreira2010-09-011-3/+6
| | | | | | The encoding functions should return only the bytes which can be inserted in buffer (maximum size is defined by ATT_MTU). The other ones should be requested by client again.
* Add attribute handle value notificationClaudio Takahasi2010-08-191-0/+15
| | | | | | Initial changes in attribute server to send notifications to all connected clients when an attribute has changed. Characteristic Configuration descriptor is not being addressed yet.
* Fix alignment access issues during encoding/decodingVinicius Costa Gomes2010-08-191-55/+19
| | | | | | | | When encoding/decoding PDU fields, we have to be careful and use alignment safe functions to load/store the values. These functions will be exported so other parts of the code can reuse them.
* Fix wrong byte order on the Error Response handleVinicius Costa Gomes2010-08-111-2/+1
|
* Update copyright information of GATT library/toolsVinicius Costa Gomes2010-08-091-1/+2
|
* Add encoders and decoders for the Find Information PDU'sVinicius Costa Gomes2010-08-091-0/+107
|
* Fix wrong calculation for number of elements of a data listVinicius Costa Gomes2010-08-091-2/+2
| | | | | We must take into account that the opcode and the length of each element is included in each PDU.
* Add the missing Read by Type functionsVinicius Costa Gomes2010-08-091-0/+50
| | | | | This adds the functions necessary to implement a GATT server. The encoder for the Read by Type Response and the decoder for the Request.
* Fix Read by Group skipping two bytes when encodingVinicius Costa Gomes2010-08-091-3/+4
|
* Implement read by group type in the attribute serverClaudio Takahasi2010-08-091-1/+19
| | | | | | Returns an attribute data list containing found services. Each element of the list contains the start, end group handle and the UUID16 of the given service. UUID128 is not being addressed yet.
* Fix the return value of Read by Group response encoderVinicius Costa Gomes2010-08-091-1/+1
| | | | | To mantain consistency, the size (in bytes) written to the PDU should be returned.
* Add support for dealing with Read Request/Response PDUsVinicius Costa Gomes2010-08-091-4/+54
| | | | | | This adds encoders and decoders for Requests and Responses of this type. The value extracted/inserted is just copied, the user shall ensure that it is in the right byte order.
* Add stubs for dealing with Read Request/Response PDUsVinicius Costa Gomes2010-08-091-0/+20
|
* Add encoder for Read By Group Type Response PDUVinicius Costa Gomes2010-08-091-0/+21
|
* Add decoder for Attribute Read by Group Type requestVinicius Costa Gomes2010-08-091-0/+29
|
* Fix ATT utility functions namingVinicius Costa Gomes2010-08-091-5/+5
| | | | | If we want to support both client and server roles, we must be clear that we are encoding/decoding requests or responses.
* Add support to deal with Read by Type PDUsVinicius Costa Gomes2010-08-091-0/+52
| | | | | This adds att_read_by_type_{encode,decode}, so we can create Read by Type Requests and parse Read by Type Responses.
* Add a way to decode the Read by Group type responseVinicius Costa Gomes2010-08-091-0/+37
| | | | att_read_by_grp_type_decode() returns a attribute data list structure.
* Add utility function to convert ATT error code to stringClaudio Takahasi2010-08-091-0/+44
|