Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH 1/2] Extend Characteristic Write to support Write Without Response
@ 2011-03-09 19:03 Claudio Takahasi
  2011-03-09 19:03 ` [PATCH 2/2] gatttool: Add Write Without Response option Claudio Takahasi
  2011-03-10  9:21 ` [PATCH 1/2] Extend Characteristic Write to support Write Without Response Johan Hedberg
  0 siblings, 2 replies; 3+ messages in thread
From: Claudio Takahasi @ 2011-03-09 19:03 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Claudio Takahasi

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.
---
 attrib/gatt.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/attrib/gatt.c b/attrib/gatt.c
index ae482f1..2b0d827 100644
--- a/attrib/gatt.c
+++ b/attrib/gatt.c
@@ -502,8 +502,12 @@ guint gatt_write_char(GAttrib *attrib, uint16_t handle, uint8_t *value,
 	uint8_t pdu[ATT_DEFAULT_LE_MTU];
 	guint16 plen;
 
-	plen = enc_write_req(handle, value, vlen, pdu, sizeof(pdu));
-	return g_attrib_send(attrib, 0, ATT_OP_WRITE_REQ, pdu, plen, func,
+	if (func)
+		plen = enc_write_req(handle, value, vlen, pdu, sizeof(pdu));
+	else
+		plen = enc_write_cmd(handle, value, vlen, pdu, sizeof(pdu));
+
+	return g_attrib_send(attrib, 0, pdu[0], pdu, plen, func,
 							user_data, NULL);
 }
 
-- 
1.7.4.1


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

end of thread, other threads:[~2011-03-10  9:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-09 19:03 [PATCH 1/2] Extend Characteristic Write to support Write Without Response Claudio Takahasi
2011-03-09 19:03 ` [PATCH 2/2] gatttool: Add Write Without Response option Claudio Takahasi
2011-03-10  9:21 ` [PATCH 1/2] Extend Characteristic Write to support Write Without Response Johan Hedberg

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