Hello,
We are working with an NRF5340 and SDK 2.5.0. Things are generally going very well, but I think Ive hit a snag for which im not sure how to proceed.
Our device needs to handle two centrals connected simultaneously. Our device exposes two services, a custom service similar to NUS and an HID mouse service.
The challenge is that the HID mouse requires security level 2 to work, but the program that connected to the NUS-like service doesnt support security and wants just-works.
The way I handled this previously was when the input_ccc_changed would get called for the service that requires the security, I would call bt_conn_set_security.
Im not sure how to proceed here; bt_conn_set_security wants a conn* object. While I store all the connection objects in an array, I dont know how to figure out which connection object is the one that wants the security upgrade; input_ccc_changed only gets a bt_gatt_attr, and I dont see a way to link that to a conn object.
What is the correct approach here? Do you have an example of someone doing something similar I can use?
Thanks for your help?