nordic

Fork of nRF51822 by Nordic Semiconductor

Revision:
282:2280bb1a9a9e
Parent:
281:cbaa4cb83548
Child:
283:6633922380bf
--- a/btle/btle_discovery.cpp	Fri Jun 19 15:55:26 2015 +0100
+++ b/btle/btle_discovery.cpp	Fri Jun 19 15:55:26 2015 +0100
@@ -30,6 +30,10 @@
                          const UUID               &matchingServiceUUIDIn,
                          const UUID               &matchingCharacteristicUUIDIn)
 {
+    if (isActive()) {
+        return BLE_ERROR_INVALID_STATE;
+    }
+
     sdSingleton.serviceCallback            = sc;
     sdSingleton.characteristicCallback     = cc;
     sdSingleton.matchingServiceUUID        = matchingServiceUUIDIn;