Commit Graph

467 Commits

Author SHA1 Message Date
Claudio Takahasi
a37a95fe6d gatttool: Add Write Without Response option
Sub-procedure used to write a Characteristic Value to a server when
the client knows the Characteristic Value Handle and the client does
not need acknowledgement.
2011-03-10 11:20:33 +02:00
Claudio Takahasi
4fce91f1cf Extend Characteristic Write to support Write Without Response
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.
2011-03-10 11:20:08 +02:00
Sheldon Demario
e880b7a554 Add option to pass adapter to interactive gatttool 2011-03-04 15:49:57 -03:00
Sheldon Demario
b2bd2cbc2a Add missing const to interactive() parameter in gatttool 2011-03-04 15:49:55 -03:00
Sheldon Demario
ed6e2d24ea Replace all strdup() with g_strdup() in gatttool 2011-03-04 15:49:53 -03:00
Sheldon Demario
adc7ca1ece Add offset option to characteristic read by handle
Some tests require an arbitrary offset.
2011-03-04 15:48:21 -03:00
Bruna Moreira
bd32dd623d Remove unused MTU variable in GAttrib struct
The MTU variable in GAttrib struct was not being used for any operation
so it should be removed.
2011-02-24 18:37:26 -03:00
Claudio Takahasi
448456a19f Coding standard change replacing malloc by glib functions
Use glib memory allocation functions instead of malloc for attribute
data list in ATT protocol utility functions.
2011-02-24 18:35:17 -03:00
Sheldon Demario
28d393d7a2 Add sec-level option to interactive gattool 2011-02-24 18:34:34 -03:00
Bruna Moreira
6904e0f137 Add Write Request in interactive gatttool 2011-02-24 18:34:26 -03:00
Bruna Moreira
d3a5c56882 Move attr_data_from_string() to utils.c
The attr_data_from_string() function will be used in interactive and
usual gatttool so this function was moved to common file utils.c.
2011-02-24 18:33:57 -03:00
Sheldon Demario
607c54cbd9 Add characteristics read options in interactive gatttool 2011-02-24 18:33:48 -03:00
Sheldon Demario
91aed1d751 Add Characteristics Descriptor Discovery option in interactive gatttool 2011-02-24 18:33:40 -03:00
Sheldon Demario
7aff2ceaf7 Create a helper function to deal with handles on interactive gatttool 2011-02-24 18:33:22 -03:00
Vinicius Costa Gomes
a2e3157116 gatttool: Remove extra reference to the connection IO Channel
As we want the connection to be closed when the last GAttrib
reference is dropped, we don't need to keep this reference.
2011-02-24 17:43:35 -03:00
Vinicius Costa Gomes
6682df6dae Add support for GATT client timeouts
This patch adds support to destroying the GATT connection
when a GATT server doesn't respond for more than 30 seconds.

A function to destroy the GAttrib is introduced and it is used
in the timeout case and when the last GAttrib reference is
dropped.
2011-02-24 17:43:16 -03:00
Vinicius Costa Gomes
33e09781d7 Fix gattrib.c coding style
Just remove an extra empty line.
2011-02-24 17:41:23 -03:00
Anderson Lizardo
c3717e3420 Add read/write callbacks to attribute server
These callbacks will allow profiles to act before an attribute is read
and after it is written, to e.g. update the attribute value to/from an
external source.

Note that by the time the callback is called, the necessary security
checks (attribute permissions, authentication and encryption) were
already performed by the core attribute server.

The callback can optionally return an ATT status code, which will be
sent to the client using an Error Response PDU.
2011-02-24 15:41:47 -03:00
Claudio Takahasi
1847ffb1b6 Don't register GATT related SDP records if attrib server is disabled
GATT related SDP records should not be added if "AttributeServer" option
is false in the configuration file. Problem happens only when attribute
plugin is enabled.
2011-02-24 15:28:30 -03:00
Anderson Lizardo
30b24e4153 Fix typo on DBG() string format 2011-02-23 11:50:18 -03:00
Elvis Pfützenreuter
de9dfe2051 Check malformed notification/indication PDU
This patch implements discard of obviously malformed
GATT notification/indication PDUs.
2011-02-23 11:48:37 -03:00
Sheldon Demario
d576392d03 Add Characteristics Discovery option to interactive gatttool 2011-02-23 00:02:08 -03:00
Sheldon Demario
7877285534 Improve help messages in interactive gatttool
Includes the parameters info on help.
2011-02-23 00:01:24 -03:00
Brian Gix
646cc43be8 Add missing UUID16 field to Included Svc Attribute 2011-02-20 15:26:14 -03:00
Brian Gix
475dd53450 Add SDP registration of Primary GATT services
Add capability to register SDP record for Primary Services.
2011-02-19 12:14:00 -03:00
Elvis Pfützenreuter
74de4d7c6c Add UUID property to GATT service object 2011-02-18 12:09:26 -03:00
Sheldon Demario
78ed16f407 Add Primary Discovery Services option to interactive gatttool 2011-02-18 11:52:44 -03:00
Sheldon Demario
0cc2459963 Use PSM value to select LE or BR/EDR transport on gatttool
Removes "le" parameter of gatt_connect() as well the global variables
used to store the le option. LE is now the default transport, if a PSM
value different than zero is given BR/EDR will be selected
2011-02-17 15:50:15 -03:00
Sheldon Demario
eb4e1d6d4b Move do_connect() to a common file between interactive.c and gatttool.c
Since do_connect() is used in both interactive.c and gatttool.c
files, it was moved to a new file that should hold all common functions
2011-02-17 15:48:43 -03:00
Brian Gix
dba40c880f Fix Min MTU to reflect values for both L2CAP & LE 2011-02-16 18:21:45 -03:00
Claudio Takahasi
0439aea808 Fix wrong header include on interactive gatttool
This wrong include is triggering compiler warning: implicit declaration
of function 'strdup'.
2011-02-16 16:05:14 -03:00
Sheldon Demario
2c8df748ac Add connect/disconnect options on interactive mode of gatttool 2011-02-15 14:19:03 -03:00
Sheldon Demario
a523620a36 Add an initial interactive mode to gatttool
Mode required to allow better GATT procedures control. Some scenarios
require sequential commands without disconnection and delay between
operations. It is also desirable to change some connection parameters
of an active connection.
2011-02-15 14:17:37 -03:00
Bruna Moreira
48f7473068 Add Write Request operation in gatttool
Add option and callbacks for Write Request operation in gatttool.
2011-02-15 11:48:05 -03:00
Bruna Moreira
ec141a423b Add encode/decode for write response
The encode/decode functions for Write Response operations were created
to keep consistency with the rest of GATT API.
2011-02-15 11:47:40 -03:00
Andre Dieb Martins
2fab731d89 Fix GATT listen mode updating
Update gatt's listen-mode flag whenever connect_cb() is called again.
2011-02-08 15:07:23 -08:00
Bruna Moreira
240fcdb006 Fix invalid read after list concatenation
g_slist_concat uses the items from second list directly so they should
not be freed.
2011-02-04 06:55:02 +02:00
Elvis Pfützenreuter
05133a40fd Fix parameter type in att_put_u32 2011-02-04 06:53:35 +02:00
Brian Gix
8865beb9a3 Fix incoming attrib-server connection MTUs
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.
2011-01-21 12:19:12 +05:30
Bruna Moreira
4ca8ed4d50 Fix duplicate characteristics
The Discover() operation (from DBus API) was registering the same
characteristics after running several times. This can be checked using
test-attrib.
2011-01-21 12:15:17 +05:30
Brian Gix
8648c3b198 Add READ_BLOB_REQUEST support to attribute server 2011-01-20 15:04:15 +05:30
Bruna Moreira
46be88cb8b Move common code from Discover all Characteristics to GATT library
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.
2011-01-19 20:41:11 +05:30
Bruna Moreira
e04efbaddf Rename gatt_primary_t to more generic name
The gatt_primary_t typedef was renamed to gatt_cb_t because it will be
used for primary and characteristic callbacks.
2011-01-19 20:40:56 +05:30
Claudio Takahasi
5399423bd6 Move interactive code of Discover Primary to gatt.c
Initial patch to move the shared code related to Discover All Primary
Services and Discover Primary Services by UUID to gatt.c.
2011-01-08 11:02:38 +02:00
Anderson Lizardo
952b5ca7d3 Move GATT service to attribute server core
GATT service (like GAP one) should be moved to the core attribute server
because there can be only one instance of it.

There was a "Attribute Opcodes Supported" characteristic inside the GATT
service in attrib/example.c which is not defined by the Core
specification and was removed before moving the code.
2011-01-07 22:28:26 +02:00
Anderson Lizardo
8a07d7e4d1 Move GAP service registration to src/attrib-server.c
GAP service shall be registered only once, so it makes sense to move it
to the core attribute server code.

The GAP "Device Name" characteristic was always "Example Device" on the
example server. This has been changed to use the Name attribute from
main.conf.
2011-01-07 22:28:24 +02:00
Anderson Lizardo
a5797b18a3 Refactor example server to use att_put_u16()
The original code was written before att_put_u16() was implemented.
2011-01-07 22:28:21 +02:00
Brian Gix
acdc181a5d Fix gatt_read_char() to support long Attrib Values
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.
2011-01-07 21:31:34 +02:00
Brian Gix
7f0b31cbb4 Fix g_attrib_send() to include a new ID parameter
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.
2011-01-07 21:31:31 +02:00
Claudio Takahasi
08a9c3ce7d Change security level on demand when reading characteristic descriptor 2011-01-05 14:04:56 +02:00
Claudio Takahasi
41d3eb82b8 Change security level on demand when reading characteristic value
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.
2011-01-05 14:04:51 +02:00
Vinicius Costa Gomes
adbfb31ab2 Add GetProperties method the Service Interface
For now this interface just includes the path that each characteristic
is registered at.
2010-12-23 10:32:25 +02:00
Vinicius Costa Gomes
87b140440a Add support for adding services to the Services property
We need to fill the devices property as each service path gets
registered in the DBus system bus.
2010-12-23 10:32:11 +02:00
Vinicius Costa Gomes
b33922d99e Remove GetCharacteristics DBus method
This method was not documented in the API, and it has the same
functionality as getting the Characteristics property.
2010-12-23 10:31:42 +02:00
Vinicius Costa Gomes
a1b0fda9a0 Add a Discover method to the GATT Client
This methods allows users to actively start the discovery of characteristics
presents in a service.
2010-12-23 10:31:05 +02:00
Vinicius Costa Gomes
463dbe1bea Add support for making LE connections to GATT client
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.
2010-12-23 10:30:45 +02:00
Vinicius Costa Gomes
60987f4afa Clean up the primary service D-Bus registration
Now, that much of this funcionality was moved to the core, we can go
straight to the registration of D-Bus interfaces.
2010-12-23 10:30:27 +02:00
Vinicius Costa Gomes
5418e09a27 Remove duplicated code for discovering GATT services
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.
2010-12-23 10:29:22 +02:00
Vinicius Costa Gomes
ed2fd82805 Add the btd_ prefix to device_add_service
This is needed to keep consistency, as device_add_service would be used
from outside the core bluetoothd.
2010-12-23 10:28:48 +02:00
Sheldon Demario
d3cb258b9b Move primary service storage to device.c
Discover All Primary Services has beed moved to device.c in order
to follow a similar approach of BR/EDR service records.
2010-12-23 00:34:04 +02:00
Vinicius Costa Gomes
5ffd0e6374 Fix attrib plugin deregistration
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.
2010-12-22 13:50:17 +02:00
Brian Gix
7749241702 Add enc_read_blob_req() as defined in BT Core Spec v4.0 2010-12-19 14:10:40 +02:00
Claudio Takahasi
70ceea2eb9 Fix memory leak of gattrib commands queue 2010-12-16 11:25:02 +02:00
Gustavo F. Padovan
b684996b93 attrib: use btd_error_failed() 2010-12-14 10:31:17 +02:00
Bruna Moreira
d599b9e2b8 Check the security level on a per request base
Check security level on attribute server on each request, and update the
"encrypted" flag.
2010-12-09 15:59:46 +02:00
Claudio Takahasi
85d0be87c9 Remove automatic battery state change on attribute example
Legacy code implemented to test Indication and Notification
2010-12-07 23:53:17 +02:00
Gustavo F. Padovan
b7d1fc1f39 Add btd_error_not_authorized() 2010-12-07 23:13:16 +02:00
Gustavo F. Padovan
696c18c48f Create btd_error_invalid_args()
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.
2010-12-07 22:58:32 +02:00
Vinicius Costa Gomes
1e35abda9f Fix writing to GAttrib socket without POLLOUT event
If the GIOChannel is in the buffered state (the default) the watch
function is called without receiving a POLLOUT from the socket. GLib
adds a G_IO_OUT condition just because there is space in the GIOChannel
internal buffer.

The solution is disabling the internal buffer, which in turn, makes the
call of g_io_channel_flush() useless.
2010-12-07 22:57:22 +02:00
Bruna Moreira
dd7a2acf88 Initial attribute permission implementation
Add enums for attribute read/write requirements, which may be "none",
"authentication required" or "authorization required". Additionally, a
"not permitted" requirement means that operation is not permitted,
allowing read-only or write-only attributes.

The attrib_db_add() API was changed to allow setting these requirements,
and the example server was changed to set requirements for its
attributes.
2010-12-07 22:52:25 +02:00
Sheldon Demario
90dec87b5c Attrib server should truncate attribute value to pdu length
When the size of attribute value is greater than pdu size, it should be
truncated to the pdu length - 2
2010-11-29 19:24:07 +02:00
Claudio Takahasi
f68cb33e96 Don't trigger the discovering when registering the client
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.
2010-11-29 19:21:00 +02:00
Claudio Takahasi
dbe7a78109 Fix memory leak of sdp list in the attribute client 2010-11-29 19:20:45 +02:00
Claudio Takahasi
d49c4e8457 Implement primary service search when creating a device
Discover primary services implemented inside the device entity to allow
proper integration of attribute plugin. Implements a single entry point
to the attribute plugin no matter the transport(BR/EDR or LE), the device
probe callback is called for both types.

Add a new function to discover all primary services without additional
calls to fetch the remaining primary services, sub-procedure iterations
is handled inside this function.

The next action are: clean the attribute client removing implicity service
and characteristics discovery, issue the Discover Primary Service based on
the remote properties and fetch the characteristic on demand.
2010-11-29 19:18:33 +02:00
Johan Hedberg
20ccc578c8 Remove unused includes 2010-11-28 13:41:35 +02:00
Sheldon Demario
63beb887a6 Extend discover characteristic by UUID in gatttool to fetch all values
If the number of characteristics returned exceeds the MTU size, it will
be needed to ask for more data until the handle range is entirely
searched.
2010-11-25 14:19:41 +02:00
Sheldon Demario
ad0e7f2c5a Implement Characteristic Value Read using UUID in the gatttool
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
2010-11-19 17:25:30 +02:00
Claudio Takahasi
f9523a9bf5 Implement Discover Primary Service by Service UUID in the gatttool
Implement only the first interaction of the discovery procedure. If the
response doesn't fit in the MTU, "start" and "end" options can be used
to discover the handles ranges of the remaining primary service instances.
UUID16 and UUID128 are supported in the uuid option.

Usage example:
$gatttool -i hcix -b xx:xx:xx:xx:xx:xx --uuid=1801 --primary
2010-11-18 22:00:02 +02:00
Claudio Takahasi
8022b94b05 Add an extra parameter in the discovery primary to specify the UUID
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.
2010-11-18 21:58:22 +02:00
Claudio Takahasi
2b3f200f29 Add Find By Type Value Response encoding/decoding functions
Find by type operation is used by Discover Primary Service by Service
UUID. Find By Type Value Response shall contain one or more group handles.
2010-11-18 21:53:54 +02:00
Bruna Moreira
b0d8865493 Implement Find by Type request encode/decoding 2010-11-18 16:44:19 +02:00
Sheldon Demario
e55509e013 Adding a new option to specify security level for gatttool 2010-11-18 14:20:11 +02:00
Claudio Takahasi
34d052348e Use reference counting of the device object while discovering services 2010-11-11 12:08:24 +02:00
Claudio Takahasi
1d723ac244 Fix invalid reference to GATT service structure 2010-11-05 07:00:44 +02:00
Claudio Takahasi
b9b0e471f2 Enable GATT over LE link on the attribute client 2010-11-05 07:00:42 +02:00
Anderson Lizardo
0a70694d3a Add support for Attribute Write Request
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.
2010-10-09 18:22:09 +03:00
Claudio Takahasi
e91886e6f8 Change Battery Service on attribute sample server
Add an optional Client Characteristic Configuration attribute for
Battery State to control which clients want notification/indication
when this attribute value changes.
2010-10-06 23:39:08 +02:00
Claudio Takahasi
b597e74fd9 Add PSM option for GATT/ATT over BR/EDR on gatttool 2010-10-05 22:26:37 +02:00
Johan Hedberg
89c9634c10 gatttool: fix trying to read beyond the last handle 2010-10-05 13:50:03 +02:00
Johan Hedberg
fa58d42ae6 Fix ATT OP codes to match spec 2010-10-05 11:27:15 +02:00
Anderson Lizardo
6352f7b918 Modify dec_read_req() to get PDU length as parameter
This is consistent with other att.h functions, and allows length checks.
2010-10-04 21:15:56 +02:00
Anderson Lizardo
dbad6fdb75 Replace hardcoded minimum length values with constants 2010-10-04 21:15:54 +02:00
Anderson Lizardo
69409f28f8 Remove typecast from att_get_u16() calls
att_get_u16() already does a cast of the void* parameter to uint16_t*.
2010-10-04 21:15:52 +02:00
Anderson Lizardo
805d059af3 Fix constness of att_get_u{8,16,32}() functions 2010-10-04 21:15:50 +02:00
Anderson Lizardo
19c8e31032 Allow errors to propagate from connection callback
This fix makes gatttool exit with non-zero return code on any error.
2010-10-04 17:06:49 +02:00
Anderson Lizardo
5b7b8ca746 Fix and refactor characteristic value update code 2010-10-04 17:06:49 +02:00
Bruna Moreira
a25fb7211b Implement characteristic_write callback in gatttool 2010-10-04 17:06:48 +02:00
Bruna Moreira
6f9ddeda63 Add new option for char value write in gatttool
Add new option --char-write for char value write (write without
response). Reuse current handle option and create the -n for new value.
Update variable names and help messages.

Note: characteristics_write callback is empty.
2010-10-04 17:06:48 +02:00
Bruna Moreira
2b80d7bf27 Make handle parameter mandatory in gatttool
If the characteristic read option (--char-read) is used, the handle
option (-a) must be provided.
2010-10-04 17:06:48 +02:00
Bruna Moreira
8d536ccf2b Use g_slist_foreach() instead of a for loop 2010-10-04 17:06:48 +02:00
Bruna Moreira
420d5b3313 Write new value for characteristic value
Note only client is implemented by now. The server implementation will
be done later.
2010-10-04 17:06:48 +02:00
Bruna Moreira
8edb7f03cf Move connection common code to l2cap_connect()
Common code for connection operations were moved to l2cap_connect()
function. This way, register_watchers() and set_value() can use it.
2010-10-04 17:06:48 +02:00
Anderson Lizardo
10840e3c30 Remove unnecessary check for watcher path 2010-10-04 17:06:48 +02:00
Bruna Moreira
b1514662a0 Implement Write command in GATT API 2010-10-04 17:06:48 +02:00
Bruna Moreira
48b01d5006 Add encoders/decoders for the Write command 2010-10-04 17:06:48 +02:00
Marcel Holtmann
d7f6fd397e The attribute protocol assigned PSM is 0x1f 2010-10-04 11:04:43 +02:00
Claudio Takahasi
2cbc3e1ba9 Add characteristic SetProperty implementation
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.
2010-09-30 17:26:55 -03:00
Vinicius Costa Gomes
b3d33e592d Add "Services" property in the org.bluez.Device interface
Add a new property "Services" representing the object paths of the
available GATT primary services. "Services" is an array of D-Bus object
paths.
2010-09-30 17:26:55 -03:00
Vinicius Costa Gomes
7d13035153 Fix ValueChanged not being called on registered agents
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.
2010-09-30 17:26:55 -03:00
Bruna Moreira
399d968958 Use bt_io_connect in gatttool
The gatttool was migrated to use bt_io_connect() instead of making
connections manually.
2010-09-30 17:26:55 -03:00
Vinicius Costa Gomes
dd714804cf Add support for LE connections to gatttool 2010-09-30 17:26:55 -03:00
Claudio Takahasi
e7b1d878d1 Fix coding style issues in attribute client code 2010-09-22 16:33:15 -04:00
Claudio Takahasi
d74b6fd61f Remove the timeout source function when the example server exits 2010-09-22 16:00:04 -04:00
Claudio Takahasi
a66ccf347b Fix memory leak of characteristic and primary service lists 2010-09-22 16:00:04 -04:00
Claudio Takahasi
90e1990f85 Unregister the primary and characteristic objects
Removes memory leak. When the attribute client is unregistered
primary and characteristic D-Bus objects shall be unregistered.
2010-09-22 16:00:04 -04:00
Claudio Takahasi
4435515810 Add UnregisterCharacteristicsWatcher implementation 2010-09-22 16:00:04 -04:00
Claudio Takahasi
59cc5e1fd0 Fix seg fault if the watcher exit before the connection complete 2010-09-22 16:00:04 -04:00
Claudio Takahasi
2eb3b72ac4 Fix disconnection when multiple watchers are registered
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.
2010-09-22 16:00:04 -04:00
Claudio Takahasi
6b2fea1f37 Increment GAttrib reference for each GATT/ATT request
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.
2010-09-22 15:59:52 -04:00
Claudio Takahasi
d0bfd6eaa5 Use the destroy function to reset the GAttrib reference
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.
2010-09-22 15:55:18 -04:00
Claudio Takahasi
8545bdc1ea Add g_attrib_set_destroy_function in gattrib
Add a new function to notify the GAttrib "users" when the GAttrib has
beed destroyed. The disconnect function is called only for remote initiated
disconnections or external events(not unref).
2010-09-22 15:55:18 -04:00
Claudio Takahasi
a5e1be914b Fix uninitialised value warning 2010-09-22 22:34:27 +03:00
Claudio Takahasi
27be80c804 Remove forward declaration on gattrib source 2010-09-22 22:34:27 +03:00
Claudio Takahasi
1b21625fb0 Add missing response for handle value indication on attribute client 2010-09-22 22:34:27 +03:00
Claudio Takahasi
8204b2e818 Report attribute changes for the Battery Service
Thermometer Humidity Service contains <<Include>> attributes that it is
not supported at the momment. For this service, Characteristics D-Bus
paths are not being registered properly. This patch allows watchers
testing registered for Battery State changes.
2010-09-22 22:34:27 +03:00
Claudio Takahasi
3fd8fddef6 Change notification/indication output formating on gatttool 2010-09-22 22:34:27 +03:00
Vinicius Costa Gomes
a58f4d094a Add a way to unregister GAttrib events
This implements g_attrib_unregister and g_attrib_unregister_all, these
methods allow events to be unregistered.
2010-09-22 22:34:26 +03:00
Claudio Takahasi
cb91573bfd Watchers don't need to reply for characteristic value updates
Value method call doesn't need confirmation. Minor optimization to
not sending method return or error replies.
2010-09-22 22:34:26 +03:00
Claudio Takahasi
e4481c09c4 Add watcher's characteristic path verification before notify changes
Each registered watcher instance is associated with a characteristic
path. Value() method shall not be sent to all watchers, characteristic
path shall match.
2010-09-22 22:34:26 +03:00
Claudio Takahasi
8125506bc1 Return an error if the path doesn't exist when registering a watcher
In the register characteristic watcher method, the given parameter
(characteristic path) shall be validated before register the watcher.
2010-09-22 22:34:26 +03:00
Vinicius Costa Gomes
316f35e7d8 Add support for actively updating the watcher
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.
2010-09-22 22:34:26 +03:00
Vinicius Costa Gomes
d98a28dabf Add support for Indications to the client
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.
2010-09-22 22:34:26 +03:00
Vinicius Costa Gomes
1bacf59916 Add support for Indications to gatttool
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.
2010-09-22 22:34:26 +03:00
Vinicius Costa Gomes
9041deab65 Add encoders/decoders for Indication/Confirmation 2010-09-22 22:34:26 +03:00
Claudio Takahasi
37e3aa41e8 Update characteristic value when a notification is received
Changes the internal characteristic value in attribute client side.
Messages to notify the watchers are not being sent yet.
2010-09-22 22:34:26 +03:00
Johan Hedberg
797f8e1491 Fix coding style issues in attribute code 2010-09-22 00:09:32 +03:00
Claudio Takahasi
fb94142b19 Fix GIOChannel and GAttrib memory leak 2010-09-21 23:53:36 +03:00
Claudio Takahasi
b1f39ceabd Reconnect the BR/EDR L2CAP connection when a watcher is registered
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.
2010-09-21 23:53:36 +03:00
Claudio Takahasi
c67d18231b Initial characteristics watcher implementation
Tracks when the client disconnects from the system bus.
2010-09-21 23:53:36 +03:00
Anderson Lizardo
4105eac9c5 Move connect_cb() upper in attrib/client.c
This callback will also be used for the watcher implementation, so
moving it avoids a forward declaration.
2010-09-21 23:53:36 +03:00
Anderson Lizardo
0f587cb1b9 Fix UUID 128-bit support on attribute client
For descriptors, a comment is added explaining why UUID 128-bit support
is not necessary yet. For characteristic discovery, characteristics with
128-bit UUID types are now loaded.
2010-09-14 09:55:35 -04:00
Bruna Moreira
49d2452e28 Add support for UUID 128-bit in {enc, dec}_read_by_type_req 2010-09-14 09:55:35 -04:00
Bruna Moreira
4d84652b18 Add support for UUID 128-bit in {enc, dec}_read_by_grp_req 2010-09-14 09:55:34 -04:00
Bruna Moreira
d7fde8a9c0 Add a new primary service to the example server
This primary service contains 128-bit UUIDs on the service declaration
and characteristic declaration attributes, useful to test the 128-bit
UUID support.
2010-09-14 09:55:34 -04:00
Bruna Moreira
469696dbc6 Add new option to set MTU size in gatttool 2010-09-14 09:53:52 -04:00
Vinicius Costa Gomes
f6c5bd6417 Define maximum and default MTU values 2010-09-13 15:54:22 -04:00
Vinicius Costa Gomes
8487d21c99 Add encoders/decoders for MTU Exchange 2010-09-13 15:54:22 -04:00
Vinicius Costa Gomes
62b464cb50 Fix not registering all characteristics for a service
Besides registering the characteristics when we receive the Attribute
Not Found Error, we should also register the characteristics when we
get to the end of the handle range contained in that service.
2010-09-13 15:51:28 -04:00
Vinicius Costa Gomes
f040311538 Fix dealing with the minimum MTU size
When using the minimum MTU, in some cases, mostly when using 128-bit UUIDs,
the PDU is exactly the size of the minimum MTU. In those case there were
off-by-one errors. Errors are returned if can't put anything useful inside
the requested PDU.
2010-09-13 15:51:28 -04:00
Vinicius Costa Gomes
818a4ca922 Fix a file descriptor leak on GATT client
In some cases, there could be a file descriptor leak, when the
connection is not succesful. As the connection callback keeps a
reference, there's no problem unref'ing it at this point.
2010-09-13 11:59:28 -04:00
Anderson Lizardo
db4ab895a0 Fix enc_read_resp to respect the buffer size
When encoding long responses, there could be situations where the
attribute value length could be larger than the buffer size and the
encoder would try to put more data than the space available.
2010-09-02 23:29:37 +03:00
Vinicius Costa Gomes
9a80377646 Fix enc_read_by_type_resp accessing invalid memory
We should always make sure that the buffer has room to hold at
least one element.
2010-09-02 23:28:42 +03:00
Vinicius Costa Gomes
9bfc195277 Fix invalid memory access
When GAttrib last reference is dropped inside the command callback,
there was a invalid memory access. For now, there's a small time
window between the last reference being dropped and GAttrib being
free'd.
2010-09-02 23:28:42 +03:00
Bruna Moreira
0aa80f9be3 Fix encoding functions when buffer is small
The encoding functions should return only the bytes which can be
inserted in buffer (maximum size is defined by ATT_MTU). The other ones
should be requested by client again.
2010-09-01 11:38:51 -04:00
Claudio Takahasi
d7323c47a9 Remove castings on attribute server 2010-09-01 11:38:51 -04:00
Claudio Takahasi
d63726493c Remove unused GIOChannel reference from gatt service structure 2010-08-27 23:52:42 +03:00
Anderson Lizardo
08f1b75029 Support for loading attribute data 2010-08-26 09:29:56 -04:00
Bruna Moreira
a5e5c9262a Support for storing attribute data
Create a new storage called "attributes" to save attribute data.

Format description:
   <bt_addr>#<attr_handle> <attr_type>#<attr_value>

 - the key is composed of the device address and the attribute handle;
 - the value is composed of the attribute type UUID (converted to
   printable 128-bit format) and the attribute value (hex encoded).
 - the key/value components are joined with "#", and separated from each
   other by a space.
2010-08-26 09:29:56 -04:00
Bruna Moreira
da394a7e17 Pretty print UUID-128 in gatttool 2010-08-26 08:37:13 -04:00
Vinicius Costa Gomes
5a48a21cbd Move the GATT Service Record registration to the server
The GATT Server SDP record should be in the server, so it is not added
when the server is disabled.
2010-08-24 15:12:22 -03:00
Vinicius Costa Gomes
b5b44ce5c8 Fix not dealing with situations with not enough memory
GAttrib should fail gracefully in situations when it is not able to
allocate memory, not just crash, which is what g_new() does.
2010-08-24 10:20:09 -04:00
Vinicius Costa Gomes
0db74b68e8 Remove gatttool unix socket transport support 2010-08-24 10:20:08 -04:00
Anderson Lizardo
30e62c9151 gatttool: add characteristic descriptor discovery support
The --start/--end options are reused to allow specifying the
starting/ending handles. Both 16-bit and 128-bit UUIDs are
pretty-printed using sdp_uuid2strn() function.
2010-08-24 10:20:08 -04:00
Bruna Moreira
a764906095 Add characteristics descriptor discovery option in gatttool
Only skeleton for new option was added (no callback).
2010-08-24 10:20:08 -04:00
Vinicius Costa Gomes
f9778e74d0 Add g_attrib_set_disconnect_function()
The function set will be called when GAttrib detects that the link
was cut off. This will allow apps to take the proper actions in this
situation.
2010-08-20 15:15:09 -03:00
Claudio Takahasi
a31269eb57 Add listen option for gatttool
Add new option --listen to watch for notifications and indications.
At the momment only notifications are supported.
2010-08-19 17:47:25 -03:00
Claudio Takahasi
4648613aba Change attribute example to test notifications
Dummy time-based notification. Thermometer humidity attribute value
is being changed every 10 seconds.
2010-08-19 17:47:25 -03:00
Claudio Takahasi
f3349f5766 Add attribute handle value notification
Initial changes in attribute server to send notifications to all
connected clients when an attribute has changed. Characteristic
Configuration descriptor is not being addressed yet.
2010-08-19 17:47:25 -03:00
Vinicius Costa Gomes
83ac94801b Fix gatttool to use the alignment safe access functions 2010-08-19 17:28:03 -03:00
Vinicius Costa Gomes
c27ffa545b Fix alignment issues on the GATT Client
Makes use of the alignment safe functions in the GATT Client.
2010-08-19 17:28:03 -03:00
Vinicius Costa Gomes
5d82240f49 Fix alignment access issues during encoding/decoding
When encoding/decoding PDU fields, we have to be careful and use
alignment safe functions to load/store the values.

These functions will be exported so other parts of the code can reuse
them.
2010-08-19 17:28:03 -03:00
Vinicius Costa Gomes
1944301bb4 Fix wrong byte order on the Error Response handle 2010-08-11 13:54:08 -03:00
Vinicius Costa Gomes
80c5a1887b Fix reading the Characteristic value multiple times
We only need to read each characteristic value one time, for example,
at the time that try to discover if that characteristic has any descriptor.
2010-08-11 13:54:08 -03:00
Vinicius Costa Gomes
f70c6722f0 Fix using the wrong start handle for Desc. Discovery
When doing the Descriptor Discovery procedure, the wrong starting
handle was being used (the characteristic value handle). This is what
the spec mandates:

"The Attribute Protocol Find Information Request shall be used with the
Starting Handle set to the handle of the specified characteristic value
+ 1 and the Ending Handle set to the ending handle of the specified
characteristic."
2010-08-11 13:54:08 -03:00
Vinicius Costa Gomes
97a1889bac Fix memory leaks on g_attrib_unref()
We must clean up the event list and the command queue when we destroy
GAttrib, it could be that something is still there.
2010-08-11 13:54:08 -03:00
Vinicius Costa Gomes
f01213d025 Add support for cancelling commands
This adds support for cancelling commands. In case the command to be removed
is the first in the queue, cancelling it would cause its ResultFunc to not be
called. In the other cases, it will be removed from the queue.
2010-08-11 13:54:08 -03:00
Vinicius Costa Gomes
92d367140b Fix the opcode verification code being too cryptic
We need to be more specific about what is the expected response opcode
(if any) for each request command and about if some command is already a
response.
2010-08-11 13:47:54 -03:00
Bruna Moreira
84b6027450 Fix memory leaks in gatttool
Unix channel reference count must be decremented before exiting. Do not
exit main loop on recursive callbacks, thus allowing queued
g_attrib_send() commands to be finished. Free memory allocated for
opt_src/opt_dst.
2010-08-11 13:47:54 -03:00
Bruna Moreira
ac81ac5175 Exiting gatttool if no option is chosen
If no operation is chosen, print usage help and exit gatttool.
2010-08-09 18:06:50 -04:00
Vinicius Costa Gomes
e43827833a Fix g_attrib_new() to always create a read watcher
In order to simplify the code we can always add that watcher when GAttrib is
created and ignore the PDU's that aren't expected.
2010-08-09 18:06:50 -04:00
Vinicius Costa Gomes
8307634aa6 Update copyright information of GATT library/tools 2010-08-09 18:06:49 -04:00
Vinicius Costa Gomes
95620eae34 Add support for reading Char values and descriptors
When the characteristic is read for the first time, we read and update
its value and its descriptors.
2010-08-09 18:06:49 -04:00
Vinicius Costa Gomes
c2b9e70040 Add support for discovering all the descriptors
All descriptors associated to every characteristic are discovered, which means,
that we know its handle and type. With this information we can later read the
values of the descriptors that we find interesting.
2010-08-09 18:06:49 -04:00
Vinicius Costa Gomes
c4fe3b3a0b Add helper functions to send Find Information requests
This function allows one to send Find Information requests without
having to build the PDU by hand each time.
2010-08-09 18:06:49 -04:00
Vinicius Costa Gomes
eabdd736c6 Add encoders and decoders for the Find Information PDU's 2010-08-09 18:06:49 -04:00
Vinicius Costa Gomes
c606feeb48 Add the GetCharacteristics() DBus method
This method allows the retrieval of every known information about the
characteristics beloging to a Service.
2010-08-09 18:06:49 -04:00
Vinicius Costa Gomes
a9a4e52bee Fix wrong paths for the Services objects
When restoring the Service information from storage, the path was created
before reading the information from storage.
2010-08-09 18:06:49 -04:00
Anderson Lizardo
08e83df251 gatttool: simplify characteristic discovery output 2010-08-09 18:06:49 -04:00
Anderson Lizardo
4dc133a198 gatttool: Replace --char-value-read with generic --char-read option
The new option is useful for reading either characteristic values or
descriptors, which use the same Read Request. This commit also fixes a
few errors related to the handle options.
2010-08-09 18:06:49 -04:00
Bruna Moreira
cafebc60e7 Remove multiple calls for g_idle_add() in gatttool 2010-08-09 18:06:49 -04:00
Bruna Moreira
0e7aa8f0ac Move connection operations to main in gatttool
The connection operations (do_connect) were moved to main. So, the
internal call to do_connect() were removed and GAttrib structure is
initialized/freed in main. All callbacks receive the GAttrib structure
through the user_data parameter.
2010-08-09 18:06:49 -04:00
Anderson Lizardo
a3f410d1f2 gatttool: coding style fixes 2010-08-09 18:06:49 -04:00
Bruna Moreira
eaef3c6c2c Add function to open connections in gatttool
The do_connect() function was created to open unix/l2cap sockets. It is
used by primary, characteristics and characteristics value options.
2010-08-09 18:06:48 -04:00
Bruna Moreira
6489a249a5 Change client to use dec_read_by_grp_resp() 2010-08-09 18:06:48 -04:00
Bruna Moreira
af40b52994 Change gatttool to use dec_read_by_grp_resp()
The primary callback in gatttool was updated to use
dec_read_by_grp_resp() function. Also, the printed message was updated
to use same spec nomenclature.
2010-08-09 18:06:48 -04:00
Claudio Takahasi
b862c11182 Remove unused parameter for register_characteristics function 2010-08-09 18:06:48 -04:00
Claudio Takahasi
754fce193b Initial implementation of characteristics GetProperties()
Returns a dictionary of characteristic properties. Format, Value and
Representation are not supported yet.
2010-08-09 18:06:48 -04:00
Vinicius Costa Gomes
68299d1d74 Fix some memory leaks when closing a GATT connection 2010-08-09 18:06:48 -04:00
Vinicius Costa Gomes
1e1434c1b7 Fix coding style issues
Some lines were passing the 79 columns limit.
2010-08-09 18:06:48 -04:00
Vinicius Costa Gomes
ee2b848176 Add support for the GAttrib queue to the client plugin
Now, that we have a proper queue for command serialization, we can remove
the previous hacks to implement a partial serialization in the client.
2010-08-09 18:06:48 -04:00
Vinicius Costa Gomes
79cb696f56 Fix the last group of characteristic not being stored
The characteristic group beloging to the last service was not being stored,
because the condition to trigger the storage was missing that last group.
2010-08-09 18:06:48 -04:00
Vinicius Costa Gomes
d7b3bbbd6e Add a Queue to serialize the GATT PDU's
With this queue we can have more control about which commands are sent, and
be sure that what is received is what we expect.
2010-08-09 18:06:48 -04:00
Anderson Lizardo
765b7e0e56 Implement characteristic value read in gatttool 2010-08-09 18:06:48 -04:00
Anderson Lizardo
262323b597 Implement characteristic value read on attribute server 2010-08-09 18:06:48 -04:00
Bruna Moreira
d8827654f9 Add characteristics value read option in gatttool
Only skeleton for new option was added (empty callback and options). The
characteristics value readi must receive a handle.
2010-08-09 18:06:48 -04:00
Bruna Moreira
416809f34b Change discover characteristics output
Make the discover characteristics output more readable (the result
values were split in permission, characteristic value handle and uuid).
2010-08-09 18:06:48 -04:00
Bruna Moreira
765a807fdc Fix memory leaks in gatttool 2010-08-09 18:06:48 -04:00
Claudio Takahasi
253ccc6d4a Remove dynamic memory allocation for uuid_t of the primary service 2010-08-09 18:06:48 -04:00
Vinicius Costa Gomes
de731d19c9 Fix wrong value for each characteristic end handle 2010-08-09 18:06:47 -04:00
Vinicius Costa Gomes
baa95be886 Fix the byte order of some of the examples handles
Some of the handles of the example's attributes were in the wrong order.
2010-08-09 18:06:47 -04:00
Claudio Takahasi
58b0cbbdd7 Register stored primary services and characteristic objects
Primary services and characteristic declarations of trusted devices are
stored. When the device is probed, object paths shall be registered.
2010-08-09 18:06:47 -04:00
Claudio Takahasi
ba800b48e1 Fix characteristics and primary service methods
Characteristic objects shall provide GetProperties() method. Primary
service objects: GetCharacteristics(), RegisterCharacteristicsWatcher()
and UnregisterCharacteristicsWatcher().
2010-08-09 18:06:47 -04:00
Bruna Moreira
a6a0f24a24 Implement discovery characteristics for gatttool 2010-08-09 18:06:47 -04:00
Bruna Moreira
280b92ef33 Change menu to make the start/end options more generic
The start/end addresses will be used by characteristics too, so some
changes were done to do the menu messages more generic.
2010-08-09 18:06:47 -04:00
Vinicius Costa Gomes
70a27054c2 Add support from restoring characteristics from storage
Now every known characteristic object is restored from storage with
essential information. Each characteristic DBus object path is registered
from that information.
2010-08-09 18:06:47 -04:00
Vinicius Costa Gomes
739afe307c Add support for storing essential characteristic info
This would allow for each characteristic DBus object path to be
registered.
2010-08-09 18:06:47 -04:00
Vinicius Costa Gomes
978b5c1707 Fix make use of fixed length string for storage
This way the storage is more stable and more under control.
2010-08-09 18:06:47 -04:00
Vinicius Costa Gomes
3164df0ec2 Simplify the characteristic structure
Fow now we only need to store a few pieces of information about each
characteristic. This will allow easier storage of that information.
2010-08-09 18:06:47 -04:00
Vinicius Costa Gomes
ecbef5b4d9 Fix wrong calculation for number of elements of a data list
We must take into account that the opcode and the length of each element is
included in each PDU.
2010-08-09 18:06:47 -04:00
Vinicius Costa Gomes
1f07bea585 Add support for loading previously stored services
This adds support for loading the GATT primary services information
that may exist. This will allow registering the DBus interface of a
service without connecting to the remote device.
2010-08-09 18:06:47 -04:00
Vinicius Costa Gomes
db3bf777b8 Add support to storing the discoved GATT Services
This adds support to storing the discovered primary services so
they can be loaded from storage later.
2010-08-09 18:06:47 -04:00
Claudio Takahasi
dd5279755e Discover all characteristics of the primary services
Adds characteristics discovery in the attrib client plugin. Fetches
all characteristics declaraction for each primary service found.
2010-08-09 18:06:46 -04:00
Bruna Moreira
e321c07ce0 Implement discovery all primary services for gatttool 2010-08-09 18:06:46 -04:00
Anderson Lizardo
f1d7e6a7a9 gatttool: add support for L2CAP socket connection
Connect using L2CAP by default, and add a --unix/-u option to select the
Unix socket (for local testing).
2010-08-09 18:06:46 -04:00
Anderson Lizardo
fa7e72f64b gatttool: add main loop
Also modify the option parsing to work properly with it.
2010-08-09 18:06:46 -04:00
Vinicius Costa Gomes
b0dc1632e4 Add the missing Read by Type functions
This adds the functions necessary to implement a GATT server. The encoder
for the Read by Type Response and the decoder for the Request.
2010-08-09 18:06:46 -04:00
Anderson Lizardo
e840565e17 Implement initial UNIX socket support
Only socket creation and close is implemented for now.
2010-08-09 18:06:46 -04:00
Vinicius Costa Gomes
9645c63fae Fix a segmentation fault when we just use g_attrib_register() 2010-08-09 18:06:46 -04:00
Vinicius Costa Gomes
915b66d026 Fix crash when removing the GIO watch
As the destroy function is called when the watch is removed, the best way to
avoid a crash when shutting the service down is to remove the watch.
2010-08-09 18:06:46 -04:00
Vinicius Costa Gomes
36683630b9 Fix Read by Group skipping two bytes when encoding 2010-08-09 18:06:46 -04:00
Claudio Takahasi
387d69382e Implement read by group type in the attribute server
Returns an attribute data list containing found services. Each
element of the list contains the start, end group handle and the
UUID16 of the given service. UUID128 is not being addressed yet.
2010-08-09 18:06:46 -04:00
Vinicius Costa Gomes
9da32607c8 Add support to events to g_attrib_register()
Passing GATTRIB_ALL_EVENTS we can cause the notify callback to be called for
all events received.
2010-08-09 18:06:46 -04:00
Vinicius Costa Gomes
238c9432c6 Fix the notify callback not receiving the pdu lenght 2010-08-09 18:06:46 -04:00
Vinicius Costa Gomes
498a41f217 Fix the return value of Read by Group response encoder
To mantain consistency, the size (in bytes) written to the PDU should
be returned.
2010-08-09 18:06:45 -04:00
Vinicius Costa Gomes
fdef314221 Add support for dealing with Read Request/Response PDUs
This adds encoders and decoders for Requests and Responses of this type. The
value extracted/inserted is just copied, the user shall ensure that it is in
the right byte order.
2010-08-09 18:06:45 -04:00
Bruna Moreira
01b0c411ad Add start/end options to gatttool
Add new command line options to change the fields of discover primary
services requests:
    --start: Starting handle(default 0x0001)
    --end: Ending handle(default 0xffff)
2010-08-09 18:06:45 -04:00
Bruna Moreira
d873388b67 Add initial gatttool skeleton
New command line tool to test GATT features. For now, it is only parsing
options.
2010-08-09 18:06:45 -04:00
Vinicius Costa Gomes
d55fa3f45d Add stubs for dealing with Read Request/Response PDUs 2010-08-09 18:06:45 -04:00
Vinicius Costa Gomes
25d2720869 Add encoder for Read By Group Type Response PDU 2010-08-09 18:06:45 -04:00
Vinicius Costa Gomes
02641ec20b Add decoder for Attribute Read by Group Type request 2010-08-09 18:06:45 -04:00
Claudio Takahasi
2581dc90f0 Remove __ATT_H macro definition 2010-08-09 18:06:45 -04:00
Claudio Takahasi
2448a8ba03 Move gatt_discover_char to gatt.c 2010-08-09 18:06:45 -04:00
Claudio Takahasi
d2657982a8 Move gatt_discover_primary to gatt.c 2010-08-09 18:06:45 -04:00
Claudio Takahasi
e79eff7995 Add secondary service attributes into the attribute database
Add all secondary services attributes required by includes definition
on primary services declared previously.
2010-08-09 18:06:45 -04:00
Claudio Takahasi
309c4edc38 Add Thermometer Service attributes into the attribute database
Add all attributes of the Thermometer Primary Service according to
example described in the SPEC. See "APPENDIX: Example Attribute
server attributes". Includes of secondary services are not supported yet.
2010-08-09 18:06:45 -04:00
Claudio Takahasi
1ad03a7606 Add Battery Service attributes into the attribute database
Add all attributes of the Battery Primary Service according to example
described in the SPEC. See "APPENDIX: Example Attribute server
attributes". Battery service and state UUID are not defined yet, random
values have been selected: 0xA002 and 0xA003.
2010-08-09 18:06:45 -04:00
Claudio Takahasi
d23a2e302b Add GATT Service attributes into the attribute database
Add all attributes of the GATT Primary Service according to example
described in the SPEC. See "APPENDIX: Example Attribute server
attributes". Attribute Opcodes Supported UUID is not defined yet, a
random value has been selected: 0xA001.
2010-08-09 18:06:45 -04:00
Claudio Takahasi
f6620753d6 Add GAP Service attributes into the attribute database
Add all attributes of the GAP Primary Service according to example
described in the SPEC. See "APPENDIX: Example Attribute server
attributes".
2010-08-09 18:06:45 -04:00
Vinicius Costa Gomes
803a045797 Add support for discovering all characteristics of a server
Until we don't have a proper command queue all the requests are manually
serialized.

No DBus object path is registered yet
2010-08-09 18:06:44 -04:00
Vinicius Costa Gomes
735bc5019a Fix ATT utility functions naming
If we want to support both client and server roles, we must be clear that we
are encoding/decoding requests or responses.
2010-08-09 18:06:44 -04:00