Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH BlueZ 00/12] client: Add support for GATT API
@ 2015-02-06 11:03 Luiz Augusto von Dentz
  2015-02-06 11:03 ` [PATCH BlueZ 01/12] client: Add support for GattService1 Luiz Augusto von Dentz
                   ` (12 more replies)
  0 siblings, 13 replies; 16+ messages in thread
From: Luiz Augusto von Dentz @ 2015-02-06 11:03 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

This adds basic support for GATT API, the main idea is that one can
navigate into the attributes and read and write values to them.

Some of the output of the changes can be found bellow:

[bluetooth]# connect XX:XX:XX:XX:XX:XX
Attempting to connect to XX:XX:XX:XX:XX:XX
[CHG] Device XX:XX:XX:XX:XX:XX Connected: yes
Connection successful
[CHG] Device XX:XX:XX:XX:XX:XX Paired: yes
[NEW] Service /org/bluez/hci0/dev_XX_XX_XX_XX_XX_XX/service0011 Battery Service (Primary)
[NEW] Characteristic /org/bluez/hci0/dev_XX_XX_XX_XX_XX_XX/service0011/char0012 Battery Level
[NEW] Descriptor /org/bluez/hci0/dev_XX_XX_XX_XX_XX_XX/service0011/char0012/desc0014 Client Characteristic Configuration
[Arc Touch Mouse SE]# select-attribute /org/bluez/hci0/dev_XX_XX_XX_XX_XX_XX/service0011
/org/bluez/hci0/dev_XX_XX_XX_XX_XX_XX/service0011                    /org/bluez/hci0/dev_XX_XX_XX_XX_XX_XX/service0011/char0012           /org/bluez/hci0/dev_XX_XX_XX_XX_XX_XX/service0011/char0012/desc0014
[Arc Touch Mouse SE]# select-attribute /org/bluez/hci0/dev_XX_XX_XX_XX_XX_XX/service0011
[Arc Touch Mouse SE:/service0011]# attribute-info 
Service - Battery Service
	UUID: 0000180f-0000-1000-8000-00805f9b34fb
	Primary: yes
	Characteristics: /org/bluez/hci0/dev_XX_XX_XX_XX_XX_XX/service0011/char0012
[Arc Touch Mouse SE:/service0011]# select-attribute /org/bluez/hci0/dev_XX_XX_XX_XX_XX_XX/service0011/char0012
[Arc Touch Mouse SE:/service0011/char0012]# attribute-info
Characteristic - Battery Level
	UUID: 00002a19-0000-1000-8000-00805f9b34fb
	Service: /org/bluez/hci0/dev_XX_XX_XX_XX_XX_XX/service0011
	Notifying: no
	Flags: read
	Flags: notify
	Descriptors: /org/bluez/hci0/dev_XX_XX_XX_XX_XX_XX/service0011/char0012/desc0014
[Arc Touch Mouse SE:/service0011/char0012]# read
Attempting to read /org/bluez/hci0/dev_XX_XX_XX_XX_XX_XX/service0011/char0012
[CHG] Attribute /org/bluez/hci0/dev_XX_XX_XX_XX_XX_XX/service0011/char0012 Value: 0x63
  63                                               c               
[Arc Touch Mouse SE:/service0011/char0012]# write 00
Attempting to write /org/bluez/hci0/dev_XX_XX_XX_XX_XX_XX/service0011/char0012
Failed to write: org.bluez.Error.NotSupported
[Arc Touch Mouse SE:/service0011/char0012]# notify on
[CHG] Attribute /org/bluez/hci0/dev_XX_XX_XX_XX_XX_XX/service0011/char0012 Notifying: yes
Notify started
[CHG] Attribute /org/bluez/hci0/dev_XX_XX_XX_XX_XX_XX/service0011/char0012 Value: 0x55
[CHG] Attribute /org/bluez/hci0/dev_XX_XX_XX_XX_XX_XX/service0011/char0012 Value: 0x56
[CHG] Attribute /org/bluez/hci0/dev_XX_XX_XX_XX_XX_XX/service0011/char0012 Value: 0x57
[CHG] Attribute /org/bluez/hci0/dev_XX_XX_XX_XX_XX_XX/service0011/char0012 Value: 0x58
[Arc Touch Mouse SE:/service0011/char0012]# notify off
[CHG] Attribute /org/bluez/hci0/dev_XX_XX_XX_XX_XX_XX/service0011/char0012 Notifying: no
Notify stopped
[Arc Touch Mouse SE:/service0011/char0012]#

Luiz Augusto von Dentz (12):
  client: Add support for GattService1
  client: Add support for GattCharacteristic1
  client: Add support for GattDescriptor1
  client: Make commands relative to device
  client: Add command list-attributes
  client: Add command select-attribute
  client: Add attribute-info command
  client/display: Add rl_hexdump
  client: Add read command
  client: Add write command
  client: Add notify command
  client: Handle attribute notifications

 Makefile.tools   |   1 +
 client/display.c |  41 +++++
 client/display.h |   1 +
 client/gatt.c    | 514 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 client/gatt.h    |  39 +++++
 client/main.c    | 409 ++++++++++++++++++++++++++++++++++---------
 6 files changed, 925 insertions(+), 80 deletions(-)
 create mode 100644 client/gatt.c
 create mode 100644 client/gatt.h

-- 
2.1.0


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2015-02-10 11:42 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-06 11:03 [PATCH BlueZ 00/12] client: Add support for GATT API Luiz Augusto von Dentz
2015-02-06 11:03 ` [PATCH BlueZ 01/12] client: Add support for GattService1 Luiz Augusto von Dentz
2015-02-06 11:03 ` [PATCH BlueZ 02/12] client: Add support for GattCharacteristic1 Luiz Augusto von Dentz
2015-02-06 11:03 ` [PATCH BlueZ 03/12] client: Add support for GattDescriptor1 Luiz Augusto von Dentz
2015-02-06 11:03 ` [PATCH BlueZ 04/12] client: Make commands relative to device Luiz Augusto von Dentz
2015-02-06 11:03 ` [PATCH BlueZ 05/12] client: Add command list-attributes Luiz Augusto von Dentz
2015-02-06 11:03 ` [PATCH BlueZ 06/12] client: Add command select-attribute Luiz Augusto von Dentz
2015-02-06 11:03 ` [PATCH BlueZ 07/12] client: Add attribute-info command Luiz Augusto von Dentz
2015-02-06 11:03 ` [PATCH BlueZ 08/12] client/display: Add rl_hexdump Luiz Augusto von Dentz
2015-02-06 11:03 ` [PATCH BlueZ 09/12] client: Add read command Luiz Augusto von Dentz
2015-02-06 11:03 ` [PATCH BlueZ 10/12] client: Add write command Luiz Augusto von Dentz
2015-02-06 11:03 ` [PATCH BlueZ 11/12] client: Add notify command Luiz Augusto von Dentz
2015-02-06 11:03 ` [PATCH BlueZ 12/12] client: Handle attribute notifications Luiz Augusto von Dentz
2015-02-09 11:41   ` Gowtham Anandha Babu
2015-02-09 13:14     ` Luiz Augusto von Dentz
2015-02-10 11:42 ` [PATCH BlueZ 00/12] client: Add support for GATT API Luiz Augusto von Dentz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox