path: root/attrib/client.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix g_attrib_send() to include a new ID parameterBrian Gix2011-01-071-1/+1
| | | | | | | | | | | | | | | | | | | | | 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.
* Change security level on demand when reading characteristic descriptorClaudio Takahasi2011-01-051-9/+20
* Change security level on demand when reading characteristic valueClaudio Takahasi2011-01-051-0/+11
| | | | | | | If a characteristic requires a higher security level, change it on demand and re-send the GATT Charateristic Value Read. Request will not be sent until the SMP negotiation finishes. This change doesn't affect GATT over BR/EDR, since encryption is mandatory for BR/EDR.
* Add GetProperties method the Service InterfaceVinicius Costa Gomes2010-12-231-0/+39
| | | | | For now this interface just includes the path that each characteristic is registered at.
* Add support for adding services to the Services propertyVinicius Costa Gomes2010-12-231-0/+1
| | | | | We need to fill the devices property as each service path gets registered in the DBus system bus.
* Remove GetCharacteristics DBus methodVinicius Costa Gomes2010-12-231-46/+0
| | | | | This method was not documented in the API, and it has the same functionality as getting the Characteristics property.
* Add a Discover method to the GATT ClientVinicius Costa Gomes2010-12-231-17/+23
| | | | | This methods allows users to actively start the discovery of characteristics presents in a service.
* Add support for making LE connections to GATT clientVinicius Costa Gomes2010-12-231-1/+9
| | | | | | Now GATT client should be able to make LE connections. The information used to determine if we should make a LE connection is the psm stored in the gatt_service structure.
* Clean up the primary service D-Bus registrationVinicius Costa Gomes2010-12-231-191/+32
| | | | | Now, that much of this funcionality was moved to the core, we can go straight to the registration of D-Bus interfaces.
* Remove duplicated code for discovering GATT servicesVinicius Costa Gomes2010-12-231-97/+4
| | | | | | Most of this functionality was moved to src/device.c. Since that move this code doesn't work. Some ugly hack were added to avoid breaking the build.
* Add the btd_ prefix to device_add_serviceVinicius Costa Gomes2010-12-231-1/+1
| | | | | This is needed to keep consistency, as device_add_service would be used from outside the core bluetoothd.
* Move primary service storage to device.cSheldon Demario2010-12-231-41/+0
| | | | | Discover All Primary Services has beed moved to device.c in order to follow a similar approach of BR/EDR service records.
* Fix attrib plugin deregistrationVinicius Costa Gomes2010-12-221-1/+1
| | | | | | As the comparison method used for find what to de-register was wrong, it was causing the btd_device reference that the attrib plugin was keeping never to be dropped.
* attrib: use btd_error_failed()Gustavo F. Padovan2010-12-141-8/+2
* Add btd_error_not_authorized()Gustavo F. Padovan2010-12-071-7/+1
* Create btd_error_invalid_args()Gustavo F. Padovan2010-12-071-13/+7
| | | | | | DBus error handling in BlueZ is a mess. This is the first patch to unify all DBus error handling like in ConnMan and oFono. This unifies all .InvalidArguments errors.
* Don't trigger the discovering when registering the clientClaudio Takahasi2010-11-291-46/+1
| | | | | | Discover All Primary Services should not be trigged by the attribute client when a given device is registered. Discover services is now done by the device entity.
* Add an extra parameter in the discovery primary to specify the UUIDClaudio Takahasi2010-11-181-4/+4
| | | | | | 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.
* Use reference counting of the device object while discovering servicesClaudio Takahasi2010-11-111-1/+2
* Fix invalid reference to GATT service structureClaudio Takahasi2010-11-051-5/+4
* Enable GATT over LE link on the attribute clientClaudio Takahasi2010-11-051-10/+12
* Remove typecast from att_get_u16() callsAnderson Lizardo2010-10-041-10/+9
| | | | att_get_u16() already does a cast of the void* parameter to uint16_t*.
* Fix and refactor characteristic value update codeAnderson Lizardo2010-10-041-23/+10
* Use g_slist_foreach() instead of a for loopBruna Moreira2010-10-041-17/+14
* Write new value for characteristic valueBruna Moreira2010-10-041-1/+12
| | | | | Note only client is implemented by now. The server implementation will be done later.
* Move connection common code to l2cap_connect()Bruna Moreira2010-10-041-24/+32
| | | | | Common code for connection operations were moved to l2cap_connect() function. This way, register_watchers() and set_value() can use it.
* Remove unnecessary check for watcher pathAnderson Lizardo2010-10-041-12/+0
* Add characteristic SetProperty implementationClaudio Takahasi2010-09-301-14/+72
| | | | | | Initial implementation of SetProperty. Add D-Bus method declaration and extracts the arguments. The new requested characteristic value is not being sent to the remote device yet.
* Add "Services" property in the org.bluez.Device interfaceVinicius Costa Gomes2010-09-301-11/+22
| | | | | | Add a new property "Services" representing the object paths of the available GATT primary services. "Services" is an array of D-Bus object paths.
* Fix ValueChanged not being called on registered agentsVinicius Costa Gomes2010-09-301-3/+0
| | | | | | The removed check was trying to verify that the watcher path was the same as the characteristic being updated, which does not make much sense.
* Fix coding style issues in attribute client codeClaudio Takahasi2010-09-221-9/+10
* Fix memory leak of characteristic and primary service listsClaudio Takahasi2010-09-221-0/+2
* Unregister the primary and characteristic objectsClaudio Takahasi2010-09-221-6/+18
| | | | | Removes memory leak. When the attribute client is unregistered primary and characteristic D-Bus objects shall be unregistered.
* Add UnregisterCharacteristicsWatcher implementationClaudio Takahasi2010-09-221-1/+49
* Fix seg fault if the watcher exit before the connection completeClaudio Takahasi2010-09-221-0/+3
* Fix disconnection when multiple watchers are registeredClaudio Takahasi2010-09-221-0/+3
| | | | | | GAttrib ref counter shall be used to control when the remote shall be disconnected. Ref counter is incremented when the watcher is registered and decremented when it leaves the bus.
* Increment GAttrib reference for each GATT/ATT requestClaudio Takahasi2010-09-221-83/+83
| | | | | | | When multiples requests are queued, GAttrib ref count shall be incremented to control disconnection. Allowing to disconnect from the remote only the last response is received. This approach allow to address errors and continue to process queued requests.
* Use the destroy function to reset the GAttrib referenceClaudio Takahasi2010-09-221-4/+11
| | | | | | In the client, after local or remote initiated disconnection the GAttrib reference shall be set to NULL to allow a proper control of references and further connections.
* Fix uninitialised value warningClaudio Takahasi2010-09-221-5/+5
* Add missing response for handle value indication on attribute clientClaudio Takahasi2010-09-221-1/+6
* Watchers don't need to reply for characteristic value updatesClaudio Takahasi2010-09-221-0/+1
| | | | | Value method call doesn't need confirmation. Minor optimization to not sending method return or error replies.
* Add watcher's characteristic path verification before notify changesClaudio Takahasi2010-09-221-0/+3
| | | | | | Each registered watcher instance is associated with a characteristic path. Value() method shall not be sent to all watchers, characteristic path shall match.
* Return an error if the path doesn't exist when registering a watcherClaudio Takahasi2010-09-221-2/+14
| | | | | In the register characteristic watcher method, the given parameter (characteristic path) shall be validated before register the watcher.
* Add support for actively updating the watcherVinicius Costa Gomes2010-09-221-0/+31
| | | | | | | This adds support for calling the ValueChanged() method on the registered watcher, when a characteristic on the associated service gets updated. For now this method will be called when we get a Notification or an Indication from the server.
* Add support for Indications to the clientVinicius Costa Gomes2010-09-221-0/+3
| | | | | | | | When receiving a Indication from the server, the Characteristic Value associated with that indication is updated. There's still no support for updating Characteristic Descriptors in case they arrive, primarily because we don't know if it makes sense.
* Add support for Indications to gatttoolVinicius Costa Gomes2010-09-221-0/+2
| | | | | | Now gatttol is able to receive indication events and repond to them. For now, this response is just sending the confirmation response back to the server and printing the received update.
* Update characteristic value when a notification is receivedClaudio Takahasi2010-09-221-3/+51
| | | | | Changes the internal characteristic value in attribute client side. Messages to notify the watchers are not being sent yet.
* Fix coding style issues in attribute codeJohan Hedberg2010-09-221-7/+11
* Reconnect the BR/EDR L2CAP connection when a watcher is registeredClaudio Takahasi2010-09-211-13/+84
| | | | | | | When there is watcher active, the client shall set the Client Characteristic Configuration attribute to receive Notifications or Indications. This patch introduces the initial changes to re-connect and watch for events.
* Initial characteristics watcher implementationClaudio Takahasi2010-09-211-0/+43
| | | | Tracks when the client disconnects from the system bus.