Hello,
I'm trying to use `sd_ble_gap_connect` to connect to a peer I discovered using `nrf_ble_scan`.
Hello,
I'm trying to use `sd_ble_gap_connect` to connect to a peer I discovered using `nrf_ble_scan`.
Hi
When sd_ble_gap_connect() returns NRF_ERROR_INVALID_PARAM that indicates that invalid parameter(s) has been supplied. Either invalid parameters in scan_params or conn_params have been supplied. A use of whitelist was requested but the whitelist has not been set (see sd_ble_gap_whitelist_set). Or the peer address was not present in the device identity list (see sd_ble_gap_device_identities_set).
Best regards,
Simon
Thanks for the reply! I'm not using the whitelist feature (I have BLE_GAP_SCAN_FP_ACCEPT_ALL set in the scan parameters). I'm getting the peer address from the scan, do I need to register the peer with the identity list?
Can you show me a code snippet of your scan and conn_params, as I think you've used invalid parameters somewhere in there.
For conn_params, I'm just letting nrf_scan initialize it with the defaults. I did try with manual parameters as well but did not make a difference.
I feel like I'm missing what the identity list is for, and I do not set it up right now. Do I need it and if so, how should I do that? For instance, if I set connect_if_match in nrf_scan, how does that work?
What are the values of the NRF_BLE_SCAN_SCAN_INTERVAL, NRF_BLE_SCAN_SCAN_WINDOW, and NRF_BLE_SCAN_SCAN_DURATION here?
Also, I'm interested in why you seem to be using your own custom version of the scan and connect functions. I would strongly recommend using something similar to the ble_app_hrs_c for instance where the nrf_ble_scan_connect_with_target() functions takes care of all these steps for you. Identity lists should not be necessary to use for BLE, so I don't think you should focus on that.
Best regards,
Simon