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

Send BLE data from saadc_callback

Hi,

There is something I don't understand and I request your help to answer my interrogation. What I want to do is a SAADC conversion then send the result of this conversion over BLE.

So basically my first working version looks something like (simplified for readability) :

But with this version, I am afraid that send_value() could be called before nrf_drv_saadc_sample() has updated the value_to_send.

So now I want to call the function send_value() within the saadc_callback but it doesn't work and I can't find a way to Debug it. It looks like it failed during the sd_ble_gatts_hvx() call (from the ble_lbs_on_button_change function (or ble_custom_on_sensor_change in my case).

So basically, this doesn't work, doesn't even succeed to establish a connection in BLE :

Any idea why ?

Thanks

Parents Reply Children
No Data