Fix dbus error in GATT read/write request 95/134095/2
authorGowtham Anandha Babu <gowtham.ab@samsung.com>
Wed, 14 Jun 2017 12:11:54 +0000 (17:41 +0530)
committerGowtham Anandha Babu <gowtham.ab@samsung.com>
Wed, 14 Jun 2017 12:21:58 +0000 (12:21 +0000)
The below error is captured on bt-frwk.
Error : GDBus.Error:org.bluez.Error.Failed: Error return with body of type '(sy)':

Bluez sends the reply in (sy). But what we want is only att_ecode.
After fix, the application will get the proper att_ecode for
GATT read/write request.

Change-Id: Ib6abf0acd44fa70740913308b2d9748e34f39fab
Signed-off-by: Gowtham Anandha Babu <gowtham.ab@samsung.com>
src/gatt-client.c

index f72fbf2..9620ede 100644 (file)
@@ -337,9 +337,10 @@ static void async_dbus_op_reply(struct async_dbus_op *op, int err,
                DBusMessage *msg = entry->data;
 
                if (err) {
+#ifndef TIZEN_FEATURE_BLUEZ_MODIFY
                        reply = err > 0 ? create_gatt_dbus_error(msg, err) :
                                btd_error_failed(msg, strerror(-err));
-#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
+#else
                        if (err > 0)
                                dbus_message_append_args(reply,
                                                        DBUS_TYPE_BYTE, &err,