Hi all,
after call inside the BLE_GAP_EVT_LESC_DHKEY_REQUEST I got error 8, what can cause it? a CONNECTION_SUPERVISED_TIMEOUT?
device nRF52, SDK13
Thanks
Hi all,
after call inside the BLE_GAP_EVT_LESC_DHKEY_REQUEST I got error 8, what can cause it? a CONNECTION_SUPERVISED_TIMEOUT?
static nrf_value_length_t peer_public_key_raw = { 0 }; peer_public_key_raw.p_value = &p_ble_evt->evt.gap_evt.params.lesc_dhkey_request.p_pk_peer->pk[0]; peer_public_key_raw.length = BLE_GAP_LESC_P256_PK_LEN; error = nrf_crypto_ecc_public_key_from_raw(NRF_CRYPTO_BLE_ECDH_CURVE_INFO, &peer_public_key_raw, &m_peer_public_key); APP_ERROR_CHECK(error); NRF_LOG_INFO("nrf_crypto_ecc_public_key_from_raw %d\r\n", error); error = nrf_crypto_ecdh_shared_secret_compute(NRF_CRYPTO_BLE_ECDH_CURVE_INFO, &m_private_key, &m_peer_public_key, &m_dh_key); APP_ERROR_CHECK(error); NRF_LOG_INFO("nrf_crypto_ecdh_shared_secret_compute %d\r\n", error); error = sd_ble_gap_lesc_dhkey_reply(connectionhandle, &m_lesc_dh_key); APP_ERROR_CHECK(error); NRF_LOG_INFO("sd_ble_gap_lesc_dhkey_reply %d\r\n", error);
device nRF52, SDK13
Thanks
Commenting out all sd_ble_gap_disconnect()s will not keep the devices connected. One device will disconnect if the other one e.g. stops responing.
Could you zoom a bit out on the sniffer log?
It says that the slave sends the disconnect message. What device are you trying to connect the nRF to? Is it a phone or another nRF (e.g. with nRF Connect for Desktop)?
Would it be possible to send the entire project instead of the snippet? Or something that I can reproduce the error with?
Hey Ed, I think I found the problem, but it is still very disconcerting.... how I said above I am getting random disconnections since the connection is established I am always getting disconnection reason 0x19[BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION]
If I change the values for MIN_CONN_INTERVAL and MAX_CONN_INTERVAL to bigger numbers it does not happen anymore, for example, I was working with MIN_CONN_INTERVAL =7.5 and MAX_CONN_INTERVAL =25 and I was getting random disconnections. I changed the values respectively to 100 and 200 and it is now working fine.
What could be the cause of this behavior?
Hey Ed, I think I found the problem, but it is still very disconcerting.... how I said above I am getting random disconnections since the connection is established I am always getting disconnection reason 0x19[BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION]
If I change the values for MIN_CONN_INTERVAL and MAX_CONN_INTERVAL to bigger numbers it does not happen anymore, for example, I was working with MIN_CONN_INTERVAL =7.5 and MAX_CONN_INTERVAL =25 and I was getting random disconnections. I changed the values respectively to 100 and 200 and it is now working fine.
What could be the cause of this behavior?