If I set the centrals connection intervals values higher as a specific value it won't any longer find/connect/enable notifications on my peripheral.
0x00A0/0x0050/400/700/0/8100 working
0x00A0/0x0050/400/800/0/8100 not working.
0x00A0/0x0050/500/800/0/8100 not working.
0x00A0/0x0050/4000/4000/0/8100 not working. (preferred one)
This leaves me really clueless :( Of course I tried a lot more combinations.. I want to use the maximum interval of 4seconds. What else could cause this problem?
Central: (SD2.0.0 SDK8.0)(nRF51-DK)
#define SCAN_INTERVAL 0x00A0 /**< Determines scan interval in units of 0.625 millisecond. */
#define SCAN_WINDOW 0x0050 /**< Determines scan window in units of 0.625 millisecond. */
#define MIN_CONNECTION_INTERVAL MSEC_TO_UNITS(2000, UNIT_1_25_MS) /**< Determines minimum connection interval in millisecond. */
#define MAX_CONNECTION_INTERVAL MSEC_TO_UNITS(4000, UNIT_1_25_MS) /**< Determines maximum connection interval in millisecond. */
#define SLAVE_LATENCY 0 /**< Determines slave latency in counts of connection events. */
#define SUPERVISION_TIMEOUT MSEC_TO_UNITS(8100, UNIT_10_MS) /**< Determines supervision time-out in units of 10 millisecond. */
Peripheral: (SD 7.1.0 SDK 6.1)(Custom Board: Seeed BLE Micro)
#define APP_ADV_INTERVAL MSEC_TO_UNITS(500, UNIT_0_625_MS) /**< The advertising interval (in units of 0.625 ms. This value corresponds to 40 ms). */
#define APP_ADV_TIMEOUT_IN_SECONDS 0 /**< The advertising timeout (in units of seconds). */
#define MIN_CONN_INTERVAL MSEC_TO_UNITS(2000, UNIT_1_25_MS) /**< Minimum acceptable connection interval (0.5 seconds). */
#define MAX_CONN_INTERVAL MSEC_TO_UNITS(4000, UNIT_1_25_MS) /**< Maximum acceptable connection interval (1 second). */
#define SLAVE_LATENCY 0 /**< Slave latency. */
#define CONN_SUP_TIMEOUT MSEC_TO_UNITS(8100, UNIT_10_MS) /**< Connection supervisory timeout (4 seconds). */
It works with smaller intervals.. But these should be in range and fulfill all requirements.. don't they?(MCP@Android can still connect to the peripheral - so probably a central setting is out of bonds? but which and why?)(also tried Scan_interval=Scan_window)
Rule from ble_gap.h
* @note If both conn_sup_timeout and max_conn_interval are specified, then the following constraint applies:
* conn_sup_timeout * 4 > (1 + slave_latency) * max_conn_interval
I tested it now with unchanged example. And then only changed settings on central and then on central+peripheral. Only unchanged worked. Changed min/max/timeout to 2000/4000/8100 and changed nothing else.
Disconnect Reason 0x0008
.. so it timed out?
I thought the connection interval would only affect everything AFTER service discovery..
I do measurements on the periphal and send them with sd_ble_gatts_hvx
. I just want to use as less power as possible. So only have the central and espeically the peripheral only wake up every x seconds to do the measurement and send them to the central.
The measurement and hvx is done by an timer. And works from 500ms-4s as far as I have tested. But shouldn't it be ok to use the same connection interval?
How much is the power use of an connection event where they do like nothing anyway?