Commit Graph

42 Commits

Author SHA1 Message Date
Vinicius Costa Gomes
0f92869a3b gattrib: Add support for listening for events for specific handles
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-11 08:55:50 +02:00
Vinicius Costa Gomes
a2e4b27451 attrib: Remove all the usages of ATT_MAX_MTU
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-11 08:35:06 +02:00
Vinicius Costa Gomes
8a39d6ed2d attrib: Remove opcode parameter from g_attrib_send()
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-09 10:56:52 +02:00
Jefferson Delfes
6e5c2bf7ae gatttool: Add "included" command
New command to find included services in interactive mode.
2012-10-09 10:56:12 +02:00
Jefferson Delfes
3d0e48b334 gatt: Remove offset parameter from gatt_read_char
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-10-01 12:54:51 +03:00
Claudio Takahasi
ea4ff5109b gatttool: Fix Characteristic descriptor discovery
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-20 14:10:54 +03:00
Johan Hedberg
5dd93fc16a Update code base to use the new BtIO API 2012-08-28 17:18:28 -07:00
Johan Hedberg
04be4fe0c0 attrib: Use proper types for size variables
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-15 12:20:51 +03:00
Eder Ruiz Maria
7040dc92fc gatt: Add support to GATT Write Long Characteristic
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-15 11:58:43 +03:00
Claudio Takahasi
cb6db2386b gatttool: Use GAttrib buffer
This patch replaces the static local buffer by the GAttrib internal
buffer to store temporarly the output ATT PDU.
2012-06-27 15:49:18 +03:00
Claudio Takahasi
2f8cd0cb7e ATT: Avoid invalid memory access for large PDU
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-27 15:49:18 +03:00
Andrzej Kaczmarek
2118c00409 gatttool: Add option to specify LE address type
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'.
2012-05-07 11:29:42 -07:00
Andrzej Kaczmarek
dbe0ed14d5 gatttool: Fix handle parsing in cmd_char_write()
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.
2012-04-26 12:12:18 +03:00
Jefferson Delfes
28f7993c17 gatttool: Update interactive prompt if connection is lost
In interactive mode, when connection is lost, the prompt used to remain
in "connected" state. This patch fixes that case, by always showing the
actual connection state.
2012-03-28 12:40:28 +03:00
Chen Ganir
1e064929b3 GATT: Replace start/end with att_range
Use att_range struct instead of individual start/end handles in
gatt_primary structure
2012-03-26 12:18:00 +03:00
Chen Ganir
48c82115a2 GATT: Rename service and char structs
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.
2012-03-26 12:16:44 +03:00
Jefferson Delfes
466360ddc6 gatttool: Add command completion for interactive mode 2012-02-29 20:07:21 -06:00
Johan Hedberg
4b609b812f Add "quit" to gatttool supported commands 2011-06-08 09:59:20 +09:00
Sheldon Demario
6a3a89774c Fix Characteristic read by UUID on gatttool
The Characteristic read by UUID GATT procedure is not incremental, i.e.
it returns the entire list in a single Read By Type request. Therefore
it should not be called recursively.
2011-04-09 10:25:56 -07:00
Bruna Moreira
6fc92a5341 Add Exchange MTU in interactive gatttool 2011-03-18 11:22:45 +02:00
Sheldon Demario
922c5feb93 Add discover characteristics by UUID to gatttool
According to the specification the characteristics discover and
characteristics discover by UUID use the same opcode and the result
should be filtered by callback.
2011-03-17 14:50:59 +02:00
Johan Hedberg
c620d295f7 Remove redundant return statements from interactive gatttool 2011-03-15 22:27:00 +02:00
Elvis Pfützenreuter
a278db781a Use new UUID functions in GATT
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.
2011-03-15 19:36:48 +02:00
Sheldon Demario
cc2d6b4db8 Add indication/notification support to interactive gatttool 2011-03-11 12:55:54 +02:00
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
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
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
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
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
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
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