This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

BLE C++ Wrapper

I am trying to wrap BLE into a nice c++ class. For this i am using ble_app_uart example. I think it was working fine until i was up to clean the helper functions. After that i got error_code: 8 at SOFTDEVICE_HANDLER_INIT(&clock_lf_cfg, NULL);.

Here is a full example. ble_app_uart_modified.rar

In file ble_wrapper.cpp:626 when i comment command ble_advertising_start there is no error.

I can't seem to find the reason. Is is possible that this is connected to C++ class? Are there some other ideas? Is there a way to narrow the issue?

Thanks.

Parents
  • Is the error in SOFTDEVICE_HANDLER_INIT, or from the call to ble_advertising_start? If the error is in SOFTDEVICE_HANDLER_INIT this error means that the stack is allready initialized, you should check that you are not calling this function multiple times. It does not make sense that you get the error in this function, but not if you comment out the proceeding call to ble_advertising_start. If the error is from ble_advertising_start, this means that the advertising module have not been successfully initialized. Where do you instantiate the class in you main.cpp file?

Reply
  • Is the error in SOFTDEVICE_HANDLER_INIT, or from the call to ble_advertising_start? If the error is in SOFTDEVICE_HANDLER_INIT this error means that the stack is allready initialized, you should check that you are not calling this function multiple times. It does not make sense that you get the error in this function, but not if you comment out the proceeding call to ble_advertising_start. If the error is from ble_advertising_start, this means that the advertising module have not been successfully initialized. Where do you instantiate the class in you main.cpp file?

Children
No Data
Related