diff options
author | Lukasz Rymanowski <lukasz.rymanowski@tieto.com> | 2015-02-26 10:39:31 +0100 |
---|---|---|
committer | Szymon Janc <szymon.janc@tieto.com> | 2015-02-27 16:33:56 +0100 |
commit | 746cc864f506712e31a14ba4b51001c0a69cb636 (patch) | |
tree | adaa48d820d8e8b84651510c1b91c0b200d7cd82 /attrib | |
parent | 7660fbd87dd391bf6d4c2d161411d0b162d0f2bf (diff) | |
download | bluez-746cc864f506712e31a14ba4b51001c0a69cb636.tar.gz |
attrib/gatt: Minor refactor in char_discovered_cb
This will be needed by next patch
Diffstat (limited to 'attrib')
-rw-r--r-- | attrib/gatt.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/attrib/gatt.c b/attrib/gatt.c index b8d766cd2..4bffd6495 100644 --- a/attrib/gatt.c +++ b/attrib/gatt.c @@ -574,10 +574,16 @@ 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 = ATT_ECODE_ATTR_NOT_FOUND; + unsigned int i, err = 0; uint16_t last = 0; uint8_t type; + /* We have all the characteristic now, lets send it up */ + if (status == ATT_ECODE_ATTR_NOT_FOUND) { + err = dc->characteristics ? 0 : status; + goto done; + } + if (status) { err = status; goto done; @@ -647,7 +653,6 @@ static void char_discovered_cb(guint8 status, const guint8 *ipdu, guint16 iplen, } done: - err = (dc->characteristics ? 0 : err); dc->cb(err, dc->characteristics, dc->user_data); } |