Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: nrf51-sdk
Fork of nRF51822 by
Diff: btle/btle_discovery.cpp
- Revision:
- 277:91705df8495e
- Parent:
- 276:ae6e5129b395
- Child:
- 278:26e3f0ef1e14
--- a/btle/btle_discovery.cpp Fri Jun 19 15:55:25 2015 +0100
+++ b/btle/btle_discovery.cpp Fri Jun 19 15:55:26 2015 +0100
@@ -155,7 +155,7 @@
terminateCharacteristicDiscovery();
}
} else {
- terminateCharacteristicDiscovery();
+ terminateCharacteristicDiscovery();
}
}
}
@@ -165,14 +165,19 @@
{
/* Iterate through the previously discovered services cached in services[]. */
while (sDiscoveryActive && (serviceIndex < numServices)) {
- if (serviceCallback) {
- serviceCallback(services[serviceIndex]);
- }
+ if ((matchingServiceUUID == ShortUUIDBytes_t(BLE_UUID_UNKNOWN)) ||
+ (matchingServiceUUID == services[serviceIndex].getShortUUID())) {
+ if (serviceCallback) {
+ serviceCallback(services[serviceIndex]);
+ }
- if (sDiscoveryActive && characteristicCallback) { /* characteristic discovery is optional. */
- launchCharacteristicDiscovery(connHandle, services[serviceIndex].getStartHandle(), services[serviceIndex].getEndHandle());
+ if (sDiscoveryActive && characteristicCallback) {
+ launchCharacteristicDiscovery(connHandle, services[serviceIndex].getStartHandle(), services[serviceIndex].getEndHandle());
+ } else {
+ serviceIndex++;
+ }
} else {
- serviceIndex++; /* Progress service index to keep discovery alive. */
+ serviceIndex++;
}
}
