Pull request for i.a. sensor buffer template
Dependencies: BLE_API MPU6050 mbed nRF51822
Diff: main.cpp
- Revision:
- 8:d1f5c8801d59
- Parent:
- 7:d92f1383bd81
- Child:
- 9:e9d6a9758cf7
--- a/main.cpp Tue Oct 16 21:25:50 2018 +0200 +++ b/main.cpp Tue Oct 16 22:01:14 2018 +0200 @@ -68,6 +68,9 @@ int16_t ax, ay, az; int16_t gx, gy, gz; +//char acceleration128bitUUIDlist[] = {0x5D,0x34,0xE2,0xF0 ,0x3D,0xD2 ,0x07,0xAC ,0x38,0xF1 ,0xBB,0xAD,0x12,0x0E,0xF8,0x53}; +char acceleration128bitUUIDlist[] = { 0x53, 0xF8, 0x0E, 0x12, 0xAD, 0xBB, 0xF1, 0x38, 0xAC, 0x07, 0xD2, 0x3D, 0xF0, 0xE2, 0x34, 0x5D }; + void connectionCallback(const Gap::ConnectionCallbackParams_t *params) { @@ -157,12 +160,13 @@ LOG("name = %s\n", name); /* setup advertising */ - ble.accumulateAdvertisingPayload(GapAdvertisingData::BREDR_NOT_SUPPORTED); - ble.setAdvertisingType(GapAdvertisingParams::ADV_CONNECTABLE_UNDIRECTED); - ble.accumulateAdvertisingPayload(GapAdvertisingData::SHORTENED_LOCAL_NAME, + ble.gap().accumulateAdvertisingPayload(GapAdvertisingData::BREDR_NOT_SUPPORTED); + ble.gap().setAdvertisingType(GapAdvertisingParams::ADV_CONNECTABLE_UNDIRECTED); + ble.gap().accumulateAdvertisingPayload(GapAdvertisingData::COMPLETE_LIST_128BIT_SERVICE_IDS, + (const uint8_t *)acceleration128bitUUIDlist, sizeof(acceleration128bitUUIDlist)); + ble.gap().accumulateScanResponse(GapAdvertisingData::COMPLETE_LOCAL_NAME, name, sizeof(name)); - ble.accumulateAdvertisingPayload(GapAdvertisingData::COMPLETE_LIST_128BIT_SERVICE_IDS, - (const uint8_t *)UARTServiceUUID_reversed, sizeof(UARTServiceUUID_reversed)); + DFUService dfu(ble); UARTService uartService(ble); uartServicePtr = &uartService;