Hello,
I'm working on Windows 11, with the nRF Connect for VS Code v2025.5.512 extension, with ncs v3.0.2. I'm using the nRF54L15-dk (PCA10156; 0.9.2; 2025.7) development kits.
So, I want to use the channel sounding sample to measure a distance and then send a data if it's below a threshold. I first tried to implement that program with the BLE RSSI instead of using the CS and it works well (cf. RSSI_execution picture).
So my question is how to discover a service, disconnect from it and discover another one ?
Since the CS is using a service, I want to first discover the ranging service then if the measured distance is below the threshold, I want do discover my custom service to send my data. I tried discovering my custom service at the beginning and at the end of the loop that gets the distance in the main (while(true)) but then either it doesn't want to measure the distance and it sends the value directly or it gets the distance but can't send the data. (cf custom_begin and custom_end pictures respectively).
Do you know how I can fix those errors ? I've put my programs and pictures in the zip folders below for both the RSSI and the CS.
Thanks and best regards,
Patrick