Bike service

Fork of BLE_API by Bluetooth Low Energy

Revision:
1186:a16103dfb50c
Parent:
1184:1589830dbdb7
Child:
1187:61ac7e01586f
diff -r 246cbece99c2 -r a16103dfb50c ble/Gap.h
--- a/ble/Gap.h	Wed Apr 06 19:15:37 2016 +0100
+++ b/ble/Gap.h	Wed Apr 06 19:15:38 2016 +0100
@@ -939,8 +939,12 @@
      * @return BLE_ERROR_NONE if the device started advertising successfully.
      */
     ble_error_t startAdvertising(void) {
+        ble_error_t rc;
         setAdvertisingData(); /* Update the underlying stack. */
-        return startAdvertising(_advParams);
+        if ((rc = startAdvertising(_advParams)) == BLE_ERROR_NONE) {
+            state.advertising = 1;
+        }
+        return rc;
     }
 
     /**