path: root/attrib/client.c
Commit message (Collapse)AuthorAgeFilesLines
* storage: Store address type in "characteristics"Paulo Alcantara2012-05-211-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' {} \;
* build: Remove glib-compat.h supportMarcel Holtmann2012-04-161-1/+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.
* attrib: Fix missing Discovery reply when disconnectedClaudio Takahasi2012-04-031-0/+14
| | | | | This patch fixes missing reply for DiscoverCharacteristics method on Generic Attribute. If link is disconnected reply message is not sent.
* attrib: Attempt to remove attio callback on watcher exitAnderson Lizardo2012-03-301-0/+1
| | | | | | | | | When registering a watcher, it is attempted to add an attio callback. Therefore, when the watcher is unregistered or exits, this attio should be removed if there are no other users. This is already done when unregistering a watcher, it just missed when it exits without unregistering.
* attrib: Fix missing D-Bus message unref on DiscoverCharacteristicsClaudio Takahasi2012-03-301-0/+3
| | | | | This patch fixes a missing message unref when DiscoverCharacteristics on Generic Attribute finishes.
* attrib: Register only new characteristics foundClaudio Takahasi2012-03-301-2/+1
| | | | | This avoids duplicating registration for previously found characteristics.
* attrib: Move Characteristic Discovery reply to a new functionClaudio Takahasi2012-03-301-17/+27
| | | | | | Minor cleanup patch moving the creation of the reply for Discover All Characteristics call to a new local function in the Generic Attribute.
* attrib: Discover Characteristics if already connectedClaudio Takahasi2012-03-301-25/+24
| | | | | | On Generic Attribute, Discover All Characteristics of a Service can be started immediately if already connected, without registering a ATTIO connection callback.
* attrib: Centralize ATTIO connection managementClaudio Takahasi2012-03-301-16/+24
| | | | | | | | On Generic Attribute, register only one ATTIO connection callback to centralize the connection management. Also make sure the connection reference is properly dropped only if there is no pending operation.
* GATT: Replace start/end with att_rangeChen Ganir2012-03-261-5/+5
| | | | | Use att_range struct instead of individual start/end handles in gatt_primary structure
* GATT: Rename service and char structsChen Ganir2012-03-261-6/+6
| | | | | | 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.
* attrib-client: Fix consecutive set value when disconnectedClaudio Takahasi2011-12-271-3/+5
| | | | | | SetProperty for "Value" property needs to be queued when disconnected. Registering ATTIO connection callback does not mean that the link is established, GAttrib instance is assigned in the connection callback.
* attrib-client: Fix GAttrib reference countingClaudio Takahasi2011-12-271-3/+7
| | | | | | Although ATT connection callbacks control GAttrib reference, each entity using GAttrib should be increment the GAttrib reference to keep the code standard.
* attrib-client: Remove unused SDP header includesClaudio Takahasi2011-12-271-2/+0
* Fix device address type trackingJohan Hedberg2011-12-231-1/+1
* Add glib-compat.h to deal with issues in old GLib versionsJohan Hedberg2011-10-181-1/+1
* Add on demand characteristic writeClaudio Takahasi2011-07-271-5/+37
| | | | | Changes the Generic Attribute registering a callback to request ATT connection(if necessary) and write the characteristic value.
* On demand connection for characteristics discoveryClaudio Takahasi2011-07-271-9/+75
| | | | | | | In the Generic Attribute API, when DiscoverCharacteristics is called ATT connection should be requested if the link is not up. A query list is required to control when the link can be disconnected since the discover finishes after receiving all caracteristic declarations.
* Register ATT connection callback based on watchersClaudio Takahasi2011-07-271-23/+32
| | | | | | In the Generic Attribute API, the ATT connection should be requested on demand. In the case of watchers, the connection doesn't need to be stay up if there isn't watcher registered.
* Change GAttrib ref counting in Generic AttributeClaudio Takahasi2011-07-271-12/+0
* Remove implicit connection from generic APIClaudio Takahasi2011-07-271-111/+10
| | | | | | | Generic attribute API should not actively manage L2CAP connections. GAttrib instance is notified through registered callbacks. SetProperty or DiscoverCharacteristic now returns NotConnected error if the link is down.
* Register the ATT connection callbacksClaudio Takahasi2011-07-271-0/+22
| | | | | | Registers the ATT connection and disconnection callbacks in the generic attribute API. First commit to remove implicit L2CAP connection establishment.
* Cleanup of primary service structsClaudio Takahasi2011-07-271-188/+144
| | | | | | Get rid of local structure to store all GATT primary services of a given device. "primary" struct has been renamed to "gatt_service" to avoid misinterpretation or confusion with "att_primary".
* Cleanup of primary service registrationClaudio Takahasi2011-07-271-23/+24
* Remove leftover D-Bus message in gatt_serviceClaudio Takahasi2011-07-271-7/+0
* Remove storing device path in gatt_serviceClaudio Takahasi2011-07-271-5/+5
* Remove not necessary data from gatt_serviceClaudio Takahasi2011-07-271-17/+30
| | | | | Bluetooth source and destination address can be obtained from the device object. GATT service doesn't need to keep these addresses.
* Allow building with GLib 2.16 for nowMarcel Holtmann2011-07-041-0/+3
* Make use of g_slist_free_full on attribLuiz Augusto von Dentz2011-06-301-4/+2
* Clean up ATT CID & PSM magic values & definititionsJohan Hedberg2011-04-261-1/+1
| | | | | Use proper defines for the ATT CID and PSM. The values are really ATT and not GATT specific so move them from gatt.h to att.h.
* Remove btd_device_add_service functionClaudio Takahasi2011-04-141-8/+8
| | | | | btd_device_add_service is no longer necessary if the object paths for the primary services can be returned during the registration.
* Add support for re-using the attrib channelVinicius Costa Gomes2011-03-301-1/+5
| | | | | | | | | In some cases, when the device is already connected there's no need to create another GAttrib instance. This will allow the Attrib client to use the connection already estabilished, this will be very useful when we support more LE profiles.
* Remove _init and _exit methods from Attrib clientVinicius Costa Gomes2011-03-301-30/+14
| | | | | | | | Now that Attrib client is being moved to the core, there's no need to have explicit _init and _exit methods. This also means that we need to pass the DBusConnection explicitly to the registration method.
* Register Attrib interface when loading device from storageVinicius Costa Gomes2011-03-301-2/+1
| | | | | Now that the GATT client functionality is being moved to the core we need to register the interface when the device is created.
* Add discover characteristics by UUID to gatttoolSheldon Demario2011-03-171-1/+1
| | | | | | 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-15/+11
| | | | | | 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.
* Fix not returning an error when DiscoverCharacteristics() failsVinicius Costa Gomes2011-03-151-0/+7
| | | | | | | | When the connection fails an error should be returned to inform the user. This adds a field to store the DBusMessage that caused the error, so we can send the correct reply.
* Fix the behaviour of the DiscoverCharacteristics methodVinicius Costa Gomes2011-03-151-4/+28
| | | | | | | | | | The previous behaviour could lead to some problems, as it returned as soon as possible. To avoid problems we return just after as the characteristics are discovered, and to save a few round trips we return the path of all characteristics that belong to this service. After this method return it will try to read the characteristics values.
* Rename the Discover method to DiscoverCharacteristicsVinicius Costa Gomes2011-03-151-1/+1
* Add offset option to characteristic read by handleSheldon Demario2011-03-041-5/+5
| | | | Some tests require an arbitrary offset.
* Fix typo on DBG() string formatAnderson Lizardo2011-02-231-1/+1
* Check malformed notification/indication PDUElvis Pfützenreuter2011-02-231-1/+9
| | | | | This patch implements discard of obviously malformed GATT notification/indication PDUs.
* Add UUID property to GATT service objectElvis Pfützenreuter2011-02-181-0/+4
* Fix GATT listen mode updatingAndre Dieb Martins2011-02-081-0/+1
| | | | Update gatt's listen-mode flag whenever connect_cb() is called again.
* Fix duplicate characteristicsBruna Moreira2011-01-211-0/+7
| | | | | | The Discover() operation (from DBus API) was registering the same characteristics after running several times. This can be checked using test-attrib.
* Move common code from Discover all Characteristics to GATT libraryBruna Moreira2011-01-191-53/+14
| | | | | | | | 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.