test

Dependencies:   nrf51-sdk

Dependents:   microbit-dal

Fork of nRF51822 by Lancaster University

Revision:
282:6633922380bf
Parent:
281:2280bb1a9a9e
Child:
283:c4c2aeab86c3
--- a/btle/btle_discovery.cpp	Fri Jun 19 15:55:26 2015 +0100
+++ b/btle/btle_discovery.cpp	Fri Jun 19 15:55:26 2015 +0100
@@ -146,8 +146,11 @@
 {
     /* Iterate through the previously discovered characteristics cached in characteristics[]. */
     while (cDiscoveryActive && (characteristicIndex < numCharacteristics)) {
-        if (characteristicCallback) {
-            characteristicCallback(characteristics[characteristicIndex]);
+        if ((matchingCharacteristicUUID == ShortUUIDBytes_t(BLE_UUID_UNKNOWN)) ||
+            (matchingCharacteristicUUID == characteristics[characteristicIndex].getShortUUID())) {
+            if (characteristicCallback) {
+                characteristicCallback(characteristics[characteristicIndex]);
+            }
         }
 
         characteristicIndex++;