linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/5] android/gatt: Fix write confirm callback being not set
@ 2014-12-08  8:22 Jakub Tyszkowski
  2014-12-08  8:22 ` [PATCH 2/5] android/gatt: Fix not confirming write commands in database Jakub Tyszkowski
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: Jakub Tyszkowski @ 2014-12-08  8:22 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Jakub Tyszkowski

Currently this callback is required or previously registered write
callback function wont be called.
---
 android/gatt.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/android/gatt.c b/android/gatt.c
index 7d1115e..4ad0ce9 100644
--- a/android/gatt.c
+++ b/android/gatt.c
@@ -6178,6 +6178,15 @@ static uint8_t find_by_type_request(const uint8_t *cmd, uint16_t cmd_len,
 	return 0;
 }
 
+static void write_confirm(struct gatt_db_attribute *attrib,
+						int err, void *user_data)
+{
+	if (!err)
+		return;
+
+	error("Error writting attribute %p", attrib);
+}
+
 static void write_cmd_request(const uint8_t *cmd, uint16_t cmd_len,
 						struct gatt_device *dev)
 {
@@ -6206,7 +6215,7 @@ static void write_cmd_request(const uint8_t *cmd, uint16_t cmd_len,
 		return;
 
 	gatt_db_attribute_write(attrib, 0, value, vlen, cmd[0], &dev->bdaddr,
-								NULL, NULL);
+							write_confirm, NULL);
 }
 
 static void write_signed_cmd_request(const uint8_t *cmd, uint16_t cmd_len,
@@ -6278,7 +6287,7 @@ static void write_signed_cmd_request(const uint8_t *cmd, uint16_t cmd_len,
 		/* Signature OK, proceed with write */
 		bt_update_sign_counter(&dev->bdaddr, REMOTE_CSRK, r_sign_cnt);
 		gatt_db_attribute_write(attrib, 0, value, vlen, cmd[0],
-						&dev->bdaddr, NULL, NULL);
+					&dev->bdaddr, write_confirm, NULL);
 	}
 }
 
@@ -6640,15 +6649,6 @@ static void device_name_read_cb(struct gatt_db_attribute *attrib,
 								strlen(name));
 }
 
-static void write_confirm(struct gatt_db_attribute *attrib,
-						int err, void *user_data)
-{
-	if (!err)
-		return;
-
-	error("Error writting attribute %p", attrib);
-}
-
 static void register_gap_service(void)
 {
 	uint16_t start, end;
-- 
1.9.1


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

end of thread, other threads:[~2014-12-09  7:53 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-08  8:22 [PATCH 1/5] android/gatt: Fix write confirm callback being not set Jakub Tyszkowski
2014-12-08  8:22 ` [PATCH 2/5] android/gatt: Fix not confirming write commands in database Jakub Tyszkowski
2014-12-08  8:22 ` [PATCH 3/5] android/gatt: Fix write commands being not handled Jakub Tyszkowski
2014-12-08  8:55   ` Luiz Augusto von Dentz
2014-12-08  9:22     ` Luiz Augusto von Dentz
2014-12-08  9:31       ` Tyszkowski Jakub
2014-12-08 10:17         ` Tyszkowski Jakub
2014-12-08 11:02           ` Luiz Augusto von Dentz
2014-12-08 19:50             ` Arman Uguray
2014-12-08 22:08               ` Luiz Augusto von Dentz
2014-12-08 22:20                 ` Arman Uguray
2014-12-09  7:53                   ` Tyszkowski Jakub
2014-12-08  8:22 ` [PATCH 4/5] android/gatt: Extract indication support from att_req_handler Jakub Tyszkowski
2014-12-08  8:22 ` [PATCH 5/5] android/gatt: Remove not handled att ops in request handler Jakub Tyszkowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).