These days I have the following problems using NRF_SDH_BLE_OBSERVER. I have a CPP project and try to initialize the BLE-Stack in the following way:
void CBLEStackModule::init(BYTE a_nMaxNumberOfPeripheralLinks, BYTE a_nMaxNumberOfCentralLinks, BYTE a_nMaxNumberOfSecurityManagerProtocolInstances)
{
DWORD nRamStart = 0;
APP_ERROR_CHECK(nrf_sdh_ble_app_ram_start_get(&nRamStart));
APP_ERROR_CHECK(nrf_sdh_enable_request());
ble_cfg_t bleConfiguration;
memset(&bleConfiguration, 0x00, sizeof(bleConfiguration));
APP_ERROR_CHECK(nrf_sdh_ble_default_cfg_set(APPLICATION_BLE_CONNECTION_CONFIG_TAG, &nRamStart));
APP_ERROR_CHECK(nrf_sdh_ble_enable(&nRamStart));
NRF_SDH_BLE_OBSERVER(m_ble_observer, APPLICATION_BLE_OBSERVER_PRIORITY, CBLEStackModule::eventHandler, NULL);
}
The Project is running but the last line
NRF_SDH_BLE_OBSERVER(m_ble_observer, APPLICATION_BLE_OBSERVER_PRIORITY, CBLEStackModule::eventHandler, NULL);
didn't work. For the notification charakteristic I need the event-handler CBLEStackModule::eventHandler but because the Macro didn't work in C++ it's not possible. Does anybody have an idea how to get that line run in a nonstatic CPP project? Or is there any other way to get it run?