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.
This commit is contained in:
Claudio Takahasi 2012-08-20 14:32:22 -03:00 committed by Johan Hedberg
parent 221fd83c2c
commit 8ff63e2707

View File

@ -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);
}