chickenjohn / ECG_Monitor_on_Android

A simple Ecg signal monitor on Android platform
GNU General Public License v3.0
56 stars 23 forks source link

Bluetooth Low Energy Question #5

Open sshome97 opened 4 years ago

sshome97 commented 4 years ago

Hello, Is this code compatible with BLE? Right now we're unable to connect the application to our microcontroller(NRF51822)

chickenjohn commented 4 years ago

I don't think it will support BLE device. You could implement your own BluetoothManager class to support it. PR is welcomed!

sshome97 commented 4 years ago

Thanks for the quick response. Another question I had is what does the SendWaveTool and how would I implement it? I'm assuming its used as sample data to show the fully operational application?

Thanks

chickenjohn commented 4 years ago

SendWaveTool is a python script I used on my computer to mimic the ECG signal sending from host to the Android App. As the host, my computer sends leadii.bin out via serial port to a bluetooth serial port device. The leadii.bin is from MIT-BIH Database, but in binary form.

sshome97 commented 4 years ago

Thanks again for the quick response. We are trying to test your application, but we don't understand how to display the ECG waveform? Meaning how will the Bluetooth serial port device lead the leadii.bin? Is this code separate from the code in your project (ie microcontroller code)? Also, where is the call in your code for the application to read data being transmitted from the bluetooth device?

Thanks

chickenjohn commented 4 years ago

For your first question: In my experiment, I connected the bluetooth serial port to my laptop via USB-to-ttl converter(like this). With this I am able to send the leadii.bin through USB->serial port->bluetooth device by running the sendwavetool.py

For your second question: this thread is always listening to the bluetooth rfcomm socket

sshome97 commented 4 years ago

Hi again, Your RR interval analysis seems very interesting. But I don't really understand how it works. Would you mind explaining it to me (Line 78 your Run thread). Our current code implements BLE where we receive data and store it in our array. We then want to send this array to a function similar to your ECGDataAnalyzer to determine the RR interval. I noticed that the RR interval depends on the recordRate. What is this value?