From 395446dbe453e0472842d1205564ea0daaf5ec50 Mon Sep 17 00:00:00 2001 From: Rohit Grover Date: Tue, 2 Jun 2015 14:12:51 +0100 Subject: [PATCH] serviceCallback should be called only if characteristic UUID filter is wildcard. --- btle/btle_discovery.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/btle/btle_discovery.cpp b/btle/btle_discovery.cpp index 56e2214..2e117e4 100644 --- a/btle/btle_discovery.cpp +++ b/btle/btle_discovery.cpp @@ -311,7 +311,8 @@ NordicServiceDiscovery::progressServiceDiscovery(void) while ((state == SERVICE_DISCOVERY_ACTIVE) && (serviceIndex < numServices)) { if ((matchingServiceUUID == UUID::ShortUUIDBytes_t(BLE_UUID_UNKNOWN)) || (matchingServiceUUID == services[serviceIndex].getUUID().getShortUUID())) { - if (serviceCallback) { + + if (serviceCallback && (matchingCharacteristicUUID == UUID::ShortUUIDBytes_t(BLE_UUID_UNKNOWN))) { serviceCallback(&services[serviceIndex]); }