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

How do I know when a connection was established and how do I use the relavent struct?

8.0, multilink example, peripheral, s110 softdevice.

By walking through sections of codes and doing some research, I reckon if a connection were being established after advertising, the callback "ble_evt_handler()" will be called upon, and a "p_ble_evt" type struct will be passed to it, which contains the "connection established" event value.

My question is, all I need is a variable or a struct that tells me the connections was established, so I can put the variable or something of similar nature in this case inside an "if () " statement, as in "if (is_conn_set==yes)".

So, would it be problematic if I put a

connection_established_flag = YES;

at the end of

"case BLE_GAP_EVT_CONNECTED:"

inside the "dm_ble_evt_handler()" function?

Or would you rather suggest a better idea? Thanks for your help in advance.

I hope I didn't erroneously identify the things that I wanted.

Parents Reply Children
No Data
Related