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

How to get softdevice state in my application

I'd like to get the current connection state eg:

result = get_connection_state()

if(result == BLE_GAP_EVT_CONNECTED) doSomthing();

Is there such a function available ?

thanks,

  • There is no such function in SD API. Also it wouldn't be such easy call if you have in mind Nordic SD architecture with multiple concurrent roles and links existing or potentially existing in the system. However you get all SD events inside your application's event handler function so it's up to you to keep track about how many links you have active and what state.

Related