make service discovery idempotent.
This commit is contained in:
parent
7a7b768e37
commit
b4d743a9ad
1 changed files with 4 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue