Wouter van Kleunen / X_NUCLEO_IDB0XA1

Fork of X_NUCLEO_IDB0XA1 by ST

Files at this revision

API Documentation at this revision

Comitter:
Andrea Palmieri
Date:
Fri Apr 08 17:42:38 2016 +0200
Parent:
222:37a7e289ee3d
Child:
224:d8669b6b3175
Commit message:
Stack Mode 0x04 allows Simultaneous Scanning and Advertisement (SSAdv)

Signed-off-by: Andrea Palmieri <andrea.palmieri@st.com>

Changed in this revision

source/BlueNRGGap.cpp Show annotated file Show diff for this revision Revisions of this file
source/platform/btle.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/source/BlueNRGGap.cpp	Wed Apr 06 18:06:07 2016 +0200
+++ b/source/BlueNRGGap.cpp	Fri Apr 08 17:42:38 2016 +0200
@@ -419,7 +419,7 @@
     }
 
     advtInterval = params.getIntervalInADVUnits();
-    PRINTF("advtInterval=%ld\n\r", advtInterval);
+    printf("advtInterval=%ld advType=%d\n\r", advtInterval, params.getAdvertisingType());
 
     ret = aci_gap_set_discoverable(params.getAdvertisingType(), // AdvType
                                    advtInterval,                // AdvIntervMin
@@ -434,9 +434,9 @@
                                    0);                          // SlaveConnIntervMax
 
     
-    PRINTF("!!!setting discoverable (servUuidlength=0x%x)\n\r", servUuidlength);
+    printf("!!!setting discoverable (servUuidlength=0x%x)\n\r", servUuidlength);
     if(BLE_STATUS_SUCCESS!=ret) {
-       PRINTF("error occurred while setting discoverable (ret=0x%x)\n\r", ret);
+       printf("error occurred while setting discoverable (ret=0x%x)\n\r", ret);
        switch (ret) {
          case BLE_STATUS_INVALID_PARAMS:
            return BLE_ERROR_INVALID_PARAM;
@@ -1156,9 +1156,11 @@
   tBleStatus ret = BLE_STATUS_SUCCESS;
 
   // Stop ADV before scanning
+  /*
   if (state.advertising == 1) {
     stopAdvertising();
   }
+  */
 
   PRINTF("Scanning...\n\r");
   ret = btleStartRadioScan(scanningParams.getActiveScanning(),
--- a/source/platform/btle.cpp	Wed Apr 06 18:06:07 2016 +0200
+++ b/source/platform/btle.cpp	Fri Apr 08 17:42:38 2016 +0200
@@ -72,8 +72,8 @@
 #define IDB04A1 0
 #define IDB05A1 1
 
-// Mode 0x03 allows a central to advertise while a connection is ongoing
-#define STACK_MODE (0x03)
+// Stack Mode 0x04 allows Simultaneous Scanning and Advertisement (SSAdv)
+#define STACK_MODE (0x04)
 
 void HCI_Input(tHciDataPacket * hciReadPacket);