summaryrefslogtreecommitdiff
path: root/attrib
diff options
context:
space:
mode:
authorClaudio Takahasi <claudio.takahasi@openbossa.org>2012-08-20 14:32:22 -0300
committerJohan Hedberg <johan.hedberg@intel.com>2012-08-20 20:45:25 +0300
commit8ff63e27074622730b6c97c4c73d6c13b7fcf3c5 (patch)
tree12a4945080120301cf89196a8ffa305265934a1d /attrib
parent221fd83c2c9e9d773fcc9d01d04ba9a745fb8754 (diff)
downloadbluez-8ff63e27074622730b6c97c4c73d6c13b7fcf3c5.tar.gz
gatt: Don't raise error if declaration was found
This patch avoids raising errors to the upper layer if at least one characteristic declaration has been found. According to the Core SPEC Characteristic declarations shall be read without authentication or authorization.
Diffstat (limited to 'attrib')
-rw-r--r--attrib/gatt.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/attrib/gatt.c b/attrib/gatt.c
index aea59ec1b..6880e2d60 100644
--- a/attrib/gatt.c
+++ b/attrib/gatt.c
@@ -253,7 +253,7 @@ static void char_discovered_cb(guint8 status, const guint8 *ipdu, guint16 iplen,
{
struct discover_char *dc = user_data;
struct att_data_list *list;
- unsigned int i, err;
+ unsigned int i, err = ATT_ECODE_ATTR_NOT_FOUND;
size_t buflen;
uint8_t *buf;
guint16 oplen;
@@ -261,7 +261,7 @@ static void char_discovered_cb(guint8 status, const guint8 *ipdu, guint16 iplen,
uint16_t last = 0;
if (status) {
- err = status == ATT_ECODE_ATTR_NOT_FOUND ? 0 : status;
+ err = status;
goto done;
}
@@ -320,9 +320,9 @@ static void char_discovered_cb(guint8 status, const guint8 *ipdu, guint16 iplen,
return;
}
- err = (dc->characteristics ? 0 : ATT_ECODE_ATTR_NOT_FOUND);
-
done:
+ err = (dc->characteristics ? 0 : err);
+
dc->cb(dc->characteristics, err, dc->user_data);
discover_char_free(dc);
}