test
Fork of nRF51822 by
Diff: btle/btle_discovery.cpp
- Revision:
- 258:62d6bf03e6a4
- Parent:
- 257:6e0ae0f1697b
- Child:
- 264:5533ac0adf4b
diff -r 6e0ae0f1697b -r 62d6bf03e6a4 btle/btle_discovery.cpp --- a/btle/btle_discovery.cpp Fri Jun 19 15:55:23 2015 +0100 +++ b/btle/btle_discovery.cpp Fri Jun 19 15:55:23 2015 +0100 @@ -154,7 +154,9 @@ .start_handle = startHandle, .end_handle = endHandle }; - printf("char discovery returned %u\r\n", sd_ble_gattc_characteristics_discover(connHandle, &handleRange)); + if (sd_ble_gattc_characteristics_discover(connHandle, &handleRange) != NRF_SUCCESS) { + terminateCharacteristicDiscovery(); + } } else { terminateCharacteristicDiscovery(); } @@ -179,7 +181,9 @@ Gap::Handle_t endHandle = services[serviceIndex - 1].endHandle; resetDiscoveredServices(); - printf("services discover returned %u\r\n", sd_ble_gattc_primary_services_discover(connHandle, endHandle, NULL)); + if (sd_ble_gattc_primary_services_discover(connHandle, endHandle, NULL) != NRF_SUCCESS) { + terminateServiceDiscovery(); + } } }