High level Bluetooth Low Energy API and radio abstraction layer

Dependencies:   nRF51822

Dependents:   LinkNode_LIS3DH

Fork of BLE_API by Bluetooth Low Energy

Revision:
1190:38d206267ad3
Parent:
1189:740911150041
Child:
1191:c8635748feec
--- a/ble/Gap.h	Wed Apr 06 19:15:43 2016 +0100
+++ b/ble/Gap.h	Wed Apr 06 19:15:44 2016 +0100
@@ -1118,12 +1118,11 @@
      */
     ble_error_t setAdvertisingPayload(const GapAdvertisingData &payload) {
         ble_error_t rc = setAdvertisingData(_advPayload, _scanResponse);
-        if (rc != BLE_ERROR_NONE) {
-            /* The payload has a problem, do not store it */
-            return rc;
+        if (rc == BLE_ERROR_NONE) {
+            _advPayload = payload;
         }
-        _advPayload = payload;
-        return BLE_ERROR_NONE;
+
+        return rc;
     }
 
     /**