summaryrefslogtreecommitdiff
path: root/attrib
Commit message (Collapse)AuthorAgeFilesLines
* device: Convert device_get_address into simple getterSzymon Janc2012-10-051-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.
* adapter: Convert adapter_get_address into simple getterSzymon Janc2012-10-051-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.
* attrib: Get address type using gatt_get_address()Anderson Lizardo2012-10-021-4/+1
| | | | This avoids a separate call to device_get_addr_type().
* gatt: Remove offset parameter from gatt_read_charJefferson Delfes2012-10-015-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.
* attrib: Simplify DBusConnection object handlingAndrzej Kaczmarek2012-09-212-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.
* gatttool: Fix Characteristic descriptor discoveryClaudio Takahasi2012-09-201-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.
* gatt: Translate Characteristic namesChen Ganir2012-09-041-3/+72
| | | | | Translate Characteristic UUID's to name. This list was taken from the Bluetooth SIG developer site.
* gatt: Fix whitespace in UUID definitionsAndrzej Kaczmarek2012-09-031-2/+2
|
* Add profile abstraction (replaces btd_device drivers)Johan Hedberg2012-09-031-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.
* Update code base to use the new BtIO APIJohan Hedberg2012-08-284-16/+10
|
* gatt: Don't raise error if declaration was foundClaudio Takahasi2012-08-201-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.
* 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.
* att: Add Find Info Response Format constantsClaudio Takahasi2012-08-201-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
* gatt: Primary service interval may not changeClaudio Takahasi2012-08-201-0/+1
| | | | | This patch address the "Service Changed" scenario on which the start and end Primary Service attribute handle interval doesn't change.
* attrib: Fix naming and variable types of security requirementsJohan Hedberg2012-08-152-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.
* attrib: Use proper types for size variablesJohan Hedberg2012-08-1510-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.
* gatt: Add support to GATT Write Long CharacteristicEder Ruiz Maria2012-08-154-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.
* att: Add encode/decode execute write supportEder Ruiz Maria2012-08-152-0/+37
| | | | | Add functions for encoding/decoding Execute Write Request and Response PDUs.
* att: Add prepare write supportEder Ruiz Maria2012-08-152-0/+59
| | | | | Add functions for encoding/decoding Prepare Write Request and Response PDUs.
* gatt: Add a new descriptor UUIDJoão Paulo Rechi Vita2012-08-141-0/+1
| | | | Add the UUID of the External Report Reference descriptor.
* gatt: add Report Reference descriptor UUIDClaudio Takahasi2012-07-091-0/+1
|
* generic attribute: Use GAttrib bufferClaudio Takahasi2012-06-271-2/+4
| | | | | This patch replaces the static local buffer by the GAttrib internal buffer to temporarily store the output ATT PDU.
* gatttool: Use GAttrib bufferClaudio Takahasi2012-06-272-4/+8
| | | | | This patch replaces the static local buffer by the GAttrib internal buffer to store temporarly the output ATT PDU.
* ATT: Avoid invalid memory access for large PDUClaudio Takahasi2012-06-274-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.
* Fix GDBus flags after conversion to macrosLucas De Marchi2012-06-271-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.
* gattrib: Make event callback identifiers globally uniqueJohan Hedberg2012-06-081-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.
* gattrib: Fix protection of GAttrib while calling callbacksJohan Hedberg2012-06-071-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.
* Remove workaround in gatt_connectAndre Guedes2012-06-071-13/+0
| | | | | This workaround is not necessary anymore since setsockopt is now checking for minimum MTU.
* Fix gatt_connect for BR/EDRAndre Guedes2012-06-071-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.
* Remove omtu parameter from LE bt_io_connect callsAndre Guedes2012-06-071-1/+0
| | | | | There is no need to set the omtu of L2CAP ATT fixed channel. We use the default value.
* gattrib: Fix g_attrib_set_mtuAndre Guedes2012-06-071-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.
* gattrib: Fix GAttrib buffer allocationAndre Guedes2012-06-071-12/+20
| | | | | | GAttrib buffer should be allocated according to ATT_MTU value. Over BR/EDR, ATT_MTU should be set to the L2CAP imtu negotiated during L2CAP configuration phase. Over LE, ATT_MTU should be 23 octets.
* gattrib: Fix a premature response timer removalIdo Yariv2012-06-071-5/+5
| | | | | | | | | | A timer is set when a response is expected. The timer is removed when data is received, regardless of whether or not the data is a response. As a result, the timer may be cleared even though a response was not received and there would be no way to detect a command timeout. Fix this by clearing the timer only after verifying a response was received.
* att: Start application error codes from the beginning of the rangeJohan Hedberg2012-06-061-3/+3
| | | | | | Application error codes start off with 0x80 onwards. In CSSv2 the range 0xE0-0xFF is reserved for "Common Profile Error Codes" so we should ensure not to mix that with our own definitions.
* attrib: Fix always requiring high securityJohan Hedberg2012-06-061-1/+9
| | | | | | | | If we get an insufficient encryption error for ATT it doesn't necessarily mean that we need to have high secirity. If we have an unauthenticated key and are unencrypted it could also mean that we just need to encrypt the link (medium security). Always requiring high security would make the connection fail for unauthenticated keys.
* gattrib: Fix command timeout handlingJohan Hedberg2012-06-053-1/+34
| | | | | | | | 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.
* 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.
* gattrib: Fix a request/response command deadlockIdo Yariv2012-05-301-24/+87
| | | | | | | | | | | New requests and responses are never sent if a request was sent and the response for it hasn't been received yet. As a result, if both end points send requests at the same time, a deadlock could occur. This could happen, for instance, if the client sends a read request and the server sends an indication before responding to the read request. Fix this by introducing an additional queue for responses. Responses may be sent while there's still a pending request/indication.
* GATT: Move GATT assigned numbers to GATT headerClaudio Takahasi2012-05-303-28/+30
|
* GATT: Rename Characteristic Configuration constantsClaudio Takahasi2012-05-301-2/+2
| | | | | | This patch renames the constants related to Client Characteristic Configuration bit field to use a proper name since it is related to GATT instead of ATT.
* storage: Store address type in "attributes" filePaulo Alcantara2012-05-271-1/+5
| | | | | | | | Addressing types can be either BR/EDR, BLE public or BLE random so the entries in the "attributes" file did not contain enough information to distinguish which addressing type it's supposed to be. Entries will now contain both address number and address type as a single key in every entry in the file.
* storage: Store address type in "characteristics"Paulo Alcantara2012-05-271-10/+15
| | | | | | | | GATT can use BR/EDR or BLE as transport. Addressing types can be either BR/EDR, BLE public or BLE random so the entries in the "characteristics" file did not contain enough information to distinguish which addressing type it's supposed to be. Entries will now contain both address number and address type as a single key in every entry in the file.
* Do not set signature and reply in GDBus tablesLucas De Marchi2012-05-171-6/+6
| | | | | Use GDBUS_* macros, so signature and reply fields are not set in each method/signal.
* Convert GDBus methods to use macro helpersLucas De Marchi2012-05-171-10/+18
| | | | | With these macro helpers we can separate in/out arguments and use their own vector.
* Constify GDBus method tablesLucas De Marchi2012-05-171-2/+2
| | | | | | | Constify method tables with the following command: find . -name '*.[ch]' -exec \ sed -i 's/\(GDBusMethodTable .* =\)/const \1/g' {} \;
* gatttool: Add option to specify LE address typeAndrzej Kaczmarek2012-05-074-11/+33
| | | | | | | | | | | | | This patch makes possible to specify LE address type. After advertising cache was removed from kernel we should always specify address type for LE link when calling bt_io_connect() as otherwise random will always be used. LE address type can be specified either by 'addr-type' or 't' command line parameter or as additional parameter to 'connect' command in interactive mode. Possible values are 'public' (default) and 'random'.
* gatttool: Fix handle parsing in cmd_char_write()Andrzej Kaczmarek2012-04-261-2/+2
| | | | | errno is not set to 0 before call to strtoll() so cmd_char_write() can fail even with proper data. Use strtohandle() helper function instead.
* build: Remove glib-compat.h supportMarcel Holtmann2012-04-163-4/+0
|
* attrib: Fix D-Bus service disconnect watch removalAnderson Lizardo2012-04-041-3/+2
| | | | | | watcher_free() will be automatically called when removing the D-Bus watch (it was set as the destroy callback when adding the watch), therefore it is only necessary to remove the watch.
* gattrib: Protect GAttrib when there is a pending writeClaudio Takahasi2012-04-031-4/+8
|