Hi
I am trying to migrate our BLE hardware platform from Laird to Nordic Semi nRF52832. I have an App which was previously working with the Laird platform, but am having serious issues just getting it to pair reliably with the nRF52832 - specifically, the underlying BLE Stack keeps calling ble_evt_handler with BLE_GAP_EVT_DISCONNECTED while trying to pair/connect!
My Android app is pretty simple:
1) It searches for a BLE device advertising with a certain name
2) It makes a connection using the MAC address learnt from the above
3) It connects to the known service UUID
4) It connects to the known characteristic UUID
5) It sets up a callback called when the characteristic sends data
(The characteristic is simply a button press on the dev board)
At some stage in the above, usually just after a successful connection, the nRF52832 BLE stack calls 'Disconnect', I then see this in my app as a 'connection lost', I try and reconnect (using the same MAC/UUID) and the cycle repeats.
Any thoughts as to why its disconnecting. I have the following parameters in place, not really sure which one to change. I am using 'Just works' pairing
#define MIN_CONN_INTERVAL MSEC_TO_UNITS(20, UNIT_1_25_MS) /**< Minimum acceptable connection interval (0.1 seconds). */
#define MAX_CONN_INTERVAL MSEC_TO_UNITS(100, UNIT_1_25_MS)
#define SLAVE_LATENCY 0 /**< Slave latency. */
#define CONN_SUP_TIMEOUT MSEC_TO_UNITS(4000, UNIT_10_MS) /**< Connection supervisory timeout (4 seconds), Supervision Timeout uses 10 ms units. */
#define FIRST_CONN_PARAMS_UPDATE_DELAY APP_TIMER_TICKS(5000) /**< Time from initiating event (connect or start of notification) to first time sd_ble_gap_conn_param_update is called (5 seconds). */
#define NEXT_CONN_PARAMS_UPDATE_DELAY APP_TIMER_TICKS(30000) /**< Time between each call to sd_ble_gap_conn_param_update after the first call (30 seconds). */
#define MAX_CONN_PARAMS_UPDATE_COUNT 6 /**< Number of attempts before giving up the connection parameter negotiation. */
#define SECURITY_REQUEST_DELAY APP_TIMER_TICKS(400) /**< Delay after connection until Security Request is sent, if necessary (ticks). */
Nigel