SDK 15.3.0; nRF52832
In a previous discussion about continuing to advertise while connected:
The advertisement module will start connectable advertising on BLE_GAP_EVT_DISCONNECT. So I changed the priority to allow the app to stop the non-connectable advertising before the event gets processed by the advertisement module
and we had:
/*Application needs higher priority than BLE_ADV_BLE_OBSERVER_PRIO in this case */ #define APP_BLE_OBSERVER_PRIO 0 /**< Application's BLE observer priority. You shouldn't need to modify this value. */
That allowed only 1 connection - the advertising was not connectable when already connected.
Now, we want to allow multiple connections.
The Multi-Peripheral example uses the Connection State module to manage the multiple connections.
But this is not correctly counting the connections in my application!
With just 1 connection, it says "0 connections" on the BLE_GAP_EVT_CONNECTED event, and "1 connection" on the BLE_GAP_EVT_DISCONNECTED event.
It looks like this is due to the altered priorities - so the Connection State module is not seeing the events until after the application and the advertising modules.
So what is the correct way to manage this ?