This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Disconnection after BLE_GAP_EVT_LESC_DHKEY_REQUEST error 19 (0x13)

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

Parents
  • Hello,

    I understand. What device are you trying to connect to? the nRF is the peripheral in the connection? Do you try to connect to a phone acting as a central? Can you try to connect to another nRF using nRF Connect for desktop, and see if you get any information in the log there? Or can you try to provide a sniffer trace, e.g. using nRF Sniffer?

    The reason I want you to try nRF Connect for desktop is that not all devices support LESC. The nRF Connect for desktop using another DK does support this, so it is only to see if the error is on the peripheral side, or on the central side. A supervision timeout suggests that there is something missing from the central, or perhaps there is something that you are not handling correctly on the peripheral side. A sniffer trace would shed some light on this.

    Best regards,

    Edvin

Reply
  • Hello,

    I understand. What device are you trying to connect to? the nRF is the peripheral in the connection? Do you try to connect to a phone acting as a central? Can you try to connect to another nRF using nRF Connect for desktop, and see if you get any information in the log there? Or can you try to provide a sniffer trace, e.g. using nRF Sniffer?

    The reason I want you to try nRF Connect for desktop is that not all devices support LESC. The nRF Connect for desktop using another DK does support this, so it is only to see if the error is on the peripheral side, or on the central side. A supervision timeout suggests that there is something missing from the central, or perhaps there is something that you are not handling correctly on the peripheral side. A sniffer trace would shed some light on this.

    Best regards,

    Edvin

Children
Related