From b58c6eb9050ca5824c198adc3fcd3384eba68af7 Mon Sep 17 00:00:00 2001 From: Milanka Ringwald Date: Tue, 15 May 2018 16:00:02 +0200 Subject: [PATCH] att_server: fix lookup for Client Characteristic Configuration in services with multiple Characteristics --- CHANGELOG.md | 1 + src/ble/att_db.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c3ada719..0dcf13428 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - SM: Fix LE Secure Connection pairing in Central role - le_device_db_tlv: fix seq nr management - SM: improve le_device_db lookup and storing of IRK +- GATT Server: fix lookup for Client Characteristic Configuration in services with multiple Characteristics ## Changes April 2018 diff --git a/src/ble/att_db.c b/src/ble/att_db.c index eed1e985b..8fdb7ba43 100644 --- a/src/ble/att_db.c +++ b/src/ble/att_db.c @@ -1240,7 +1240,7 @@ uint16_t gatt_server_get_client_configuration_handle_for_characteristic_with_uui if (characteristic_found) break; continue; } - if (att_iterator_match_uuid16(&it, GATT_CLIENT_CHARACTERISTICS_CONFIGURATION)){ + if (characteristic_found && att_iterator_match_uuid16(&it, GATT_CLIENT_CHARACTERISTICS_CONFIGURATION)){ return it.handle; } } @@ -1319,7 +1319,7 @@ uint16_t gatt_server_get_client_configuration_handle_for_characteristic_with_uui if (characteristic_found) break; continue; } - if (att_iterator_match_uuid16(&it, GATT_CLIENT_CHARACTERISTICS_CONFIGURATION)){ + if (characteristic_found && att_iterator_match_uuid16(&it, GATT_CLIENT_CHARACTERISTICS_CONFIGURATION)){ return it.handle; } }