fdsf
Fork of nRF51822 by
Diff: btle/btle_discovery.cpp
- Revision:
- 273:8ada9e8111a3
- Parent:
- 272:c918f8a73f3f
- Child:
- 274:f82e0ecba699
diff -r c918f8a73f3f -r 8ada9e8111a3 btle/btle_discovery.cpp --- a/btle/btle_discovery.cpp Fri Jun 19 15:55:25 2015 +0100 +++ b/btle/btle_discovery.cpp Fri Jun 19 15:55:25 2015 +0100 @@ -24,11 +24,18 @@ static NordicServiceDiscovery discoverySingleton; ble_error_t -ServiceDiscovery::launch(Gap::Handle_t connectionHandle, ServiceCallback_t sc, CharacteristicCallback_t cc) +ServiceDiscovery::launch(Gap::Handle_t connectionHandle, + ServiceCallback_t sc, + CharacteristicCallback_t cc, + UUID matchingServiceUUIDIn, + UUID matchingCharacteristicUUIDIn) { + discoverySingleton.serviceCallback = sc; + discoverySingleton.characteristicCallback = cc; + discoverySingleton.matchingServiceUUID = matchingServiceUUIDIn; + discoverySingleton.matchingCharacteristicUUID = matchingCharacteristicUUIDIn; + discoverySingleton.serviceDiscoveryStarted(connectionHandle); - discoverySingleton.serviceCallback = sc; - discoverySingleton.characteristicCallback = cc; uint32_t rc; if ((rc = sd_ble_gattc_primary_services_discover(connectionHandle, NordicServiceDiscovery::SRV_DISC_START_HANDLE, NULL)) != NRF_SUCCESS) { @@ -48,19 +55,6 @@ return BLE_ERROR_NONE; } -ble_error_t -ServiceDiscovery::launch(Gap::Handle_t connectionHandle, - UUID matchingServiceUUIDIn, - ServiceCallback_t sc, - UUID matchingCharacteristicUUIDIn, - CharacteristicCallback_t cc) -{ - discoverySingleton.matchingServiceUUID = matchingServiceUUIDIn; - discoverySingleton.matchingCharacteristicUUID = matchingCharacteristicUUIDIn; - - return launch(connectionHandle, sc, cc); -} - void ServiceDiscovery::terminate(void) {