Linux bluetooth development
 help / color / mirror / Atom feed
From: Lukasz Rymanowski <lukasz.rymanowski@tieto.com>
To: linux-bluetooth@vger.kernel.org
Cc: szymon.janc@tieto.com, Lukasz Rymanowski <lukasz.rymanowski@tieto.com>
Subject: [PATCH v2 3/5] android/gatt: Add support for reliable write
Date: Thu, 17 Apr 2014 13:57:46 +0200	[thread overview]
Message-ID: <1397735868-19092-4-git-send-email-lukasz.rymanowski@tieto.com> (raw)
In-Reply-To: <1397735868-19092-1-git-send-email-lukasz.rymanowski@tieto.com>

This patch add support for reliable write
---
 android/gatt.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/android/gatt.c b/android/gatt.c
index e339789..281f520 100644
--- a/android/gatt.c
+++ b/android/gatt.c
@@ -2294,6 +2294,11 @@ static void handle_client_write_characteristic(const void *buf, uint16_t len)
 	}
 
 	switch (cmd->write_type) {
+	case GATT_WRITE_TYPE_PREPARE:
+		res = gatt_reliable_write_char(dev->attrib, ch->ch.value_handle,
+							cmd->value, cmd->len,
+							write_char_cb, cb_data);
+		break;
 	case GATT_WRITE_TYPE_DEFAULT:
 		res = gatt_write_char(dev->attrib, ch->ch.value_handle,
 							cmd->value, cmd->len,
@@ -2593,6 +2598,12 @@ static void handle_client_write_descriptor(const void *buf, uint16_t len)
 	}
 
 	switch (cmd->write_type) {
+	case GATT_WRITE_TYPE_PREPARE:
+		res = gatt_reliable_write_char(dev->attrib, descr->handle,
+							cmd->value, cmd->len,
+							write_descr_cb,
+							cb_data);
+		break;
 	case GATT_WRITE_TYPE_DEFAULT:
 		res = gatt_write_char(dev->attrib, descr->handle, cmd->value,
 					cmd->len, write_descr_cb, cb_data);
-- 
1.8.4


  parent reply	other threads:[~2014-04-17 11:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-17 11:57 [PATCH v2 0/5]android/gatt: GATT Client write types support Lukasz Rymanowski
2014-04-17 11:57 ` [PATCH v2 1/5] attrib: Add API for reliable write Lukasz Rymanowski
2014-04-17 11:57 ` [PATCH v2 2/5] attrib: Expose write execute Lukasz Rymanowski
2014-04-17 11:57 ` Lukasz Rymanowski [this message]
2014-04-17 11:57 ` [PATCH v2 4/5] android/gatt: Add support for " Lukasz Rymanowski
2014-04-17 11:57 ` [PATCH v2 5/5] android/gatt: Add support for write without response Lukasz Rymanowski
2014-04-23 13:19 ` [PATCH v2 0/5]android/gatt: GATT Client write types support Szymon Janc

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1397735868-19092-4-git-send-email-lukasz.rymanowski@tieto.com \
    --to=lukasz.rymanowski@tieto.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=szymon.janc@tieto.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox