Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: BLE_API mbed nRF51822
Fork of eco_Labs_ble_Client by
Revision 35:b2af2293635a, committed 2016-12-16
- Comitter:
- jinu
- Date:
- Fri Dec 16 11:32:53 2016 +0000
- Parent:
- 34:d146cdbffd91
- Commit message:
- BLE name chnage and local name fix
Changed in this revision
| ble_uart.cpp | Show annotated file Show diff for this revision Revisions of this file | 
--- a/ble_uart.cpp	Fri Dec 16 10:20:16 2016 +0000
+++ b/ble_uart.cpp	Fri Dec 16 11:32:53 2016 +0000
@@ -22,7 +22,7 @@
 #include "ble_types.h"
 #include "spi_slave.h"
 #include "UARTService.h"
- 
+#include "ble_gap.h"
 /******************************************************************************/
 /* Local Defines                                                              */
 /******************************************************************************/
@@ -120,12 +120,17 @@
     ble.onDataWritten(ble_dataReceiveCallback);
  
     uart = new UARTService(ble);
- 
+
+    ble_gap_conn_sec_mode_t sec_mode;
+
+    BLE_GAP_CONN_SEC_MODE_SET_OPEN(&sec_mode);
+    sd_ble_gap_device_name_set(&sec_mode,(const uint8_t *)tx_buf,length);
+  
     /* Setup advertising */
     ble.accumulateAdvertisingPayload(GapAdvertisingData::BREDR_NOT_SUPPORTED | GapAdvertisingData::LE_GENERAL_DISCOVERABLE);
     ble.setAdvertisingType(GapAdvertisingParams::ADV_CONNECTABLE_UNDIRECTED);
-    ble.accumulateAdvertisingPayload(GapAdvertisingData::COMPLETE_LOCAL_NAME,
-                                     (const uint8_t *)tx_buf, length);
+//    ble.accumulateAdvertisingPayload(GapAdvertisingData::COMPLETE_LOCAL_NAME,
+//                                     (const uint8_t *)tx_buf, length);
 //  ble.accumulateAdvertisingPayload(GapAdvertisingData::INCOMPLETE_LIST_128BIT_SERVICE_IDS,
 //                                  (const uint8_t *)UARTServiceUUID_reversed, sizeof(UARTServiceUUID_reversed));
 //  ble.accumulateAdvertisingPayload(GapAdvertisingData::INCOMPLETE_LIST_16BIT_SERVICE_IDS, (uint8_t *)uuid16_list, sizeof(uuid16_list));    
    