Press buttons to activate the LED.
Dependencies: BLE_API nRF51822
Fork of Puck by
Diff: Puck.h
- Revision:
- 20:29b0143f3af3
- Parent:
- 18:4c95a470d778
- Child:
- 21:00a3567124e3
--- 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);