just a fork

Fork of BLE_API by Bluetooth Low Energy

Files at this revision

API Documentation at this revision

Comitter:
vcoubard
Date:
Wed Apr 06 19:15:44 2016 +0100
Parent:
1189:740911150041
Child:
1191:c8635748feec
Commit message:
Synchronized with git rev 24cde750
Author: Andres Amaya Garcia
Rewrite setAdvertisingPayload for consistency with other APIs

Changed in this revision

ble/Gap.h Show annotated file Show diff for this revision Revisions of this file
--- 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;
     }
 
     /**