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

Changing service depending on state

The thing I currently try to implement is to combine two 128-bit services in one app - custom and UART.

I arleady made run them separately - one service at app.

Way they should change - at the init before BLE init the state of variable is checked - let it be button input.

Depending on state, first or second service should turn on.

I know that I can't run two 128-bit services at one time, so I thought I can run one of two services at one time till core resets.

What I currently have - all works perfectly separately, but after I add BLE_CUS_DEF(m_cus) to UART project or BLE_NUS_DEF(m_nus) to custom service project, thing that worked before stops working.

No interaction with the second service instance is done, only initialisation and required includes.

Custom service connects, works for receiving data, but after I try to apply notification by timer, core holds.

UART service project fails to connect even.

I tried to increase memory size - does nothing.

Custom service project is done by example from Github for SDK 14.0 (https://github.com/bjornspockeli/custom_ble_service_example/tree/9ab5c4e381d8ffe36eb0eeebdead0cbe5b6cb1ce)

UART service is done by fixing example project, can provide my code if it's required.

The reason for SDK 14.0 is that target project I need to modify done on that version and I have no time to port it to actual SDK but if it will make it work - surely I would.

Expect some help.

Thanks.

Parents Reply
  • When I have two separate projects - each wprks like a charm.
    If I add initialisation of CUS to NUS, NUS fails to connect - but dev kit indicates as connected (light continiously on, not blinking).
    If I add initialisation of NUS to CUS, CUS connects, data is received by board but when I try to send the data from board by notify, it works one time and then core helds. 

    I added two services to the code and it failed to work, so I rolled back each step to make it work again, and this step was adding BLE_CUS_DEF(m_cus) or BLE_NUS_DEF(m_nus).

Children
No Data
Related