adaptation for bkap

Fork of X_NUCLEO_IDB0XA1 by ST

Files at this revision

API Documentation at this revision

Comitter:
vrou44
Date:
Mon May 14 12:32:41 2018 +0000
Parent:
307:fa98703ece8e
Commit message:
Changes for Book And Plug Proto

Changed in this revision

source/platform/btle.cpp Show annotated file Show diff for this revision Revisions of this file
x-nucleo-idb0xa1/bluenrg-hci/ble_debug.h Show annotated file Show diff for this revision Revisions of this file
x-nucleo-idb0xa1/x_nucleo_idb0xa1_targets.h Show annotated file Show diff for this revision Revisions of this file
diff -r fa98703ece8e -r 36435ab0e5b2 source/platform/btle.cpp
--- a/source/platform/btle.cpp	Fri Sep 16 12:03:25 2016 +0200
+++ b/source/platform/btle.cpp	Mon May 14 12:32:41 2018 +0000
@@ -87,7 +87,8 @@
 volatile uint8_t set_connectable = 1;
 
 static char versionString[32];
-uint8_t bnrg_expansion_board = IDB04A1; /* at startup, suppose the X-NUCLEO-IDB04A1 is used */
+//uint8_t bnrg_expansion_board = IDB04A1; /* at startup, suppose the X-NUCLEO-IDB04A1 is used */
+uint8_t bnrg_expansion_board = IDB05A1; /* HD at startup, suppose the X-NUCLEO-IDB05A1 is used */
 
 /**************************************************************************/
 /*!
@@ -143,6 +144,7 @@
                                    &service_handle,
                                    &dev_name_char_handle,
                                    &appearance_char_handle);
+        PRINTF("\r\n!!!!!!! HD aci_gap_init_IDB05A1 \r\n");
     } else {
         // IDB04A1 is configured as peripheral by default
         ret = aci_gap_init_IDB04A1(GAP_PERIPHERAL_ROLE_IDB04A1, &service_handle, &dev_name_char_handle, &appearance_char_handle);
@@ -162,18 +164,23 @@
     }
 
     //FIXME: Security and passkey set by default
-    ret = aci_gap_set_auth_requirement(MITM_PROTECTION_REQUIRED,
+    ret = aci_gap_set_auth_requirement(
+    								   // MITM_PROTECTION_NOT_REQUIRED, HD
+    								   MITM_PROTECTION_REQUIRED,
                                        OOB_AUTH_DATA_ABSENT,
                                        NULL,
                                        7,
                                        16,
+                                       // USE_FIXED_PIN_FOR_PAIRING,
                                        USE_FIXED_PIN_FOR_PAIRING,
-                                       123456,
+                                       654321,
                                        BONDING);
     if (ret != BLE_STATUS_SUCCESS) {
         PRINTF("Auth Req set failed.\n");
-    }
-
+    } else {
+	    PRINTF("\n\r!!!!! HD Auth Req set success.\n");
+	}
+	
     aci_hal_set_tx_power_level(1,4);
 
     g_gap_service_handle = service_handle;
diff -r fa98703ece8e -r 36435ab0e5b2 x-nucleo-idb0xa1/bluenrg-hci/ble_debug.h
--- a/x-nucleo-idb0xa1/bluenrg-hci/ble_debug.h	Fri Sep 16 12:03:25 2016 +0200
+++ b/x-nucleo-idb0xa1/bluenrg-hci/ble_debug.h	Mon May 14 12:32:41 2018 +0000
@@ -48,6 +48,7 @@
 
 /* Exported macro ------------------------------------------------------------*/
 //#define DEBUG
+#define DEBUG       // HD
 #ifdef DEBUG
 #include <stdio.h>
 #define PRINTF(...) printf(__VA_ARGS__)
diff -r fa98703ece8e -r 36435ab0e5b2 x-nucleo-idb0xa1/x_nucleo_idb0xa1_targets.h
--- a/x-nucleo-idb0xa1/x_nucleo_idb0xa1_targets.h	Fri Sep 16 12:03:25 2016 +0200
+++ b/x-nucleo-idb0xa1/x_nucleo_idb0xa1_targets.h	Mon May 14 12:32:41 2018 +0000
@@ -56,6 +56,7 @@
 	 Expansion boards modified in this way allow to be used on almost
 	 any Arduino-compliant base board.
 */
+#define IDB0XA1_D13_PATCH
 #if defined(IDB0XA1_D13_PATCH)
 #define IDB0XA1_PIN_SPI_SCK    (D13)
 #else // !defined(IDB0XA1_D13_PATCH)