We do have standalone applications developed in nrf52840, SD 6.1.1 Peripheral and Central individually, and working perfect.
Now we want to merge both applications based on our requirements. Let say based on one event My primary peripheral application should work as central and peripheral mode both simultaneously.
Background of both applications
- Peripheral : --- This application is collecting data from on board sensor periodically and saving it to the memory, and sending those data chunks whenever central (let say Mobile app and other central device) is requesting.
- Central :--- which scans nearby peripheral device and connects based on filters and connects to more than one peripheral sensor through BLE. After connecting it reading data from more than one peripheral. periodically.
Question I have is,
- I want to switch the role between peripheral to central based on event frequently, how can I do that?
- Which examples from SDK 15.3.0_59ac345 is more relevant to my application “ multirole_lesc” or “hrs_rscs_relay” from ble_central_and_peripheralàexperimental ?
- How ble_conn_state_role(conn_handle) is switching the role in these examples? . It is not clear by tracing it down.
- What will be the major key function need to address when we are switching between the roles.?
- How we can assign the priority of our central and peripheral roles? I mean to say my priority here is let say peripheral role should be more important than central and when both called simultaneously than I want to perform my peripheral activity first.