Update for latest nRF51822 code changes.

Dependencies:   BLE_API nRF51822

Fork of Puck by Nordic Pucks

Files at this revision

API Documentation at this revision

Comitter:
sigveseb
Date:
Tue Mar 03 20:51:34 2015 +0000
Parent:
19:e41c83f1430e
Child:
21:00a3567124e3
Commit message:
Add setting of device name to puck init

Changed in this revision

Puck.h Show annotated file Show diff for this revision Revisions of this file
--- a/Puck.h	Sun Mar 01 18:37:05 2015 +0000
+++ b/Puck.h	Tue Mar 03 20:51:34 2015 +0000
@@ -205,11 +205,16 @@
     ble.init();
     LOG_DEBUG("Inited BLEDevice.\n");
     setState(DISCONNECTED);
-
+    
+    char deviceName[10];
+    sprintf(&deviceName[0], "Puck %04X", minor);
+    deviceName[9] = '\0';
+    ble.setDeviceName((const uint8_t*) deviceName);
+    
     ble.accumulateAdvertisingPayload(GapAdvertisingData::BREDR_NOT_SUPPORTED);
     LOG_DEBUG("Accumulate advertising payload: BREDR_NOT_SUPPORTED.\n");
     
-    ble.accumulateAdvertisingPayload(GapAdvertisingData::MANUFACTURER_SPECIFIC_DATA, beaconPayload, sizeof(beaconPayload));
+    //ble.accumulateAdvertisingPayload(GapAdvertisingData::MANUFACTURER_SPECIFIC_DATA, beaconPayload, sizeof(beaconPayload));
     LOG_DEBUG("Accumulate advertising payload: beacon data.\n");
     
     ble.setAdvertisingType(GapAdvertisingParams::ADV_CONNECTABLE_UNDIRECTED);