Edit

Dependencies:   Lis2dh12 aconno_I2C aconno_nrf52_uart adc52832_common aconno_SEGGER_RTT

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers aconno_ble.cpp Source File

aconno_ble.cpp

00001 /*
00002  *   Made by Jurica Resetar @ aconno
00003  *   More info @ aconno.de
00004  *
00005  */
00006 
00007 #include "aconno_ble.h"
00008 
00009 /**
00010 * Callback triggered when the ble initialization process has finished
00011 */
00012 void bleInitComplete(BLE::InitializationCompleteCallbackContext *params){
00013     BLE&        ble   = params->ble;
00014     ble_error_t error = params->error;
00015 
00016     if (error != BLE_ERROR_NONE) {
00017         return;
00018     }
00019 
00020     /* Ensure that it is the default instance of BLE */
00021     if(ble.getInstanceID() != BLE::DEFAULT_INSTANCE) {
00022         return;
00023     }
00024     
00025     /* setup advertising */
00026     ble.gap().accumulateAdvertisingPayload(GapAdvertisingData::COMPLETE_LOCAL_NAME, (uint8_t *)DEVICE_NAME, sizeof(DEVICE_NAME));
00027     ble.gap().accumulateAdvertisingPayload(GapAdvertisingData::MANUFACTURER_SPECIFIC_DATA, (uint8_t *)MSD, MSD_SIZE_b);
00028     ble.gap().setAdvertisingInterval(ADV_INTERVAL_MS);
00029 }