summaryrefslogtreecommitdiff
path: root/attrib
AgeCommit message (Collapse)AuthorFilesLines
2012-12-14attrib: conn_state should be staticJohan Hedberg1-1/+1
2012-12-13core: Remove attribute client APIJohan Hedberg2-1245/+0
There will be a more comprehensive API coming soon and we don't want to have this one around for 5.0 since it'd immediately have to be deprecated.
2012-12-07Revert "Ensure config.h is included by using CPPFLAGS"Johan Hedberg4-0/+16
This reverts commit 8a03376544b046a84301847d1594f6c3674983ff. The patch needs to be split up and the gdbus/ changes were bogus compared to the original commit message. Conflicts: Makefile.am Makefile.obexd profiles/cyclingspeed/cyclingspeed.c profiles/heartrate/heartrate.c src/error.c
2012-12-05Reorder btio.h includesLucas De Marchi4-4/+4
Let "#include <btio/btio.h>" together with other includes using '<' rather than '"'.
2012-12-05Use the entire include path for btio.hLucas De Marchi5-5/+5
2012-12-05Use the entire include path for gdbus.hLucas De Marchi1-1/+1
2012-12-05Ensure config.h is included by using CPPFLAGSLucas De Marchi4-16/+0
Instead of trying to include config.h in each file over the tree and possibly forgetting to include it, give a "-include config.h" argument to the compiler so it's guaranteed that a) it will be included for all source files and b) it will be the first header included. gdbus/ directory is left out, since it would break other projects using it.
2012-12-01gatt: Improve characteristics discoveryPaulo Borges1-1/+1
In the Discover Characteristics by UUID sub-procedure, if a fetched characteristic doesn't matches with the target UUID, all others characteristics in that response were discarded. Because of this, the procedure will make a new request to possibly rediscover the characteristics in the range beyond this last characteristic. At present, this procedure works because the gatt library will send a Read by Type Request starting at the first attribute after the non matching characteristic. This commit makes the rest of the characteristics to be checked for a matching type, which should reduce the number of requests sent during the discovery of characteristics.
2012-12-01gatt: Fix memory leak in characteristic discoveryPaulo Borges1-3/+3
If the Discover Characteristics by UUID sub-procedure has been executed and the first characteristic is not the target, a memory leak occurs. This commit fixes this leak by postponing the allocation to after the UUID verification.
2012-11-13gatt: Update characteristic names translation tableAndrzej Kaczmarek1-0/+23
2012-10-11gattrib: Add support for listening for events for specific handlesVinicius Costa Gomes5-18/+42
We want only the profile that implements a service to be notified of changes on that service. Before this patch, all the registered event notifiers are being called.
2012-10-11attrib: Fix not checking if att_data_list_alloc failsVinicius Costa Gomes1-0/+6
Now that this function may fail in more usual situations (invalid input), we have to check its return value.
2012-10-11att: Fix sending pdu's with invalid dataVinicius Costa Gomes1-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.
2012-10-11att: Replace ATT_MAX_MTU with ATT_MAX_VALUE_LENVinicius Costa Gomes1-1/+1
ATT has the concept that an attribute value has a maximum length and we weren't keeping track of this.
2012-10-11attrib: Remove all the usages of ATT_MAX_MTUVinicius Costa Gomes2-2/+2
This "define" was bogus for two reasons: 1. There's no concept of maximum MTU in the ATT level; 2. It was used as a maximum attribute value length.
2012-10-11gattrib: Fix ignoring the error message when write failsVinicius Costa Gomes1-1/+7
If an error happens during writing to the socket, we should complain that it failed.
2012-10-09attrib: Remove opcode parameter from g_attrib_send()Vinicius Costa Gomes6-40/+33
In all uses of g_attrib_send() the opcode of the command/event is already clear because of the att.h functions used to build the ATT PDU.
2012-10-09gatttool: Add "included" commandJefferson Delfes1-0/+60
New command to find included services in interactive mode.
2012-10-09gatt: Add support for find included servicesVinicius Costa Gomes2-0/+201
Some services like HID over LE can reference another service using included services. See Vol 3, Part G, section 2.6.3 of Core specification for more details.
2012-10-05device: Convert device_get_address into simple getterSzymon Janc1-26/+16
This allow to remove number of local variables used only to get device address and pass it as pointer later on. bdaddr_type parameter is also removed as there is device_get_addr_type already present which can be used to get it if needed.
2012-10-05adapter: Convert adapter_get_address into simple getterSzymon Janc1-1/+1
Most uses of adapter_get_address were in form of: bdaddr_t addr; adapter_get_address(adapter, &addr); foo(&addr); Changing it to getter makes code simpler and avoid number of not needed memcpy.
2012-10-02attrib: Get address type using gatt_get_address()Anderson Lizardo1-4/+1
This avoids a separate call to device_get_addr_type().
2012-10-01gatt: Remove offset parameter from gatt_read_charJefferson Delfes5-37/+15
The Core spec allows to implement Read Long Characteristic Value as a Read Request, followed by zero or more Read Blob Requests, therefore the offset parameter is unnecessary and is always 0 for normal use.
2012-09-21attrib: Simplify DBusConnection object handlingAndrzej Kaczmarek2-25/+19
This patch removes redundant references and function parameters for DBusConnection object and uses btd_get_dbus_connection() call wherever such object is needed instead. Pointer returned by this call is guaranteed to be valid for entire bluetoothd lifetime and thus do not need to be refcounted.
2012-09-20gatttool: Fix Characteristic descriptor discoveryClaudio Takahasi1-9/+13
This patch fixes end condition for Characteristic Descriptor Discovery. This sub-procedure is complete when the Error Response is received and the Error Code is set to Attribute Not Found or the Find Information Response has an Attribute Handle that is equal to the Ending Handle of the request.
2012-09-04gatt: Translate Characteristic namesChen Ganir1-3/+72
Translate Characteristic UUID's to name. This list was taken from the Bluetooth SIG developer site.
2012-09-03gatt: Fix whitespace in UUID definitionsAndrzej Kaczmarek1-2/+2
2012-09-03Add profile abstraction (replaces btd_device drivers)Johan Hedberg1-0/+1
This patch removes the btd_device_driver concept and replaces it with btd_profile. The new construct also contains the necessary parts for adapter drivers, so btd_adapter_driver is only needed for non-profile related functionality (most of which is in plugins/*). The main purpose of this new construct is to facilitate a centralized connection creation mechanism for profiles, ultimately enabling the addition of a Device.Connect() method instead of requiring a UI to know to call e.g. Input.Connect or Audio.Connect. This feature will also be extended to externally implemented profiles once the internal implementation gets more stable, such as OBEX (obexd) and HFP (oFono). The new D-Bus interface will also partially restore functionality which was previously available through the Serial interface.
2012-08-28Update code base to use the new BtIO APIJohan Hedberg4-16/+10
2012-08-20gatt: Don't raise error if declaration was foundClaudio Takahasi1-4/+4
This patch avoids raising errors to the upper layer if at least one characteristic declaration has been found. According to the Core SPEC Characteristic declarations shall be read without authentication or authorization.
2012-08-20gatt: Return not found if characteritics is emptyClaudio Takahasi1-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.
2012-08-20att: Add Find Info Response Format constantsClaudio Takahasi1-0/+4
This patch adds constants declarations for Find Information Response Format field. The format means that information data constains a list of 1 or more handles with their 16-bit or 128-bit Bluetooth UUIDs
2012-08-20gatt: Primary service interval may not changeClaudio Takahasi1-0/+1
This patch address the "Service Changed" scenario on which the start and end Primary Service attribute handle interval doesn't change.
2012-08-15attrib: Fix naming and variable types of security requirementsJohan Hedberg2-10/+10
There's a single read/write requirement value so the variables should be named in singular form. Also, until there's e.g. an enum typedef for them a simple int shall do.
2012-08-15attrib: Use proper types for size variablesJohan Hedberg10-149/+163
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.
2012-08-15gatt: Add support to GATT Write Long CharacteristicEder Ruiz Maria4-7/+110
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.
2012-08-15att: Add encode/decode execute write supportEder Ruiz Maria2-0/+37
Add functions for encoding/decoding Execute Write Request and Response PDUs.
2012-08-15att: Add prepare write supportEder Ruiz Maria2-0/+59
Add functions for encoding/decoding Prepare Write Request and Response PDUs.
2012-08-14gatt: Add a new descriptor UUIDJoão Paulo Rechi Vita1-0/+1
Add the UUID of the External Report Reference descriptor.
2012-07-09gatt: add Report Reference descriptor UUIDClaudio Takahasi1-0/+1
2012-06-27generic attribute: Use GAttrib bufferClaudio Takahasi1-2/+4
This patch replaces the static local buffer by the GAttrib internal buffer to temporarily store the output ATT PDU.
2012-06-27gatttool: Use GAttrib bufferClaudio Takahasi2-4/+8
This patch replaces the static local buffer by the GAttrib internal buffer to store temporarly the output ATT PDU.
2012-06-27ATT: Avoid invalid memory access for large PDUClaudio Takahasi4-13/+19
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.
2012-06-27Fix GDBus flags after conversion to macrosLucas De Marchi1-1/+1
Commit "aa3b9016bf444b60e1b7e1804dfc323a23a93c5a Convert GDBus methods to use macro helpers" converted the previous tables to use the new macros but some flags were lost.
2012-06-08gattrib: Make event callback identifiers globally uniqueJohan Hedberg1-2/+2
The attrib server code relies on these id's to be unique globally and not just per GAttrib instance. As an easy fix make them global by adding a static guint to g_attrib_register.
2012-06-07gattrib: Fix protection of GAttrib while calling callbacksJohan Hedberg1-0/+4
The callbacks could result with the reference count dropping to 0 and the object being freed. This patch fixes the issue by adding one extra reference for the duration of the timeout function.
2012-06-07Remove workaround in gatt_connectAndre Guedes1-13/+0
This workaround is not necessary anymore since setsockopt is now checking for minimum MTU.
2012-06-07Fix gatt_connect for BR/EDRAndre Guedes1-1/+1
Use BT_IO_OPT_IMTU instead of BT_IO_OPT_OMTU in bt_io_connect. We cannot control omtu value since it is negotiated during L2CAP configuration phase.
2012-06-07Remove omtu parameter from LE bt_io_connect callsAndre Guedes1-1/+0
There is no need to set the omtu of L2CAP ATT fixed channel. We use the default value.
2012-06-07gattrib: Fix g_attrib_set_mtuAndre Guedes1-8/+0
23 octets is the default (and minimum) ATT_MTU value. If someone tries to set ATT_MTU less than 23 octets g_attrib_set_mtu should fail (return FALSE). Additionally, there is no constraint regarding the maximum value of ATT_MTU, so we should not check for it. Also, we should not change the L2CAP ATT fixed channel MTU. bt_io_set call will always fail since we are not supposed to change L2CAP MTU after connection is established.