Bluetooth: Fix checking response len in read by type

Error should be responded if no previous attribute of the same type was
read (added to response buffer). In case if previous attributes were
added to buffer no error should be responded and read initiator should
perform read by type with increased start handle.

Change-Id: I31c4469e172a496890f049d9304a03673506c5f3
Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tieto.com>
This commit is contained in:
Grzegorz Kolodziejczyk 2015-11-20 10:35:31 +01:00 committed by Anas Nashif
commit dc82c46ea8

View file

@ -605,7 +605,7 @@ static uint8_t read_type_cb(const struct bt_gatt_attr *attr, void *user_data)
*/ */
data->err = check_perm(conn, attr, BT_GATT_PERM_READ_MASK); data->err = check_perm(conn, attr, BT_GATT_PERM_READ_MASK);
if (data->err) { if (data->err) {
if (!data->rsp->len) { if (data->rsp->len) {
data->err = 0x00; data->err = 0x00;
} }
return BT_GATT_ITER_STOP; return BT_GATT_ITER_STOP;