Hello,
I have been developing an embedded system where, data would be captured from analog sensors and then processed and sent by Bluetooth to a android device. In my project, I am capturing ECG data from one of the analog pin of nRF52840 DevKit. Then, I save data in a buffer and send them by BLE. In the Android phone, we have a custom App where, we would receive those data and plot them.
Problem: I face an issue of missing ADC data on the mobile App side when I am trying to send 96 samples in a Bluetooth packet (96 samples are converted to 192 bytes, as each sample is 2 bytes). When I send 48 samples (96 bytes) in a Bluetooth packet, I still have some data missed on the Mobile App side but, the problem is not severe in that case. When ADC data checked without combining the BLE part, they look fine.
Description: I have taken the SAADC example from here and merged it with blue_app_uart example. I am sampling the ADC at a rate of 1kHz and storing 96 samples in the buffer. Few of the important BLE settings are as follows,
Min Conn Interval 95 ms
Max Conn Interval 105 ms
BLE GAP EVENT LENGTH 76 (95 MS)
GAP DATA LENGTH 251
Thank you for reading my post. I would be very grateful if anyone can point out a possible solution for this case. I can also share the code here if it seems required. Please let me know.