Hi!
I'm working on HID mouse example on SDK 13.0.0, SoftDevice S1332 v4.0.5. I'm supposed to use this as a low power media button control, using a nRF52 DK.
I've done a few modicifations on the code for power optimizations, such as setting TX power, set the preferred connection paramaters slightly according to Android spec and disabled logging.
I've set the min, max connection intervals and latency parameters non rigid, to be compliant with as much devices as possible at this point. Since I want this device to be low power I would like it to stay as close to the 4 second boundary as possible regarding connection intervals. The connection intervals are set this way:
#define MIN_CONN_INTERVAL MSEC_TO_UNITS(7.5, UNIT_1_25_MS) /**< Minimum connection interval (7.5 ms). */
#define MAX_CONN_INTERVAL MSEC_TO_UNITS(125, UNIT_1_25_MS) /**< Maximum connection interval (15 ms). */
#define SLAVE_LATENCY 30 /**< Slave latency. (30 ) */
#define CONN_SUP_TIMEOUT MSEC_TO_UNITS(20000, UNIT_10_MS) /**< Connection supervisory timeout (20000 ms). */
When I connect the nRF52 as a peripheral to my phone (Huawei P9 Plus), they connect, exchange connection parameters, and stay connected according to my "low power connection intervals". I have verified the connection intervals by current measurements on the nRF52, as well as a nrf sniffer trace.
These two devices can stay connected on the "low power connection intervals" for longer periods, but when the devices gets disconnected by being too far away from each other, and then reconnect, they seem to operate on the Android CONNECTION_PRIORITY_BALANCED plan, which is 50 ms interval. They dont seem to negotiate for connection parameters again either, as I've measured on the oscillioscope for at least 15 minutes after reconnection.
My sniffer trace hasn't been able to track the "reconnection event", the unit I'm using as sniffer is probably not able to capture the reconnection event due to high sensitivity.
However, if I disable and enable the bluetooth on my phone, the two previosly bonded devices seem to reconnect and communicate on my own custom connection interval.
From what I've seen in the HID mouse example code, the ble_evt_dispatch is set while initiating the BLE stack.
From ble_evt_dispatch, ble_conn_params_on_ble_evt is called.
Further the BLE_GAP_EVT_CONNECTED should be the case upon connection and reconnection?
From BLE_GAP_EVT_CONNECTED, on_connect is called, which eventually resets the update counter and should initiate a new connection parameter negotiation.
This should mean that a parameter negotiation should occur for each time a device connects.
Does anyone have a clue regarding what could be the issue here?
The project file is located here: