Hi,
With the bleprph example, whenever a central connects it seems to use a
small connection interval (like 50ms). I'd like a longer one (around
500ms). I've change the code in main from this:
uint8_t bleprph_pref_conn_params[8] = {0}
To this:
// Units 1.25 ms; min 6; max 3200
#define MIN_CONNECTION_INTERVAL 300
// Units 1.25 ms; min 6; max 3200
#define MAX_CONNECTION_INTERVAL 500
#define SLAVE_LATENCY 0
// Units 10 ms; min 10; max 3200
#define CONNECTION_SUPERVISION_TIMEOUT_MULTIPLIER 200
// See
https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.characteristic.gap.peripheral_preferred_connection_parameters.xml
uint16_t bleprph_pref_conn_params[4] = {
MIN_CONNECTION_INTERVAL,
MAX_CONNECTION_INTERVAL,
SLAVE_LATENCY,
CONNECTION_SUPERVISION_TIMEOUT_MULTIPLIER,
};
And that does result in the 'Preferred connection parameters'
characteristic giving the desired values, but the actual connection
interval doesn't change.
I've added logging to print every packet the device receives, and it gets a
few BLE_LL_CTRL_CONN_UPDATE_REQ's from the central, but it doesn't ever
seem to tell the central its preferred connection parameters, and I can't
really work out how it is supposed to work from the spec. Is the peripheral
meant to send a LL_CONNECTION_PARAM_REQ packet?
I found there is a BLE_LL_CFG_FEAT_CONN_PARAM_REQ feature, and although
using it did mean the central sent a LL_CONNECTION_PARAM_REQ, the
connection interval wasn't increased. Also the code around that feature has
a lot of XXX's!
Any hints before I start sniffing hiw Nordic's stack dies it?
Cheers,
Tim