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-bluetooth-mdw
Fork of nRF51822 by
Diff: btle/btle_discovery.cpp
- Revision:
- 242:73fc02cc20b1
- Parent:
- 240:75b69581d1dd
- Child:
- 243:a966506d1e5b
diff -r d264f9ec06a3 -r 73fc02cc20b1 btle/btle_discovery.cpp
--- a/btle/btle_discovery.cpp Fri Jun 19 15:55:21 2015 +0100
+++ b/btle/btle_discovery.cpp Fri Jun 19 15:55:21 2015 +0100
@@ -58,15 +58,15 @@
void
NordicServiceDiscovery::setupDiscoveredServices(const ble_gattc_evt_prim_srvc_disc_rsp_t *response)
{
- currSrvInd = 0;
- srvCount = response->count;
+ serviceIndex = 0;
+ numServices = response->count;
/* Account for the limitation on the number of discovered services we can handle at a time. */
- if (srvCount > BLE_DB_DISCOVERY_MAX_SRV) {
- srvCount = BLE_DB_DISCOVERY_MAX_SRV;
+ if (numServices > BLE_DB_DISCOVERY_MAX_SRV) {
+ numServices = BLE_DB_DISCOVERY_MAX_SRV;
}
- for (unsigned serviceIndex = 0; serviceIndex < srvCount; serviceIndex++) {
+ for (unsigned serviceIndex = 0; serviceIndex < numServices; serviceIndex++) {
services[serviceIndex].setup(response->services[serviceIndex].uuid.uuid,
response->services[serviceIndex].handle_range.start_handle,
response->services[serviceIndex].handle_range.end_handle);
@@ -76,15 +76,15 @@
void
NordicServiceDiscovery::setupDiscoveredCharacteristics(const ble_gattc_evt_char_disc_rsp_t *response)
{
- currCharInd = 0;
- charCount = response->count;
+ characteristicIndex = 0;
+ numCharacteristics = response->count;
/* Account for the limitation on the number of discovered characteristics we can handle at a time. */
- if (charCount > BLE_DB_DISCOVERY_MAX_CHAR_PER_SRV) {
- charCount = BLE_DB_DISCOVERY_MAX_CHAR_PER_SRV;
+ if (numCharacteristics > BLE_DB_DISCOVERY_MAX_CHAR_PER_SRV) {
+ numCharacteristics = BLE_DB_DISCOVERY_MAX_CHAR_PER_SRV;
}
- for (unsigned charIndex = 0; charIndex < charCount; charIndex++) {
+ for (unsigned charIndex = 0; charIndex < numCharacteristics; charIndex++) {
characteristics[charIndex].setup(response->chars[charIndex].uuid.uuid,
*(const uint8_t *)(&response->chars[charIndex].char_props),
response->chars[charIndex].handle_decl,
