BLE heart rate example, with yotta machinations.
Dependencies: BLE_API mbed nRF51822
Fork of BLE_HeartRate by
Diff: main.cpp
- Revision:
- 27:97adf2b76b9c
- Parent:
- 26:e6ad33b227c6
- Child:
- 28:bdfc8cc53f0b
--- a/main.cpp Thu Jul 03 11:44:59 2014 +0100 +++ b/main.cpp Thu Jul 03 11:52:32 2014 +0100 @@ -53,6 +53,8 @@ GattCharacteristic *hrmChars[] = {&hrmRate, &hrmLocation, }; GattService hrmService(GattService::UUID_HEART_RATE_SERVICE, hrmChars, sizeof(hrmChars) / sizeof(GattCharacteristic *)); +static const uint16_t uuid16_list[] = {GattService::UUID_DEVICE_INFORMATION_SERVICE, GattService::UUID_HEART_RATE_SERVICE}; + void disconnectionCallback(void) { DEBUG("Disconnected!\n\r"); @@ -92,6 +94,7 @@ /* setup advertising */ ble.accumulateAdvertisingPayload(GapAdvertisingData::BREDR_NOT_SUPPORTED); + ble.accumulateAdvertisingPayload(GapAdvertisingData::COMPLETE_LIST_16BIT_SERVICE_IDS, (uint8_t*)uuid16_list, sizeof(uuid16_list)); ble.accumulateAdvertisingPayload(GapAdvertisingData::HEART_RATE_SENSOR_HEART_RATE_BELT); ble.setAdvertisingType(GapAdvertisingParams::ADV_CONNECTABLE_UNDIRECTED); ble.setAdvertisingInterval(160); /* 100ms; in multiples of 0.625ms. */