![](/media/cache/profiles/b5c4ec91390a6fbccf8d918d443563ed.jpg.50x50_q85.jpg)
Edit
Dependencies: Lis2dh12 aconno_I2C aconno_nrf52_uart adc52832_common aconno_SEGGER_RTT
Diff: aconno_ble/aconno_ble.cpp
- Revision:
- 3:f2078081a779
diff -r e7952623d06c -r f2078081a779 aconno_ble/aconno_ble.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/aconno_ble/aconno_ble.cpp Tue Jan 16 17:24:31 2018 +0000 @@ -0,0 +1,29 @@ +/* + * Made by Jurica Resetar @ aconno + * More info @ aconno.de + * + */ + +#include "aconno_ble.h" + +/** +* Callback triggered when the ble initialization process has finished +*/ +void bleInitComplete(BLE::InitializationCompleteCallbackContext *params){ + BLE& ble = params->ble; + ble_error_t error = params->error; + + if (error != BLE_ERROR_NONE) { + return; + } + + /* Ensure that it is the default instance of BLE */ + if(ble.getInstanceID() != BLE::DEFAULT_INSTANCE) { + return; + } + + /* setup advertising */ + ble.gap().accumulateAdvertisingPayload(GapAdvertisingData::COMPLETE_LOCAL_NAME, (uint8_t *)DEVICE_NAME, sizeof(DEVICE_NAME)); + ble.gap().accumulateAdvertisingPayload(GapAdvertisingData::MANUFACTURER_SPECIFIC_DATA, (uint8_t *)MSD, MSD_SIZE_b); + ble.gap().setAdvertisingInterval(ADV_INTERVAL_MS); +}