BLE test

Fork of X_NUCLEO_IDB0XA1 by ST

Revision:
213:781abfbf2d1c
Parent:
210:08c4c85ca679
Child:
215:e8fa3129410a
Child:
217:23870c55b07e
--- a/source/BlueNRGGap.cpp	Thu Jan 14 10:59:36 2016 +0100
+++ b/source/BlueNRGGap.cpp	Fri Mar 18 12:05:22 2016 +0100
@@ -283,6 +283,21 @@
         //Set the SCAN_RSP Payload
         scan_response_payload = scanResponse.getPayload();
         scan_rsp_length = scanResponse.getPayloadLen();
+        
+        // Update the ADV data if we are already in ADV mode
+        if(AdvLen > 0 && state.advertising == 1) {
+ 
+            tBleStatus ret = aci_gap_update_adv_data(AdvLen, AdvData);
+            if(BLE_STATUS_SUCCESS!=ret) {
+                PRINTF("error occurred while adding adv data (ret=0x%x)\n", ret);
+                switch (ret) {
+                    case BLE_STATUS_TIMEOUT:
+                        return BLE_STACK_BUSY;
+                    default:
+                        return BLE_ERROR_UNSPECIFIED;
+                }
+            }
+        }
     }
     return BLE_ERROR_NONE;
 }