summaryrefslogtreecommitdiff
path: root/attrib/gatt.c
Commit message (Collapse)AuthorAgeFilesLines
...
* gatt: Return not found if characteritics is emptyClaudio Takahasi2012-08-201-1/+2
| | | | | | | | | This patch changes the behaviour of Discover All Characteristics and Discover Characteristics by UUID returning <<Attribute Not Found>> when Characteristic list that matches the defined criteria is empty. This scenario can happen when the GATT client avoids extra iteraction with the remote attribute server if the last received handle(or handle + 1) is equal to the end handle of the primary service.
* attrib: Use proper types for size variablesJohan Hedberg2012-08-151-21/+22
| | | | | | | | | 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.
* gatt: Add support to GATT Write Long CharacteristicEder Ruiz Maria2012-08-151-5/+104
| | | | | | Extending the function gatt_write_char for support GATT Write Long Characteristics. MTU is checked and if the payload does not fit, the prepare and execute write are used to do the transaction.
* GATT: Avoid unneeded discover transactionClaudio Takahasi2012-05-301-1/+1
| | | | | | This patch fix unneeded discover characteristics transaction when the last characteristic declaration contains the handle number equals to the end handle of the primary service.
* build: Remove glib-compat.h supportMarcel Holtmann2012-04-161-2/+0
|
* GATT: Replace start/end with att_rangeChen Ganir2012-03-261-2/+2
| | | | | Use att_range struct instead of individual start/end handles in gatt_primary structure
* GATT: Rename service and char structsChen Ganir2012-03-261-4/+4
| | | | | | Rename the att_primary to gatt_primary and att_char to gatt_char. Characteristic and Service do not exist in the ATT spec, only in GATT.
* Add glib-compat.h to deal with issues in old GLib versionsJohan Hedberg2011-10-181-1/+1
|
* Refactor value assignments of bt_uuid_t variablesAnderson Lizardo2011-09-221-1/+1
| | | | | | | | | Prior to this commit, the assignments were made with memcpy(). This can be unsafe and less readable, therefore it was replaced with code like: <dst> = *src; This also allows more compiler safety checks.
* Allow building with GLib 2.16 for nowMarcel Holtmann2011-07-041-0/+6
|
* Make use of g_slist_free_full on attribLuiz Augusto von Dentz2011-06-301-2/+1
|
* Remove unused op variable from encode_discover_primarySzymon Janc2011-05-151-3/+0
|
* Register primary services exported over basic rateClaudio Takahasi2011-04-141-0/+78
| | | | | | This patch registers the object paths for primary services exported through SDP. PSM, start and end handle information are available in the Protocol Descriptor List.
* Add Exchange MTU operation in GATT libraryBruna Moreira2011-03-181-0/+13
|
* Use GAttrib buffer for ATT protocol PDUsBruna Moreira2011-03-181-45/+64
| | | | | Prior to this commit, there were local buffers inside GATT functions. Now, a single buffer is used, to make sure the MTU limit is respected.
* Add discover characteristics by UUID to gatttoolSheldon Demario2011-03-171-5/+11
| | | | | | According to the specification the characteristics discover and characteristics discover by UUID use the same opcode and the result should be filtered by callback.
* Use new UUID functions in GATTElvis Pfützenreuter2011-03-151-33/+35
| | | | | | 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.
* Extend Characteristic Write to support Write Without ResponseClaudio Takahasi2011-03-101-2/+6
| | | | | | If callback is not informed, Write Command will be used to execute a Write Without Response sub-procedure. Error is not returned by the server no matter the result of the operation.
* Add offset option to characteristic read by handleSheldon Demario2011-03-041-4/+11
| | | | Some tests require an arbitrary offset.
* Fix invalid read after list concatenationBruna Moreira2011-02-041-1/+0
| | | | | g_slist_concat uses the items from second list directly so they should not be freed.
* Fix incoming attrib-server connection MTUsBrian Gix2011-01-211-14/+14
| | | | | | | | | | | | It is important for the Attribute Server to be aware of and completely fill response packets up to the full MTU when reading long attributes. Some remote devices will only request additional (READ_BLOB) data if the preceding read sent the maximum amount of data. Incoming connections are identified as L2CAP or LE by pointers to the Service IO channel the incoming connection was recieved on in the user_data parameter. L2CAP channels are set to the BR/EDR minimum MTU of 48, and LE channels to the LE payload size of 23.
* Move common code from Discover all Characteristics to GATT libraryBruna Moreira2011-01-191-3/+108
| | | | | | | | The attribute client (attrib/client.c) and gatttool share similar code to parse the PDU coming from server. This commit moves this common code to attrib/gatt.c, and simplifies the callbacks implemented by the clients. The client callbacks are now called just once and get a GSList of characteristics, instead of the raw PDU.
* Rename gatt_primary_t to more generic nameBruna Moreira2011-01-191-2/+2
| | | | | The gatt_primary_t typedef was renamed to gatt_cb_t because it will be used for primary and characteristic callbacks.
* Move interactive code of Discover Primary to gatt.cClaudio Takahasi2011-01-081-7/+158
| | | | | Initial patch to move the shared code related to Discover All Primary Services and Discover Primary Services by UUID to gatt.c.
* Fix gatt_read_char() to support long Attrib ValuesBrian Gix2011-01-071-2/+128
| | | | | | | | | | Fix gatt_read_char() to support long Attribute Values by recognizing that results longer that 21 octets may include data beyond what has been returned with the first read. Extra data is obtained by issuing READ_BLOB requests until either a result is returned shorter than 22 octets, or an error is recieved indicating that no further data is available. The API for this function has not changed.
* Fix g_attrib_send() to include a new ID parameterBrian Gix2011-01-071-6/+6
| | | | | | | | | | | | | | | | | | | | | Overall purpose of change is to enable a GATT procedure to be executed atomically, even if it requires multiple ATT request/response transactions. Fix g_attrib_send() to include an ID parameter, if the pkt to be sent should be added to the Head of the pkt queue. If the ID is Zero, legacy functionality is maintained, and the pkt will be added at the tail of the queuer, and a new ID will be generated, and returned to the caller. If ID is non-zero, the pkt will be added to the head of the queue, with the ID value requested, which will also be returned to the caller. Fix received_data() to not service the send queue until after the received data has been processed by calling the cmd->func() callback, to allow the callback to insert another pkt on the head of the queue. Fix all callers of g_attrib_send() to include new parameter.
* Implement Characteristic Value Read using UUID in the gatttoolSheldon Demario2010-11-191-3/+12
| | | | | | | | | | | Sub-procedure used to read a Characteristic Value when the client only knows the characteristic UUID and doesn't know the handle. More than one handle and attribute value pair can be returned, it is up to the user define the handles range based on the service handles range. Usage example: $gatttool --char-read --uuid=2a00 -i hcix -b xx:xx:xx:xx:xx:xx
* Add an extra parameter in the discovery primary to specify the UUIDClaudio Takahasi2010-11-181-7/+30
| | | | | | Extends discover primary function to perform discover by UUID. UUID parameter defines which procedure will be executed: Discover All Primary Services or Discover Primary Service by Service UUID.
* Add support for Attribute Write RequestAnderson Lizardo2010-10-091-0/+11
| | | | | | | 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.
* Implement Write command in GATT APIBruna Moreira2010-10-041-0/+11
|
* Define maximum and default MTU valuesVinicius Costa Gomes2010-09-131-4/+4
|
* Update copyright information of GATT library/toolsVinicius Costa Gomes2010-08-091-1/+2
|
* Add helper functions to send Find Information requestsVinicius Costa Gomes2010-08-091-0/+14
| | | | | This function allows one to send Find Information requests without having to build the PDU by hand each time.
* Implement characteristic value read on attribute serverAnderson Lizardo2010-08-091-0/+11
|
* Move gatt_discover_char to gatt.cClaudio Takahasi2010-08-091-1/+18
|
* Move gatt_discover_primary to gatt.cClaudio Takahasi2010-08-091-0/+48