[PATCH 8/8] android/gatt: Fix incorrect status in read characteristic cb

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Pass correct status to upper layer.
---
 android/gatt.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/android/gatt.c b/android/gatt.c
index 852c50b..2ddbf29 100644
--- a/android/gatt.c
+++ b/android/gatt.c
@@ -2769,11 +2769,12 @@ static void send_client_read_char_notify(int32_t status, const uint8_t *pdu,
 
 	ev->conn_id = conn_id;
 	ev->status = status;
+	ev->data.status = status;
 
 	element_id_to_hal_srvc_id(s_id, primary, &ev->data.srvc_id);
 	element_id_to_hal_gatt_id(ch_id, &ev->data.char_id);
 
-	if (pdu) {
+	if (status == 0 && pdu) {
 		vlen = dec_read_resp(pdu, len, ev->data.value, sizeof(buf));
 		if (vlen < 0) {
 			error("gatt: Protocol error");
-- 
1.9.0

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux