Hi,
I need an example to extract RR-interval from BLE data.
I found this information:
https://www.bluetooth.com/specifica...oth.characteristic.heart_rate_measurement.xml
There is a bit that control if data are present, the bit4 of the flag is about RR-Interval presence.
I found this note about RR:
In my app I use this code to extract bpm data from a Polar BLE heartbelt.
Please somebody can help me to modify this code to check presence and extract RR-interval data?
Thank you.
I need an example to extract RR-interval from BLE data.
I found this information:
https://www.bluetooth.com/specifica...oth.characteristic.heart_rate_measurement.xml
There is a bit that control if data are present, the bit4 of the flag is about RR-Interval presence.
I found this note about RR:
If RR-Interval values are present in the Heart Rate Measurement characteristic, the Server set bit 4 of the Flags field (RR-Interval bit) to 1 and include one or more RR-Interval values in the Heart Rate Measurement characteristic. Otherwise RRInterval values are not be included and bit 4 of the Flags field is set to 0. For a 23-octet ATT_MTU and the Heart Rate Measurement Value format set to UINT8, the maximum number of RR-Interval Values that can be notified if Energy Expended is present is 8 and the maximum number of RR-Interval Values that can be notified if Energy Expended is not present is 9. For a 23-octet ATT_MTU and the Heart Rate Measurement Value format set to UINT16, when notifying the Heart Rate Measurement characteristic, the maximum number of RR-Interval values that can be contained within a single Heart Rate Measurement characteristic with Energy Expended is 7 and the maximum number of RR-Interval values that can be notified if Energy Expended is not present is 8. If more RR-Interval values are measured since the last notification than fit into one Heart Rate Measurement characteristic, then the remaining RR-Interval values should be included in the next available Heart Rate Measurement characteristic.
(the bit3 of the flag is the presence of energy expended data)
In my app I use this code to extract bpm data from a Polar BLE heartbelt.
B4X:
Sub BLEDataAvailable (Service As String, Characteristics As Map)
Dim Conv As ByteConverter
Dim keyread As String
Dim bpm_temp As String
For i=0 To Characteristics.size-1
keyread = Characteristics.GetKeyAt(i)
'MEASURE
If keyread = "00002a37-0000-1000-8000-00805f9b34fb" Then
testoconvhrm = Conv.HexFromBytes(Characteristics.GetValueAt(i))
If testoconvhrm = "" Then
Log("NO BEAT")
Else
byte2 = testoconvhrm.CharAt(2)
byte3 = testoconvhrm.CharAt(3)
bpm_temp = byte2 & byte3
beat = Bit.ParseInt(bpm_temp, 16)
End If
End If
Next
End Sub
Please somebody can help me to modify this code to check presence and extract RR-interval data?
Thank you.