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.
Fork of nRF51822 by
Diff: btle/btle_gattc.cpp
- Revision:
- 231:4362ce7ffbd7
- Parent:
- 230:4c2bb92598b7
- Child:
- 232:102cf741f177
diff -r 4c2bb92598b7 -r 4362ce7ffbd7 btle/btle_gattc.cpp
--- a/btle/btle_gattc.cpp Fri Jun 19 15:55:20 2015 +0100
+++ b/btle/btle_gattc.cpp Fri Jun 19 15:55:20 2015 +0100
@@ -122,9 +122,9 @@
void progressCharacteristicDiscovery() {
while (characteristicDiscoveryInProgress && (currCharInd < charCount)) {
- printf("%x [%u]\r\n",
- characteristics[currCharInd].uuid,
- characteristics[currCharInd].valueHandle);
+ /* THIS IS WHERE THE CALLBACK WILL GO */
+ printf("%x [%u]\r\n", characteristics[currCharInd].uuid, characteristics[currCharInd].valueHandle);
+
currCharInd++;
}
@@ -147,19 +147,20 @@
void progressServiceDiscovery() {
while (serviceDiscoveryInProgress && (currSrvInd < srvCount)) {
- printf("%x [%u %u]\r\n",
- services[currSrvInd].uuid,
- services[currSrvInd].startHandle,
- services[currSrvInd].endHandle);
+ /* THIS IS WHERE THE CALLBACK WILL GO */
+ printf("%x [%u %u]\r\n", services[currSrvInd].uuid, services[currSrvInd].startHandle, services[currSrvInd].endHandle);
- launchCharacteristicDiscovery(connHandle, services[currSrvInd].startHandle, services[currSrvInd].endHandle);
+ if (true) { /* characteristic discovery is optional. */
+ launchCharacteristicDiscovery(connHandle, services[currSrvInd].startHandle, services[currSrvInd].endHandle);
+ } else {
+ currSrvInd++; /* Progress service index to keep discovery alive. */
+ }
}
if (serviceDiscoveryInProgress && (srvCount > 0) && (currSrvInd > 0)) {
Gap::Handle_t endHandle = services[currSrvInd - 1].endHandle;
resetDiscoveredServices();
- printf("services discover returned %u\r\n",
- sd_ble_gattc_primary_services_discover(connHandle, endHandle, NULL));
+ printf("services discover returned %u\r\n", sd_ble_gattc_primary_services_discover(connHandle, endHandle, NULL));
}
}
