make service discovery idempotent.

This commit is contained in:
Rohit Grover 2015-05-22 10:47:43 +01:00
parent 7a7b768e37
commit b4d743a9ad

View file

@ -30,6 +30,10 @@ ServiceDiscovery::launch(Gap::Handle_t connectionHandle,
const UUID &matchingServiceUUIDIn,
const UUID &matchingCharacteristicUUIDIn)
{
if (isActive()) {
return BLE_ERROR_INVALID_STATE;
}
sdSingleton.serviceCallback = sc;
sdSingleton.characteristicCallback = cc;
sdSingleton.matchingServiceUUID = matchingServiceUUIDIn;