
KeyboardStream example from BLE_HID
Dependencies: BLE_API BLE_HID mbed nRF51822
This example is currently copied as-is from the github development repo.
Diff: keyboard_stream.cpp
- Revision:
- 3:2f64c208af3a
- Parent:
- 1:40ee264cd4f0
--- a/keyboard_stream.cpp Thu Nov 19 15:16:43 2015 +0000 +++ b/keyboard_stream.cpp Sun Apr 03 22:09:25 2016 +0100 @@ -116,9 +116,11 @@ HID_DEBUG("setting up gap\r\n"); ble.gap().accumulateAdvertisingPayload(GapAdvertisingData::KEYBOARD); ble.gap().accumulateAdvertisingPayload(GapAdvertisingData::COMPLETE_LOCAL_NAME, - (uint8_t *)DEVICE_NAME, sizeof(DEVICE_NAME)); + (const uint8_t *)DEVICE_NAME, sizeof(DEVICE_NAME)); ble.gap().accumulateAdvertisingPayload(GapAdvertisingData::SHORTENED_LOCAL_NAME, - (uint8_t *)SHORT_DEVICE_NAME, sizeof(SHORT_DEVICE_NAME)); + (const uint8_t *)SHORT_DEVICE_NAME, sizeof(SHORT_DEVICE_NAME)); + + ble.gap().setDeviceName((const uint8_t *)DEVICE_NAME); HID_DEBUG("advertising\r\n"); ble.gap().startAdvertising();