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

Context lost when using NRF_SDH_BLE_OBSERVER in a non-static context

Using NRF_SDH_BLE_OBSERVER in a non-static context doesn't work because the registered variable, and therefore the handler context is lost.  How can one register for ble events in a non-static context?  I'm using C++ and would like to maintain the ble handler and context in the scope of a class.

Parents
  • Hello, did you resolve this issue. I am also using C++ and get 2 different errors when calling NRF_SDH_BLE_OBSERVER:

    - from a function - error: 'NRF_SDH_BLE_OBSERVER' was not declared in this scope

    - globally and actually when called from NRF_BLE_GATT_DEF -  error: expected constructor, destructor, or type conversion before '(' token
    NRF_BLE_GATT_DEF(m_gatt) /**< GATT module instance. */

Reply
  • Hello, did you resolve this issue. I am also using C++ and get 2 different errors when calling NRF_SDH_BLE_OBSERVER:

    - from a function - error: 'NRF_SDH_BLE_OBSERVER' was not declared in this scope

    - globally and actually when called from NRF_BLE_GATT_DEF -  error: expected constructor, destructor, or type conversion before '(' token
    NRF_BLE_GATT_DEF(m_gatt) /**< GATT module instance. */

Children
No Data
Related