Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs

Alternating between Central + Peripheral and Peripheral + Peripheral in a memory constrained environment

I have an existing application that leverages a permanent Central and Peripheral role on the same device to communicate with other devices.

The application is quite memory constrained (I've been optimizing for dozens of bytes here and there for a little while), and I'm wondering if it's possible to configure the s332 soft device as 2 peripheral links (P1 + P2) until commanded to switch, disable P2 and replace it with a Central (P1 + C).

Ideally I would like to keep P1 active the entire time (possibly in a connection when switching P2 for C).

I know I can do something like this by allocating P1, P2, and C (i.e. NRF_SDH_BLE_PERIPHERAL_LINK_COUNT = 2, NRF_SDH_BLE_CENTRAL_LINK_COUNT = 1, and NRF_SDH_BLE_TOTAL_LINK_COUNT = 3), but is it possible to reuse the memory between P2 and C due to my constrained environment?

I'm working on a version of the nRF52 SDK, not the nRF Connect SDK.

Related