Good afternoon,
We have developed a new equipment based on the nrf52840. We use sofldevice 's140_nrf52_6.1.0_softdevice' and we use bonding with static pin.
We have setup following parameters:
#define SEC_PARAM_BOND 1 /**< Perform bonding. */ #define SEC_PARAM_MITM 1 /**< Man In The Middle protection not required. */ #define SEC_PARAM_LESC 1 /**< LE Secure Connections enabled. */ #define SEC_PARAM_KEYPRESS 0 /**< Keypress notifications not enabled. */ #define SEC_PARAM_IO_CAPABILITIES BLE_GAP_IO_CAPS_DISPLAY_ONLY /**< Display Only. */ #define SEC_PARAM_OOB 0 /**< Out Of Band data not available. */ #define SEC_PARAM_MIN_KEY_SIZE 7 /**< Minimum encryption key size. */ #define SEC_PARAM_MAX_KEY_SIZE 16 /**< Maximum encryption key size. */
We also agreed with you (someone in this devzone) advertisement parameters. Equipment does advertisign every 10" (for power consumption constraints) with the following parameters:
#define APP_ADV_INTERVAL 80 /**< The advertising interval (in units of 0.625 ms. This value corresponds to 50 ms). */
#define APP_ADV_DURATION 200 /**< The advertising duration (2 seconds) in units of 10 milliseconds. */
Device sends data once every 62.5ms, and we have defined connection parameters:
#define MIN_CONN_INTERVAL MSEC_TO_UNITS(7.5, UNIT_1_25_MS) /**< Minimum acceptable connection interval (0.5 seconds). */ #define MAX_CONN_INTERVAL MSEC_TO_UNITS(100, UNIT_1_25_MS) /**< Maximum acceptable connection interval (1 second). */ #define SLAVE_LATENCY 0 /**< Slave latency. */ #define CONN_SUP_TIMEOUT MSEC_TO_UNITS(4000, UNIT_10_MS) /**< Connection supervisory timeout (4 seconds). */
Equipment is working quite fine but, depending on the smartphone (iOS and Android) we use, we are facing the following problems, that not only happen with our application but they also happen with nRF-Connect app:
- Depending on the Smartphone, we are not asked for the PIN when pairing/bonding the first time.
- In some smartphones, it takes a lot of time (even when already bonded) to stablish connection: maximum time should be 10" (advertising period) but sometimes, it takes more and more time.
- When it takes a lot of time to connect, sometimes smartphone is able to connect when bluetooth is switched off and switched on again. But this is not happening with other devices, only with this one we have designed. Is it something related with parameters we have set up?
We would like to receive an assessment regarding all the parameters we use for setting up the connection and ways to have a more robust connection, as we have the feeling that connection robustness is weak and it is quite depending on the smartphone is being used.
Best regards,
Dani.